Package org.pentaho.reporting.libraries.pixie.wmf

Examples of org.pentaho.reporting.libraries.pixie.wmf.MfDcState


    final Arc2D arc = new Arc2D.Double();
    arc.setArcType(Arc2D.OPEN);
    arc.setFrame(rec.x, rec.y, rec.width, rec.height);
    arc.setAngles(start.x, start.y, end.x, end.y);

    final MfDcState state = file.getCurrentState();

    if (state.getLogBrush().isVisible())
    {
      state.preparePaint();
      graph.fill(arc);
      state.postPaint();
    }
    if (state.getLogPen().isVisible())
    {
      state.prepareDraw();
      graph.draw(arc);
      state.postDraw();
    }
  }
View Full Code Here


   * @param file the meta file.
   */
  public void replay(final WmfFile file)
  {
    final Graphics2D graphics = file.getGraphics2D();
    final MfDcState state = file.getCurrentState();
    final MfLogFont lFont = state.getLogFont();

    state.prepareDrawText();
    final FontMetrics metrics = graphics.getFontMetrics();
    final int textWidth = metrics.stringWidth(text);
    final Point p = getScaledOrigin();
    final int x = p.x + calcDeltaX(state.getVerticalTextAlignment(), textWidth);
    int y = p.y + calcDeltaY(state.getHorizontalTextAlignment(), metrics);

    if (isOpaque() || state.getBkMode() != BrushConstants.TRANSPARENT)
    {
      final Rectangle background = new Rectangle(x, y - metrics.getAscent(), textWidth, metrics.getHeight());
      graphics.setColor(state.getBkColor());
      graphics.fill(background);
      graphics.setColor(state.getTextColor());
    }
    // System.out.println("X: " + x + " Y: " + p.y + " " + calcDeltaY(state.getHorizontalTextAlignment(), metrics));

    final Graphics2D g2 = (Graphics2D) graphics.create();
    g2.drawString(text, x, y);

    if (lFont.isUnderline())
    {  // Underline.
      y += metrics.getDescent() / 8 + 1;
      //state.prepareDraw();
      g2.setStroke(new BasicStroke(metrics.getHeight() / 14));
      g2.drawLine(x, y, x + textWidth, y);
      //state.postDraw();
    }
    if (lFont.isStrikeOut())
    {  // Underline.
      //state.prepareDraw();
      y -= metrics.getAscent() / 2.5 + 1;
      g2.setStroke(new BasicStroke(metrics.getHeight() / 14));
      g2.drawLine(x, y, x + textWidth, y);
      //state.postDraw();
    }

    state.postDrawText();
  }
View Full Code Here

   *
   * @param file the meta file.
   */
  public void replay(final WmfFile file)
  {
    final MfDcState state = file.getCurrentState();
    state.setBkColor(color);
  }
View Full Code Here

   */
  public void replay(final WmfFile file)
  {
    final MfLogRegion regio = file.getRegionObject(region);

    final MfDcState state = file.getCurrentState();
    state.setLogRegion(regio);
    final MfLogBrush brush = state.getLogBrush();

    final Graphics2D graph = file.getGraphics2D();
    final Rectangle rec = scaleRect(regio.getBounds());

    if (brush.isVisible())
    {
      state.preparePaint();
      graph.fill(rec);
      state.postPaint();
    }
  }
View Full Code Here

   *
   * @param file the meta file.
   */
  public void replay(final WmfFile file)
  {
    final MfDcState state = file.getCurrentState();
    final Point p = getScaledTarget();
    state.setWindowOrg(p.x, p.y);
  }
View Full Code Here

   * @param file the meta file.
   */
  public void replay(final WmfFile file)
  {
    final Graphics2D graph = file.getGraphics2D();
    final MfDcState state = file.getCurrentState();
    int cx = state.getCurPosX();
    int cy = state.getCurPosY();
    final int[] points_x = getScaledPointsX();
    final int[] points_y = getScaledPointsY();

    if (state.getLogPen().isVisible())
    {
      state.prepareDraw();
      cx = points_x[0];
      cy = points_y[0];
      final Line2D.Double line = new Line2D.Double();
      for (int i = 1; i < count; i++)
      {
        final int destX = points_x[i];
        final int destY = points_y[i];
        line.setLine(cx, cy, destX, destY);
        graph.draw(line);
        cx = destX;
        cy = destY;
      }
      state.postDraw();
    }
    state.setCurPos(cx, cy);
  }
View Full Code Here

   * @param file the meta file.
   */
  public void replay(final WmfFile file)
  {
    final Graphics2D graph = file.getGraphics2D();
    final MfDcState state = file.getCurrentState();

    final int cx = state.getCurPosX();
    final int cy = state.getCurPosY();

    final Point destP = getScaledDestination();

    if (state.getLogPen().isVisible())
    {
      state.prepareDraw();
      graph.draw(new Line2D.Double(cx, cy, destP.x, destP.y));
      state.postDraw();

    }
    state.setCurPos(destP.x, destP.y);
  }
View Full Code Here

   *
   * @param file the meta file.
   */
  public void replay(final WmfFile file)
  {
    final MfDcState state = file.getCurrentState();
    state.setTextCharExtra(textCharExtra);
  }
View Full Code Here

   *
   * @param file the meta file.
   */
  public void replay(final WmfFile file)
  {
    final MfDcState state = file.getCurrentState();
    state.setMapperFlag(mapperflags);
  }
View Full Code Here

  public void replay(final WmfFile file)
  {
    final Graphics2D graph = file.getGraphics2D();

    final Polygon polygon = new Polygon(getScaledPointsX(), getScaledPointsY(), getPointCount());
    final MfDcState state = file.getCurrentState();

    if (state.getLogBrush().isVisible())
    {
      state.preparePaint();
      graph.fill(polygon);
      state.postPaint();
    }
    if (state.getLogPen().isVisible())
    {
      state.prepareDraw();
      graph.draw(polygon);
      state.postDraw();
    }
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.pixie.wmf.MfDcState

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.