Search in sources :

Example 36 with Stream

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

the class HTTPParser method printFunctionArrows.

private void printFunctionArrows(final Vector left, final String string) throws IOException {
    final Vector<Row> v = new Vector<Row>();
    for (int i = 0; i < left.size(); i++) {
        final Stream stream = (Stream) left.get(i);
        final Row[] rs = stream.getAdded();
        for (final Row row : rs) {
            if (v.indexOf(row) < 0)
                v.add(row);
        }
    }
    final Row[] rows = new Row[v.size()];
    for (int i = 0; i < rows.length; i++) rows[i] = v.get(i);
    if (rows.length == 0)
        return;
    RowFactory.sortByName(rows);
    htmlStream.println("<p>");
    htmlStream.println("<table border=1 width=100%>");
    printMainTableTitle(string, 3);
    htmlStream.print("<tr>");
    htmlStream.print("<td><b>");
    htmlStream.print(RES.getString("kod"));
    htmlStream.print("</b></td>");
    htmlStream.print("<td><b>");
    htmlStream.print(RES.getString("element"));
    htmlStream.print("</b></td>");
    htmlStream.print("<td><b>");
    htmlStream.print(RES.getString("clasificator"));
    htmlStream.print("</b></td>");
    htmlStream.println("</tr>");
    for (final Row row : rows) {
        htmlStream.print("<tr>");
        htmlStream.print("<td>");
        printStartATeg("rows/index.html?id=" + row.getGlobalId().toString());
        htmlStream.print(row.getKod());
        printEndATeg();
        htmlStream.print("</td>");
        htmlStream.print("<td width=100%>");
        printStartATeg("rows/index.html?id=" + row.getGlobalId().toString());
        htmlStream.print(row.getName());
        printEndATeg();
        htmlStream.print("</td>");
        Qualifier q = dataPlugin.getEngine().getQualifier(row.getElement().getQualifierId());
        Element element = StandardAttributesPlugin.getElement(dataPlugin.getEngine(), q.getId());
        htmlStream.print("<td>");
        String name = q.getName();
        if (element != null) {
            printStartATeg("rows/index.html?id=" + element.getId());
        } else {
            if (name.equals(StandardAttributesPlugin.QUALIFIERS_QUALIFIER))
                name = RES.getString("clasificator");
        }
        htmlStream.print(name);
        if (element != null) {
            printEndATeg();
        }
        htmlStream.print("</td>");
        htmlStream.println("</tr>");
    }
    htmlStream.println("</table>");
    htmlStream.println("</p>");
}
Also used : Element(com.ramussoft.common.Element) ByteArrayOutputStream(java.io.ByteArrayOutputStream) OutputStream(java.io.OutputStream) Stream(com.ramussoft.pb.Stream) InputStream(java.io.InputStream) Qualifier(com.ramussoft.common.Qualifier) Row(com.ramussoft.pb.Row) NRow(com.ramussoft.pb.data.negine.NRow) Vector(java.util.Vector)

Example 37 with Stream

use of com.ramussoft.pb.Stream 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 38 with Stream

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

the class IDLImporter method getStream.

private Stream getStream(String name) {
    Stream stream = streams.get(name);
    if (stream == null) {
        stream = (Stream) plugin.createRow(plugin.getBaseStream(), true);
        stream.setName(name);
        streams.put(name, stream);
    }
    return stream;
}
Also used : Stream(com.ramussoft.pb.Stream) InputStream(java.io.InputStream)

Example 39 with Stream

use of com.ramussoft.pb.Stream 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 40 with Stream

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

the class AbstractSector method splitSectorStreams.

private void splitSectorStreams(final Sector sector) {
    final Stream my = getStream();
    final Stream other = splitStream(my);
    if (my == null)
        return;
    ((AbstractSector) sector).setThisStream(other);
}
Also used : NStream(com.ramussoft.pb.data.negine.NStream) Stream(com.ramussoft.pb.Stream)

Aggregations

Stream (com.ramussoft.pb.Stream)51 Row (com.ramussoft.pb.Row)30 Function (com.ramussoft.pb.Function)21 Sector (com.ramussoft.pb.Sector)18 ByteArrayOutputStream (java.io.ByteArrayOutputStream)15 NSector (com.ramussoft.pb.data.negine.NSector)14 Vector (java.util.Vector)13 InputStream (java.io.InputStream)11 PaintSector (com.ramussoft.pb.idef.elements.PaintSector)10 ByteArrayInputStream (java.io.ByteArrayInputStream)10 Crosspoint (com.ramussoft.pb.Crosspoint)9 NFunction (com.ramussoft.pb.data.negine.NFunction)9 OutputStream (java.io.OutputStream)7 NStream (com.ramussoft.pb.data.negine.NStream)6 ArrayList (java.util.ArrayList)6 FloatPoint (com.dsoft.pb.types.FloatPoint)4 SectorRefactor (com.ramussoft.pb.idef.elements.SectorRefactor)4 MovingFunction (com.ramussoft.pb.idef.visual.MovingFunction)4 IOException (java.io.IOException)4 FRectangle (com.dsoft.pb.types.FRectangle)3