use of com.ramussoft.reportgef.model.QBounds in project ramus by Vitaliy-Yakovchuk.
the class XMLDiagram method createNewBounds.
public QBounds createNewBounds(String componentName) {
QBounds bounds = new QBounds();
double y = top;
for (QBounds bounds2 : this.yBounds) {
y += bounds2.getSize().getHeight();
}
bounds.setLocation(new Point2D.Double(LEFT, y));
bounds.setComponentType(componentName);
bounds.setPosition(this.bounds.length);
Component component = framework.createComponent(this, bounds);
bounds.setBackground(component.getDefaultBackground());
bounds.setFont(component.getDefaultFont());
bounds.setFontColor(component.getDefaultFontColor());
bounds.setForeground(component.getDefaultForeground());
bounds.setSize(new Dimension2DImpl(component.getMinWidth(), component.getMinHeight()));
add(bounds, component);
return new QBounds();
}
use of com.ramussoft.reportgef.model.QBounds in project ramus by Vitaliy-Yakovchuk.
the class XMLDiagram method createTableColumn.
public void createTableColumn() {
Table table = getSelectedTable();
if (table != null) {
QBounds tableBound = (QBounds) getBounds(table);
createNewBounds("TableColumn");
TableColumn column = (TableColumn) components[components.length - 1];
column.setTable(table);
table.addColumn(tableBound, this, column);
}
}
use of com.ramussoft.reportgef.model.QBounds in project ramus by Vitaliy-Yakovchuk.
the class XMLDiagram method removeSelectedComponents.
public void removeSelectedComponents() {
Bounds[] bounds = editor.getSelection().getBounds();
List<Integer> list = new ArrayList<Integer>();
for (Bounds bounds2 : bounds) {
int index = getIndexOfBounds(bounds2);
list.add(index);
Component component = components[index];
if (component instanceof Table) {
for (TableColumn column : ((Table) component).getColumns()) {
list.add(getIndexOfComponent(column));
}
}
}
List<Bounds> bounds2 = new ArrayList<Bounds>();
List<QBounds> yBounds = new ArrayList<QBounds>();
List<Component> components = new ArrayList<Component>();
for (int i = 0; i < this.components.length; i++) {
if (list.indexOf(i) < 0) {
bounds2.add(this.bounds[i]);
components.add(this.components[i]);
}
}
this.bounds = bounds2.toArray(new Bounds[bounds2.size()]);
this.components = components.toArray(new Component[components.size()]);
for (QBounds qBounds : this.yBounds) {
if (bounds2.indexOf(qBounds) >= 0) {
yBounds.add(qBounds);
}
}
this.yBounds = yBounds.toArray(new QBounds[yBounds.size()]);
editor.getSelection().setBounds(new Bounds[] {});
double y = top;
for (int i = 0; i < this.components.length; i++) {
if (((XMLComponent) this.components[i]).isY()) {
QBounds e = (QBounds) this.bounds[i];
e.setLocation(new Point2D.Double(e.getLocation().getX(), y));
yBounds.add(e);
y += e.getSize().getHeight();
if (this.components[i] instanceof Table) {
Table table = (Table) this.components[i];
table.removeComlumntIfNeed(components, this);
}
}
}
}
use of com.ramussoft.reportgef.model.QBounds in project ramus by Vitaliy-Yakovchuk.
the class Group method applyTransforms.
public void applyTransforms() {
double scaleX = getScaleX();
double scaleY = getScaleY();
for (Bounds bounds : this.bounds) {
if (bounds instanceof QBounds) {
QBounds qBounds = (QBounds) bounds;
Point2D point = qBounds.getLocation();
qBounds.setLocation(new Point2D.Double(point.getX() + translate.getX(), point.getY() + translate.getY()));
Dimension2D d = qBounds.getSize();
qBounds.setSize(new Dimension2DImpl(d.getWidth() * scaleX, d.getHeight() * scaleY));
}
}
clear();
}
use of com.ramussoft.reportgef.model.QBounds in project ramus by Vitaliy-Yakovchuk.
the class BoundsCloner method copy.
public static Bounds copy(Bounds bounds) {
if (bounds instanceof QBounds) {
QBounds qBounds = (QBounds) bounds;
QBounds bounds2 = new QBounds();
bounds2.setBackground(copy(qBounds.getBackground()));
bounds2.setComponentType(qBounds.getComponentType());
bounds2.setElementId(qBounds.getElementId());
bounds2.setFont(qBounds.getFont());
bounds2.setFontColor(qBounds.getFontColor());
bounds2.setForeground(copy(qBounds.getForeground()));
bounds2.setLinkElementId(qBounds.getLinkElementId());
bounds2.setLocation(qBounds.getLocation());
bounds2.setPosition(qBounds.getPosition());
bounds2.setRotation(qBounds.getRotation());
bounds2.setSize(qBounds.getSize());
return bounds2;
} else {
ArrowBounds arrowBounds = (ArrowBounds) bounds;
ArrowBounds bounds2 = new ArrowBounds();
bounds2.setComponentType(arrowBounds.getComponentType());
bounds2.setElementId(arrowBounds.getElementId());
bounds2.setFont(arrowBounds.getFont());
bounds2.setFontColor(arrowBounds.getFontColor());
bounds2.setForeground(copy(arrowBounds.getForeground()));
bounds2.setLinkElementId(arrowBounds.getLinkElementId());
bounds2.setPosition(arrowBounds.getPosition());
bounds2.setFromBounds(arrowBounds.getFromBounds());
bounds2.setPoints(copy(arrowBounds.getPoints()));
bounds2.setToBounds(arrowBounds.getToBounds());
bounds2.setFromPreferences(arrowBounds.getFromPreferences());
bounds2.setToPreferences(arrowBounds.getToPreferences());
return bounds2;
}
}
Aggregations