Search in sources :

Example 1 with MatrixProjection

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

the class NFunction method getOwners.

public Row[] getOwners() {
    Function function = (Function) getParentRow();
    if (function.getDecompositionType() == MovingArea.DIAGRAM_TYPE_DFDS) {
        if (function != null) {
            List<Row> res = new ArrayList<Row>();
            int c = function.getChildCount();
            for (int i = 0; i < c; i++) {
                Function function2 = (Function) function.getChildAt(i);
                if (function2.getType() == Function.TYPE_DFDS_ROLE && this.equals(function2.getOwner())) {
                    Stream stream = (Stream) dataPlugin.findRowByGlobalId(function2.getLink());
                    if (stream != null) {
                        for (Row row : stream.getAdded()) if (!res.contains(row))
                            res.add(row);
                    }
                }
            }
            Row[] rows = res.toArray(new Row[res.size()]);
            RowFactory.sortByName(rows);
            return rows;
        }
    }
    String s = dataPlugin.getProperty(DataPlugin.PROPERTY_OUNERS);
    if (s == null)
        s = "";
    final StringTokenizer st = new StringTokenizer(s);
    final Vector<GlobalId> ids = new Vector<GlobalId>();
    while (st.hasMoreTokens()) {
        ids.add(GlobalId.convert(st.nextToken()));
    }
    final MatrixProjection projection = dataPlugin.getProjection(MatrixProjection.TYPE_IDEF0, "BOTTOM");
    final Vector left = projection.getLeft(this);
    final Vector<Row> res = new Vector<Row>();
    Row[] rows;
    for (int i = 0; i < left.size(); i++) {
        final Stream r = (Stream) left.get(i);
        if ((rows = r.getAdded()).length == 0)
            addRow(res, ids, r);
        else
            for (final Row element2 : rows) addRow(res, ids, element2);
    }
    rows = res.toArray(new Row[res.size()]);
    RowFactory.sortByName(rows);
    return rows;
}
Also used : MatrixProjection(com.ramussoft.pb.MatrixProjection) ArrayList(java.util.ArrayList) GlobalId(com.ramussoft.pb.types.GlobalId) Function(com.ramussoft.pb.Function) StringTokenizer(java.util.StringTokenizer) Stream(com.ramussoft.pb.Stream) Row(com.ramussoft.pb.Row) Vector(java.util.Vector)

Example 2 with MatrixProjection

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

the class HTTPParser method printFunctionsArrows.

private void printFunctionsArrows(final Function function) throws IOException {
    MatrixProjection projection = dataPlugin.getFastMatrixProjectionIDEF0(MovingPanel.TOP, function);
    Vector left = getStreams(function, projection);
    if (left.size() > 0)
        printFunctionArrows(left, RES.getString("TopElements"));
    projection = dataPlugin.getFastMatrixProjectionIDEF0(MovingPanel.LEFT, function);
    left = getStreams(function, projection);
    if (left.size() > 0)
        printFunctionArrows(left, RES.getString("LeftElements"));
    projection = dataPlugin.getFastMatrixProjectionIDEF0(MovingPanel.RIGHT, function);
    left = getStreams(function, projection);
    if (left.size() > 0)
        printFunctionArrows(left, RES.getString("RightElements"));
    projection = dataPlugin.getFastMatrixProjectionIDEF0(MovingPanel.BOTTOM, function);
    left = getStreams(function, projection);
    if (left.size() > 0)
        printFunctionArrows(left, RES.getString("BottomElements"));
}
Also used : MatrixProjection(com.ramussoft.pb.MatrixProjection) Vector(java.util.Vector)

Aggregations

MatrixProjection (com.ramussoft.pb.MatrixProjection)2 Vector (java.util.Vector)2 Function (com.ramussoft.pb.Function)1 Row (com.ramussoft.pb.Row)1 Stream (com.ramussoft.pb.Stream)1 GlobalId (com.ramussoft.pb.types.GlobalId)1 ArrayList (java.util.ArrayList)1 StringTokenizer (java.util.StringTokenizer)1