Search in sources :

Example 6 with Crosspoint

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);
    }
}
Also used : Function(com.ramussoft.pb.Function) NFunction(com.ramussoft.pb.data.negine.NFunction) Sector(com.ramussoft.pb.Sector) NSector(com.ramussoft.pb.data.negine.NSector) Crosspoint(com.ramussoft.pb.Crosspoint)

Example 7 with Crosspoint

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);
}
Also used : Function(com.ramussoft.pb.Function) NFunction(com.ramussoft.pb.data.negine.NFunction) Sector(com.ramussoft.pb.Sector) NSector(com.ramussoft.pb.data.negine.NSector) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) Stream(com.ramussoft.pb.Stream) Row(com.ramussoft.pb.Row) Crosspoint(com.ramussoft.pb.Crosspoint)

Example 8 with Crosspoint

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);
}
Also used : AbstractCrosspoint(com.ramussoft.pb.data.AbstractCrosspoint) Crosspoint(com.ramussoft.pb.Crosspoint) AbstractCrosspoint(com.ramussoft.pb.data.AbstractCrosspoint)

Example 9 with Crosspoint

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);
}
Also used : Sector(com.ramussoft.pb.Sector) NSector(com.ramussoft.pb.data.negine.NSector) Vector(java.util.Vector) Crosspoint(com.ramussoft.pb.Crosspoint)

Example 10 with Crosspoint

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;
}
Also used : Crosspoint(com.ramussoft.pb.Crosspoint)

Aggregations

Crosspoint (com.ramussoft.pb.Crosspoint)29 NSector (com.ramussoft.pb.data.negine.NSector)18 Sector (com.ramussoft.pb.Sector)16 FloatPoint (com.dsoft.pb.types.FloatPoint)15 Function (com.ramussoft.pb.Function)12 NFunction (com.ramussoft.pb.data.negine.NFunction)11 NCrosspoint (com.ramussoft.pb.data.negine.NCrosspoint)9 Row (com.ramussoft.pb.Row)6 Vector (java.util.Vector)6 AbstractSector (com.ramussoft.pb.data.AbstractSector)5 PaintSector (com.ramussoft.pb.idef.elements.PaintSector)5 Stream (com.ramussoft.pb.Stream)4 Point (com.ramussoft.pb.idef.elements.Point)4 DFDFunction (com.ramussoft.pb.dfd.visual.DFDFunction)3 ByteArrayInputStream (java.io.ByteArrayInputStream)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 ArrayList (java.util.ArrayList)3 DFDSFunction (com.ramussoft.pb.dfds.visual.DFDSFunction)2 Ordinate (com.ramussoft.pb.idef.elements.Ordinate)2 SectorRefactor (com.ramussoft.pb.idef.elements.SectorRefactor)2