Search in sources :

Example 1 with Dimension2DImpl

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();
}
Also used : Point2D(java.awt.geom.Point2D) Component(com.ramussoft.reportgef.Component) XMLComponent(com.ramussoft.report.editor.xml.components.XMLComponent) QBounds(com.ramussoft.reportgef.model.QBounds) Dimension2DImpl(com.ramussoft.reportgef.model.Dimension2DImpl)

Example 2 with Dimension2DImpl

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();
}
Also used : Point2D(java.awt.geom.Point2D) QBounds(com.ramussoft.reportgef.model.QBounds) Bounds(com.ramussoft.reportgef.model.Bounds) Dimension2D(java.awt.geom.Dimension2D) QBounds(com.ramussoft.reportgef.model.QBounds) Dimension2DImpl(com.ramussoft.reportgef.model.Dimension2DImpl)

Example 3 with Dimension2DImpl

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;
}
Also used : Point2D(java.awt.geom.Point2D) QBounds(com.ramussoft.reportgef.model.QBounds) Dimension2DImpl(com.ramussoft.reportgef.model.Dimension2DImpl)

Example 4 with Dimension2DImpl

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;
}
Also used : Point2D(java.awt.geom.Point2D) QBounds(com.ramussoft.reportgef.model.QBounds) Dimension2DImpl(com.ramussoft.reportgef.model.Dimension2DImpl)

Example 5 with Dimension2DImpl

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;
}
Also used : Dimension(java.awt.Dimension) QBounds(com.ramussoft.reportgef.model.QBounds) GradientPaint(java.awt.GradientPaint) XMLComponent(com.ramussoft.report.editor.xml.components.XMLComponent) Dimension2DImpl(com.ramussoft.reportgef.model.Dimension2DImpl)

Aggregations

Dimension2DImpl (com.ramussoft.reportgef.model.Dimension2DImpl)6 QBounds (com.ramussoft.reportgef.model.QBounds)6 Point2D (java.awt.geom.Point2D)5 XMLComponent (com.ramussoft.report.editor.xml.components.XMLComponent)3 Component (com.ramussoft.reportgef.Component)2 Bounds (com.ramussoft.reportgef.model.Bounds)2 GradientPaint (java.awt.GradientPaint)2 Table (com.ramussoft.report.editor.xml.components.Table)1 TableColumn (com.ramussoft.report.editor.xml.components.TableColumn)1 Dimension (java.awt.Dimension)1 Dimension2D (java.awt.geom.Dimension2D)1 ArrayList (java.util.ArrayList)1