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

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


          "Use relative coordinates instead.");
      final Stroke stroke = readStroke(atts);
      final String name = atts.getValue(getUri(), LineReadHandler.NAME_ATT);
      final Color c = ReportParserUtil.parseColor(atts.getValue(getUri(), LineReadHandler.COLOR_ATT));

      final HorizontalLineElementFactory elementFactory = new HorizontalLineElementFactory();
      elementFactory.setName(name);
      elementFactory.setColor(c);
      elementFactory.setStroke(stroke);
      elementFactory.setX(new Float(0));
      elementFactory.setY(new Float(y2));
      elementFactory.setMinimumWidth(new Float(-100));
      elementFactory.setMinimumHeight(new Float(0));
      elementFactory.setShouldDraw(Boolean.TRUE);
      element = elementFactory.createElement();
      return;
    }


    final boolean relativeSizes = (x1 < 0) || (y1 < 0) || (x2 < 0) || (y2 < 0);
View Full Code Here


      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

      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 HorizontalLineElementFactory factory;

  public HorizontalLineElementReadHandler()
  {
    factory = new HorizontalLineElementFactory();
  }
View Full Code Here

          "Use relative coordinates instead.");
      final Stroke stroke = readStroke(atts);
      final String name = atts.getValue(getUri(), LineReadHandler.NAME_ATT);
      final Color c = ReportParserUtil.parseColor(atts.getValue(getUri(), LineReadHandler.COLOR_ATT));

      final HorizontalLineElementFactory elementFactory = new HorizontalLineElementFactory();
      elementFactory.setName(name);
      elementFactory.setColor(c);
      elementFactory.setStroke(stroke);
      elementFactory.setX(new Float(0));
      elementFactory.setY(new Float(y2));
      elementFactory.setMinimumWidth(new Float(-100));
      elementFactory.setMinimumHeight(new Float(0));
      elementFactory.setShouldDraw(Boolean.TRUE);
      element = elementFactory.createElement();
      return;
    }


    final boolean relativeSizes = (x1 < 0) || (y1 < 0) || (x2 < 0) || (y2 < 0);
View Full Code Here

      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 HorizontalLineElementFactory factory;

  public HorizontalLineElementReadHandler()
  {
    factory = new HorizontalLineElementFactory();
  }
View Full Code Here

TOP

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

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.