Search in sources :

Example 36 with Row

use of com.ramussoft.pb.Row 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 37 with Row

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

the class FastMatrixProjection method add.

private void add(final Function child, final Sector sector, final Stream stream, final Vector v, final boolean soft) {
    add(v, sector);
    add(rights.get(stream.getGlobalId()), new SectorFunction(sector, child));
    if (soft) {
        final Vector<Row> childs = dataPlugin.getChilds(child, true);
        for (int i = 0; i < childs.size(); i++) {
            final Function f = (Function) childs.get(i);
            add(f, sector, stream, lefts.get(f.getGlobalId()), soft);
        }
    }
}
Also used : Function(com.ramussoft.pb.Function) Row(com.ramussoft.pb.Row) Crosspoint(com.ramussoft.pb.Crosspoint)

Example 38 with Row

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

the class Adder method getLeft.

public Vector<Row> getLeft(final Row row) {
    final Vector<Row> res = a.getLeft(row);
    final Vector<Row> t = b.getLeft(row);
    for (int i = 0; i < t.size(); i++) {
        final Row r = t.get(i);
        if (res.indexOf(r) < 0)
            res.add(r);
    }
    return res;
}
Also used : Row(com.ramussoft.pb.Row)

Example 39 with Row

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

the class Adder method getRight.

public Vector<Row> getRight(final Row row) {
    final Vector<Row> res = a.getRight(row);
    final Vector<Row> t = b.getRight(row);
    for (int i = 0; i < t.size(); i++) {
        final Row r = t.get(i);
        if (res.indexOf(r) < 0)
            res.add(r);
    }
    return res;
}
Also used : Row(com.ramussoft.pb.Row)

Example 40 with Row

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

the class FunctionOwnerAttributePlugin method getAttributeEditor.

@Override
public AttributeEditor getAttributeEditor(final Engine engine, final AccessRules rules, final Element element, Attribute attribute, AttributeEditor old) {
    if (old != null)
        old.close();
    return new AbstractAttributeEditor() {

        private SelectOwner component = new SelectOwner();

        @Override
        public Object setValue(Object value) {
            DataPlugin plugin = NDataPluginFactory.getDataPlugin(engine.getQualifier(element.getQualifierId()), engine, rules);
            component.setFunction((Function) plugin.findRowByGlobalId(element.getId()));
            return value;
        }

        @Override
        public Object getValue() {
            Row row = component.getOwner();
            if (row != null)
                return row.getElement().getId();
            return null;
        }

        @Override
        public JComponent getComponent() {
            return component;
        }
    };
}
Also used : AbstractAttributeEditor(com.ramussoft.gui.common.AbstractAttributeEditor) SelectOwner(com.ramussoft.pb.idef.frames.SelectOwner) Row(com.ramussoft.pb.Row) DataPlugin(com.ramussoft.pb.DataPlugin)

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