use of com.ramussoft.pb.dfd.visual.DataStore 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;
}
Aggregations