use of com.ramussoft.reportgef.model.Dimension2DImpl 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.Dimension2DImpl 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.Dimension2DImpl in project ramus by Vitaliy-Yakovchuk.
the class TableColumn method createBodyBounds.
private Bounds createBodyBounds(QBounds mBounds) {
QBounds bounds = new QBounds();
Point2D p = mBounds.getLocation();
bounds.setLocation(new Point2D.Double(p.getX(), p.getY() + 25));
bounds.setBackground(columnBody.getDefaultBackground());
bounds.setFont(columnBody.getDefaultFont());
bounds.setFontColor(columnBody.getDefaultFontColor());
bounds.setForeground(columnBody.getDefaultForeground());
bounds.setSize(new Dimension2DImpl(mBounds.getSize().getWidth(), columnBody.getMinHeight()));
return bounds;
}
use of com.ramussoft.reportgef.model.Dimension2DImpl in project ramus by Vitaliy-Yakovchuk.
the class TableColumn method createHeaderBounds.
private Bounds createHeaderBounds(QBounds mBounds) {
QBounds bounds = new QBounds();
Point2D p = mBounds.getLocation();
bounds.setLocation(new Point2D.Double(p.getX(), p.getY()));
bounds.setBackground(columnHeader.getDefaultBackground());
bounds.setFont(columnHeader.getDefaultFont());
bounds.setFontColor(columnHeader.getDefaultFontColor());
bounds.setForeground(columnHeader.getDefaultForeground());
bounds.setSize(new Dimension2DImpl(mBounds.getSize().getWidth(), columnHeader.getMinHeight()));
return bounds;
}
use of com.ramussoft.reportgef.model.Dimension2DImpl in project ramus by Vitaliy-Yakovchuk.
the class XMLDiagram method getSize.
@Override
public Dimension2D getSize() {
double height = top * 2;
for (int i = 0; i < components.length; i++) {
XMLComponent component = (XMLComponent) components[i];
if (component.isY()) {
height += ((QBounds) bounds[i]).getSize().getHeight();
}
}
final Dimension2DImpl size = new Dimension2DImpl(width + LEFT * 2, height);
if (!size.equals(this.size)) {
this.size = size;
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (editor != null) {
editor.setPreferredSize(new Dimension((int) size.getWidth(), (int) size.getHeight()));
editor.revalidate();
editor.repaint();
}
}
});
}
return size;
}
Aggregations