Package org.pentaho.reporting.engine.classic.core.elementfactory

Examples of org.pentaho.reporting.engine.classic.core.elementfactory.VerticalLineElementFactory



    if (x1 == x2)
    {
      // assume that we have a vertical line
      final VerticalLineElementFactory elementFactory = new VerticalLineElementFactory();
      elementFactory.setName(name);
      elementFactory.setColor(c);
      elementFactory.setStroke(stroke);
      elementFactory.setX(new Float(bounds.getX()));
      elementFactory.setY(new Float(bounds.getY()));
      elementFactory.setMinimumWidth(new Float(bounds.getWidth()));
      elementFactory.setMinimumHeight(new Float(bounds.getHeight()));
      elementFactory.setScale(Boolean.TRUE);
      elementFactory.setKeepAspectRatio(Boolean.FALSE);
      elementFactory.setShouldDraw(Boolean.TRUE);
      element = elementFactory.createElement();
    }
    else if (y1 == y2)
    {
      // assume that we have a horizontal line
      final HorizontalLineElementFactory elementFactory = new HorizontalLineElementFactory();
      elementFactory.setName(name);
      elementFactory.setColor(c);
      elementFactory.setStroke(stroke);
      elementFactory.setX(new Float(bounds.getX()));
      elementFactory.setY(new Float(bounds.getY()));
      elementFactory.setMinimumWidth(new Float(bounds.getWidth()));
      elementFactory.setMinimumHeight(new Float(bounds.getHeight()));
      elementFactory.setScale(Boolean.TRUE);
      elementFactory.setKeepAspectRatio(Boolean.FALSE);
      elementFactory.setShouldDraw(Boolean.TRUE);
      element = elementFactory.createElement();
    }
    else
    {
      // here comes the magic - we transform the line into the absolute space;
      // this should preserve the general appearance. Heck, and if not, then
      // it is part of the users reponsibility to resolve that. Magic does not
      // solve all problems, you know.
      final Line2D line = new Line2D.Float
          (Math.abs(x1), Math.abs(y1), Math.abs(x2), Math.abs(y2));
      final Rectangle2D shapeBounds = line.getBounds2D();
      final Shape transformedShape =
          ShapeTransform.translateShape(line, -shapeBounds.getX(), -shapeBounds.getY());
      // and use that shape with the user's bounds to create the element.
      final ContentElementFactory elementFactory = new ContentElementFactory();
      elementFactory.setName(name);
      elementFactory.setColor(c);
      elementFactory.setStroke(stroke);
      elementFactory.setX(new Float(shapeBounds.getX()));
      elementFactory.setY(new Float(shapeBounds.getY()));
      elementFactory.setMinimumWidth(new Float(shapeBounds.getWidth()));
      elementFactory.setMinimumHeight(new Float(shapeBounds.getHeight()));
      elementFactory.setContent(transformedShape);
      elementFactory.setScale(Boolean.TRUE);
      elementFactory.setKeepAspectRatio(Boolean.FALSE);
      elementFactory.setShouldDraw(Boolean.TRUE);
      element = elementFactory.createElement();
    }
  }
View Full Code Here


            computePosition(name, y1, y2), width, height);

    if (x1 == x2)
    {
      // assume that we have a vertical line
      final VerticalLineElementFactory elementFactory = new VerticalLineElementFactory();
      elementFactory.setName(name);
      elementFactory.setColor(c);
      elementFactory.setStroke(stroke);
      elementFactory.setX(new Float(bounds.getX()));
      elementFactory.setY(new Float(bounds.getY()));
      elementFactory.setMinimumWidth(new Float(bounds.getWidth()));
      elementFactory.setMinimumHeight(new Float(bounds.getHeight()));
      elementFactory.setScale(Boolean.TRUE);
      elementFactory.setKeepAspectRatio(Boolean.FALSE);
      elementFactory.setShouldDraw(Boolean.TRUE);
      element = elementFactory.createElement();
    }
    else if (y1 == y2)
    {
      // assume that we have a horizontal line
      final HorizontalLineElementFactory elementFactory = new HorizontalLineElementFactory();
      elementFactory.setName(name);
      elementFactory.setColor(c);
      elementFactory.setStroke(stroke);
      elementFactory.setX(new Float(bounds.getX()));
      elementFactory.setY(new Float(bounds.getY()));
      elementFactory.setMinimumWidth(new Float(bounds.getWidth()));
      elementFactory.setMinimumHeight(new Float(bounds.getHeight()));
      elementFactory.setScale(Boolean.TRUE);
      elementFactory.setKeepAspectRatio(Boolean.FALSE);
      elementFactory.setShouldDraw(Boolean.TRUE);
      element = elementFactory.createElement();
    }
    else
    {
      // here comes the magic - we transform the line into the absolute space;
      // this should preserve the general appearance. Heck, and if not, then
      // it is part of the users responsibility to resolve that. Magic does not
      // solve all problems, you know.
      final Line2D line = new Line2D.Float
          (Math.abs(x1), Math.abs(y1), Math.abs(x2), Math.abs(y2));
      final Rectangle2D shapeBounds = line.getBounds2D();
      final Shape transformedShape =
          ShapeTransform.translateShape(line, -shapeBounds.getX(), -shapeBounds.getY());
      // and use that shape with the user's bounds to create the element.
      final ContentElementFactory elementFactory = new ContentElementFactory();
      elementFactory.setName(name);
      elementFactory.setColor(c);
      elementFactory.setStroke(stroke);
      elementFactory.setX(new Float(bounds.getX()));
      elementFactory.setY(new Float(bounds.getY()));
      elementFactory.setMinimumWidth(new Float(bounds.getWidth()));
      elementFactory.setMinimumHeight(new Float(bounds.getHeight()));
      elementFactory.setContent(transformedShape);
      elementFactory.setScale(Boolean.TRUE);
      elementFactory.setKeepAspectRatio(Boolean.FALSE);
      elementFactory.setShouldDraw(Boolean.TRUE);
      element = elementFactory.createElement();
    }

  }
View Full Code Here

{
  private VerticalLineElementFactory factory;

  public VerticalLineElementReadHandler()
  {
    factory = new VerticalLineElementFactory();
  }
View Full Code Here

                                           final Rectangle2D bounds)
  {
    if (x1 == x2)
    {
      // assume that we have a vertical line
      final VerticalLineElementFactory elementFactory = new VerticalLineElementFactory();
      elementFactory.setName(name);
      elementFactory.setColor(c);
      elementFactory.setStroke(stroke);
      elementFactory.setX(new Float(bounds.getX()));
      elementFactory.setY(new Float(bounds.getY()));
      elementFactory.setMinimumWidth(new Float(bounds.getWidth()));
      elementFactory.setMinimumHeight(new Float(bounds.getHeight()));
      elementFactory.setScale(Boolean.TRUE);
      elementFactory.setKeepAspectRatio(Boolean.FALSE);
      elementFactory.setShouldDraw(Boolean.TRUE);
      element = elementFactory.createElement();
    }
    else if (y1 == y2)
    {
      // assume that we have a horizontal line
      final HorizontalLineElementFactory elementFactory = new HorizontalLineElementFactory();
      elementFactory.setName(name);
      elementFactory.setColor(c);
      elementFactory.setStroke(stroke);
      elementFactory.setX(new Float(bounds.getX()));
      elementFactory.setY(new Float(bounds.getY()));
      elementFactory.setMinimumWidth(new Float(bounds.getWidth()));
      elementFactory.setMinimumHeight(new Float(bounds.getHeight()));
      elementFactory.setScale(Boolean.TRUE);
      elementFactory.setKeepAspectRatio(Boolean.FALSE);
      elementFactory.setShouldDraw(Boolean.TRUE);
      element = elementFactory.createElement();
    }
    else
    {
      // here comes the magic - we transform the line into the absolute space;
      // this should preserve the general appearance. Heck, and if not, then
      // it is part of the users reponsibility to resolve that. Magic does not
      // solve all problems, you know.
      final Line2D line = new Line2D.Float
          (Math.abs(x1), Math.abs(y1), Math.abs(x2), Math.abs(y2));
      final Rectangle2D shapeBounds = line.getBounds2D();
      final Shape transformedShape =
          ShapeTransform.translateShape(line, -shapeBounds.getX(), -shapeBounds.getY());
      // and use that shape with the user's bounds to create the element.
      final ContentElementFactory elementFactory = new ContentElementFactory();
      elementFactory.setName(name);
      elementFactory.setColor(c);
      elementFactory.setStroke(stroke);
      elementFactory.setX(new Float(shapeBounds.getX()));
      elementFactory.setY(new Float(shapeBounds.getY()));
      elementFactory.setMinimumWidth(new Float(shapeBounds.getWidth()));
      elementFactory.setMinimumHeight(new Float(shapeBounds.getHeight()));
      elementFactory.setContent(transformedShape);
      elementFactory.setScale(Boolean.TRUE);
      elementFactory.setKeepAspectRatio(Boolean.FALSE);
      elementFactory.setShouldDraw(Boolean.TRUE);
      element = elementFactory.createElement();
    }
  }
View Full Code Here

{
  private VerticalLineElementFactory factory;

  public VerticalLineElementReadHandler()
  {
    factory = new VerticalLineElementFactory();
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.elementfactory.VerticalLineElementFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.