[jboss-cvs] jboss-profiler/java/webapp/lzx ...

Takuro Okada t2-okada at nri.co.jp
Thu Dec 14 06:58:48 EST 2006


  User: tokada  
  Date: 06/12/14 06:58:48

  Modified:    java/webapp/lzx  Tag: JBossProfiler_Expansion
                        stacktracediagram.lzx
  Log:
  Added some functions.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.4   +65 -27    jboss-profiler/java/webapp/lzx/Attic/stacktracediagram.lzx
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: stacktracediagram.lzx
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-profiler/java/webapp/lzx/Attic/stacktracediagram.lzx,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -b -r1.1.2.3 -r1.1.2.4
  --- stacktracediagram.lzx	13 Dec 2006 10:13:38 -0000	1.1.2.3
  +++ stacktracediagram.lzx	14 Dec 2006 11:58:48 -0000	1.1.2.4
  @@ -34,9 +34,19 @@
     <include href="floatingmessage.lzx"/>
     
     <class name="popupmessage" extends="basecomponent" bgcolor="0xffffff">
  -    <text name="_contents" fontsize="9" resize="true"/>
  +    <simplelayout axis="y"/>
       <method name="setMessage" args="message">
  -      this._contents.setText(message);
  +      <![CDATA[
  +      if(message instanceof Array) {
  +        for(var i=0; i<message.length; i++) {
  +          var text = new LzText(this, {fontsize:9, resize:true});
  +          text.setText(message[i]);
  +          this.subviews.push(text);
  +        }
  +      }else {
  +        this.subnodes.push(message);
  +      }
  +      ]]>
       </method>
     </class>
     
  @@ -73,25 +83,15 @@
           <method name="strokeLifeline">
             dottedLine(parent._centerPoint, 0, parent._centerPoint, parent.height);
           </method>
  -        <method name="strokeActivation" args="begin, elapsed, elapsedTime">
  +        <method name="strokeActivation" args="begin, elapsed, message">
             var width = parent.parent.activationwidth;
             offsetLine(parent._centerPoint-width/2, begin, width, elapsed, true);
             
             // creates a view to handle mouse events
             var activation = new LzView(this, {x:parent._centerPoint-width/2, y:begin, width:width, height:elapsed, clickable:true});
  -          activation.setAttribute("value", elapsedTime);
  -          new LzDelegate(this, "focusin", activation, "onmouseover");
  -          new LzDelegate(this, "focusout", activation, "onmouseout");
  -        </method>
  -        <method name="focusin" args="activation">
  -          var attr = {name:"message",
  -                      x:classroot.parent.parent.getMouse("x")+4,
  -                      y:classroot.parent.parent.getMouse("y")-16};
  -          var m = new popupmessage(classroot.parent.parent, attr);
  -          m.setMessage("Elapsed Time : "+activation.value);
  -        </method>
  -        <method name="focusout" args="activation">
  -          classroot.parent.parent.searchSubnodes("name", "message").destroy(true);
  +          activation.setAttribute("message", message);
  +          new LzDelegate(classroot.parent.parent, "openMessage", activation, "onmouseover");
  +          new LzDelegate(classroot.parent.parent, "closeMessage", activation, "onmouseout");
           </method>
         </linedrawview>
       </view>
  @@ -106,12 +106,12 @@
         this.objectbox.setWidth(this.objectbox.contents.objectname.width + 16);
         this.activationarea.drawview.strokeLifeline();
       </handler>
  -    <method name="setActivation" args="begin, elapsed, elapsedTime">
  -      this.activationarea.drawview.strokeActivation(begin, elapsed, elapsedTime);
  +    <method name="setActivation" args="begin, elapsed, message">
  +      this.activationarea.drawview.strokeActivation(begin, elapsed, message);
       </method>
     </class>
     
  -  <class name="notifytext" extends="text" clickable="true">
  +  <class name="notifytext" extends="text" clickable="true" resize="true">
       <attribute name="target"/>
       <attribute name="targetevent" type="string"/>
       <attribute name="sourceevent" type="string"/>
  @@ -175,7 +175,7 @@
           text.fullname = name;
           ]]>
         </method>
  -      <method name="strokeSelfMessage" args="beginx, beginy, height, id, name, offset">
  +      <method name="strokeSelfMessage" args="beginx, beginy, height, id, name, offset, message">
           <![CDATA[
           //var endy = beginy;
           //if(height>=parent.selfmessageheight) endy = beginy + parent.selfmessageheight;
  @@ -193,6 +193,12 @@
           text.setText(name.substr(name.lastIndexOf('.')+1));
           text.threadid = id;
           text.fullname = name;
  +        
  +        // creates a view to handle mouse events
  +        var activation = new LzView(this, {x:beginx, y:endy, width:offset, height:activationHeight, clickable:true});
  +        activation.setAttribute("message", message);
  +        new LzDelegate(classroot, "openMessage", activation, "onmouseover");
  +        new LzDelegate(classroot, "closeMessage", activation, "onmouseout");
           ]]>
         </method>
       </linedrawview>
  @@ -214,13 +220,16 @@
           var elapsedTime = childNode.getAttr(valueattr);
           if(ignorezerovalue && elapsedTime==0) continue;
           var name = childNode.getAttr(nameattr);
  +        
           var className = null;
  +        var methodName = null;
           if(name.charAt(0)=='/') {
             className = name;
  +          methodName = name.substr(name.lastIndexOf('/')+1);
           }else {
             className = name.substr(0, name.lastIndexOf('.'));
  +          methodName = name.substr(name.lastIndexOf('.')+1);
           }
  -        var methodName =name.substr(name.lastIndexOf('.')+1);
           
           var updateLane = selectLane(className);
           if(updateLane==null) {
  @@ -229,20 +238,40 @@
           
           var beginPixel = ((timestamp-beginTimestamp)/1000) * this.baseheight + baseheightoffset; // msec
           var elapsedPixel = (elapsedTime/1000000000) * this.baseheight; // nsec
  +        
  +        var callerClassName = null;
  +        var callerMethodName = null;
           var caller = childNode.getAttr(callerattr);
  -        var callerIndex = caller.lastIndexOf('.');
  -        if(callerIndex>=0) caller = caller.substring(0, caller.lastIndexOf('.'));
  -        if(caller==updateLane.objectname) {
  +        if(caller!="null") {
  +          var callerMethodIndex = caller.lastIndexOf('.');
  +          if(callerMethodIndex>=0) {
  +            callerClassName = caller.substring(0, callerMethodIndex);
  +            callerMethodName = caller.substr(callerMethodIndex+1);
  +          }else {
  +            callerClassName = caller;
  +          }
  +        }
  +        
  +        var message = new Array();
  +        message.push("ID : "+id);
  +        message.push("Class Name : "+className);
  +        message.push("Method Name : "+methodName);
  +        message.push("Caller Class Name : "+callerClassName);
  +        message.push("Caller Method Name : "+callerMethodName);
  +        message.push("Elapsed Time : "+elapsedTime);
  +        
  +        if(callerClassName==updateLane.objectname) {
             this.drawview.strokeSelfMessage(updateLane.jointpointright,
                                             beginPixel + updateLane.activationarea.y,
                                             elapsedPixel,
                                             id,
                                             name,
  -                                          updateLane.activationwidth);
  +                                          updateLane.activationwidth,
  +                                          message);
           }else {
  -          updateLane.setActivation(beginPixel, elapsedPixel, elapsedTime);
  +          updateLane.setActivation(beginPixel, elapsedPixel, message);
             if(i!=0) {
  -            messages.push({lane:updateLane, caller:caller, begin:beginPixel, elapsed:elapsedPixel, id:id, method:name});
  +            messages.push({lane:updateLane, caller:callerClassName, begin:beginPixel, elapsed:elapsedPixel, id:id, method:name});
             }
           }
         }
  @@ -278,6 +307,15 @@
         ]]>
       </method>
       
  +    <method name="openMessage" args="activation">
  +      var pm = new popupmessage(this, {name:"popupmessage", x:this.getMouse("x")+4, y:this.getMouse("y")-88});
  +      pm.setMessage(activation.message);
  +    </method>
  +    
  +    <method name="closeMessage" args="activation">
  +      this.searchSubnodes("name", "popupmessage").destroy(true);
  +    </method>
  +    
     </class>
     
     <resource name="objectbox_l" src="./images/objectbox_l.png"/>
  
  
  



More information about the jboss-cvs-commits mailing list