Java Code Examples for java.awt.Paint

The following are top voted examples for showing how to use java.awt.Paint. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: parabuild-ci   File: ContourPlot.java   View source code 6 votes vote down vote up
/**
 * Draws a vertical line on the chart to represent a 'range marker'.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param marker  the marker line.
 * @param dataArea  the axis data area.
 */
public void drawDomainMarker(Graphics2D g2,
                             ContourPlot plot,
                             ValueAxis domainAxis,
                             Marker marker,
                             Rectangle2D dataArea) {

    if (marker instanceof ValueMarker) {
        ValueMarker vm = (ValueMarker) marker;
        double value = vm.getValue();
        Range range = domainAxis.getRange();
        if (!range.contains(value)) {
            return;
        }
  
        double x = domainAxis.valueToJava2D(value, dataArea, RectangleEdge.BOTTOM);
        Line2D line = new Line2D.Double(x, dataArea.getMinY(), x, dataArea.getMaxY());
        Paint paint = marker.getOutlinePaint();
        Stroke stroke = marker.getOutlineStroke();
        g2.setPaint(paint != null ? paint : Plot.DEFAULT_OUTLINE_PAINT);
        g2.setStroke(stroke != null ? stroke : Plot.DEFAULT_OUTLINE_STROKE);
        g2.draw(line);
    }

}
 
Example 2
Project: parabuild-ci   File: XYPlot.java   View source code 6 votes vote down vote up
/**
 * Draws the gridlines for the plot, if they are visible.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param ticks  the ticks.
 */
protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea,
                                   List ticks) {

    // no renderer, no gridlines...
    if (getRenderer() == null) {
        return;
    }

    // draw the domain grid lines, if any...
    if (isDomainGridlinesVisible()) {
        Stroke gridStroke = getDomainGridlineStroke();
        Paint gridPaint = getDomainGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            Iterator iterator = ticks.iterator();
            while (iterator.hasNext()) {
                ValueTick tick = (ValueTick) iterator.next();
                getRenderer().drawDomainGridLine(g2, this, getDomainAxis(),
                        dataArea, tick.getValue());
            }
        }
    }
}
 
Example 3
Project: parabuild-ci   File: CategoryLineAnnotation.java   View source code 6 votes vote down vote up
/**
 * Creates a new annotation that draws a line between (category1, value1)
 * and (category2, value2).
 *
 * @param category1  the category (<code>null</code> not permitted).
 * @param value1  the value.
 * @param category2  the category (<code>null</code> not permitted).
 * @param value2  the value.
 * @param paint  the line color (<code>null</code> not permitted).
 * @param stroke  the line stroke (<code>null</code> not permitted).
 */
public CategoryLineAnnotation(Comparable category1, double value1, 
                              Comparable category2, double value2,
                              Paint paint, Stroke stroke) {
    if (category1 == null) {
        throw new IllegalArgumentException("Null 'category1' argument.");   
    }
    if (category2 == null) {
        throw new IllegalArgumentException("Null 'category2' argument.");   
    }
    if (paint == null) {
        throw new IllegalArgumentException("Null 'paint' argument.");   
    }
    if (stroke == null) {
        throw new IllegalArgumentException("Null 'stroke' argument.");   
    }
    this.category1 = category1;
    this.value1 = value1;
    this.category2 = category2;
    this.value2 = value2;
    this.paint = paint;
    this.stroke = stroke;
}
 
Example 4
Project: parabuild-ci   File: XYPolygonAnnotation.java   View source code 6 votes vote down vote up
/**
 * Creates a new annotation.  The array of polygon coordinates must 
 * contain an even number of coordinates (each pair is an (x, y) location 
 * on the plot) and the last point is automatically joined back to the 
 * first point.
 *
 * @param polygon  the coordinates of the polygon's vertices 
 *     (<code>null</code> not permitted).
 * @param stroke  the shape stroke (<code>null</code> permitted).
 * @param outlinePaint  the shape color (<code>null</code> permitted).
 * @param fillPaint  the paint used to fill the shape (<code>null</code> 
 *                   permitted).
 */
public XYPolygonAnnotation(double[] polygon, 
                           Stroke stroke, 
                           Paint outlinePaint, Paint fillPaint) {
    if (polygon == null) {
        throw new IllegalArgumentException("Null 'polygon' argument.");
    }
    if (polygon.length % 2 != 0) {
        throw new IllegalArgumentException("The 'polygon' array must " 
                + "contain an even number of items.");
    }
    this.polygon = (double[]) polygon.clone();
    this.stroke = stroke;
    this.outlinePaint = outlinePaint;
    this.fillPaint = fillPaint;
}
 
Example 5
Project: parabuild-ci   File: CategoryPlot.java   View source code 6 votes vote down vote up
/**
 * Utility method for drawing a line perpendicular to the range axis (used
 * for crosshairs).
 *
 * @param g2  the graphics device.
 * @param dataArea  the area defined by the axes.
 * @param value  the data value.
 * @param stroke  the line stroke (<code>null</code> not permitted).
 * @param paint  the line paint (<code>null</code> not permitted).
 */
protected void drawRangeLine(Graphics2D g2, Rectangle2D dataArea,
        double value, Stroke stroke, Paint paint) {

    double java2D = getRangeAxis().valueToJava2D(value, dataArea, 
            getRangeAxisEdge());
    Line2D line = null;
    if (this.orientation == PlotOrientation.HORIZONTAL) {
        line = new Line2D.Double(java2D, dataArea.getMinY(), java2D, 
                dataArea.getMaxY());
    }
    else if (this.orientation == PlotOrientation.VERTICAL) {
        line = new Line2D.Double(dataArea.getMinX(), java2D, 
                dataArea.getMaxX(), java2D);
    }
    g2.setStroke(stroke);
    g2.setPaint(paint);
    g2.draw(line);

}
 
Example 6
Project: parabuild-ci   File: PaintMap.java   View source code 6 votes vote down vote up
/**
 * Tests this map for equality with an arbitrary object.
 * 
 * @param obj  the object (<code>null</code> permitted).
 * 
 * @return A boolean.
 */
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof PaintMap)) {
        return false;
    }
    PaintMap that = (PaintMap) obj;
    if (this.store.size() != that.store.size()) {
        return false;
    }
    Set keys = this.store.keySet();
    Iterator iterator = keys.iterator();
    while (iterator.hasNext()) {
        Comparable key = (Comparable) iterator.next();
        Paint p1 = getPaint(key);
        Paint p2 = that.getPaint(key);
        if (!PaintUtilities.equal(p1, p2)) {
            return false;
        }
    }
    return true;
}
 
Example 7
Project: parabuild-ci   File: XYPlot.java   View source code 6 votes vote down vote up
/**
 * Draws the domain tick bands, if any.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param ticks  the ticks.
 */
public void drawDomainTickBands(Graphics2D g2, Rectangle2D dataArea, List ticks) {
    // draw the domain tick bands, if any...
    Paint bandPaint = getDomainTickBandPaint();
    if (bandPaint != null) {
        boolean fillBand = false;
        final ValueAxis xAxis = getDomainAxis();
        double previous = xAxis.getLowerBound();
        Iterator iterator = ticks.iterator();
        while (iterator.hasNext()) {
            ValueTick tick = (ValueTick) iterator.next();
            double current = tick.getValue();
            if (fillBand) {
                getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, current);
            }
            previous = current;
            fillBand = !fillBand;
        }
        double end = xAxis.getUpperBound();
        if (fillBand) {
            getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, end);
        }
    }
}
 
Example 8
Project: alevin-svn2   File: MappingTreeSelectionListener.java   View source code 5 votes vote down vote up
@Override
public Paint transform(VirtualLink input) {
	if (vls.contains(input))
		return Color.CYAN;
	else
		return backupVL.get(input.getLayer()).transform(input);
}
 
Example 9
Project: brModelo   File: Impressor.java   View source code 5 votes vote down vote up
/**
 * Pinta a área que não será impressa
 */
private void PinteNoArea(Graphics2D Canvas) {
    if (getDiagrama() != null) {
        Paint bkp = Canvas.getPaint();
        Canvas.setColor(new Color(241, 241, 241));

        int x = PaginasW * LarguraPagina;
        Canvas.fillRect(x + 2, 2, getWidth() - (x + 4), getHeight() - 4);

        int y = PaginasH * AlturaPagina;
        Canvas.fillRect(2, y + 2, getWidth() - 4, getHeight() - (y + 4));
        Canvas.setPaint(bkp);
    }
}
 
Example 10
Project: parabuild-ci   File: GanttRenderer.java   View source code 5 votes vote down vote up
/**
 * Sets the paint used to show the percentage complete and sends a {@link RendererChangeEvent}
 * to all registered listeners.
 * 
 * @param paint  the paint (<code>null</code> not permitted).
 */
public void setCompletePaint(Paint paint) {
    if (paint == null) {
        throw new IllegalArgumentException("Null paint not permitted.");
    }
    this.completePaint = paint;
    notifyListeners(new RendererChangeEvent(this));
}
 
Example 11
Project: litiengine   File: Appearance.java   View source code 5 votes vote down vote up
public Paint getBackgroundPaint(double width, double height) {
  if (this.isTransparentBackground()) {
    return null;
  }

  if (this.backgroundColor2 == null) {
    return this.backgroundColor1;
  }

  if (this.horizontalBackgroundGradient) {
    return new GradientPaint(0, 0, this.backgroundColor1, (float) (width / 2.0), 0, this.backgroundColor2);
  } else {
    return new GradientPaint(0, 0, this.backgroundColor1, 0, (float) (height / 2.0), this.backgroundColor2);
  }
}
 
Example 12
Project: parabuild-ci   File: XYPlot.java   View source code 5 votes vote down vote up
/**
 * Draws the range tick bands, if any.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param ticks  the ticks.
 * 
 * @see #setRangeTickBandPaint(Paint)
 */
public void drawRangeTickBands(Graphics2D g2, Rectangle2D dataArea,
                               List ticks) {

    // draw the range tick bands, if any...
    Paint bandPaint = getRangeTickBandPaint();
    if (bandPaint != null) {
        boolean fillBand = false;
        ValueAxis axis = getRangeAxis();
        double previous = axis.getLowerBound();
        Iterator iterator = ticks.iterator();
        while (iterator.hasNext()) {
            ValueTick tick = (ValueTick) iterator.next();
            double current = tick.getValue();
            if (fillBand) {
                getRenderer().fillRangeGridBand(g2, this, axis, dataArea, 
                        previous, current);
            }
            previous = current;
            fillBand = !fillBand;
        }
        double end = axis.getUpperBound();
        if (fillBand) {
            getRenderer().fillRangeGridBand(g2, this, axis, dataArea, 
                    previous, end);
        }
    }
}
 
Example 13
Project: parabuild-ci   File: CompassPlot.java   View source code 5 votes vote down vote up
/**
 * Sets the series outline paint.
 *
 * @param series  the series index.
 * @param p  the paint.
 */
public void setSeriesOutlinePaint(int series, Paint p) {

    if ((series >= 0) && (series < this.seriesNeedle.length)) {
        this.seriesNeedle[series].setOutlinePaint(p);
    }

}
 
Example 14
Project: parabuild-ci   File: WaterfallBarRenderer.java   View source code 5 votes vote down vote up
/**
 * Constructs a new waterfall renderer.
 *
 * @param firstBarPaint  the color of the first bar (<code>null</code> not 
 *                       permitted).
 * @param positiveBarPaint  the color for bars with positive values 
 *                          (<code>null</code> not permitted).
 * @param negativeBarPaint  the color for bars with negative values 
 *                          (<code>null</code> not permitted).
 * @param lastBarPaint  the color of the last bar (<code>null</code> not 
 *                      permitted).
 */
public WaterfallBarRenderer(Paint firstBarPaint, 
                            Paint positiveBarPaint, 
                            Paint negativeBarPaint,
                            Paint lastBarPaint) {
    super();
    if (firstBarPaint == null) {
        throw new IllegalArgumentException("Null 'firstBarPaint' argument");
    }
    if (positiveBarPaint == null) {
        throw new IllegalArgumentException(
            "Null 'positiveBarPaint' argument"
        );   
    }
    if (negativeBarPaint == null) {
        throw new IllegalArgumentException(
            "Null 'negativeBarPaint' argument"
        );   
    }
    if (lastBarPaint == null) {
        throw new IllegalArgumentException("Null 'lastBarPaint' argument");
    }
    this.firstBarPaint = firstBarPaint;
    this.lastBarPaint = lastBarPaint;
    this.positiveBarPaint = positiveBarPaint;
    this.negativeBarPaint = negativeBarPaint;
    setGradientPaintTransformer(
        new StandardGradientPaintTransformer(
            GradientPaintTransformType.CENTER_VERTICAL
        )
    );
    setMinimumBarLength(1.0);
}
 
Example 15
Project: parabuild-ci   File: WaterfallBarRenderer.java   View source code 5 votes vote down vote up
/**
 * Constructs a new waterfall renderer.
 *
 * @param firstBarPaint  the color of the first bar.
 * @param positiveBarPaint  the color for bars with positive values.
 * @param negativeBarPaint  the color for bars with negative values.
 * @param lastBarPaint  the color of the last bar.
 */
public WaterfallBarRenderer(Paint firstBarPaint, 
                            Paint positiveBarPaint, 
                            Paint negativeBarPaint,
                            Paint lastBarPaint) {
    super();
    this.firstBarPaint = firstBarPaint;
    this.lastBarPaint = lastBarPaint;
    this.positiveBarPaint = positiveBarPaint;
    this.negativeBarPaint = negativeBarPaint;
    setGradientPaintTransformer(
        new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_VERTICAL));
    setMinimumBarLength(1.0);
}
 
Example 16
Project: rapidminer   File: FormattedAreaRenderer.java   View source code 5 votes vote down vote up
@Override
public Paint getItemOutlinePaint(int seriesIdx, int valueIdx) {
	if (getFormatDelegate().isItemSelected(seriesIdx, valueIdx)) {
		return super.getItemOutlinePaint(seriesIdx, valueIdx);
	} else {
		return DataStructureUtils.setColorAlpha(Color.LIGHT_GRAY, 20);
	}
}
 
Example 17
Project: parabuild-ci   File: XYPlot.java   View source code 5 votes vote down vote up
/**
 * Draws the domain tick bands, if any.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param ticks  the ticks.
 * 
 * @see #setDomainTickBandPaint(Paint)
 */
public void drawDomainTickBands(Graphics2D g2, Rectangle2D dataArea,
                                List ticks) {
    // draw the domain tick bands, if any...
    Paint bandPaint = getDomainTickBandPaint();
    if (bandPaint != null) {
        boolean fillBand = false;
        ValueAxis xAxis = getDomainAxis();
        double previous = xAxis.getLowerBound();
        Iterator iterator = ticks.iterator();
        while (iterator.hasNext()) {
            ValueTick tick = (ValueTick) iterator.next();
            double current = tick.getValue();
            if (fillBand) {
                getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea,
                        previous, current);
            }
            previous = current;
            fillBand = !fillBand;
        }
        double end = xAxis.getUpperBound();
        if (fillBand) {
            getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, 
                    previous, end);
        }
    }
}
 
Example 18
Project: parabuild-ci   File: DefaultDrawingSupplier.java   View source code 5 votes vote down vote up
/**
 * Creates a new supplier.
 *
 * @param paintSequence  the fill paint sequence.
 * @param outlinePaintSequence  the outline paint sequence.
 * @param strokeSequence  the stroke sequence.
 * @param outlineStrokeSequence  the outline stroke sequence.
 * @param shapeSequence  the shape sequence.
 */
public DefaultDrawingSupplier(Paint[] paintSequence,
                              Paint[] outlinePaintSequence,
                              Stroke[] strokeSequence,
                              Stroke[] outlineStrokeSequence,
                              Shape[] shapeSequence) {

    this.paintSequence = paintSequence;
    this.outlinePaintSequence = outlinePaintSequence;
    this.strokeSequence = strokeSequence;
    this.outlineStrokeSequence = outlineStrokeSequence;
    this.shapeSequence = shapeSequence;

}
 
Example 19
Project: rapidminer   File: FormattedXYDifferenceRenderer.java   View source code 5 votes vote down vote up
@Override
public Paint getPositivePaint() {
	StaticDebug.debug("getPositivePaint(): " + trueSeriesIdx);
	Color color = getFormatDelegate().getSeriesColor(trueSeriesIdx);
	if (color != null) {
		return DataStructureUtils.setColorAlpha(color, color.getAlpha() / 2);
	} else {
		return super.getPositivePaint();
	}
}
 
Example 20
Project: parabuild-ci   File: PolarPlot.java   View source code 5 votes vote down vote up
/**
 * Sets the paint used to display the angle labels and sends a 
 * {@link PlotChangeEvent} to all registered listeners.
 * 
 * @param paint  the paint (<code>null</code> not permitted).
 */
public void setAngleLabelPaint(Paint paint) {
    if (paint == null) {
        throw new IllegalArgumentException("Null 'paint' argument.");
    }
    this.angleLabelPaint = paint;
    notifyListeners(new PlotChangeEvent(this));
}
 
Example 21
Project: brModelo   File: FormaTriangular.java   View source code 5 votes vote down vote up
@Override
protected void DoPaintDoks(Graphics2D g) {
    Point[] pts = getPontosDoTriangulo();
    Paint bkpP = g.getPaint();
    g.setPaint(Color.orange);
    for (Point pt : pts) {
        g.fillRect(pt.x - 2, pt.y - 2, 4, 4);
    }
    g.setPaint(bkpP);
}
 
Example 22
Project: parabuild-ci   File: PiePlot.java   View source code 5 votes vote down vote up
/**
 * Sets the paint used for the lines that connect pie sections to their corresponding labels,
 * and sends a {@link PlotChangeEvent} to all registered listeners.
 * 
 * @param paint  the paint (<code>null</code> not permitted).
 */
public void setLabelLinkPaint(Paint paint) {
    if (paint == null) {
        throw new IllegalArgumentException("Null 'paint' argument.");
    }
    this.labelLinkPaint = paint;
    notifyListeners(new PlotChangeEvent(this));
}
 
Example 23
Project: parabuild-ci   File: AbstractRenderer.java   View source code 5 votes vote down vote up
/**
 * Sets the base outline paint and, if requested, sends a 
 * {@link RendererChangeEvent} to all registered listeners.
 * 
 * @param paint  the paint (<code>null</code> not permitted).
 * @param notify  notify listeners?
 */
public void setBaseOutlinePaint(Paint paint, boolean notify) {
    if (paint == null) {
        throw new IllegalArgumentException("Null 'paint' argument.");   
    }
    this.baseOutlinePaint = paint;
    if (notify) {
        fireChangeEvent();
    }
}
 
Example 24
Project: parabuild-ci   File: XYBoxAndWhiskerRenderer.java   View source code 5 votes vote down vote up
/**
 * Sets the paint used to paint the various artifacts such as outliers, 
 * farout symbol, median line and the averages ellipse.
 * 
 * @param artifactPaint  the paint (<code>null</code> not permitted).
 */
public void setArtifactPaint(Paint artifactPaint) {
    if (artifactPaint == null) {
        throw new IllegalArgumentException(
                "Null 'artifactPaint' argument.");
    }
    this.artifactPaint = artifactPaint;
    notifyListeners(new RendererChangeEvent(this));
}
 
Example 25
Project: parabuild-ci   File: LegendTitle.java   View source code 5 votes vote down vote up
/**
 * Sets the item paint.
 *
 * @param paint  the paint (<code>null</code> not permitted).
 */
public void setItemPaint(Paint paint) {
    if (paint == null) {
        throw new IllegalArgumentException("Null 'paint' argument.");   
    }
    this.itemPaint = paint;
    notifyListeners(new TitleChangeEvent(this));
}
 
Example 26
Project: parabuild-ci   File: SimpleDialFrame.java   View source code 5 votes vote down vote up
/**
 * Sets the background paint.
 * 
 * @param paint  the paint (<code>null</code> not permitted).
 * 
 * @see #getBackgroundPaint()
 */
public void setBackgroundPaint(Paint paint) {
    if (paint == null) {
        throw new IllegalArgumentException("Null 'paint' argument.");
    }
    this.backgroundPaint = paint;
    notifyListeners(new DialLayerChangeEvent(this));
}
 
Example 27
Project: rapidminer   File: FormattedLineAndShapeRenderer.java   View source code 5 votes vote down vote up
@Override
public Paint getItemPaint(int seriesIdx, int valueIdx) {
	Paint paintFromDelegate = getFormatDelegate().getItemPaint(seriesIdx, valueIdx);
	if (paintFromDelegate == null) {
		return super.getItemPaint(seriesIdx, valueIdx);
	} else {
		return paintFromDelegate;
	}
}
 
Example 28
Project: rapidminer   File: FormattedBarRenderer.java   View source code 5 votes vote down vote up
@Override
public Paint getItemPaint(int seriesIdx, int valueIdx) {
	Paint paintFromDelegate = getFormatDelegate().getItemPaint(seriesIdx, valueIdx);
	if (paintFromDelegate == null) {
		return super.getItemPaint(seriesIdx, valueIdx);
	} else {
		return paintFromDelegate;
	}
}
 
Example 29
Project: parabuild-ci   File: DefaultDrawingSupplier.java   View source code 5 votes vote down vote up
/**
 * Creates a new supplier.
 *
 * @param paintSequence  the fill paint sequence.
 * @param outlinePaintSequence  the outline paint sequence.
 * @param strokeSequence  the stroke sequence.
 * @param outlineStrokeSequence  the outline stroke sequence.
 * @param shapeSequence  the shape sequence.
 */
public DefaultDrawingSupplier(Paint[] paintSequence,
                              Paint[] outlinePaintSequence,
                              Stroke[] strokeSequence,
                              Stroke[] outlineStrokeSequence,
                              Shape[] shapeSequence) {

    this.paintSequence = paintSequence;
    this.outlinePaintSequence = outlinePaintSequence;
    this.strokeSequence = strokeSequence;
    this.outlineStrokeSequence = outlineStrokeSequence;
    this.shapeSequence = shapeSequence;

}
 
Example 30
Project: rapidminer   File: FormattedClusteredXYBarRenderer.java   View source code 5 votes vote down vote up
@Override
public Paint getItemPaint(int seriesIdx, int valueIdx) {
	Paint paintFromDelegate = getFormatDelegate().getItemPaint(seriesIdx, valueIdx);
	if (paintFromDelegate == null) {
		return super.getItemPaint(seriesIdx, valueIdx);
	} else {
		return paintFromDelegate;
	}
}
 
Example 31
Project: rapidminer   File: FormattedScatterRenderer.java   View source code 5 votes vote down vote up
@Override
public Paint getItemOutlinePaint(int seriesIdx, int valueIdx) {
	if (getFormatDelegate().isItemSelected(seriesIdx, valueIdx)) {
		return super.getItemOutlinePaint(seriesIdx, valueIdx);
	} else {
		return DataStructureUtils.setColorAlpha(Color.LIGHT_GRAY, 20);
	}
}
 
Example 32
Project: rapidminer   File: FormattedStatisticalBarRenderer.java   View source code 5 votes vote down vote up
@Override
public Paint getItemPaint(int seriesIdx, int valueIdx) {
	Paint paintFromDelegate = getFormatDelegate().getItemPaint(seriesIdx, valueIdx);
	if (paintFromDelegate == null) {
		return super.getItemPaint(seriesIdx, valueIdx);
	} else {
		return paintFromDelegate;
	}
}
 
Example 33
Project: rapidminer   File: FormattedStackedXYBarRenderer.java   View source code 5 votes vote down vote up
@Override
public Paint getItemPaint(int seriesIdx, int valueIdx) {
	Paint paintFromDelegate = getFormatDelegate().getItemPaint(seriesIdx, valueIdx);
	if (paintFromDelegate == null) {
		return super.getItemPaint(seriesIdx, valueIdx);
	} else {
		return paintFromDelegate;
	}
}
 
Example 34
Project: ojAlgo-extensions   File: PieChartBuilder.java   View source code 5 votes vote down vote up
@Override
protected Plot makePlot(final JFreeChartBuilder.PlotParameters parameters) {

    final KeyedValuesDataset tmpDataset = this.getDataset();

    final PiePlot retVal = new PiePlot(tmpDataset);

    retVal.setShadowXOffset(0);
    retVal.setShadowYOffset(0);

    retVal.setBackgroundPaint(parameters.getBackground());
    retVal.setOutlinePaint(parameters.getOutline());

    retVal.setLabelGenerator(new StandardPieSectionLabelGenerator());

    if (this.isTooltips()) {
        retVal.setToolTipGenerator(new StandardPieToolTipGenerator());
    }
    if (this.isUrls()) {
        retVal.setURLGenerator(new StandardPieURLGenerator());
    }

    for (final Entry<Comparable<?>, Paint> tmpEntry : this.getColourSet()) {
        retVal.setSectionPaint(tmpEntry.getKey(), tmpEntry.getValue());
    }

    return retVal;
}
 
Example 35
Project: rapidminer   File: FormattedXYDifferenceRenderer.java   View source code 5 votes vote down vote up
@Override
public Paint getItemPaint(int seriesIdx, int valueIdx) {
	Paint paintFromDelegate = getFormatDelegate().getItemPaint(trueSeriesIdx, valueIdx);
	if (paintFromDelegate == null) {
		return super.getItemPaint(seriesIdx, valueIdx);
	} else {
		return paintFromDelegate;
	}
}
 
Example 36
Project: Svg2AndroidXml   File: AssetUtil.java   View source code 4 votes vote down vote up
public FillEffect(Paint paint, double opacity) {
    this.paint = paint;
    this.opacity = opacity;
}
 
Example 37
Project: alevin-svn2   File: LayerViewer.java   View source code 4 votes vote down vote up
public final void setEdgeDrawPaintTransformer(
		Transformer<E, Paint> paintTransformer) {
	getRenderContext().setArrowDrawPaintTransformer(paintTransformer);
	getRenderContext().setArrowFillPaintTransformer(paintTransformer);
	getRenderContext().setEdgeDrawPaintTransformer(paintTransformer);
}
 
Example 38
Project: cuttlefish   File: PluggableRendererDemo.java   View source code 4 votes vote down vote up
public Paint getDrawPaint(Vertex v)
{
    return Color.BLACK;
}
 
Example 39
Project: sstore-soft   File: ProcedureConflictGraphNode.java   View source code 4 votes vote down vote up
@Override
public Paint transform(ConflictVertex v) {
    PickedState<ConflictVertex> pickedState = vizPanel.getPickedVertexState();
    return (pickedState.isPicked(v) ? picked : unpicked);
}
 
Example 40
Project: parabuild-ci   File: MeterNeedle.java   View source code 4 votes vote down vote up
/**
 * Sets the fill paint.
 *
 * @param p  the fill paint.
 */
public void setFillPaint(Paint p) {
    if (p != null) {
        this.fillPaint = p;
    }
}