use of com.ramussoft.pb.dfd.visual.DFDFunction 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;
}
use of com.ramussoft.pb.dfd.visual.DFDFunction in project ramus by Vitaliy-Yakovchuk.
the class MovingArea method editActive.
/**
* Якщо виділений якийсь об’єкт, тоді з’являється діалогове вікно для роботи
* з його властивостями.
*/
@SuppressWarnings("unused")
public void editActive() {
if ((Metadata.EDUCATIONAL) && (Math.random() < 0.2d)) {
AttributePlugin plugin = panel.getFramework().findAttributePlugin(new AttributeType("Core", "Table", false));
if (!(plugin instanceof EmptyPlugin)) {
System.exit(233);
}
}
if ((activeObject instanceof MovingFunction) || (activeObject instanceof DFDFunction)) {
final IDEF0Object movingFunction = (IDEF0Object) activeObject;
// String text = movingFunction.getFunction().getName();
panel.getFunctionOptions().showModal(movingFunction);
/*
* if(!text.equals(movingFunction.getFunction().getName()))
* movingFunction.resetBounds();
*/
} else if (activeObject instanceof DFDSRole) {
panel.getDFDSRoleOptionsDialog().showModal((DFDSRole) activeObject);
} else if (activeObject instanceof DFDObject) {
panel.getDFDObjectOptionsDialog().showModal((DFDObject) activeObject);
} else if (activeObject instanceof MovingText)
panel.getTextOptionsDialog().showModal((MovingText) activeObject);
else if (activeObject instanceof PaintSector.Pin) {
panel.getArrowOptionsDialog().showModal(((PaintSector.Pin) activeObject).getSector(), this);
// setPanels();
}
repaintAsync();
}
Aggregations