Search in sources :

Example 1 with NRow

use of com.ramussoft.pb.data.negine.NRow in project ramus by Vitaliy-Yakovchuk.

the class DFDSFunction method onEndBoundsChange.

@Override
public void onEndBoundsChange() {
    FRectangle oldRec = function.getBounds();
    if (oldRec.equals(myBounds))
        return;
    final SectorRefactor refactor = movingArea.getRefactor();
    ((NRow) function).startUserTransaction();
    onProcessEndBoundsChange();
    refactor.setUndoPoint();
}
Also used : SectorRefactor(com.ramussoft.pb.idef.elements.SectorRefactor) FRectangle(com.dsoft.pb.types.FRectangle) NRow(com.ramussoft.pb.data.negine.NRow)

Example 2 with NRow

use of com.ramussoft.pb.data.negine.NRow in project ramus by Vitaliy-Yakovchuk.

the class HTTPParser method printClasificator.

private void printClasificator() throws IOException {
    final Row row = loadRowById();
    if (row == null) {
        printError(RES.getString("cantLoatClasificator"));
        return;
    }
    if (row instanceof Function) {
        htmlTitle = MovingFunction.getIDEF0Kod((com.ramussoft.database.common.Row) row) + " " + row.getName();
    } else
        htmlTitle = row.getKod() + ". " + row.getName();
    printStartD();
    printRowBase(row);
    if (row instanceof Function) {
        boolean b = true;
        if (!row.isLeaf()) {
            b = false;
            htmlStream.println("<br>");
            printStartATeg("idef0/index.html?id=" + row.getGlobalId().toString());
            htmlStream.print(RES.getString("idef0Model"));
            printEndATeg();
        }
        if (row.isElement()) {
            if (b)
                htmlStream.println("<br>");
            else
                htmlStream.print(" ");
            printStartATeg("idef0/index.html?id=" + row.getParentRow().getGlobalId().toString());
            htmlStream.print(RES.getString("ParentIDEF0Model"));
            printEndATeg();
        }
        htmlStream.println("<br>");
    } else if (row instanceof Stream && !dataPlugin.getBaseStream().equals(row)) {
        printStreamsRows((Stream) row);
    }
    boolean haveTable = false;
    Vector<Row> v = dataPlugin.getChilds(row, row.isElement());
    if (v.size() > 0) {
        if (haveTable)
            htmlStream.println("<br>");
        printElements(RES.getString("childElements"), v.toArray(), row.isElement() ? "rows" : "clasificators");
        haveTable = true;
    }
    if (!row.isElement()) {
        if (haveTable)
            htmlStream.println("<br>");
        v = dataPlugin.getRecChilds(row, true);
        htmlStream.println("<hr>");
        String var = params.get("var");
        String attr = params.get("attr");
        if (var != null) {
            Engine engine = dataPlugin.getEngine();
            long attrId = Long.parseLong(attr);
            long varId = Long.parseLong(var);
            Attribute attribute = engine.getAttribute(attrId);
            List<VariantPropertyPersistent> list = (List<VariantPropertyPersistent>) engine.getAttribute(null, attribute);
            VariantPropertyPersistent vpp = null;
            for (VariantPropertyPersistent vp : list) if (vp.getVariantId() == varId) {
                vpp = vp;
                break;
            }
            if ((vpp != null) && (vpp.getValue() != null)) {
                String value = vpp.getValue();
                ArrayList list1 = new ArrayList();
                for (Row r : v) {
                    if (value.equals(((NRow) r).getAttribute(attribute)))
                        list1.add(r);
                }
                htmlStream.println("(" + value + ")");
                htmlStream.println("<br>");
                printElements(RES.getString("childElements"), list1.toArray(), row.isElement() ? "rows" : "clasificators");
            }
        } else
            printElements(RES.getString("clasificatorElements"), v.toArray());
    } else
        printRowAttributes(row);
    if (row instanceof Function && (row.isElement())) {
        printFunctionsArrows((Function) row);
    } else if (!(row instanceof Stream)) {
        printArrowFunctionss(row);
    }
    printEndD();
}
Also used : Attribute(com.ramussoft.common.Attribute) ArrayList(java.util.ArrayList) VariantPropertyPersistent(com.ramussoft.core.attribute.simple.VariantPropertyPersistent) Function(com.ramussoft.pb.Function) MovingFunction(com.ramussoft.pb.idef.visual.MovingFunction) ByteArrayOutputStream(java.io.ByteArrayOutputStream) OutputStream(java.io.OutputStream) Stream(com.ramussoft.pb.Stream) InputStream(java.io.InputStream) List(java.util.List) ArrayList(java.util.ArrayList) Row(com.ramussoft.pb.Row) NRow(com.ramussoft.pb.data.negine.NRow) IEngine(com.ramussoft.common.IEngine) Engine(com.ramussoft.common.Engine)

Example 3 with NRow

use of com.ramussoft.pb.data.negine.NRow in project ramus by Vitaliy-Yakovchuk.

the class IDEF0Object method onEndBoundsChange.

/*
     * (non-Javadoc)
     *
     * @see com.jason.clasificators.frames.idf.MovingPanel#onEndBoundsChange()
     */
@Override
public void onEndBoundsChange() {
    final FRectangle oldRec = function.getBounds();
    if (oldRec.equals(myBounds))
        return;
    final SectorRefactor refactor = movingArea.getRefactor();
    ((NRow) function).startUserTransaction();
    onProcessEndBoundsChange();
    refactor.setUndoPoint();
}
Also used : SectorRefactor(com.ramussoft.pb.idef.elements.SectorRefactor) FRectangle(com.dsoft.pb.types.FRectangle) NRow(com.ramussoft.pb.data.negine.NRow)

Aggregations

NRow (com.ramussoft.pb.data.negine.NRow)3 FRectangle (com.dsoft.pb.types.FRectangle)2 SectorRefactor (com.ramussoft.pb.idef.elements.SectorRefactor)2 Attribute (com.ramussoft.common.Attribute)1 Engine (com.ramussoft.common.Engine)1 IEngine (com.ramussoft.common.IEngine)1 VariantPropertyPersistent (com.ramussoft.core.attribute.simple.VariantPropertyPersistent)1 Function (com.ramussoft.pb.Function)1 Row (com.ramussoft.pb.Row)1 Stream (com.ramussoft.pb.Stream)1 MovingFunction (com.ramussoft.pb.idef.visual.MovingFunction)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1