Package simtools.diagram.undo

Examples of simtools.diagram.undo.CreateEdit


                    }
                  }
           
          as.translate(x,y);
          ShapesContainer.this.add(as);
          compoundEdit.addEdit(new CreateEdit(ShapesContainer.this,as));
        }
        }

        // Now Copy the connectors
        for (int i = 0; i < selectedConnectors.size(); i++) {
            Connection connection = (Connection) selectedConnectors.get(i);

            if (connection instanceof AbstractShape){
                Gate fisrtGate = (Gate) connection.getFirstEndGate();
                Gate lastGate = (Gate) connection.getLastEndGate();
               
                Gate newFg = null;
                Gate newLg = null;

                if ((fisrtGate!=null) && selectedGatedComponent.contains(fisrtGate.getOwner())){
                    newFg = (Gate) clonedGates.get(fisrtGate);
                }
                if ((lastGate!=null) && selectedGatedComponent.contains(lastGate.getOwner())){
                    newLg = (Gate) clonedGates.get(lastGate);
                }

                AbstractShape newConnector = ((AbstractShape)connection).cloneShape();
                newConnector.translate(x,y);
               
                if (newFg != null){
                    ((Connection)newConnector).connect(newFg, true);
                    compoundEdit.addEdit(new GateConnectEdit( (Connection)newConnector, newFg, true));
                }

                if (newLg != null){
                    ((Connection)newConnector).connect(newLg, false);
                    compoundEdit.addEdit(new GateConnectEdit( (Connection)newConnector, newLg, false));
                }

                // Add it ton container
                ShapesContainer.this.add(newConnector);
               
                compoundEdit.addEdit(new CreateEdit(ShapesContainer.this,newConnector));
            }
        }

        compoundEdit.end();
        fireUndoableEditUpdate(new UndoableEditEvent(this, compoundEdit));
View Full Code Here


      super.resizeEnd();
    }
   
    public void performCreate(AbstractShape shape) {
      fireUndoableEditUpdate(
          new UndoableEditEvent(this, new CreateEdit(ShapesContainer.this, shape))
      );
    }
View Full Code Here

                       // Create a new element
                        Element createdElement = currentElementCreator.create(_selX,_selY, dx, dy);

                        if (createdElement != null){
                            _elementContainer.add(createdElement);
                            _compoundEdit.addEdit(new CreateEdit(_elementContainer,createdElement));
                           
                       
                            // If the element created is a connection and if a gate has been tracked,
                            // then perform the connection of the first connection end.
                            if (selectedGate!=null && createdElement instanceof Connection){
View Full Code Here

TOP

Related Classes of simtools.diagram.undo.CreateEdit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.