Search in sources :

Example 41 with Sector

use of com.ramussoft.pb.Sector in project ramus by Vitaliy-Yakovchuk.

the class HTTPParser method getStreams.

private Vector getStreams(final Function function, final MatrixProjection projection) {
    Vector left = projection.getLeft(function);
    final Vector x = new Vector();
    for (int i = 0; i < left.size(); i++) {
        final Sector s = (Sector) left.get(i);
        if (s.getStream() != null)
            x.add(s.getStream());
    }
    left = x;
    return left;
}
Also used : Sector(com.ramussoft.pb.Sector) PaintSector(com.ramussoft.pb.idef.elements.PaintSector) Vector(java.util.Vector)

Example 42 with Sector

use of com.ramussoft.pb.Sector in project ramus by Vitaliy-Yakovchuk.

the class AbstractSector method copyVisual.

public void copyVisual(final int type) {
    synchronized (dataPlugin) {
        final Vector<Sector> v = new Vector<Sector>();
        getConnected(v);
        for (int i = 0; i < v.size(); i++) {
            v.get(i).setVisualAttributes(getVisualAttributes());
        }
    }
}
Also used : Sector(com.ramussoft.pb.Sector) NSector(com.ramussoft.pb.data.negine.NSector) Vector(java.util.Vector) Crosspoint(com.ramussoft.pb.Crosspoint)

Example 43 with Sector

use of com.ramussoft.pb.Sector in project ramus by Vitaliy-Yakovchuk.

the class AbstractSector method getStreamChilds.

private void getStreamChilds(final Vector<Sector> v) {
    final Stream stream = getStream();
    final Vector<Sector> n = new Vector<Sector>(3);
    getChilds(getStart().getCrosspoint(), n);
    getChilds(getEnd().getCrosspoint(), n);
    for (final Sector s : n) {
        if ((s.getStream() == null || stream != null && stream.equals(s.getStream())) && (v.indexOf(s) < 0)) {
            v.add(s);
            ((AbstractSector) s).getStreamChilds(v);
        }
    }
}
Also used : Sector(com.ramussoft.pb.Sector) NSector(com.ramussoft.pb.data.negine.NSector) NStream(com.ramussoft.pb.data.negine.NStream) Stream(com.ramussoft.pb.Stream) Vector(java.util.Vector)

Example 44 with Sector

use of com.ramussoft.pb.Sector in project ramus by Vitaliy-Yakovchuk.

the class DFDObjectDialog method onOk.

@Override
protected void onOk() {
    Journaled journaled = (Journaled) dataPlugin.getEngine();
    journaled.startUserTransaction();
    Function function = object.getFunction();
    function.setFont(fontChooser.getSelFont());
    function.setBackground(backgroundColorChooser.getColor());
    function.setForeground(foregroundColorChooser.getColor());
    if (link == null) {
        function.setLink(-1);
    } else
        function.setLink(link.getElement().getId());
    Function p = (Function) function.getParent();
    List<Sector> list = new ArrayList<Sector>();
    if (p != null) {
        for (Sector sector : p.getSectors()) {
            if (function.equals(sector.getStart().getFunction()))
                list.add(sector);
            else if (function.equals(sector.getEnd().getFunction()))
                list.add(sector);
        }
    }
    for (Sector sector : list) SectorRefactor.fixOwners(sector, dataPlugin);
    journaled.commitUserTransaction();
    super.onOk();
}
Also used : Journaled(com.ramussoft.common.journal.Journaled) Function(com.ramussoft.pb.Function) Sector(com.ramussoft.pb.Sector) ArrayList(java.util.ArrayList)

Example 45 with Sector

use of com.ramussoft.pb.Sector in project ramus by Vitaliy-Yakovchuk.

the class MatrixProjectionIDEF0 method getRight.

/**
 * Метод повертає вектор елементів класифікатора робіт, які пов’язані з
 * відповідним елементом класифікатора потоків.
 */
public Vector<Row> getRight(final Row row) {
    final Vector<Row> res = new Vector<Row>();
    final Object[] functions = Main.dataPlugin.getRecChilds(Main.dataPlugin.getBaseFunction(), true).toArray();
    Function f;
    Function pF;
    final Vector<Function> softs = new Vector<Function>();
    if (functionType == -1)
        for (final Object element : functions) {
            boolean add = true;
            f = (Function) element;
            for (int j = 0; j < softs.size(); j++) if (Main.dataPlugin.isParent(f, softs.get(j))) {
                res.add(f);
                add = false;
                break;
            }
            if (add) {
                pF = (Function) f.getParentRow();
                final Vector v = pF.getSectors();
                for (int j = 0; j < v.size(); j++) {
                    final Sector sector = (Sector) v.get(j);
                    if (type == MovingPanel.RIGHT) {
                        if (f.equals(sector.getStart().getFunction()) && row.equals(sector.getStream())) {
                            res.add(f);
                            if (sector.getStart().getTunnelSoft() == Crosspoint.TUNNEL_SOFT)
                                softs.add(f);
                        }
                    } else {
                        if (sector.getEnd().getFunctionType() == type && f.equals(sector.getStart().getFunction()) && row.equals(sector.getStream())) {
                            res.add(f);
                            if (sector.getEnd().getTunnelSoft() == Crosspoint.TUNNEL_SOFT)
                                softs.add(f);
                        }
                    }
                }
            }
        }
    else
        for (final Object element : functions) {
            f = (Function) element;
            if (f.getType() == functionType) {
                boolean add = true;
                for (int j = 0; j < softs.size(); j++) if (Main.dataPlugin.isParent(f, softs.get(j))) {
                    res.add(f);
                    add = false;
                    break;
                }
                if (add) {
                    pF = (Function) f.getParentRow();
                    final Vector v = pF.getSectors();
                    for (int j = 0; j < v.size(); j++) {
                        final Sector sector = (Sector) v.get(j);
                        if (type == MovingPanel.RIGHT) {
                            if (f.equals(sector.getStart().getFunction()) && row.equals(sector.getStream())) {
                                res.add(f);
                                if (sector.getStart().getTunnelSoft() == Crosspoint.TUNNEL_SOFT)
                                    softs.add(f);
                            }
                        } else {
                            if (sector.getEnd().getFunctionType() == type && f.equals(sector.getStart().getFunction()) && row.equals(sector.getStream())) {
                                res.add(f);
                                if (sector.getEnd().getTunnelSoft() == Crosspoint.TUNNEL_SOFT)
                                    softs.add(f);
                            }
                        }
                    }
                }
            }
        }
    return res;
}
Also used : Function(com.ramussoft.pb.Function) Sector(com.ramussoft.pb.Sector) Row(com.ramussoft.pb.Row) Vector(java.util.Vector)

Aggregations

Sector (com.ramussoft.pb.Sector)50 NSector (com.ramussoft.pb.data.negine.NSector)40 Crosspoint (com.ramussoft.pb.Crosspoint)29 Function (com.ramussoft.pb.Function)25 NFunction (com.ramussoft.pb.data.negine.NFunction)19 Vector (java.util.Vector)19 Stream (com.ramussoft.pb.Stream)18 Row (com.ramussoft.pb.Row)15 FloatPoint (com.dsoft.pb.types.FloatPoint)10 PaintSector (com.ramussoft.pb.idef.elements.PaintSector)10 ByteArrayInputStream (java.io.ByteArrayInputStream)9 ByteArrayOutputStream (java.io.ByteArrayOutputStream)9 AbstractSector (com.ramussoft.pb.data.AbstractSector)7 ArrayList (java.util.ArrayList)5 HashSet (java.util.HashSet)5 NStream (com.ramussoft.pb.data.negine.NStream)4 Point (com.ramussoft.pb.idef.elements.Point)4 DataLoader (com.dsoft.utils.DataLoader)3 NCrosspoint (com.ramussoft.pb.data.negine.NCrosspoint)3 DFDFunction (com.ramussoft.pb.dfd.visual.DFDFunction)3