use of com.ramussoft.pb.Sector 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.Sector 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.Sector 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.Sector 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.Sector in project ramus by Vitaliy-Yakovchuk.
the class DFDSRole method setStream.
public void setStream(Stream stream, ReplaceStreamType replaceStreamType) {
function.setLink((stream == null) ? -1 : stream.getElement().getId());
Function function = (Function) this.function.getOwner();
if (function != null) {
HashSet<Sector> toUpdate = new HashSet<Sector>();
for (Sector sector : ((Function) this.function.getParent()).getSectors()) {
if (function.equals(sector.getStart().getFunction()) || function.equals(sector.getEnd().getFunction()))
if (!toUpdate.contains(sector))
toUpdate.add(sector);
}
for (Sector sector : toUpdate) SectorRefactor.fixOwners(sector, movingArea.dataPlugin);
} else {
SectorRefactor.copyOwnersFrom(this.function, movingArea.dataPlugin);
}
}
Aggregations