Search in sources :

Example 76 with Row

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

the class NDataPlugin method getRecChilds.

private void getRecChilds(Row row, final boolean element, final Vector res) {
    Vector<Row> v = getChilds(row, element);
    for (Row r : v) {
        res.add(r);
        getRecChilds(r, element, res);
    }
}
Also used : Row(com.ramussoft.pb.Row)

Example 77 with Row

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

the class AbstractMatrixProjection method getLeftParent.

private void getLeftParent(final Row row, final Vector<Row[]> add) {
    if (row.isElement()) {
        final Vector v = getLeft(row);
        Row[] v1;
        for (int i = 0; i < v.size(); i++) {
            v1 = new Row[2];
            v1[0] = row;
            v1[1] = (Row) v.get(i);
            add.add(v1);
        }
        getLeftParent((Row) row.getParent(), add);
    }
}
Also used : Row(com.ramussoft.pb.Row) Vector(java.util.Vector)

Example 78 with Row

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

the class NFunction method getOwner.

public Row getOwner() {
    // Row row = dataPlugin.findRowByGlobalId(getLink());
    // if (row != null)
    // return row;
    Row owner = getNativeOwner();
    if (getType() >= Function.TYPE_EXTERNAL_REFERENCE)
        return owner;
    if (owner == null) {
        Function par = (Function) getParent();
        if (par == null)
            return null;
        Row ow = null;
        if (par.getDecompositionType() == MovingArea.DIAGRAM_TYPE_DFDS) {
            for (com.ramussoft.database.common.Row r : ((NFunction) par).getChildren()) {
                Function function = (Function) r;
                if (function.getType() == TYPE_DFDS_ROLE && this.equals(function.getOwner())) {
                    Stream stream = (Stream) dataPlugin.findRowByGlobalId(function.getLink());
                    if (stream != null) {
                        Row[] rows = stream.getAdded();
                        if (rows.length > 1) {
                            ow = null;
                            break;
                        } else if (rows.length == 1) {
                            if (ow != null) {
                                ow = null;
                                break;
                            } else
                                ow = rows[0];
                        }
                    }
                }
            }
        }
        if (ow != null)
            return ow;
    }
    if (owner == null && getParentRow() != null)
        return ((Function) getParentRow()).getOwner();
    return owner;
}
Also used : Function(com.ramussoft.pb.Function) Stream(com.ramussoft.pb.Stream) Row(com.ramussoft.pb.Row)

Example 79 with Row

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

the class NStream method checkRows.

private void checkRows() {
    boolean ok = true;
    for (final Row row : getARows()) if (row == null) {
        ok = false;
        break;
    }
    if (!ok) {
        System.err.println("NULL IN ADDED ROWS");
        final Vector<Row> tmp = new Vector<Row>();
        for (final Row row : getARows()) if (row != null) {
            tmp.add(row);
        }
        setARows(tmp.toArray(new Row[tmp.size()]));
        for (int i = 0; i < getARows().length; i++) getARows()[i] = tmp.get(i);
    }
}
Also used : Row(com.ramussoft.pb.Row) Vector(java.util.Vector)

Example 80 with Row

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

the class NStream method getTitle.

/**
 * Метод, який повертає назву стрілки, якщо назва - пустий рядок, то
 * повертається набір назв пов’язаних класифікаторів розділених крапкою з
 * комою і пробілом, теж саме що викликати метод getTitle("; ").
 *
 * @return Назва сектора.
 */
public static String getTitle(final Row[] rows) {
    StringBuilder sb = new StringBuilder();
    final String div = ";\n";
    boolean first = true;
    for (Row row : rows) {
        if (first)
            first = false;
        else
            sb.append(div);
        sb.append(row.getName());
        String status = row.getAttachedStatus();
        if (status != null) {
            int i = status.indexOf('|');
            if (i >= 0) {
                status = status.substring(i + 1);
                if (status.trim().length() == 0)
                    status = null;
            }
        }
        if (status != null) {
            sb.append(" (");
            sb.append(status);
            sb.append(')');
        }
    }
    return sb.toString();
}
Also used : Row(com.ramussoft.pb.Row)

Aggregations

Row (com.ramussoft.pb.Row)93 Function (com.ramussoft.pb.Function)35 Stream (com.ramussoft.pb.Stream)30 Vector (java.util.Vector)28 NFunction (com.ramussoft.pb.data.negine.NFunction)19 Sector (com.ramussoft.pb.Sector)15 NRow (com.ramussoft.pb.data.negine.NRow)14 Qualifier (com.ramussoft.common.Qualifier)13 Crosspoint (com.ramussoft.pb.Crosspoint)13 NSector (com.ramussoft.pb.data.negine.NSector)13 PaintSector (com.ramussoft.pb.idef.elements.PaintSector)12 ByteArrayOutputStream (java.io.ByteArrayOutputStream)11 ArrayList (java.util.ArrayList)11 SectorRefactor (com.ramussoft.pb.idef.elements.SectorRefactor)10 Attribute (com.ramussoft.common.Attribute)9 MovingFunction (com.ramussoft.pb.idef.visual.MovingFunction)9 IOException (java.io.IOException)9 FloatPoint (com.dsoft.pb.types.FloatPoint)8 Point (com.ramussoft.pb.idef.elements.Point)8 Element (com.ramussoft.common.Element)7