use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.
the class NDataPlugin method getRowSet.
public RowSet getRowSet(final long id) {
RowSet res = rowSets.get(id);
if (res == null) {
final Qualifier qualifier = engine.getQualifier(id);
boolean create = true;
if (IDEF0Plugin.isFunction(qualifier)) {
create = false;
List<Attribute> list = new ArrayList<Attribute>(qualifier.getSystemAttributes());
list.addAll(qualifier.getAttributes());
final Qualifier baseFunctions = IDEF0Plugin.getBaseFunctions(engine);
res = new RowSet(engine, qualifier, list.toArray(new Attribute[list.size()]), new RowSet.RowCreater() {
@Override
public com.ramussoft.database.common.Row createRow(Element element, RowSet data, Attribute[] attributes, Object[] objects) {
if (element != null)
return new NFunction(NDataPlugin.this, element, data, attributes, objects) {
@Override
public long getQualifierId() {
if (id == baseFunctions.getId()) {
return IDEF0Plugin.getBaseQualifierId(engine, getElement());
}
return id;
}
};
return new NFunction(NDataPlugin.this, IDEF0Plugin.findElementForBaseFunction(id, engine), data, attributes, objects) {
@Override
public String getName() {
return qualifier.getName();
}
@Override
public boolean isBase() {
return true;
}
@Override
public boolean isElement() {
return false;
}
@Override
public long getQualifierId() {
return id;
}
};
}
}) {
@Override
protected boolean filter(Element element) {
return false;
}
};
}
if (create)
res = new RowSet(engine, qualifier, qualifier.getAttributes().toArray(new Attribute[qualifier.getAttributes().size()]), new RowSet.RowCreater() {
@Override
public com.ramussoft.database.common.Row createRow(Element element, RowSet data, Attribute[] attributes, Object[] objects) {
NRow row = new NRow(NDataPlugin.this, element, data, attributes, objects);
row.setElement(true);
return row;
}
});
rowSets.put(id, res);
}
return res;
}
use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.
the class ModelsPanel method openDiagram.
private void openDiagram(TreePath path) {
Object object = path.getLastPathComponent();
if (object instanceof ModelsNode) {
Qualifier qualifier = ((ModelsNode) object).getQualifier();
OpenDiagram open = new OpenDiagram(qualifier, -1l);
framework.propertyChanged(IDEF0ViewPlugin.OPEN_DIAGRAM, open);
} else {
Row row = (Row) object;
if (row.getChildCount() == 0)
row = row.getParent();
if (row instanceof ModelsNode) {
Qualifier qualifier = ((ModelsNode) row).getQualifier();
OpenDiagram open = new OpenDiagram(qualifier, -1l);
framework.propertyChanged(IDEF0ViewPlugin.OPEN_DIAGRAM, open);
} else {
if ((row != null) && (row.getElement() != null)) {
Qualifier qualifier = engine.getQualifier(row.getElement().getQualifierId());
OpenDiagram open = new OpenDiagram(qualifier, row.getElementId());
framework.propertyChanged(IDEF0ViewPlugin.OPEN_DIAGRAM, open);
}
}
}
}
use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.
the class HTTPParser method replaceIDEF0Row.
private Row replaceIDEF0Row(Row row) {
if (IDEF0Plugin.getBaseFunctions(dataPlugin.getEngine()).getId() == row.getElement().getQualifierId()) {
Qualifier base = IDEF0Plugin.getBaseQualifier(dataPlugin.getEngine(), row.getElement());
row = NDataPluginFactory.getDataPlugin(base, dataPlugin.getEngine(), dataPlugin.getAccessRules()).getBaseFunction();
}
return row;
}
use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.
the class HTTPParser method printModelsList.
protected void printModelsList() throws IOException {
printMainTableTitle(GlobalResourcesManager.getString("ModelsView"));
for (Qualifier q : IDEF0Plugin.getBaseQualifiers(dataPlugin.getEngine())) {
com.ramussoft.database.common.Row row = dataPlugin.getRowSet(q.getId()).getRoot();
final String href = "idef0/index.html?id=" + row.getElement().getId();
htmlStream.print("<tr><td valign=\"top\" colspan=\"2\">");
printStartATeg(href);
htmlStream.print(q.getName());
printEndATeg();
htmlStream.println("</td></tr>");
}
}
use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.
the class HTTPParser method printArrowFunctionss.
private void printArrowFunctionss(final Row row) throws IOException {
final Vector funcs = new Vector<Row>();
List<Qualifier> list = dataPlugin.getEngine().getQualifiers();
for (Qualifier q : list) {
if (IDEF0Plugin.isFunction(q)) {
DataPlugin dp = NDataPluginFactory.getDataPlugin(q, dataPlugin.getEngine(), dataPlugin.getAccessRules());
funcs.addAll(dp.getRecChilds(dp.getBaseFunction(), true));
}
}
final Vector<UF> res = new Vector<UF>();
for (int i = 0; i < funcs.size(); i++) {
addFunction(row, (Function) funcs.get(i), res);
}
if (res.size() > 0) {
htmlStream.println("<p><table width=100% border=1>");
printMainTableTitle(RES.getString("UseInFunctions"), 3);
htmlStream.print("<tr>");
htmlStream.print("<td><b>");
htmlStream.print(RES.getString("kod"));
htmlStream.print("</b></td>");
htmlStream.print("<td width=100%><b>");
htmlStream.print(RES.getString("FunctionName"));
htmlStream.print("</b></td>");
htmlStream.print("<td><b>");
htmlStream.print(RES.getString("Type"));
htmlStream.print("</b></td>");
htmlStream.println("</tr>");
for (int i = 0; i < res.size(); i++) {
final UF uf = res.get(i);
htmlStream.println("<tr>");
htmlStream.print("<td>");
printStartATeg("rows/index.html?id=" + uf.function.getGlobalId().toString());
htmlStream.print(MovingFunction.getIDEF0Kod((com.ramussoft.database.common.Row) uf.function));
htmlStream.print("</td>");
htmlStream.print("<td width=100%>");
printStartATeg("rows/index.html?id=" + uf.function.getGlobalId().toString());
htmlStream.print(uf.function.getName());
htmlStream.print("</td>");
htmlStream.print("<td>");
switch(uf.type) {
case MovingPanel.RIGHT:
htmlStream.print(RES.getString("RightElements"));
break;
case MovingPanel.LEFT:
htmlStream.print(RES.getString("LeftElements"));
break;
case MovingPanel.TOP:
htmlStream.print(RES.getString("TopElements"));
break;
case MovingPanel.BOTTOM:
htmlStream.print(RES.getString("BottomElements"));
break;
}
htmlStream.print("</td>");
htmlStream.println("</tr>");
}
htmlStream.println("</table></p>");
}
}
Aggregations