use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.
the class SectorRefactor method getStartRoles.
private static void getStartRoles(Sector sector, HashSet<Function> roles, DataPlugin dataPlugin) {
Function function2 = sector.getStart().getFunction();
if (function2 != null && function2.getType() == Function.TYPE_DFDS_ROLE)
if (!roles.contains(function2))
roles.add(function2);
function2 = sector.getEnd().getFunction();
if (function2 != null && function2.getType() == Function.TYPE_DFDS_ROLE)
if (!roles.contains(function2))
roles.add(function2);
if (sector.getStart().getCrosspoint() != null) {
for (Sector sector2 : sector.getStart().getCrosspoint().getOppozite(sector)) getStartRoles(sector2, roles, dataPlugin);
}
}
use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.
the class SectorRefactor method fixStartOwners.
private static void fixStartOwners(Sector sector, DataPlugin dataPlugin) {
Function function2 = sector.getEnd().getFunction();
if (function2 != null && function2.getType() == Function.TYPE_DFDS_ROLE)
fillFromOwners(function2, dataPlugin);
Crosspoint crosspoint = sector.getStart().getCrosspoint();
if (crosspoint != null) {
for (Sector sector2 : crosspoint.getOppozite(sector)) fixStartOwners(sector2, dataPlugin);
}
}
use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.
the class SectorRefactor method fillEndFromOwners.
private static void fillEndFromOwners(Sector sector, HashSet<Row> owners, DataPlugin dataPlugin, boolean[] hasFunctionOwners) {
Crosspoint crosspoint = sector.getEnd().getCrosspoint();
Function function2 = sector.getEnd().getFunction();
if (function2 != null) {
if (function2.getType() != Function.TYPE_DFDS_ROLE) {
Row row = function2.getOwner();
if (row != null && !owners.contains(row)) {
owners.add(row);
hasFunctionOwners[0] = true;
}
} else {
Stream stream = (Stream) dataPlugin.findRowByGlobalId(function2.getLink());
if (stream != null)
for (Row row : stream.getAdded()) {
if (row != null && !owners.contains(row))
owners.add(row);
}
}
}
if (crosspoint != null)
for (Sector sector2 : crosspoint.getOppozite(sector)) fillEndFromOwners(sector2, owners, dataPlugin, hasFunctionOwners);
}
use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.
the class SectorRefactor method getEndRoles.
private static void getEndRoles(Sector sector, HashSet<Function> roles, DataPlugin dataPlugin) {
Function function2 = sector.getEnd().getFunction();
if (function2 != null && function2.getType() == Function.TYPE_DFDS_ROLE)
if (!roles.contains(function2))
roles.add(function2);
function2 = sector.getStart().getFunction();
if (function2 != null && function2.getType() == Function.TYPE_DFDS_ROLE)
if (!roles.contains(function2))
roles.add(function2);
if (sector.getEnd().getCrosspoint() != null) {
for (Sector sector2 : sector.getEnd().getCrosspoint().getOppozite(sector)) getEndRoles(sector2, roles, dataPlugin);
}
}
use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.
the class MatrixProjectionOuner method getRight.
public Vector<Row> getRight(final Row row) {
final Vector<Row> res = new Vector<Row>();
final Vector<Row> functions = Main.dataPlugin.getRecChilds(Main.dataPlugin.getBaseFunction(), true);
for (int i = 0; i < functions.size(); i++) {
final Function f = (Function) functions.get(i);
final Row o = f.getOwner();
if (o.equals(row))
res.add(f);
}
return res;
}
Aggregations