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();
}
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);
}
}
}
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;
}
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;
}
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;
}
};
}
Aggregations