Package com.positive.charts.util

Examples of com.positive.charts.util.Stroke


   * @param block
   *            the text block.
   */
  public TextBox(final TextBlock block) {
    this.outlinePaint = PiePlot.DEFAULT_LABEL_PAINT;
    this.outlineStroke = new Stroke(1);
    this.interiorGap = new RectangleInsets(1.0, 3.0, 1.0, 3.0);
    if (color == null) {
      color = new Color(Display.getCurrent(), 255, 255, 192);
    }
    this.backgroundPaint = color;
View Full Code Here


    // g2.setComposite(originalComposite);
    // }
    //
    if (this.isBorderVisible()) {
      final Color paint = this.getBorderPaint();
      final Stroke stroke = this.getBorderStroke();
      if ((paint != null) && (stroke != null)) {
        final Rectangle borderArea = new Rectangle(chartArea.x,
            chartArea.y, (chartArea.width - 1),
            (int) (chartArea.height - 1.0));
        gc.setForeground(paint);
        stroke.set(gc);
        gc.drawRectangle(borderArea);
        // gc.draw(borderArea);
      }
    }
View Full Code Here

   *
   * @param gc
   * @param strokeName
   */
  protected void applyStroke(final GC gc, final String strokeName) {
    final Stroke stroke = this.getStroke(strokeName);
    if (stroke != null) {
      stroke.set(gc);
    }
  }
View Full Code Here

  public void setParent(final Plot parent) {
    this.parent = parent;
  }

  public void setStroke(final String key, final Stroke stroke) {
    final Stroke oldStroke = this.drawingAssets.getStroke(key);
    this.drawingAssets.setStroke(key, stroke);
    if ((stroke != null) && stroke.equals(oldStroke)) {
      return;
    }
    this.notifyListeners(new PlotChangeEvent(this));
View Full Code Here

    final Color color = this.getItemColor(series, item);
    if (color != null) {
      gc.setForeground(color);
    }

    final Stroke stroke = this.getItemStroke(series, item);
    if (stroke != null) {
      stroke.set(gc);
    }

    // gc.setAntialias(SWT.ON);
    // gc.setAlpha(200);
    gc.drawPath(shape);
View Full Code Here

                .setForeground(this.getItemOutlinePaint(series,
                    item));
          } else {
            gr.setForeground(this.getItemPaint(series, item));
          }
          final Stroke itemOutlineStroke = this.getItemOutlineStroke(
              series, item);
          itemOutlineStroke.set(gr);
          gr.drawRectangle(shape);
        }
      }
    }
View Full Code Here

   *
   * @return The stroke (never <code>null</code>).
   */
  public Stroke getSeriesOutlineStroke(final int series) {

    final Stroke stroke = this.getDrawingAssets().getStroke(
        Plot.STROKE_SERIES_OUTLINE_OVERRIDE);
    if (stroke != null) {
      return stroke;
    }

    // otherwise look up the stroke table
    Stroke result = (Stroke) this.outlineStrokeMap.get(new Integer(series));
    if (result == null) {
      // ask drawing supplier for next color
      final DrawingSupplier supplier = this.getDrawingSupplier();
      if (supplier != null) {
        result = supplier.getNextStroke();
View Full Code Here

   *            the series index (zero-based)
   *
   * @return the stroke style to use to draw the series.
   */
  public Stroke getSeriesStroke(final int index) {
    Stroke stroke = this.getDrawingAssets().getStroke(
        Plot.STROKE_SERIES_OVERRIDE);
    if (stroke != null) {
      return stroke;
    }

    stroke = (Stroke) this.strokeMap.get(new Integer(index));
    if (stroke == null) {
      stroke = this.getDrawingAssets().getStroke(Plot.STROKE_SERIES_BASE);
      if (stroke == null) {
        this.getDrawingAssets().setStroke(Plot.STROKE_SERIES_BASE,
            stroke = new Stroke(1));
      }
    }
    return stroke;
  }
View Full Code Here

   *            the data area.
   */
  protected void drawZeroRangeBaseline(final GC gc, final Rectangle area) {
    if (this.isRangeZeroBaselineVisible()) {
      final Color color = this.getColor(COLOR_ZERO_RANGE_GRIDLINE);
      final Stroke stroke = this.getStroke(STROKE_ZERO_RANGE_GRIDLINE);
      this.getRenderer().drawRangeLine(gc, this, this.getRangeAxis(),
          area, 0.0, color, stroke);
    }
  }
View Full Code Here

    final PlotOrientation orientation = plot.getOrientation();
    final int v = (int) axis.valueToJava2D(value, dataArea, plot
        .getDomainAxisEdge());

    final Color color = plot.getDomainGridlinePaint();
    final Stroke stroke = plot.getDomainGridlineStroke();
    // g2.setPaint(paint != null ? paint : Plot.DEFAULT_OUTLINE_PAINT);
    // g2.setStroke(stroke != null ? stroke : Plot.DEFAULT_OUTLINE_STROKE);

    if (color != null) {
      g2.setForeground(color);
    }
    if (stroke != null) {
      stroke.set(g2);
    }
    if (orientation == PlotOrientation.HORIZONTAL) {
      g2.drawLine(RectangleUtil.getMinX(dataArea), v, RectangleUtil
          .getMaxX(dataArea), v);
    } else if (orientation == PlotOrientation.VERTICAL) {
View Full Code Here

TOP

Related Classes of com.positive.charts.util.Stroke

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.