use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class HTTPParser method outFunctionModel.
private void outFunctionModel(final int format) throws IOException {
Row row = loadRowById();
if (row == null || !(row instanceof Function))
return;
row = replaceIDEF0Row(row);
final Function f = (Function) row;
int imageWidth = IMAGE_WIDTH;
String s = (String) params.get("w");
if (s != null) {
try {
imageWidth = new Integer(s).intValue();
if (imageWidth > 2000)
imageWidth = 2000;
} catch (final Exception e) {
}
}
int imageHeight = IMAGE_HEIGHT;
s = (String) params.get("h");
if (s != null) {
try {
imageHeight = new Integer(s).intValue();
if (imageHeight > 1600)
imageHeight = 1600;
} catch (final Exception e) {
}
}
final PIDEF0painter painter = new PIDEF0painter(f, new Dimension(imageWidth, imageHeight), dataPlugin);
painter.writeToStream(stream, format);
}
use of com.ramussoft.pb.Row 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>");
}
use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class HTTPParser method printFullIDEF0Model.
private void printFullIDEF0Model() throws IOException {
int imageWidth = IMAGE_WIDTH;
String s = (String) params.get("w");
if (s != null) {
try {
imageWidth = new Integer(s).intValue();
} catch (final Exception e) {
}
}
int imageHeight = IMAGE_HEIGHT;
s = (String) params.get("h");
if (s != null) {
try {
imageHeight = new Integer(s).intValue();
} catch (final Exception e) {
}
}
Row row = loadRowById();
htmlTitle = replaceIDEF0Row(row).getName();
printStartD();
printIDEF0Image(row, imageWidth, imageHeight);
printEndD();
}
use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class HTTPParser method printClasificatorsList.
protected void printClasificatorsList() throws IOException {
printMainTableTitle(RES.getString("clasificatorsTitle"));
final Vector v = dataPlugin.getRecChilds(null, false);
for (int i = 0; i < v.size(); i++) {
final Row row = (Row) v.get(i);
final String href = "clasificators/index.html?id=" + row.getGlobalId();
htmlStream.print("<tr><td valign=\"top\">");
printStartATeg(href);
printRowKod(row, false);
printEndATeg();
htmlStream.print("</td><td>");
printStartATeg(href);
printRowName(row, false);
printEndATeg();
htmlStream.println("</td></tr>");
}
}
use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class HTTPParser method printMatrixProjection.
private void printMatrixProjection() throws IOException {
final String sId = (String) params.get("matrixid");
if (sId == null) {
printMatrixError();
return;
}
final Long id = Long.parseLong(sId);
if (id == null) {
printMatrixError();
return;
}
Engine engine = dataPlugin.getEngine();
Attribute mp = engine.getAttribute(id);
if (mp == null) {
printMatrixError();
return;
}
htmlTitle = RES.getString("matrixProjection") + " " + mp.getName();
printStartD();
boolean rotate = "true".equals(params.get("rotate"));
htmlStream.print("<center><h2 class=\"Ramus\">" + RES.getString("matrixProjection") + ": " + mp.getName() + "</h2></center>");
htmlStream.println("<table width=100%>");
htmlStream.println("<tr>");
htmlStream.println("<td valign=top align=center width=50%>");
ElementListPropertyPersistent pp = (ElementListPropertyPersistent) engine.getAttribute(null, mp);
Qualifier qualifier1 = engine.getQualifier(pp.getQualifier1());
Qualifier qualifier2 = engine.getQualifier(pp.getQualifier2());
if (rotate) {
Qualifier tmp = qualifier1;
qualifier1 = qualifier2;
qualifier2 = tmp;
}
htmlStream.println("<table border=1 width=100%>");
List<Row> rows = (List) dataPlugin.getRowSet(qualifier1.getId()).getAllRows();
printMainTableTitle(qualifier1.getName());
final Row leftRow = loadRowById();
for (int i = 0; i < rows.size(); i++) {
final Row row = (Row) rows.get(i);
final boolean gray = i % 2 == 0;
String sGray = "";
String bs = "";
String be = "";
if (row.equals(leftRow)) {
bs = "<i>";
be = "</i>";
}
if (gray)
sGray = " bgcolor=" + GRAY;
String href = "matrixprojections/index.html?id=" + row.getGlobalId().toString() + "&matrixid=" + sId + (rotate ? "&rotate=true" : "");
htmlStream.print("<tr>");
htmlStream.print("<td" + sGray + ">");
printStartATeg("rows/index.html?id=" + row.getElement().getId());
htmlStream.print("^");
printEndATeg();
printStartATeg(href);
htmlStream.print(bs);
printRowKod(row, false, IDEF0Plugin.isFunction(qualifier1));
htmlStream.print(be);
if (href != null)
printEndATeg();
htmlStream.print("</td>");
htmlStream.print("<td" + sGray + ">");
printStartATeg(href);
htmlStream.print(bs);
printRowName(row, false);
htmlStream.print(be);
if (href != null)
printEndATeg();
htmlStream.print("</td>");
htmlStream.println("</tr>");
}
htmlStream.println("</table>");
htmlStream.println("</td>");
htmlStream.println("<td valign=top align=center width=50%>");
final String row2Name = qualifier2.getName() + " (" + RES.getString("addedElements") + (leftRow == null ? "" : " " + leftRow.getKod() + ". " + leftRow.getName()) + ")";
if (leftRow != null) {
List<ElementListPersistent> left = (List<ElementListPersistent>) engine.getAttribute(leftRow.getElement(), mp);
final Vector v = new Vector();
for (ElementListPersistent p : left) {
if (rotate) {
v.add(dataPlugin.findRowByGlobalId(p.getElement1Id()));
} else {
v.add(dataPlugin.findRowByGlobalId(p.getElement2Id()));
}
}
printElements(row2Name, v.toArray(), null);
} else {
htmlStream.println("<table width=100%>");
htmlStream.println("<caption>");
printSmallTitle(row2Name);
htmlStream.println("</caption>");
htmlStream.println("</table>");
}
htmlStream.println("</td>");
htmlStream.println("</tr>");
htmlStream.println("</table>");
String href = "matrixprojections/index.html?matrixid=" + sId;
if (!rotate)
href += "&rotate=" + "true";
htmlStream.println("<p align=right>");
printStartATeg(href);
htmlStream.println(RES.getString("rotate"));
printEndATeg();
htmlStream.println("</p>");
printEndD();
}
Aggregations