use of com.ramussoft.report.editor.xml.components.Label in project ramus by Vitaliy-Yakovchuk.
the class ComponentLoader method startElement.
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
text = "";
if (qName.equals("attribute")) {
this.attributes = attributes;
} else if (qName.equals("Table")) {
currentTable = new Table();
current = currentTable;
yComponents.add(current);
currentTableHeadColumn = 0;
currentTableBodyColumn = 0;
} else if (qName.equals("Label")) {
current = new Label();
yComponents.add(current);
} else if (qName.equals("TitleElement")) {
TableColumn[] columns = currentTable.getColumns();
if (columns.length <= currentTableHeadColumn) {
columns = Arrays.copyOf(columns, columns.length + 1);
currentTable.setColumns(columns);
TableColumn tableColumn = new TableColumn();
tableColumn.setTable(currentTable);
columns[columns.length - 1] = tableColumn;
}
currentTable.setColumns(columns);
current = columns[currentTableHeadColumn].getColumnHeader();
currentTableHeadColumn++;
} else if (qName.equals("BodyElement")) {
TableColumn[] columns = currentTable.getColumns();
if (columns.length <= currentTableBodyColumn) {
columns = Arrays.copyOf(columns, columns.length + 1);
currentTable.setColumns(columns);
TableColumn tableColumn = new TableColumn();
tableColumn.setTable(currentTable);
columns[columns.length - 1] = tableColumn;
}
currentTable.setColumns(columns);
current = columns[currentTableBodyColumn].getColumnBody();
currentTableBodyColumn++;
}
}
use of com.ramussoft.report.editor.xml.components.Label in project ramus by Vitaliy-Yakovchuk.
the class XMLComponentFramefork method createLabalComponentFactory.
private ComponentFactory createLabalComponentFactory() {
return new AbstractComponentFactory() {
@Override
public String getType() {
return "Label";
}
@Override
public Component createComponent(Diagram diagram, Engine engine, AccessRules accessRules, Bounds bounds) {
Label label = new Label();
label.setWidth(((XMLDiagram) diagram).getWidthForCompontns());
return label;
}
@Override
public Component getComponent(Engine engine, AccessRules accessRules, Bounds bounds) {
return null;
}
};
}
Aggregations