use of com.ramussoft.pb.Crosspoint 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.Crosspoint 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.Crosspoint in project ramus by Vitaliy-Yakovchuk.
the class NSector method rMe.
private void rMe(final SectorBorder sb) {
Crosspoint c = sb.getCrosspoint();
if (c == null) {
c = ((NSectorBorder) sb).crosspoint;
((NSectorBorder) sb).crosspoint = null;
}
if (c == null)
return;
((AbstractCrosspoint) c).remove1(this);
}
use of com.ramussoft.pb.Crosspoint in project ramus by Vitaliy-Yakovchuk.
the class AbstractSector method getConnectedOnFunction.
/**
* Метод повертає масив під’єднаних до точки секторів, при чому всі сектори
* знаходяться на одному функціональному блоці.
*
* @param crosspoint Точка перетену секторів.
* @return Масив секторів, що під’єднані до точки.
*/
private void getConnectedOnFunction(final Crosspoint crosspoint, final Vector<Sector> v) {
if (crosspoint == null)
return;
final Vector<Sector> ss = new Vector<Sector>();
crosspoint.getSectors(ss);
int i;
final int n = ss.size();
final int oLen = v.size();
Sector s;
for (i = 0; i < n; i++) if ((s = ss.get(i)).getFunction().equals(getFunction()))
if (v.indexOf(s) < 0)
v.add(s);
final int len = v.size();
for (i = oLen; i < len; i++) ((AbstractSector) v.get(i)).getConnectedOnFunction(v);
}
use of com.ramussoft.pb.Crosspoint in project ramus by Vitaliy-Yakovchuk.
the class AbstractSector method splitSector.
public Sector splitSector() {
final AbstractSector sector = (AbstractSector) dataPlugin.createSector();
sector.getEnd().setCrosspointA(getEnd().getCrosspoint());
sector.getEnd().setFunctionA(getEnd().getFunction());
sector.getEnd().setFunctionTypeA(getEnd().getFunctionType());
sector.getEnd().setBorderTypeA(getEnd().getBorderType());
sector.getEnd().commit();
getEnd().setFunctionA(null);
getEnd().setFunctionTypeA(-1);
getEnd().setBorderTypeA(-1);
final Crosspoint crosspoint = dataPlugin.createCrosspoint();
sector.getStart().setCrosspointA(crosspoint);
sector.getStart().commit();
getEnd().setCrosspointA(crosspoint);
getEnd().commit();
sector.setFunction(getFunction());
// sector.setStreamAddedByRefactor(isStreamAddedByRefactor());
splitSectorStreams(sector);
sector.setVisualAttributes(getVisualAttributes());
return sector;
}
Aggregations