Search in sources :

Example 1 with External

use of com.ramussoft.pb.dfd.visual.External in project ramus by Vitaliy-Yakovchuk.

the class MovingArea method addIDEF0Object.

private IDEF0Object addIDEF0Object(final Function function) {
    IDEF0Object movingFunction;
    if (function.getType() < Function.TYPE_EXTERNAL_REFERENCE) {
        if (DIAGRAM_TYPE_DFD == activeFunction.getDecompositionType())
            movingFunction = new DFDFunction(this, function) {

                /**
                 * @see com.ramussoft.pb.idef.visual.MovingText#onFocusGained(java.awt.event.FocusEvent)
                 */
                @Override
                public void focusGained(boolean silent) {
                    super.focusGained(silent);
                    setActiveObject(this, silent);
                }

                @Override
                public void focusLost() {
                    super.focusLost();
                    if (getActiveObject() == this)
                        setActiveObject(null);
                }
            };
        else if (DIAGRAM_TYPE_DFDS == activeFunction.getDecompositionType())
            movingFunction = new DFDSFunction(this, function) {

                /**
                 * @see com.ramussoft.pb.idef.visual.MovingText#onFocusGained(java.awt.event.FocusEvent)
                 */
                @Override
                public void focusGained(boolean silent) {
                    super.focusGained(silent);
                    setActiveObject(this, silent);
                }

                @Override
                public void focusLost() {
                    super.focusLost();
                    if (getActiveObject() == this)
                        setActiveObject(null);
                }
            };
        else
            movingFunction = new MovingFunction(this, function) {

                /**
                 * @see com.ramussoft.pb.idef.visual.MovingText#onFocusGained(java.awt.event.FocusEvent)
                 */
                @Override
                public void focusGained(boolean silent) {
                    super.focusGained(silent);
                    setActiveObject(this, silent);
                }

                @Override
                public void focusLost() {
                    super.focusLost();
                    if (getActiveObject() == this)
                        setActiveObject(null, false);
                }
            };
    } else {
        if (function.getType() == Function.TYPE_EXTERNAL_REFERENCE) {
            movingFunction = new External(this, function) {

                /**
                 * @see com.ramussoft.pb.idef.visual.MovingText#onFocusGained(java.awt.event.FocusEvent)
                 */
                @Override
                public void focusGained(boolean silent) {
                    super.focusGained(silent);
                    setActiveObject(this);
                }

                @Override
                public void focusLost() {
                    super.focusLost();
                    if (getActiveObject() == this)
                        setActiveObject(null);
                }
            };
        } else if (function.getType() == Function.TYPE_DFDS_ROLE) {
            movingFunction = new DFDSRole(this, function) {

                /**
                 * @see com.ramussoft.pb.idef.visual.MovingText#onFocusGained(java.awt.event.FocusEvent)
                 */
                @Override
                public void focusGained(boolean silent) {
                    super.focusGained(silent);
                    setActiveObject(this, silent);
                }

                @Override
                public void focusLost() {
                    super.focusLost();
                    if (getActiveObject() == this)
                        setActiveObject(null, false);
                }
            };
        } else {
            // DATA STORE
            movingFunction = new DataStore(this, function) {

                /**
                 * @see com.ramussoft.pb.idef.visual.MovingText#onFocusGained(java.awt.event.FocusEvent)
                 */
                @Override
                public void focusGained(boolean silent) {
                    super.focusGained(silent);
                    setActiveObject(this);
                }

                @Override
                public void focusLost() {
                    super.focusLost();
                    if (getActiveObject() == this)
                        setActiveObject(null);
                }
            };
        }
    }
    movingFunctions.put(function, movingFunction);
    return movingFunction;
}
Also used : DFDFunction(com.ramussoft.pb.dfd.visual.DFDFunction) DFDSRole(com.ramussoft.pb.dfds.visual.DFDSRole) DataStore(com.ramussoft.pb.dfd.visual.DataStore) External(com.ramussoft.pb.dfd.visual.External) DFDSFunction(com.ramussoft.pb.dfds.visual.DFDSFunction)

Aggregations

DFDFunction (com.ramussoft.pb.dfd.visual.DFDFunction)1 DataStore (com.ramussoft.pb.dfd.visual.DataStore)1 External (com.ramussoft.pb.dfd.visual.External)1 DFDSFunction (com.ramussoft.pb.dfds.visual.DFDSFunction)1 DFDSRole (com.ramussoft.pb.dfds.visual.DFDSRole)1