Examples of BasicStroke


Examples of java.awt.BasicStroke

  {

    final float width = getFloatParameter("value");
    if (width > 0)
    {
      return new BasicStroke(width);
    }

    final Float realWidth = (Float) getParameter("width");
    final Float[] dashes = (Float[]) getParameter("dashes");
    if (realWidth == null || dashes == null)
    {
      return null;
    }
    final float[] dashesPrimitive = new float[dashes.length];
    for (int i = 0; i < dashes.length; i++)
    {
      final Float dash = dashes[i];
      dashesPrimitive[i] = dash.floatValue();
    }
    return new BasicStroke(realWidth.floatValue(),
        BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER,
        10.0f, dashesPrimitive, 0.0f);
  }
View Full Code Here

Examples of java.awt.BasicStroke

  {
    if (!(o instanceof BasicStroke))
    {
      throw new ObjectFactoryException("Expected object of type BasicStroke");
    }
    final BasicStroke bs = (BasicStroke) o;
    setParameter("value", String.valueOf(bs.getLineWidth()));
  }
View Full Code Here

Examples of java.awt.BasicStroke

    else
    {
      dash = null;
    }

    stroke = new BasicStroke(width, cap, join, miterLimit, dash, dashPhase);
  }
View Full Code Here

Examples of java.awt.BasicStroke

    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

Examples of java.awt.BasicStroke

    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

Examples of java.awt.BasicStroke

        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

Examples of java.awt.BasicStroke

  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

Examples of java.awt.BasicStroke

    {
      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

Examples of java.awt.BasicStroke

      // 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

Examples of java.awt.BasicStroke

  {
    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
TOP
Copyright © 2018 www.massapi.com. 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.