Example usage for java.awt Color darkGray

List of usage examples for java.awt Color darkGray

Introduction

In this page you can find the example usage for java.awt Color darkGray.

Prototype

Color darkGray

To view the source code for java.awt Color darkGray.

Click Source Link

Document

The color dark gray.

Usage

From source file:org.micromanager.saim.plot.PlotUtils.java

/**
 * Create a frame with a plot of the data given in XYSeries overwrite any
 * previously created frame with the same title
 *
        /* w ww .ja  va2 s  .co  m*/
 * @param title shown in the top of the plot
 * @param data array with data series to be plotted
 * @param xTitle Title of the X axis
 * @param yTitle Title of the Y axis
 * @param showShapes whether or not to draw shapes at the data points
 * @param annotation to be shown in plot
 * @return Frame that displays the data
 */
public Frame plotDataN(String title, XYSeries[] data, String xTitle, String yTitle, boolean[] showShapes,
        String annotation) {

    //Close existing frames
    Frame[] gfs = ChartFrame.getFrames();
    for (Frame f : gfs) {
        if (f.getTitle().equals(title)) {
            f.dispose();
        }
    }

    // JFreeChart code
    XYSeriesCollection dataset = new XYSeriesCollection();
    // calculate min and max to scale the graph
    double minX, minY, maxX, maxY;
    minX = data[0].getMinX();
    minY = data[0].getMinY();
    maxX = data[0].getMaxX();
    maxY = data[0].getMaxY();
    for (XYSeries d : data) {
        dataset.addSeries(d);
        if (d.getMinX() < minX) {
            minX = d.getMinX();
        }
        if (d.getMaxX() > maxX) {
            maxX = d.getMaxX();
        }
        if (d.getMinY() < minY) {
            minY = d.getMinY();
        }
        if (d.getMaxY() > maxY) {
            maxY = d.getMaxY();
        }
    }

    JFreeChart chart = ChartFactory.createScatterPlot(title, // Title
            xTitle, // x-axis Label
            yTitle, // y-axis Label
            dataset, // Dataset
            PlotOrientation.VERTICAL, // Plot Orientation
            true, // Show Legend
            true, // Use tooltips
            false // Configure chart to generate URLs?
    );
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.white);
    plot.setRangeGridlinePaint(Color.lightGray);

    XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();
    renderer.setBaseShapesVisible(true);

    for (int i = 0; i < data.length; i++) {
        renderer.setSeriesFillPaint(i, Color.white);
        renderer.setSeriesLinesVisible(i, true);
    }

    renderer.setSeriesPaint(0, Color.blue);
    Shape circle = new Ellipse2D.Float(-2.0f, -2.0f, 4.0f, 4.0f);
    renderer.setSeriesShape(0, circle, false);

    if (data.length > 1) {
        renderer.setSeriesPaint(1, Color.red);
        Shape square = new Rectangle2D.Float(-2.0f, -2.0f, 4.0f, 4.0f);
        renderer.setSeriesShape(1, square, false);
    }
    if (data.length > 2) {
        renderer.setSeriesPaint(2, Color.darkGray);
        Shape rect = new Rectangle2D.Float(-2.0f, -1.0f, 4.0f, 2.0f);
        renderer.setSeriesShape(2, rect, false);
    }
    if (data.length > 3) {
        renderer.setSeriesPaint(3, Color.magenta);
        Shape rect = new Rectangle2D.Float(-1.0f, -2.0f, 2.0f, 4.0f);
        renderer.setSeriesShape(3, rect, false);
    }

    for (int i = 0; i < data.length; i++) {
        if (showShapes.length > i && !showShapes[i]) {
            renderer.setSeriesShapesVisible(i, false);
        }
    }

    // place annotation at 80 % of max X, maxY
    XYAnnotation an = new XYTextAnnotation(annotation, maxX - 0.2 * (maxX - minX), maxY);
    plot.addAnnotation(an);

    renderer.setUseFillPaint(true);

    final MyChartFrame graphFrame = new MyChartFrame(title, chart);
    graphFrame.getChartPanel().setMouseWheelEnabled(true);
    graphFrame.pack();
    graphFrame.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent arg0) {
            graphFrame.dispose();
        }
    });

    graphFrame.setVisible(true);

    return graphFrame;
}

From source file:edu.ucsf.valelab.saim.plot.PlotUtils.java

/**
 * Create a frame with a plot of the data given in XYSeries overwrite any
 * previously created frame with the same title
 *
        /*w w w  .  ja va2 s.  c  om*/
 * @param title shown in the top of the plot
 * @param data array with data series to be plotted
 * @param xTitle Title of the X axis
 * @param yTitle Title of the Y axis
 * @param showShapes whether or not to draw shapes at the data points
 * @param annotation to be shown in plot
 * @return Frame that displays the data
 */
public Frame plotDataN(String title, XYSeries[] data, String xTitle, String yTitle, boolean[] showShapes,
        String annotation) {

    // Close existing frames
    // Frame[] gfs = ChartFrame.getFrames();
    // for (Frame f : gfs) {
    //if (f.getTitle().equals(title)) {
    //   f.dispose();
    //}
    // }

    // JFreeChart code
    XYSeriesCollection dataset = new XYSeriesCollection();
    // calculate min and max to scale the graph
    double minX, minY, maxX, maxY;
    minX = data[0].getMinX();
    minY = data[0].getMinY();
    maxX = data[0].getMaxX();
    maxY = data[0].getMaxY();
    for (XYSeries d : data) {
        dataset.addSeries(d);
        if (d.getMinX() < minX) {
            minX = d.getMinX();
        }
        if (d.getMaxX() > maxX) {
            maxX = d.getMaxX();
        }
        if (d.getMinY() < minY) {
            minY = d.getMinY();
        }
        if (d.getMaxY() > maxY) {
            maxY = d.getMaxY();
        }
    }

    JFreeChart chart = ChartFactory.createScatterPlot(title, // Title
            xTitle, // x-axis Label
            yTitle, // y-axis Label
            dataset, // Dataset
            PlotOrientation.VERTICAL, // Plot Orientation
            true, // Show Legend
            true, // Use tooltips
            false // Configure chart to generate URLs?
    );
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.white);
    plot.setRangeGridlinePaint(Color.lightGray);

    XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();
    renderer.setBaseShapesVisible(true);

    for (int i = 0; i < data.length; i++) {
        renderer.setSeriesFillPaint(i, Color.white);
        renderer.setSeriesLinesVisible(i, true);
    }

    renderer.setSeriesPaint(0, Color.blue);
    Shape circle = new Ellipse2D.Float(-2.0f, -2.0f, 4.0f, 4.0f);
    renderer.setSeriesShape(0, circle, false);

    if (data.length > 1) {
        renderer.setSeriesPaint(1, Color.red);
        Shape square = new Rectangle2D.Float(-2.0f, -2.0f, 4.0f, 4.0f);
        renderer.setSeriesShape(1, square, false);
    }
    if (data.length > 2) {
        renderer.setSeriesPaint(2, Color.darkGray);
        Shape rect = new Rectangle2D.Float(-2.0f, -1.0f, 4.0f, 2.0f);
        renderer.setSeriesShape(2, rect, false);
    }
    if (data.length > 3) {
        renderer.setSeriesPaint(3, Color.magenta);
        Shape rect = new Rectangle2D.Float(-1.0f, -2.0f, 2.0f, 4.0f);
        renderer.setSeriesShape(3, rect, false);
    }

    for (int i = 0; i < data.length; i++) {
        if (showShapes.length > i && !showShapes[i]) {
            renderer.setSeriesShapesVisible(i, false);
        }
    }

    // place annotation at 80 % of max X, maxY
    XYAnnotation an = new XYTextAnnotation(annotation, maxX - 0.2 * (maxX - minX), maxY);
    plot.addAnnotation(an);

    renderer.setUseFillPaint(true);

    final MyChartFrame graphFrame = new MyChartFrame(title, chart);
    graphFrame.getChartPanel().setMouseWheelEnabled(true);
    graphFrame.pack();
    graphFrame.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent arg0) {
            graphFrame.dispose();
        }
    });

    graphFrame.setVisible(true);

    return graphFrame;
}

From source file:net.sf.mzmine.chartbasics.chartthemes.ChartThemeFactory.java

/**
 * Creates and returns a theme called "Darkness". In this theme, the charts have a black
 * background and white lines and labels
 *
 * @return The "Darkness" theme.//  w w  w . jav  a  2 s .  co m
 */
public static EStandardChartTheme createDarknessTheme() {
    EStandardChartTheme theme = new EStandardChartTheme(THEME.DARKNESS, "Darkness");
    // Fonts
    theme.setExtraLargeFont(new Font("Arial", Font.BOLD, 20));
    theme.setLargeFont(new Font("Arial", Font.BOLD, 11));
    theme.setRegularFont(new Font("Arial", Font.PLAIN, 11));
    theme.setSmallFont(new Font("Arial", Font.PLAIN, 11));
    //
    theme.setTitlePaint(Color.white);
    theme.setSubtitlePaint(Color.white);
    theme.setLegendBackgroundPaint(Color.black);
    theme.setLegendItemPaint(Color.white);
    theme.setChartBackgroundPaint(Color.black);
    theme.setPlotBackgroundPaint(Color.black);
    theme.setPlotOutlinePaint(Color.yellow);
    theme.setBaselinePaint(Color.white);
    theme.setCrosshairPaint(Color.red);
    theme.setLabelLinkPaint(Color.lightGray);
    theme.setTickLabelPaint(Color.white);
    theme.setAxisLabelPaint(Color.white);
    theme.setShadowPaint(Color.darkGray);
    theme.setItemLabelPaint(Color.white);
    theme.setDrawingSupplier(new DefaultDrawingSupplier(
            new Paint[] { Color.WHITE, 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.setErrorIndicatorPaint(Color.lightGray);
    theme.setGridBandPaint(new Color(255, 255, 255, 20));
    theme.setGridBandAlternatePaint(new Color(255, 255, 255, 40));

    // axis
    Color transp = new Color(255, 255, 255, 200);
    theme.setRangeGridlinePaint(transp);
    theme.setDomainGridlinePaint(transp);

    theme.setAxisLinePaint(Color.white);

    theme.setMasterFontColor(Color.WHITE);
    // axis offset
    theme.setAxisOffset(new RectangleInsets(0, 0, 0, 0));
    return theme;
}

From source file:it.eng.spagobi.engines.chart.bo.charttypes.dialcharts.Meter.java

/**
 * Creates the chart ./*from   w  w  w .ja  v a  2s  .  c  om*/
 * 
 * @param chartTitle  the chart title.
 * @param dataset  the dataset.
 * 
 * @return A chart .
 */

public JFreeChart createChart(DatasetMap datasets) {

    Dataset dataset = (Dataset) datasets.getDatasets().get("1");

    MeterPlot plot = new MeterPlot((ValueDataset) dataset);
    plot.setRange(new Range(lower, upper));

    for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
        KpiInterval interval = (KpiInterval) iterator.next();

        plot.addInterval(new MeterInterval(interval.getLabel(), new Range(interval.getMin(), interval.getMax()),
                Color.lightGray, new BasicStroke(2.0f), interval.getColor()));
    }

    plot.setNeedlePaint(Color.darkGray);
    plot.setDialBackgroundPaint(Color.white);
    plot.setDialOutlinePaint(Color.gray);
    plot.setDialShape(DialShape.CHORD);
    plot.setMeterAngle(260);
    plot.setTickLabelsVisible(true);
    //set tick label style
    Font tickLabelsFont = new Font(labelsTickStyle.getFontName(), Font.PLAIN, labelsTickStyle.getSize());
    plot.setTickLabelFont(tickLabelsFont);
    plot.setTickLabelPaint(labelsTickStyle.getColor());
    plot.setTickSize(5.0);
    plot.setTickPaint(Color.lightGray);
    if (units != null) {
        plot.setUnits(units);
    }

    plot.setValuePaint(labelsValueStyle.getColor());
    plot.setValueFont(new Font(labelsValueStyle.getFontName(), Font.PLAIN, labelsValueStyle.getSize()));

    JFreeChart chart = new JFreeChart(name, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    chart.setBackgroundPaint(color);

    TextTitle title = setStyleTitle(name, styleTitle);
    chart.setTitle(title);
    if (subName != null && !subName.equals("")) {
        TextTitle subTitle = setStyleTitle(subName, styleSubTitle);
        chart.addSubtitle(subTitle);
    }

    return chart;
}

From source file:org.micromanager.asidispim.Utils.PlotUtils.java

/**
 * Create a frame with a plot of the data given in XYSeries overwrite any
 * previously created frame with the same title
 *
        /*from   w  w w. ja v  a 2s.co  m*/
 * @param title shown in the top of the plot
 * @param data array with data series to be plotted
 * @param xTitle Title of the X axis
 * @param yTitle Title of the Y axis
 * @param showShapes whether or not to draw shapes at the data points
 * @param annotation to be shown in plot
 * @return Frame that displays the data
 */
public Frame plotDataN(String title, XYSeries[] data, String xTitle, String yTitle, boolean[] showShapes,
        String annotation) {

    // if we already have a plot open with this title, close it, but remember
    // its position
    Frame[] gfs = ChartFrame.getFrames();
    for (Frame f : gfs) {
        if (f.getTitle().equals(title)) {
            f.dispose();
        }
    }

    // JFreeChart code
    XYSeriesCollection dataset = new XYSeriesCollection();
    // calculate min and max to scale the graph
    double minX, minY, maxX, maxY;
    minX = data[0].getMinX();
    minY = data[0].getMinY();
    maxX = data[0].getMaxX();
    maxY = data[0].getMaxY();
    for (XYSeries d : data) {
        dataset.addSeries(d);
        if (d.getMinX() < minX) {
            minX = d.getMinX();
        }
        if (d.getMaxX() > maxX) {
            maxX = d.getMaxX();
        }
        if (d.getMinY() < minY) {
            minY = d.getMinY();
        }
        if (d.getMaxY() > maxY) {
            maxY = d.getMaxY();
        }
    }

    JFreeChart chart = ChartFactory.createScatterPlot(title, // Title
            xTitle, // x-axis Label
            yTitle, // y-axis Label
            dataset, // Dataset
            PlotOrientation.VERTICAL, // Plot Orientation
            false, // Show Legend
            true, // Use tooltips
            false // Configure chart to generate URLs?
    );
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.white);
    plot.setRangeGridlinePaint(Color.lightGray);

    XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();
    renderer.setBaseShapesVisible(true);

    for (int i = 0; i < data.length; i++) {
        renderer.setSeriesFillPaint(i, Color.white);
        renderer.setSeriesLinesVisible(i, true);
    }

    renderer.setSeriesPaint(0, Color.blue);
    Shape circle = new Ellipse2D.Float(-2.0f, -2.0f, 4.0f, 4.0f);
    renderer.setSeriesShape(0, circle, false);

    if (data.length > 1) {
        renderer.setSeriesPaint(1, Color.red);
        Shape square = new Rectangle2D.Float(-2.0f, -2.0f, 4.0f, 4.0f);
        renderer.setSeriesShape(1, square, false);
    }
    if (data.length > 2) {
        renderer.setSeriesPaint(2, Color.darkGray);
        Shape rect = new Rectangle2D.Float(-2.0f, -1.0f, 4.0f, 2.0f);
        renderer.setSeriesShape(2, rect, false);
    }
    if (data.length > 3) {
        renderer.setSeriesPaint(3, Color.magenta);
        Shape rect = new Rectangle2D.Float(-1.0f, -2.0f, 2.0f, 4.0f);
        renderer.setSeriesShape(3, rect, false);
    }

    for (int i = 0; i < data.length; i++) {
        if (showShapes.length > i && !showShapes[i]) {
            renderer.setSeriesShapesVisible(i, false);
        }
    }

    XYAnnotation an = new XYTextAnnotation(annotation, maxX - 0.01, maxY);
    plot.addAnnotation(an);

    renderer.setUseFillPaint(true);

    final MyChartFrame graphFrame = new MyChartFrame(title, chart);
    graphFrame.getChartPanel().setMouseWheelEnabled(true);
    graphFrame.pack();
    graphFrame.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent arg0) {
            graphFrame.dispose();
        }
    });

    graphFrame.setVisible(true);

    return graphFrame;
}

From source file:org.bench4Q.console.ui.section.P_WIPSSection.java

private JPanel printWIPSPic() throws IOException {
    double[][] value = wipsSmooth();
    for (int i = 0; i < value[0].length; ++i) {
        value[0][i] = i;/*from   w  w w.ja v a2s  . c o  m*/
        // value[1][i] = webInteractionThroughput[i];.
    }

    DefaultCategoryDataset defaultcategorydataset = new DefaultCategoryDataset();
    String series1 = "Basic";
    String series2 = "real";
    // String series2 = "High";

    for (int i = 0; i < value[0].length; ++i) {
        defaultcategorydataset.addValue(value[1][i], series1, new Integer((int) value[0][i]));
        defaultcategorydataset.addValue(webInteractionThroughput[0][i], series2,
                new Integer((int) value[0][i]));
    }

    JFreeChart chart = ChartFactory.createLineChart("WIPS = " + WIPS, "time", "WIPS", defaultcategorydataset,
            PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(Color.white);
    CategoryPlot categoryplot = (CategoryPlot) chart.getPlot();
    categoryplot.setBackgroundPaint(Color.WHITE);
    categoryplot.setRangeGridlinePaint(Color.white);
    NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis();
    numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    numberaxis.setAutoRangeIncludesZero(true);
    LineAndShapeRenderer lineandshaperenderer = (LineAndShapeRenderer) categoryplot.getRenderer();
    lineandshaperenderer.setShapesVisible(false);
    lineandshaperenderer.setSeriesStroke(0, new BasicStroke(2.0F, 1, 1, 1.0F, new float[] { 1F, 1F }, 0.0F));
    lineandshaperenderer.setSeriesFillPaint(0, Color.BLACK);
    lineandshaperenderer.setSeriesStroke(1,
            new BasicStroke(2.0F, 1, 0, 2.0F, new float[] { 1F, 10000F }, 0.0F));
    lineandshaperenderer.setSeriesFillPaint(0, Color.darkGray);
    return new ChartPanel(chart);
}

From source file:org.pentaho.reporting.engine.classic.demo.ancient.demo.layouts.BandInBandStackingDemoHandler.java

/**
 * Create a report with a single report header band. This band contains several sub bands.
 *
 * @return the created report.//from ww w .  j a  v a  2s  .  c  o m
 */
public MasterReport createReport() {
    final Band levelA1 = createBand("A1", Color.magenta, 0, 0, 100, 100);
    levelA1.addElement(createBand("A1-B1", Color.blue, 0, 50, 50, 50));
    levelA1.addElement(createBand("A1-B2", Color.yellow, 50, 0, 150, 50));
    // x=55%, y=5%, width=40%, height=100%
    final Band levelA2 = createBand("A2", Color.green, -50, 0, -50, -100);
    // x=5%, y=55%, width=40%, height=40%
    levelA2.addElement(createBand("A2-B1", Color.red, 0, -50, -50, -50));
    // x=55%, y=5%, width=40%, height=40%
    levelA2.addElement(createBand("A2-B2", Color.darkGray, -55, -5, -40, -40));

    final ReportHeader header = new ReportHeader();
    header.setName("Report-Header");
    header.getStyle().setStyleProperty(ElementStyleKeys.MIN_WIDTH, new Float(-100));
    header.getStyle().setStyleProperty(ElementStyleKeys.MIN_HEIGHT, new Float(100));
    header.getStyle().setStyleProperty(ElementStyleKeys.MAX_WIDTH, new Float(Short.MAX_VALUE));
    header.getStyle().setStyleProperty(ElementStyleKeys.MAX_HEIGHT, new Float(100));

    header.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, Color.ORANGE);

    header.addElement(levelA1);
    header.addElement(levelA2);

    final ContentFieldElementFactory cfef = new ContentFieldElementFactory();
    cfef.setFieldname("CreateComponent");
    cfef.setMinimumSize(new FloatDimension(400, 400));
    cfef.setAbsolutePosition(new Point2D.Float(0, 0));

    final ReportFooter footer = new ReportFooter();
    footer.addElement(cfef.createElement());

    final MasterReport report = new MasterReport();
    report.setReportHeader(header);
    report.setReportFooter(footer);
    report.setName("Band in Band stacking");

    report.addExpression(new ComplexComponentExpression("CreateComponent"));
    return report;
}

From source file:MWC.GUI.JFreeChart.StepperXYPlot.java

/**
 * draw the new stepper line into the plot
 * /*  w  ww . j a va  2s .  c om*/
 * @param g2
 * @param linePosition
 * @param dataArea
 */
protected void plotStepperLine(final Graphics2D g2, final double linePosition, final Rectangle2D dataArea) {
    // prepare to draw
    final Stroke oldStroke = g2.getStroke();
    g2.setXORMode(Color.darkGray);

    // thicken up the line
    g2.setStroke(new BasicStroke(3));

    if (this.getOrientation() == PlotOrientation.VERTICAL) {
        // draw the line
        g2.drawLine((int) linePosition - 1, (int) dataArea.getY() + 1, (int) linePosition - 1,
                (int) dataArea.getY() + (int) dataArea.getHeight() - 1);
    } else {
        // draw the line
        g2.drawLine((int) dataArea.getY() + 1, (int) linePosition - 1,
                (int) dataArea.getY() + (int) dataArea.getHeight() - 1, (int) linePosition - 1);

    }

    // and restore everything
    g2.setStroke(oldStroke);
    g2.setPaintMode();
}

From source file:savant.view.swing.Savant.java

/**
 * == [[ DOCKING ]] == Components (such as frames, the Task Pane, etc.) can
 * be docked to regions of the UI/*from  w  w w  . j  a v  a2  s  .  c o  m*/
 */
private void initDocking() {

    JPanel masterPlaceholderPanel = new JPanel();
    masterPlaceholderPanel.setLayout(new BorderLayout());

    panel_main.setLayout(new BorderLayout());
    panel_main.add(masterPlaceholderPanel, BorderLayout.CENTER);

    auxDockingManager = new DefaultDockingManager(this, masterPlaceholderPanel);

    masterPlaceholderPanel.setBackground(ColourSettings.getColor(ColourKey.SPLITTER));
    auxDockingManager.setSidebarRollover(false);
    auxDockingManager.getWorkspace().setBackground(ColourSettings.getColor(ColourKey.SPLITTER));
    auxDockingManager.setInitSplitPriority(DockingManager.SPLIT_EAST_SOUTH_WEST_NORTH);

    JPanel trackPanel = new JPanel();
    trackPanel.setLayout(new BorderLayout());

    auxDockingManager.getWorkspace().add(trackPanel, BorderLayout.CENTER);

    trackDockingManager = new DefaultDockingManager(this, trackPanel);
    trackPanel.setBackground(ColourSettings.getColor(ColourKey.SPLITTER));
    trackDockingManager.getWorkspace().setBackground(ColourSettings.getColor(ColourKey.SPLITTER));
    trackDockingManager.getWorkspace().setBackground(Color.red);
    trackDockingManager.setInitNorthSplit(JideSplitPane.VERTICAL_SPLIT);

    auxDockingManager.setShowInitial(false);
    trackDockingManager.setShowInitial(false);
    auxDockingManager.loadLayoutData();
    trackDockingManager.loadLayoutData();

    rangeSelector = new RangeSelectionPanel();
    rangeSelector.setPreferredSize(new Dimension(10000, 23));
    rangeSelector.setMaximumSize(new Dimension(10000, 23));
    locationController.addListener(rangeSelector);
    rangeSelector.setVisible(false);

    ruler = new Ruler();
    ruler.setPreferredSize(new Dimension(10000, 23));
    ruler.setMaximumSize(new Dimension(10000, 23));
    ruler.setVisible(false);

    Box box2 = Box.createVerticalBox();
    box2.add(rangeSelector);
    box2.add(ruler);

    trackPanel.add(box2, BorderLayout.NORTH);

    trackBackground = new JPanel();
    trackBackground.setBackground(Color.darkGray);

    trackBackground.setLayout(new BorderLayout());

    trackDockingManager.getWorkspace().add(trackBackground);
    trackDockingManager.setAllowedDockSides(DockContext.DOCK_SIDE_HORIZONTAL);
}

From source file:com.griddynamics.jagger.reporting.chart.ChartHelper.java

public static JFreeChart createStackedAreaChart(String title, XYSeriesCollection areaData,
        XYSeriesCollection lineData, String xLabel, String yLabel, ColorTheme theme) {

    final ValueAxis xAxis = new NumberAxis(xLabel);
    final ValueAxis yAxis = new NumberAxis(yLabel);
    XYPlot mainPlot = new XYPlot();
    mainPlot.setDomainAxis(xAxis);//  w ww.  j  a  v a 2s  .  co m
    mainPlot.setRangeAxis(yAxis);

    mainPlot.setForegroundAlpha(0.9f);

    //[ stacked area
    DefaultTableXYDataset areaDs = new DefaultTableXYDataset();
    for (int i = 0; i < areaData.getSeriesCount(); i++) {
        areaDs.addSeries(areaData.getSeries(i));
    }
    XYItemRenderer stackedRenderer = new StackedXYAreaRenderer2();
    mainPlot.setDataset(areaDs);
    mainPlot.setRenderer(stackedRenderer);

    Color[] colors = generateJetSpectrum(areaData.getSeriesCount());
    for (int i = 0; i < areaData.getSeriesCount(); i++) {
        stackedRenderer.setSeriesPaint(i, colors[i]);
    }
    //]

    //[ lines
    if (lineData != null) {
        XYItemRenderer lineRenderer = new StandardXYItemRenderer();
        DefaultTableXYDataset lineDs = new DefaultTableXYDataset();
        for (int i = 0; i < lineData.getSeriesCount(); i++) {
            lineDs.addSeries(lineData.getSeries(i));
        }
        mainPlot.setDataset(1, lineDs);
        mainPlot.setRenderer(1, lineRenderer);

        colors = new Color[] { Color.black, Color.red, Color.darkGray };
        for (int i = 0; i < lineData.getSeriesCount(); i++) {
            lineRenderer.setSeriesPaint(i, colors[i % colors.length]);
            lineRenderer.setSeriesStroke(i, new BasicStroke(2f));
        }
    }
    //]

    mainPlot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);

    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, mainPlot, true);

    formatColorTheme(chart, theme);

    return chart;
}