Package java.awt

Examples of java.awt.BasicStroke$DashIterator$Line


    MasterReport report = new MasterReport();
    report.setName("ReportTextLayout001");

    final RectangleElementFactory rectangleElementFactory = new RectangleElementFactory();
    rectangleElementFactory.setColor(Color.GREEN);
    rectangleElementFactory.setStroke(new BasicStroke(1));
    rectangleElementFactory.setX(new Float (0));
    rectangleElementFactory.setY(new Float (10));
    rectangleElementFactory.setMinimumWidth(new Float (-100));
    rectangleElementFactory.setMinimumHeight(new Float (104));
    rectangleElementFactory.setShouldFill(Boolean.TRUE);
View Full Code Here


    final String lineWidth = result1.getProperty("lineWidth");
    if (lineWidth != null)
    {
      final float lineWidthf = ParserUtil.parseFloat(lineWidth, "Failed to parse lineWidth", getLocator());
      element.getStyle().setStyleProperty(ElementStyleKeys.STROKE, new BasicStroke(lineWidthf));
    }

    final String arcWidth = result1.getProperty("arcWidth");
    if (arcWidth != null)
    {
View Full Code Here

        g.drawImage(icon.getImage(), xpos + (xcell - icon.getIconWidth()) / 2, ypos + center, null);
        if (view.getSelectedIndex() == index) {
          if (view.hasFocus()) {
            g2.setColor(Color.darkGray);
            g2.setStroke(
              new BasicStroke(
                1.0f,
                BasicStroke.CAP_BUTT,
                BasicStroke.JOIN_MITER,
                1.0f,
                new float[] { 1.0f },
View Full Code Here

  private void drawTextDecoration(final FontDecorationSpec decorationSpec)
  {
    final Graphics2D graphics = (Graphics2D) this.graphics.create();
    graphics.setColor(decorationSpec.getTextColor());
    graphics.setStroke(new BasicStroke((float) decorationSpec.getLineWidth()));
    graphics.draw(new Line2D.Double(decorationSpec.getStart(), decorationSpec.getVerticalPosition(),
        decorationSpec.getEnd(), decorationSpec.getVerticalPosition()));
    graphics.dispose();
  }
View Full Code Here

    {
      final double extraPadding;
      final Object o = styleSheet.getStyleProperty(ElementStyleKeys.STROKE);
      if (o instanceof BasicStroke)
      {
        final BasicStroke stroke = (BasicStroke) o;
        extraPadding = stroke.getLineWidth() / 2.0;
      }
      else
      {
        extraPadding = 0.5;
      }
View Full Code Here

      // These two are supposed to be taken from the .AFM file
      //int UnderlinePosition = -100;
      final int UnderlineThickness = 50;
      //
      final double d = PdfGraphics2D.asPoints((double) UnderlineThickness, (int) fontSize);
      setStroke(new BasicStroke((float) d));
      y = (float) ((double) (y) + PdfGraphics2D.asPoints((double) (UnderlineThickness), (int) fontSize));
      final Line2D line = new Line2D.Double((double) x, (double) y, (width + x), (double) y);
      draw(line);
    }
  }
View Full Code Here

  {
    if (!(stroke instanceof BasicStroke))
    {
      return stroke;
    }
    final BasicStroke st = (BasicStroke) stroke;
    final float scale = (float) Math.sqrt(Math.abs(transform.getDeterminant()));
    final float[] dash = st.getDashArray();
    if (dash != null)
    {
      final int dashLength = dash.length;
      for (int k = 0; k < dashLength; ++k)
      {
        dash[k] *= scale;
      }
    }
    return new BasicStroke(st.getLineWidth() * scale, st.getEndCap(), st.getLineJoin(), st.getMiterLimit(), dash,
        st.getDashPhase() * scale);
  }
View Full Code Here

    final Stroke s = (Stroke) style.getStyleProperty(ElementStyleKeys.STROKE);
    if (s instanceof BasicStroke == false)
    {
      return null;
    }
    final BasicStroke bs = (BasicStroke) s;
    final BorderStyle borderStyle = StrokeUtility.translateStrokeStyle(s);
    if (BorderStyle.NONE.equals(borderStyle))
    {
      return null;
    }

    final Color c = (Color) style.getStyleProperty(ElementStyleKeys.PAINT);
    return new BorderEdge(borderStyle, c, StrictGeomUtility.toInternalValue(bs.getLineWidth()));
  }
View Full Code Here

    }
    if (!(newStroke instanceof BasicStroke))
    {
      return;
    }
    final BasicStroke nStroke = (BasicStroke) newStroke;
    final boolean oldOk = (oldStroke instanceof BasicStroke);
    BasicStroke oStroke = null;
    if (oldOk)
    {
      oStroke = (BasicStroke) oldStroke;
    }
    if (!oldOk || nStroke.getLineWidth() != oStroke.getLineWidth())
    {
      cb.setLineWidth(nStroke.getLineWidth());
    }
    if (!oldOk || nStroke.getEndCap() != oStroke.getEndCap())
    {
      switch (nStroke.getEndCap())
      {
        case BasicStroke.CAP_BUTT:
          cb.setLineCap(0);
          break;
        case BasicStroke.CAP_SQUARE:
          cb.setLineCap(2);
          break;
        default:
          cb.setLineCap(1);
      }
    }
    if (!oldOk || nStroke.getLineJoin() != oStroke.getLineJoin())
    {
      switch (nStroke.getLineJoin())
      {
        case BasicStroke.JOIN_MITER:
          cb.setLineJoin(0);
          break;
        case BasicStroke.JOIN_BEVEL:
          cb.setLineJoin(2);
          break;
        default:
          cb.setLineJoin(1);
      }
    }
    if (!oldOk || nStroke.getMiterLimit() != oStroke.getMiterLimit())
    {
      cb.setMiterLimit(nStroke.getMiterLimit());
    }
    final boolean makeDash;
    if (oldOk)
    {
      if (nStroke.getDashArray() != null)
      {
        if (nStroke.getDashPhase() != oStroke.getDashPhase())
        {
          makeDash = true;
        }
        else if (!Arrays.equals(nStroke.getDashArray(), oStroke.getDashArray()))
        {
          makeDash = true;
        }
        else
        {
          makeDash = false;
        }
      }
      else if (oStroke.getDashArray() != null)
      {
        makeDash = true;
      }
      else
      {
View Full Code Here

    //itemsSparkFactory.setBackgroundColor(Color.yellow);
    final ItemBand itemBand = report.getItemBand();
    itemBand.addElement(itemsSparkFactory.createElement());

    itemBand.addElement(HorizontalLineElementFactory.createHorizontalLine
        (15, null, new BasicStroke(5)));

    report.setDataFactory(new TableDataFactory("default", data));
    return report;
  }
View Full Code Here

TOP

Related Classes of java.awt.BasicStroke$DashIterator$Line

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.