Ignore:
Timestamp:
04/20/07 16:26:34 (17 years ago)
Author:
x07vasba
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.uml.sysml.diagram2/src/org/modelica/uml/sysml/diagram2/part/SysmlInheritanceDiagramAction.java

    r501 r502  
    141141            classType = result[0].trim();
    142142            classType = classType.substring(1, classType.length()-1);
    143            
     143
    144144            //Out of memory debugging
    145             if(createdNodes.size()== 88){
     145            if(classes[i].equals("Modelica.Blocks.Interfaces.RealInput")){
    146146                int breakp = 0;
    147147            }
    148            
     148
    149149            createdEditPart = createEmptyNodeEditPart(classType);
    150150            createdNode = new CustomNode(classType.trim(),classes[i],createdEditPart);
    151                
     151
    152152            createdNodes.add(createdNode);
    153153
    154154            command = "getClassNames("+ classes[i]+ ")";
    155            
     155
    156156            String retval="";
    157157
     
    162162
    163163            }
    164            
     164
    165165            org.modelica.mdt.core.List list = null;
    166166            try{
     
    178178
    179179            }
    180        
    181             result = new String[list.size()];
    182            
    183             for(int j =0;j<list.size();j++){
    184                
    185                 result[j] = classes[i] + "." + list.elementAt(j).toString();
    186                 String tmpResult = result[j];
    187             }
    188             createInheritanceNodesList(result);
    189         }
    190        
     180
     181            if(list != null){
     182                result = new String[list.size()];
     183
     184                for(int j =0;j<list.size();j++){
     185
     186                    result[j] = classes[i] + "." + list.elementAt(j).toString();
     187                    String tmpResult = result[j];
     188                }
     189                createInheritanceNodesList(result);
     190            }
     191        }
     192
    191193    }
    192194
     
    213215           
    214216            for(int i=0;i<inheritanceCount;i++){
    215                 omcCommand = "getNthInheritedClass("+ sourceNode.getName()+","+i+")";
     217                omcCommand = "getNthInheritedClass("+ sourceNode.getName()+","+(i+1)+")";
    216218               
    217219                try{
     
    222224                }
    223225
     226                omcResult = omcResult.trim();
     227                //omcResult = omcResult.substring(1, omcResult.length()-1);
     228               
    224229                EditPart targetEditPart = getEditPart(omcResult);
    225230               
     
    245250                    SysmlDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
    246251       
    247         Command command = connectionRequest.getCreateCommand(connectionRequest,
    248                 (EditPart)editPart.getChildren().get(0),
    249                 (EditPart)editPart.getChildren().get(1));
     252        Command command = connectionRequest.getCreateCommand(connectionRequest,source, target);
    250253       
    251254        if (command == null || !(command.canExecute())) {
     
    296299
    297300            //Set the location of the node in the diagram
    298             if(startPoint.y<200)
     301            if(startPoint.x<200)
    299302                startPoint.x += 100;
    300303            else{
    301304                startPoint.y += 100;
    302305                startPoint.x = 0;
     306               
    303307            }
    304308               
     
    343347        while(listIterator.hasNext()){
    344348            CustomNode tempNode = (CustomNode)listIterator.next();
    345             if(tempNode.getName()== name){
     349            if(tempNode.getName().equals(name)){
    346350                return tempNode.getNodeEditPart();
    347351            }
Note: See TracChangeset for help on using the changeset viewer.