use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.
the class AbstractClassicTemplate method createSimpleArrow.
protected void createSimpleArrow(final Function function, final MovingArea movingArea, final int num, final int type) {
final Function f = (Function) function.getChildAt(num);
createStartxBorderPoint(movingArea, getX(f), 10, type);
createInPoint(movingArea, type, f);
}
use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.
the class ClassicTemplate method createChilds.
@Override
public synchronized void createChilds(final Function function, final DataPlugin dataPlugin) {
final MovingArea movingArea = new MovingArea(dataPlugin);
movingArea.setDataPlugin(dataPlugin);
movingArea.setActiveFunction(function);
movingArea.setArrowAddingState();
super.createChilds(function, dataPlugin, movingArea);
int num = count / 2;
if (2 * num == count)
num--;
createSimpleArrow(function, movingArea, num);
PaintSector s;
final Function f = (Function) function.getChildAt(num);
createFrom(movingArea, f, top);
createInPoint(movingArea, TOP, (Function) function.getChildAt(count - 1));
s = movingArea.getRefactor().getSector();
for (int i = count - 2; i > num; i--) {
final Function fS = (Function) function.getChildAt(i);
createFrom(movingArea, fS, s, getX(fS), POS);
createInPoint(movingArea, TOP, fS);
}
createFrom(movingArea, f, bottom);
createInPoint(movingArea, BOTTOM, (Function) function.getChildAt(count - 1));
s = movingArea.getRefactor().getSector();
for (int i = count - 2; i > num; i--) {
final Function fS = (Function) function.getChildAt(i);
createFrom(movingArea, fS, s, getX(fS), movingArea.CLIENT_HEIGHT - POS);
createInPoint(movingArea, BOTTOM, fS);
}
if (num > 0) {
createFrom(movingArea, f, top, getX(f), POS - 1);
createInPoint(movingArea, TOP, (Function) function.getChildAt(0));
s = movingArea.getRefactor().getSector();
for (int i = 1; i < num; i++) {
final Function fS = (Function) function.getChildAt(i);
createFrom(movingArea, fS, s, getX(fS), POS);
createInPoint(movingArea, TOP, fS);
}
createFrom(movingArea, f, bottom);
createInPoint(movingArea, BOTTOM, (Function) function.getChildAt(0));
s = movingArea.getRefactor().getSector();
for (int i = 1; i < num; i++) {
final Function fS = (Function) function.getChildAt(i);
createFrom(movingArea, fS, s, getX(fS), movingArea.CLIENT_HEIGHT - POS);
createInPoint(movingArea, BOTTOM, fS);
}
}
movingArea.getRefactor().saveToFunction();
}
use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.
the class NFunction method getOwner.
public Row getOwner() {
// Row row = dataPlugin.findRowByGlobalId(getLink());
// if (row != null)
// return row;
Row owner = getNativeOwner();
if (getType() >= Function.TYPE_EXTERNAL_REFERENCE)
return owner;
if (owner == null) {
Function par = (Function) getParent();
if (par == null)
return null;
Row ow = null;
if (par.getDecompositionType() == MovingArea.DIAGRAM_TYPE_DFDS) {
for (com.ramussoft.database.common.Row r : ((NFunction) par).getChildren()) {
Function function = (Function) r;
if (function.getType() == TYPE_DFDS_ROLE && this.equals(function.getOwner())) {
Stream stream = (Stream) dataPlugin.findRowByGlobalId(function.getLink());
if (stream != null) {
Row[] rows = stream.getAdded();
if (rows.length > 1) {
ow = null;
break;
} else if (rows.length == 1) {
if (ow != null) {
ow = null;
break;
} else
ow = rows[0];
}
}
}
}
}
if (ow != null)
return ow;
}
if (owner == null && getParentRow() != null)
return ((Function) getParentRow()).getOwner();
return owner;
}
use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.
the class MatrixProjectionOuner method getLeft.
public Vector<Row> getLeft(final Row row) {
final Vector<Row> res = new Vector<Row>();
final Function f = (Function) row;
final Row o = f.getOwner();
if (o != null)
res.add(o);
return res;
}
use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.
the class IDLExporter method rec.
private void rec(FunctionCallback callback, boolean onlyModels) throws IOException {
Vector<Row> v = dataPlugin.getRecChilds(base, true);
callback.call(base);
for (Row row : v) {
if ((row.getChildCount() == 0) && (!onlyModels))
callback.call((Function) row);
else if (row.getChildCount() > 0)
callback.call((Function) row);
}
}
Aggregations