Package simtools.diagram.gate

Examples of simtools.diagram.gate.ConnectionPathSelection


     */
    protected void disconnectConnectionEnd(){
        CompoundEdit ce = new CompoundEdit();

        if (_elementContainer.getSelection().getShapeCount()==1 &&  _elementContainer.getSelection().getSelectedShape(0) instanceof ConnectionPathSelection){
            ConnectionPathSelection cs = (ConnectionPathSelection)_elementContainer.getSelection().getSelectedShape(0);
            Connection connection = cs.getConnection();

            if( cs.isFirstEndSelected() && connection.getFirstEndGate()!=null ){
                Gate firstGate = connection.getFirstEndGate()
                connection.disconnect(firstGate);
                ce.addEdit(new GateDisconnectEdit(connection, firstGate,true));  

            } else if( cs.isLastEndSelected() && connection.getLastEndGate()!=null  ){
                Gate lastGate = connection.getLastEndGate()
                connection.disconnect(lastGate);
                ce.addEdit(new GateDisconnectEdit(connection, lastGate,false));  
            }
        }
View Full Code Here


         int selectionSize= _elementContainer.getSelection().getShapeCount();
         for (int i=0;i< selectionSize && res; i++){
             ElementSelection ds = _elementContainer.getSelection().getSelectedShape(i);
             if (ds instanceof ConnectionPathSelection){

                 ConnectionPathSelection cs = (ConnectionPathSelection)ds;
                 Connection connection = cs.getConnection();

                 Gate firstGate = connection.getFirstEndGate()
                 if (firstGate!=null && !_elementContainer.getSelection().isSelected((Shape)firstGate.getOwner())) {
                     res = false;
                 }
View Full Code Here


            // look up for gate at selected end
            if (_translatingPoint &&  ss instanceof ConnectionPathSelection && ((ConnectionPathSelection)ss).isOneEndSelected()){

                ConnectionPathSelection cps = ((ConnectionPathSelection)ss);
                Connection connection = cps.getConnection();

                boolean isFirstEndSelected = ((ConnectionPathSelection)ss).isFirstEndSelected();

                Point p = isFirstEndSelected? connection.getPath().getNode(0) : connection.getPath().getNode(connection.getPath().getNodeNumber()-1);
View Full Code Here

    /* (non-Javadoc)
     * @see simtools.diagram.SelectableShapeInterface#createSelection(java.awt.Point, simtools.diagram.DiagramSelection)
     */
    public ElementSelection createSelection(Point shapeOrigin, DiagramSelection ds) {
        return new ConnectionPathSelection(this,shapeOrigin);
    }
View Full Code Here

    /* (non-Javadoc)
     * @see simtools.diagram.SelectableShapePointsInterface#createSelection()
     */
    public ElementSelection createSelection(Point shapeOrigin, DiagramSelection ds) {
        return new ConnectionPathSelection(this,shapeOrigin);
    }
View Full Code Here

TOP

Related Classes of simtools.diagram.gate.ConnectionPathSelection

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.