Java Code Examples for org.jfree.chart.plot.DefaultDrawingSupplier#DEFAULT_SHAPE_SEQUENCE

The following examples show how to use org.jfree.chart.plot.DefaultDrawingSupplier#DEFAULT_SHAPE_SEQUENCE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StandardChartTheme.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates and returns a theme called "Darkness".  In this theme, the
 * charts have a black background.
 *
 * @return The "Darkness" theme.
 */
public static ChartTheme createDarknessTheme() {
    StandardChartTheme theme = new StandardChartTheme("Darkness");
    theme.titlePaint = Color.white;
    theme.subtitlePaint = Color.white;
    theme.legendBackgroundPaint = Color.black;
    theme.legendItemPaint = Color.white;
    theme.chartBackgroundPaint = Color.black;
    theme.plotBackgroundPaint = Color.black;
    theme.plotOutlinePaint = Color.yellow;
    theme.baselinePaint = Color.white;
    theme.crosshairPaint = Color.red;
    theme.labelLinkPaint = Color.lightGray;
    theme.tickLabelPaint = Color.white;
    theme.axisLabelPaint = Color.white;
    theme.shadowPaint = Color.darkGray;
    theme.itemLabelPaint = Color.white;
    theme.drawingSupplier = new DefaultDrawingSupplier(
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC"), Color.decode("0xFF0000"),
                    Color.decode("0xFFFF7F"), Color.decode("0x6681CC"),
                    Color.decode("0xFF7F7F"), Color.decode("0xFFFFBF"),
                    Color.decode("0x99A6CC"), Color.decode("0xFFBFBF"),
                    Color.decode("0xA9A938"), Color.decode("0x2D4587")},
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC")},
            new Stroke[] {new BasicStroke(2.0f)},
            new Stroke[] {new BasicStroke(0.5f)},
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
    theme.wallPaint = Color.darkGray;
    theme.errorIndicatorPaint = Color.lightGray;
    theme.gridBandPaint = new Color(255, 255, 255, 20);
    theme.gridBandAlternatePaint = new Color(255, 255, 255, 40);
    return theme;
}
 
Example 2
Source File: StandardChartTheme.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates and returns a theme called "Darkness".  In this theme, the
 * charts have a black background.
 *
 * @return The "Darkness" theme.
 */
public static ChartTheme createDarknessTheme() {
    StandardChartTheme theme = new StandardChartTheme("Darkness");
    theme.titlePaint = Color.white;
    theme.subtitlePaint = Color.white;
    theme.legendBackgroundPaint = Color.black;
    theme.legendItemPaint = Color.white;
    theme.chartBackgroundPaint = Color.black;
    theme.plotBackgroundPaint = Color.black;
    theme.plotOutlinePaint = Color.yellow;
    theme.baselinePaint = Color.white;
    theme.crosshairPaint = Color.red;
    theme.labelLinkPaint = Color.lightGray;
    theme.tickLabelPaint = Color.white;
    theme.axisLabelPaint = Color.white;
    theme.shadowPaint = Color.darkGray;
    theme.itemLabelPaint = Color.white;
    theme.drawingSupplier = new DefaultDrawingSupplier(
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC"), Color.decode("0xFF0000"),
                    Color.decode("0xFFFF7F"), Color.decode("0x6681CC"),
                    Color.decode("0xFF7F7F"), Color.decode("0xFFFFBF"),
                    Color.decode("0x99A6CC"), Color.decode("0xFFBFBF"),
                    Color.decode("0xA9A938"), Color.decode("0x2D4587")},
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC")},
            new Stroke[] {new BasicStroke(2.0f)},
            new Stroke[] {new BasicStroke(0.5f)},
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
    theme.wallPaint = Color.darkGray;
    theme.errorIndicatorPaint = Color.lightGray;
    theme.gridBandPaint = new Color(255, 255, 255, 20);
    theme.gridBandAlternatePaint = new Color(255, 255, 255, 40);
    theme.shadowGenerator = null;
    return theme;
}
 
Example 3
Source File: StandardChartTheme.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates and returns a theme called "Darkness".  In this theme, the
 * charts have a black background.
 *
 * @return The "Darkness" theme.
 */
public static ChartTheme createDarknessTheme() {
    StandardChartTheme theme = new StandardChartTheme("Darkness");
    theme.titlePaint = Color.white;
    theme.subtitlePaint = Color.white;
    theme.legendBackgroundPaint = Color.black;
    theme.legendItemPaint = Color.white;
    theme.chartBackgroundPaint = Color.black;
    theme.plotBackgroundPaint = Color.black;
    theme.plotOutlinePaint = Color.yellow;
    theme.baselinePaint = Color.white;
    theme.crosshairPaint = Color.red;
    theme.labelLinkPaint = Color.lightGray;
    theme.tickLabelPaint = Color.white;
    theme.axisLabelPaint = Color.white;
    theme.shadowPaint = Color.darkGray;
    theme.itemLabelPaint = Color.white;
    theme.drawingSupplier = new DefaultDrawingSupplier(
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC"), Color.decode("0xFF0000"),
                    Color.decode("0xFFFF7F"), Color.decode("0x6681CC"),
                    Color.decode("0xFF7F7F"), Color.decode("0xFFFFBF"),
                    Color.decode("0x99A6CC"), Color.decode("0xFFBFBF"),
                    Color.decode("0xA9A938"), Color.decode("0x2D4587")},
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC")},
            new Stroke[] {new BasicStroke(2.0f)},
            new Stroke[] {new BasicStroke(0.5f)},
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
    theme.wallPaint = Color.darkGray;
    theme.errorIndicatorPaint = Color.lightGray;
    theme.gridBandPaint = new Color(255, 255, 255, 20);
    theme.gridBandAlternatePaint = new Color(255, 255, 255, 40);
    theme.shadowGenerator = null;
    return theme;
}
 
Example 4
Source File: StandardChartTheme.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Creates and returns a theme called "Darkness".  In this theme, the
 * charts have a black background.
 *
 * @return The "Darkness" theme.
 */
public static ChartTheme createDarknessTheme() {
    StandardChartTheme theme = new StandardChartTheme("Darkness");
    theme.titlePaint = Color.white;
    theme.subtitlePaint = Color.white;
    theme.legendBackgroundPaint = Color.black;
    theme.legendItemPaint = Color.white;
    theme.chartBackgroundPaint = Color.black;
    theme.plotBackgroundPaint = Color.black;
    theme.plotOutlinePaint = Color.yellow;
    theme.baselinePaint = Color.white;
    theme.crosshairPaint = Color.red;
    theme.labelLinkPaint = Color.lightGray;
    theme.tickLabelPaint = Color.white;
    theme.axisLabelPaint = Color.white;
    theme.shadowPaint = Color.darkGray;
    theme.itemLabelPaint = Color.white;
    theme.drawingSupplier = new DefaultDrawingSupplier(
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC"), Color.decode("0xFF0000"),
                    Color.decode("0xFFFF7F"), Color.decode("0x6681CC"),
                    Color.decode("0xFF7F7F"), Color.decode("0xFFFFBF"),
                    Color.decode("0x99A6CC"), Color.decode("0xFFBFBF"),
                    Color.decode("0xA9A938"), Color.decode("0x2D4587")},
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC")},
            new Stroke[] {new BasicStroke(2.0f)},
            new Stroke[] {new BasicStroke(0.5f)},
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
    theme.wallPaint = Color.darkGray;
    theme.errorIndicatorPaint = Color.lightGray;
    theme.gridBandPaint = new Color(255, 255, 255, 20);
    theme.gridBandAlternatePaint = new Color(255, 255, 255, 40);
    theme.shadowGenerator = null;
    return theme;
}
 
Example 5
Source File: GraphicsExportDialog.java    From mzmine2 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the colours of the selected colour palette to the chart theme.
 */
protected void setStandardColors() {
  DrawingSupplier ds = new DefaultDrawingSupplier(colors, colors, colors,
      DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
      DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
      DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);

  theme.setDrawingSupplier(ds);
}
 
Example 6
Source File: StandardChartTheme.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates and returns a theme called "Darkness".  In this theme, the
 * charts have a black background.
 *
 * @return The "Darkness" theme.
 */
public static ChartTheme createDarknessTheme() {
    StandardChartTheme theme = new StandardChartTheme("Darkness");
    theme.titlePaint = Color.white;
    theme.subtitlePaint = Color.white;
    theme.legendBackgroundPaint = Color.black;
    theme.legendItemPaint = Color.white;
    theme.chartBackgroundPaint = Color.black;
    theme.plotBackgroundPaint = Color.black;
    theme.plotOutlinePaint = Color.yellow;
    theme.baselinePaint = Color.white;
    theme.crosshairPaint = Color.red;
    theme.labelLinkPaint = Color.lightGray;
    theme.tickLabelPaint = Color.white;
    theme.axisLabelPaint = Color.white;
    theme.shadowPaint = Color.darkGray;
    theme.itemLabelPaint = Color.white;
    theme.drawingSupplier = new DefaultDrawingSupplier(
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC"), Color.decode("0xFF0000"),
                    Color.decode("0xFFFF7F"), Color.decode("0x6681CC"),
                    Color.decode("0xFF7F7F"), Color.decode("0xFFFFBF"),
                    Color.decode("0x99A6CC"), Color.decode("0xFFBFBF"),
                    Color.decode("0xA9A938"), Color.decode("0x2D4587")},
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC")},
            new Stroke[] {new BasicStroke(2.0f)},
            new Stroke[] {new BasicStroke(0.5f)},
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
    theme.wallPaint = Color.darkGray;
    theme.errorIndicatorPaint = Color.lightGray;
    theme.gridBandPaint = new Color(255, 255, 255, 20);
    theme.gridBandAlternatePaint = new Color(255, 255, 255, 40);
    theme.shadowGenerator = null;
    return theme;
}
 
Example 7
Source File: StandardChartTheme.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates and returns a theme called "Darkness".  In this theme, the
 * charts have a black background.
 *
 * @return The "Darkness" theme.
 */
public static ChartTheme createDarknessTheme() {
    StandardChartTheme theme = new StandardChartTheme("Darkness");
    theme.titlePaint = Color.white;
    theme.subtitlePaint = Color.white;
    theme.legendBackgroundPaint = Color.black;
    theme.legendItemPaint = Color.white;
    theme.chartBackgroundPaint = Color.black;
    theme.plotBackgroundPaint = Color.black;
    theme.plotOutlinePaint = Color.yellow;
    theme.baselinePaint = Color.white;
    theme.crosshairPaint = Color.red;
    theme.labelLinkPaint = Color.lightGray;
    theme.tickLabelPaint = Color.white;
    theme.axisLabelPaint = Color.white;
    theme.shadowPaint = Color.darkGray;
    theme.itemLabelPaint = Color.white;
    theme.drawingSupplier = new DefaultDrawingSupplier(
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC"), Color.decode("0xFF0000"),
                    Color.decode("0xFFFF7F"), Color.decode("0x6681CC"),
                    Color.decode("0xFF7F7F"), Color.decode("0xFFFFBF"),
                    Color.decode("0x99A6CC"), Color.decode("0xFFBFBF"),
                    Color.decode("0xA9A938"), Color.decode("0x2D4587")},
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC")},
            new Stroke[] {new BasicStroke(2.0f)},
            new Stroke[] {new BasicStroke(0.5f)},
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
    theme.wallPaint = Color.darkGray;
    theme.errorIndicatorPaint = Color.lightGray;
    theme.gridBandPaint = new Color(255, 255, 255, 20);
    theme.gridBandAlternatePaint = new Color(255, 255, 255, 40);
    theme.shadowGenerator = null;
    return theme;
}
 
Example 8
Source File: StandardChartTheme.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates and returns a theme called "Darkness".  In this theme, the
 * charts have a black background.
 *
 * @return The "Darkness" theme.
 */
public static ChartTheme createDarknessTheme() {
    StandardChartTheme theme = new StandardChartTheme("Darkness");
    theme.titlePaint = Color.white;
    theme.subtitlePaint = Color.white;
    theme.legendBackgroundPaint = Color.black;
    theme.legendItemPaint = Color.white;
    theme.chartBackgroundPaint = Color.black;
    theme.plotBackgroundPaint = Color.black;
    theme.plotOutlinePaint = Color.yellow;
    theme.baselinePaint = Color.white;
    theme.crosshairPaint = Color.red;
    theme.labelLinkPaint = Color.lightGray;
    theme.tickLabelPaint = Color.white;
    theme.axisLabelPaint = Color.white;
    theme.shadowPaint = Color.darkGray;
    theme.itemLabelPaint = Color.white;
    theme.drawingSupplier = new DefaultDrawingSupplier(
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC"), Color.decode("0xFF0000"),
                    Color.decode("0xFFFF7F"), Color.decode("0x6681CC"),
                    Color.decode("0xFF7F7F"), Color.decode("0xFFFFBF"),
                    Color.decode("0x99A6CC"), Color.decode("0xFFBFBF"),
                    Color.decode("0xA9A938"), Color.decode("0x2D4587")},
            new Paint[] {Color.decode("0xFFFF00"),
                    Color.decode("0x0036CC")},
            new Stroke[] {new BasicStroke(2.0f)},
            new Stroke[] {new BasicStroke(0.5f)},
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
    theme.wallPaint = Color.darkGray;
    theme.errorIndicatorPaint = Color.lightGray;
    theme.gridBandPaint = new Color(255, 255, 255, 20);
    theme.gridBandAlternatePaint = new Color(255, 255, 255, 40);
    theme.shadowGenerator = null;
    return theme;
}
 
Example 9
Source File: ChartUtils.java    From PDV with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Set theme
 */
private static void setChartTheme() {
    StandardChartTheme chartTheme = new StandardChartTheme("US");
    chartTheme.setExtraLargeFont(new Font("Arial", Font.BOLD, 14));
    chartTheme.setRegularFont(new Font("Arial", Font.PLAIN, 13));
    chartTheme.setLargeFont(new Font("Arial", Font.PLAIN, 14));
    chartTheme.setSmallFont(new Font("Arial", Font.PLAIN, 12));
    chartTheme.setTitlePaint(new Color(51, 51, 51));
    chartTheme.setSubtitlePaint(new Color(85, 85, 85));

    chartTheme.setLegendBackgroundPaint(Color.WHITE);
    chartTheme.setLegendItemPaint(Color.BLACK);
    chartTheme.setChartBackgroundPaint(Color.WHITE);

    Paint[] OUTLINE_PAINT_SEQUENCE = new Paint[] { Color.WHITE };
    DefaultDrawingSupplier drawingSupplier = new DefaultDrawingSupplier(CHART_COLORS, CHART_COLORS, OUTLINE_PAINT_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
    chartTheme.setDrawingSupplier(drawingSupplier);

    chartTheme.setPlotBackgroundPaint(Color.WHITE);
    chartTheme.setPlotOutlinePaint(Color.WHITE);
    chartTheme.setLabelLinkPaint(new Color(8, 55, 114));
    chartTheme.setLabelLinkStyle(PieLabelLinkStyle.CUBIC_CURVE);

    chartTheme.setAxisOffset(new RectangleInsets(5, 12, 5, 12));
    chartTheme.setDomainGridlinePaint(new Color(192, 208, 224));
    chartTheme.setRangeGridlinePaint(new Color(192, 192, 192));

    chartTheme.setBaselinePaint(Color.WHITE);
    chartTheme.setCrosshairPaint(Color.BLUE);
    chartTheme.setAxisLabelPaint(new Color(51, 51, 51));
    chartTheme.setTickLabelPaint(new Color(67, 67, 72));
    chartTheme.setBarPainter(new StandardBarPainter());
    chartTheme.setXYBarPainter(new StandardXYBarPainter());

    chartTheme.setItemLabelPaint(Color.black);
    chartTheme.setThermometerPaint(Color.white);

    ChartFactory.setChartTheme(chartTheme);
}
 
Example 10
Source File: GenericChartTheme.java    From jasperreports with GNU Lesser General Public License v3.0 4 votes vote down vote up
protected void setPlotDrawingDefaults(Plot p, JRChartPlot jrPlot)
{
	@SuppressWarnings("unchecked")
	List<Paint> defaultSeriesColors = (List<Paint>)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.SERIES_COLORS);
	Paint[] defaultPlotOutlinePaintSequence = 
		getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_OUTLINE_PAINT_SEQUENCE) != null ?
		(Paint[])getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_OUTLINE_PAINT_SEQUENCE) :
		DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE;
		
	Stroke[] defaultPlotStrokeSequence = 
		getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_STROKE_SEQUENCE) != null ?
		(Stroke[])getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_STROKE_SEQUENCE) :
		DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE;
		
	Stroke[] defaultPlotOutlineStrokeSequence = 
		getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_OUTLINE_STROKE_SEQUENCE) != null ?
		(Stroke[])getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_OUTLINE_STROKE_SEQUENCE) :
		DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE;
		
	Shape[] defaultPlotShapeSequence = 
		getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_SHAPE_SEQUENCE) != null ?
		(Shape[])getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_SHAPE_SEQUENCE) :
		DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE;
	// Set color series
	Paint[] colors = null;
	SortedSet<JRSeriesColor> seriesColors = jrPlot.getSeriesColors();
	Paint[] colorSequence = null;
	if (seriesColors != null && seriesColors.size() > 0)
	{
		int seriesColorsSize = seriesColors.size();
		
		colors = new Paint[DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE.length + seriesColorsSize];

		JRSeriesColor[] jrColorSequence = new JRSeriesColor[seriesColorsSize];
		seriesColors.toArray(jrColorSequence);
		colorSequence = new Paint[seriesColorsSize];
		
		for (int i = 0; i < seriesColorsSize; i++)
		{
			colorSequence[i] = jrColorSequence[i].getColor();
		}
		populateSeriesColors(colors, colorSequence);
	}
	else if (defaultSeriesColors != null && defaultSeriesColors.size() > 0)
	{
		colors = new Paint[DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE.length + defaultSeriesColors.size()];
		colorSequence = new Paint[defaultSeriesColors.size()];
		defaultSeriesColors.toArray(colorSequence);
		populateSeriesColors(colors, colorSequence);
	}
	else
	{
		colors = DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE;
	}
	
	p.setDrawingSupplier(new DefaultDrawingSupplier(
			colors,
			defaultPlotOutlinePaintSequence,
			defaultPlotStrokeSequence,
			defaultPlotOutlineStrokeSequence,
			defaultPlotShapeSequence
			)
		);
	
}