Package simtools.diagram.gate

Examples of simtools.diagram.gate.Gate


            if (ns!=null){
                ns.translate(-p.x, -p.y);

                v.addElement(ns);

                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())){
View Full Code Here


            if (ss.element instanceof GatedComponent){
                GatedComponent gc = (GatedComponent)ss.element;

                List gates = gc.getGates();
                for(int k=0; k< gates.size(); k++){
                    Gate gate =  ((Gate)gates.get(k));
                    List connections = gate.getConnections();

                    for(int j=0; j< connections.size(); j++){
                        Connection connection = (Connection)connections.get(j);   
                        if (connection.isConnected(gate)){
                            ce.addEdit(new GateDisconnectEdit(connection, gate, connection.getFirstEndGate()!=null && connection.getFirstEndGate().equals(gate)));
View Full Code Here

        res.gateHolder = gateHolder.cloneGateHolder(res);
       
        // clone gates
        List gates = gateHolder.getGates();
        for(int i=0;i< gates.size();i++){
            Gate gate = (Gate)gates.get(i);
            res.gateHolder.addGate(gate.cloneGate(res));
        }
        return res;
    }
View Full Code Here

     * @see simtools.diagram.gate.GatedComponent#connectionAddedAt(simtools.diagram.gate.Gate, simtools.diagram.gate.Connection)
     */
    public void connectionAddedAt(Gate gate, Connection connection) {  

        // If the other connection gate  holds a signal, the given gate becomes an input of this component
        Gate otherGate = null;
        if (connection.getFirstEndGate() != null && !connection.getFirstEndGate().equals(gate)){
            otherGate = connection.getFirstEndGate();

        } else if (connection.getLastEndGate() != null && !connection.getLastEndGate().equals(gate)){
            otherGate = connection.getLastEndGate();
View Full Code Here

     */
    private int getIndex(Gate gate){
        int res = -1;
       
        if (gates.contains(gate)) {
            Gate g = null;
            for(int i=0;i<gates.size() && !gate.equals(g) ;i++){
                g = (Gate)gates.get(i);
                if (g.getSide() == gate.getSide()){
                    res++;
                }
            }
        }
       
View Full Code Here

    /* (non-Javadoc)
     * @see simtools.diagram.gate.GatedComponent#getGateAt(int, int)
     */
    public Gate getGateAt(int ox, int oy){
        Gate res = null;
        Point p = new Point(ox, oy);

        List gates = getGates();
        for(int i=0;i<gates.size() && res==null; i++){
            Gate g = (Gate)gates.get(i);
            if ( g.canBeHanged(p)){
                res = g;
            }
        }
        return res;
    }
View Full Code Here

      
    public GatedRectangleShape(int ox, int oy, int width, int height) {
        super(ox, oy, width, height);
        gateHolder = new GatesHolder(this);
       
        addGate(northGate = new Gate(this, Gate.NORTH));
        addGate(southGate = new Gate(this, Gate.SOUTH));
        addGate(eastGate = new Gate(this, Gate.EAST));
        addGate(westGate = new Gate(this, Gate.WEST));
       
    }
View Full Code Here

TOP

Related Classes of simtools.diagram.gate.Gate

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.