Search in sources :

Example 6 with Function

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);
    }
}
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)

Example 7 with Function

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);
    }
}
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 8 with Function

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);
}
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 9 with Function

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);
    }
}
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)

Example 10 with Function

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;
}
Also used : Function(com.ramussoft.pb.Function) Row(com.ramussoft.pb.Row) Vector(java.util.Vector)

Aggregations

Function (com.ramussoft.pb.Function)96 NFunction (com.ramussoft.pb.data.negine.NFunction)50 Row (com.ramussoft.pb.Row)36 MovingFunction (com.ramussoft.pb.idef.visual.MovingFunction)27 Crosspoint (com.ramussoft.pb.Crosspoint)25 Sector (com.ramussoft.pb.Sector)25 Stream (com.ramussoft.pb.Stream)21 FloatPoint (com.dsoft.pb.types.FloatPoint)19 NSector (com.ramussoft.pb.data.negine.NSector)18 DFDFunction (com.ramussoft.pb.dfd.visual.DFDFunction)17 PaintSector (com.ramussoft.pb.idef.elements.PaintSector)17 Vector (java.util.Vector)17 DFDSFunction (com.ramussoft.pb.dfds.visual.DFDSFunction)15 IOException (java.io.IOException)13 FRectangle (com.dsoft.pb.types.FRectangle)11 Point (com.ramussoft.pb.idef.elements.Point)11 SectorRefactor (com.ramussoft.pb.idef.elements.SectorRefactor)10 ByteArrayOutputStream (java.io.ByteArrayOutputStream)10 ArrayList (java.util.ArrayList)10 MovingArea (com.ramussoft.pb.idef.visual.MovingArea)8