Examples of BasicStroke


Examples of java.awt.BasicStroke

    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

Examples of java.awt.BasicStroke

    }
    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

Examples of java.awt.BasicStroke

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

Examples of java.awt.BasicStroke

      return null;
    }

    if (BorderStyle.DASHED.equals(edge.getBorderStyle()))
    {
      return new BasicStroke(effectiveWidth, BasicStroke.CAP_SQUARE,
          BasicStroke.JOIN_MITER,
          10.0f, new float[]
              {6 * effectiveWidth, 6 * effectiveWidth}, 0.0f);
    }
    if (BorderStyle.DOTTED.equals(edge.getBorderStyle()))
    {
      return new BasicStroke(effectiveWidth, BasicStroke.CAP_SQUARE,
          BasicStroke.JOIN_MITER,
          5.0f, new float[]{0.0f, 2 * effectiveWidth}, 0.0f);
    }
    if (BorderStyle.DOT_DASH.equals(edge.getBorderStyle()))
    {
      return new BasicStroke(effectiveWidth, BasicStroke.CAP_SQUARE,
          BasicStroke.JOIN_MITER,
          10.0f, new float[]
              {0, 2 * effectiveWidth, 6 * effectiveWidth, 2 * effectiveWidth}, 0.0f);
    }
    if (BorderStyle.DOT_DOT_DASH.equals(edge.getBorderStyle()))
    {
      return new BasicStroke(effectiveWidth, BasicStroke.CAP_SQUARE,
          BasicStroke.JOIN_MITER,
          10.0f, new float[]{0, 2 * effectiveWidth,
              0, 2 * effectiveWidth,
              6 * effectiveWidth, 2 * effectiveWidth}, 0.0f);
    }
    return new BasicStroke(effectiveWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER);
  }
View Full Code Here

Examples of java.awt.BasicStroke

      if (staticBoxLayoutProperties.getBorderTop() > 0)
      {
        final BorderEdge borderEdge = border.getTop();

        final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderTop());
        if (basicStroke != null)
        {
          g2d.setColor(borderEdge.getColor());
          g2d.setStroke(basicStroke);
          g2d.draw(borderShape);
        }
      }
      g2d.setColor(oldColor);
      g2d.setStroke(oldStroke);
      return;
    }


    if (backgroundColor != null)
    {
      final Shape borderShape = getBorderShape();
      g2d.setColor(backgroundColor);
      g2d.fill(borderShape);
    }

    final StaticBoxLayoutProperties sblp = this.staticBoxLayoutProperties;
    if (sblp.getBorderTop() > 0)
    {
      final BorderEdge borderEdge = border.getTop();
      final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderTop());
      if (basicStroke != null)
      {
        g2d.setColor(borderEdge.getColor());
        g2d.setStroke(basicStroke);
        g2d.draw(getBorderTopShape());
      }
    }

    if (sblp.getBorderRight() > 0)
    {
      final BorderEdge borderEdge = border.getRight();
      final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderRight());
      if (basicStroke != null)
      {
        g2d.setColor(borderEdge.getColor());
        g2d.setStroke(basicStroke);
        g2d.draw(getBorderRightShape());
      }
    }

    if (sblp.getBorderBottom() > 0)
    {
      final BorderEdge borderEdge = border.getBottom();
      final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderBottom());
      if (basicStroke != null)
      {
        g2d.setColor(borderEdge.getColor());
        g2d.setStroke(basicStroke);
        g2d.draw(getBorderBottomShape());
      }
    }

    if (sblp.getBorderLeft() > 0)
    {
      final BorderEdge borderEdge = border.getLeft();
      final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderLeft());
      if (basicStroke != null)
      {
        g2d.setColor(borderEdge.getColor());
        g2d.setStroke(basicStroke);
        g2d.draw(getBorderLeftShape());
View Full Code Here

Examples of java.awt.BasicStroke

    final Shape s = getShape();
    g2.translate(x, y);
    g2.setPaint(Color.black);
    if (this.draw)
    {
      g2.setStroke(new BasicStroke(0.5f));
      g2.draw(s);
    }
    if (this.fill)
    {
      g2.fill(s);
View Full Code Here

Examples of java.awt.BasicStroke

        //      newbie.setGraphicID(egraphic.gID);
        newbie.setLineType(getOMGraphicLineType(egraphic.lType.value()));
        newbie.setRenderType(getOMGraphicRenderType(egraphic.rType.value()));
        //      newbie.setGraphicType(getOMGraphicType(egraphic.gType.value()));
        newbie.setStroke(new BasicStroke(egraphic.lineWidth));
        newbie.setDeclutterType(egraphic.dcType.value());
        newbie.setLinePaint(getColor(egraphic.color));
        newbie.setFillPaint(getColor(egraphic.fillColor));

        if (newbie instanceof JObjectHolder)
View Full Code Here

Examples of java.awt.BasicStroke

        case com.bbn.openmap.CSpecialist.GraphicPackage.settableFields._GF_fillColor:
            ((OMGraphic) graphic).setFillPaint(getColor(update.fillColor()));
            break;

        case com.bbn.openmap.CSpecialist.GraphicPackage.settableFields._GF_lineWidth:
            ((OMGraphic) graphic).setStroke(new BasicStroke(update.lineWidth()));
            break;

        case com.bbn.openmap.CSpecialist.GraphicPackage.settableFields._GF_stipple:
            System.err.println("ignoring stipple");
            //            ((OMGraphic)graphic).setStipple(getOMStipple(update.stipple()));
View Full Code Here

Examples of java.awt.BasicStroke

  protected void configureChart(final JFreeChart chart)
  {
    super.configureChart(chart);

    //Create the stroke for the primary (= real) data series...
    final Stroke thick = new BasicStroke(thicknessprimaryseries);

    //...and apply that stroke to the series
    final SpiderWebPlot webPlot = (SpiderWebPlot) chart.getPlot();

    if (StringUtils.isEmpty(getTooltipFormula()) == false)
View Full Code Here

Examples of java.awt.BasicStroke

    labelFactory.setMinimumSize(new FloatDimension(-100, 15));
    labelFactory.setText("Rating");
    b.addElement(labelFactory.createElement());

    b.addElement(HorizontalLineElementFactory.createHorizontalLine
        (15, null, new BasicStroke(1)));

    final Group group = report.getGroupByName("record-group");
    group.getHeader().addElement(b);
  }
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.