Example usage for java.awt Color DARK_GRAY

List of usage examples for java.awt Color DARK_GRAY

Introduction

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

Prototype

Color DARK_GRAY

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

Click Source Link

Document

The color dark gray.

Usage

From source file:uk.org.rbc1b.roms.controller.volunteer.VolunteerBadgePdfView.java

/**
 * Adds the RBC Region's title (e.g. London and the Home Counties) to the
 * bottom of the badge./*from  ww w  .ja  v  a2  s. c  om*/
 *
 * @param content to be added
 * @param rbcRegion RBC region
 */
private static void addRBCRegionFooter(PdfContentByte content) throws DocumentException, IOException {
    content.beginText();
    content.moveText(183, 345);

    BaseFont bf = BaseFont.createFont();
    content.setFontAndSize(bf, 9);
    content.setColorFill(Color.DARK_GRAY);
    content.showText(VolunteerBadgePdfView.BADGE_RBC_REGION);
    content.endText();
}

From source file:charts.PieChart3D.java

/**
 * Creates a chart./*from  w  w  w.j  a v  a 2s  .  c o  m*/
 *
 * @param dataset
 *            the dataset.
 *
 * @return A chart.
 */
private static JFreeChart createChart(PieDataset dataset, PieChartModel model) {

    JFreeChart chart = ChartFactory.createPieChart(model.getTitle(), // chart
            // title
            dataset, // data
            false, // no legend
            true, // tooltips
            false // no URL generation
    );

    // set a custom background for the chart
    chart.setBackgroundPaint(
            new GradientPaint(new Point(0, 0), new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY));

    // customise the title position and font
    TextTitle t = chart.getTitle();
    t.setHorizontalAlignment(HorizontalAlignment.LEFT);
    t.setPaint(new Color(240, 240, 240));
    t.setFont(new Font("Arial", Font.BOLD, 26));

    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setBackgroundPaint(null);
    plot.setInteriorGap(0.04);
    plot.setOutlineVisible(false);

    // use gradients and white borders for the section colours
    plot.setSectionPaint("FCA", createGradientPaint(new Color(200, 200, 255), Color.BLUE));
    plot.setSectionPaint("FCH", createGradientPaint(new Color(255, 200, 200), Color.RED));
    plot.setSectionPaint("FCS", createGradientPaint(new Color(200, 255, 200), Color.GREEN));
    plot.setSectionPaint("FCG", createGradientPaint(new Color(200, 255, 200), Color.YELLOW));
    plot.setSectionPaint("FCJ", createGradientPaint(new Color(200, 255, 200), Color.BLACK));
    plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} {1} ({2}) "));
    plot.setBaseSectionOutlinePaint(Color.WHITE);
    plot.setSectionOutlinesVisible(true);
    plot.setBaseSectionOutlineStroke(new BasicStroke(2.0f));

    // customise the section label appearance
    plot.setLabelFont(new Font("Courier New", Font.BOLD, 20));
    plot.setLabelLinkPaint(Color.WHITE);
    plot.setLabelLinkStroke(new BasicStroke(2.0f));
    plot.setLabelOutlineStroke(null);
    plot.setLabelPaint(Color.WHITE);
    plot.setLabelBackgroundPaint(null);

    // add a subtitle giving the data source
    TextTitle source = new TextTitle(model.getSubTitle(), new Font("Courier New", Font.PLAIN, 12));
    source.setPaint(Color.WHITE);
    source.setPosition(RectangleEdge.BOTTOM);
    source.setHorizontalAlignment(HorizontalAlignment.RIGHT);
    chart.addSubtitle(source);
    return chart;

}

From source file:RMOS.PieChart.java

/**
 * Creates a chart.// ww w .  jav a  2  s.  com
 *
 * @param dataset  the dataset.
 *
 * @return A chart.
 */
private static JFreeChart createChart(PieDataset dataset) {

    JFreeChart chart = ChartFactory.createPieChart("Eco Systems Statistics", // chart title
            dataset, // data
            false, // no legend
            true, // tooltips
            false // no URL generation
    );

    // set a custom background for the chart
    chart.setBackgroundPaint(
            new GradientPaint(new Point(0, 0), new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY));

    // customise the title position and font
    TextTitle t = chart.getTitle();
    t.setHorizontalAlignment(HorizontalAlignment.LEFT);
    t.setPaint(new Color(240, 240, 240));
    t.setFont(new Font("Arial", Font.BOLD, 26));

    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setBackgroundPaint(null);
    plot.setInteriorGap(0.04);
    plot.setOutlineVisible(false);

    plot.setSectionPaint(f1.getStationInGroup().get(1), Color.blue);
    plot.setSectionPaint(f1.getStationInGroup().get(1), Color.GREEN);

    // use gradients and white borders for the section colours
    /*plot.setSectionPaint("Others", createGradientPaint(new Color(200, 200, 255), Color.BLUE));
    plot.setSectionPaint("Samsung", createGradientPaint(new Color(255, 200, 200), Color.RED));
    plot.setSectionPaint("Apple", createGradientPaint(new Color(200, 255, 200), Color.GREEN));
    plot.setSectionPaint("Nokia", createGradientPaint(new Color(200, 255, 200), Color.YELLOW));*/
    plot.setBaseSectionOutlinePaint(Color.WHITE);
    plot.setSectionOutlinesVisible(true);
    plot.setBaseSectionOutlineStroke(new BasicStroke(2.0f));

    // customise the section label appearance
    plot.setLabelFont(new Font("Courier New", Font.BOLD, 20));
    plot.setLabelLinkPaint(Color.WHITE);
    plot.setLabelLinkStroke(new BasicStroke(2.0f));
    plot.setLabelOutlineStroke(null);
    plot.setLabelPaint(Color.WHITE);
    plot.setLabelBackgroundPaint(null);

    // add a subtitle giving the data source
    TextTitle source = new TextTitle("Source: Eco Recycle Station", new Font("Courier New", Font.PLAIN, 12));
    source.setPaint(Color.WHITE);
    source.setPosition(RectangleEdge.BOTTOM);
    source.setHorizontalAlignment(HorizontalAlignment.RIGHT);
    chart.addSubtitle(source);
    return chart;

}

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

/**
 * Create command bar//from www  .j  av a 2  s .c om
 */
FrameCommandBar(Frame f) {
    frame = f;
    graphPane = (GraphPane) f.getGraphPane();
    mainTrack = (Track) f.getTracks()[0];
    setMinimumSize(new Dimension(50, 22));
    setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));

    // TODO: Should we really be doing BAM-specific stuff in this class?
    JMenu toolsMenu = createToolsMenu();
    add(toolsMenu);

    if (mainTrack.getValidDrawingModes().length > 1) {
        JMenu modeMenu = createDisplayModeMenu();
        add(modeMenu);
    }

    JMenu appearanceMenu = createAppearanceMenu();
    add(appearanceMenu);

    DataFormat df = mainTrack.getDataFormat();
    if (df == DataFormat.ALIGNMENT || df == DataFormat.GENERIC_INTERVAL || df == DataFormat.RICH_INTERVAL) {
        intervalMenu = createIntervalMenu();
        add(intervalMenu);

        drawModeChanged(mainTrack.getDrawingMode());
        int h = getIntervalHeight();
        graphPane.setUnitHeight(h);
        graphPane.setScaledToFit(false);
    }
}

From source file:org.polymap.core.style.geotools.DefaultStyles.java

/**
 * Create a Style to draw polygon features with a thin blue outline and
 * a cyan fill//from   w  w  w .j  av a2s. c  o  m
 */
private Style createPolygonStyle(Style style) {

    // create a partially opaque outline stroke
    Stroke stroke = styleFactory.createStroke(filterFactory.literal(Color.DARK_GRAY),
            filterFactory.literal(0.5), filterFactory.literal(0.5));

    // create a partial opaque fill
    Fill fill = styleFactory.createFill(filterFactory.literal(Color.CYAN), filterFactory.literal(0.5));

    /*
     * Setting the geometryPropertyName arg to null signals that we want to
     * draw the default geometry of features
     */
    PolygonSymbolizer sym = styleFactory.createPolygonSymbolizer(stroke, fill, null);

    Rule rule = styleFactory.createRule();

    rule.setName("Rule for PolygonSymbolizer");
    rule.symbolizers().add(sym);

    style.featureTypeStyles().get(0).rules().add(rule);

    return style;
}

From source file:uk.co.modularaudio.service.bufferedimageallocation.impl.debugwindow.imagebrowser.RawImageCanvas.java

@Override
public void paint(final Graphics rawG) {
    final Graphics2D g = (Graphics2D) rawG;
    g.getClipBounds(clipBounds);//from   w w  w  .  j  a va2 s. com

    if (curBufferedImage != null) {
        g.setComposite(opaqueComposite);
        g.setColor(Color.DARK_GRAY);
        g.fillRect(0, 0, width, height);
        g.drawImage(curBufferedImage, 0, 0, null);

        // Draw the free blocks over the top
        // We draw 50 transparent fill then outline with full yellow
        g.setColor(DARK_BLUE);
        g.setComposite(ninetyPercentAlphaComposite);
        //         g.setComposite( fiftyPercentAlphaComposite );
        //         g.setComposite( tenPercentAlphaComposite );
        for (final Rectangle freeBlockRectangle : freeBlockRectangles) {
            g.fillRect(freeBlockRectangle.x, freeBlockRectangle.y, freeBlockRectangle.width,
                    freeBlockRectangle.height);
        }

        g.setColor(Color.yellow);
        g.setComposite(opaqueComposite);
        for (final Rectangle freeBlockRectangle : freeBlockRectangles) {
            g.drawRect(freeBlockRectangle.x, freeBlockRectangle.y, freeBlockRectangle.width,
                    freeBlockRectangle.height);
        }

        g.setComposite(opaqueComposite);
        g.setColor(Color.RED);
        for (final Rectangle usedBlockRectangle : usedBlockRectangles) {
            g.drawRect(usedBlockRectangle.x, usedBlockRectangle.y, usedBlockRectangle.width,
                    usedBlockRectangle.height);
        }
    } else {
        g.setColor(Color.gray);
        g.fillRect(0, 0, width, height);
    }
}

From source file:common.AbstractGUI.java

protected void createLogPanel() {
    logPanel = new JPanel();
    logPanel.setLayout(new BoxLayout(logPanel, BoxLayout.Y_AXIS));

    logTextArea = new JTextArea(33, 30);
    logTextArea.setEditable(false);/*from  www .  ja v  a2s  .c  o m*/
    logTextArea.setAutoscrolls(true);
    logTextArea.setFont(new Font("Courier New", Font.PLAIN, 11));
    logTextArea.setBackground(Color.DARK_GRAY);
    logTextArea.setForeground(Color.GREEN);
    logTextArea.addMouseListener(logTextAreaMouseListener);

    scrollPane = new JScrollPane(logTextArea);

    Box horizontalLayout = Box.createHorizontalBox();
    filterTxt = new JTextField();
    filterBtn = new JButton("Filter");
    filterBtn.addActionListener(filterActionListner);
    filterTxt.setMaximumSize(new Dimension(250, 30));
    horizontalLayout.add(filterTxt);
    horizontalLayout.add(filterBtn);
    logPanel.add(horizontalLayout);
    logPanel.add(scrollPane);
    tabbedPane.addTab("Log", logPanel);
}

From source file:playground.sergioo.workplaceCapacities2012.gui.ClustersPanel.java

public ClustersPanel(ClustersWindow window, List<CentroidCluster<PointPerson>> clusters) {
    super();//w w  w.j  a  va2s.c  o  m
    this.window = window;
    addLayer(new Layer(new AxisPainter(24 * 3600, 18 * 3600, 0, 6 * 3600, 3600, 3600, Color.DARK_GRAY)));
    PointsPainter pointsPainter = new PointsPainter();
    float i = 0;
    for (org.apache.commons.math3.ml.clustering.Cluster<PointPerson> cluster : clusters) {
        //Color color = new Color((float)(Math.random()*0.5), (float)(Math.random()*0.5), (float)(Math.random()*0.5), 0.3f);
        float p = (i + 0.5f) / clusters.size();
        Color color = JetColor.getJetColor(p);
        color = new Color(color.getRed(), color.getGreen(), color.getBlue(), 50);
        PointsPersonPainter ppPainter = new PointsPersonPainter(color);
        ppPainter.setWeightedPoints(cluster.getPoints());
        addLayer(new Layer(ppPainter));
        PointPerson center = cluster.getPoints().get(0).centroidOf(cluster.getPoints());
        pointsPainter.addPoint(new CoordImpl(center.getElement(0), center.getElement(1)));
        i++;
    }
    addLayer(new Layer(pointsPainter));
    this.setBackground(Color.WHITE);
    calculateBoundaries();
    super.setPreferredSize(Toolkit.getDefaultToolkit().getScreenSize().width,
            Toolkit.getDefaultToolkit().getScreenSize().height);
    addMouseListener(this);
    addMouseMotionListener(this);
    addMouseWheelListener(this);
    addKeyListener(this);
    setFocusable(true);
}

From source file:de.tud.kom.p2psim.impl.skynet.visualization.MetricsPlot.java

private void createChartPanel(String title, long time) {
    YIntervalSeriesCollection dataset = new YIntervalSeriesCollection();
    chart = ChartFactory.createTimeSeriesChart(title, X_AXIS_TITLE, "", dataset, true, true, true);
    XYPlot plot = (XYPlot) chart.getPlot();

    DeviationRenderer errorRenderer = new DeviationRenderer();
    errorRenderer.setShapesVisible(false);
    errorRenderer.setLinesVisible(true);
    errorRenderer.setAlpha(0.0f);//  w  w w. j a  va  2  s  .  c o m
    // errorRenderer.setDrawYError(false);
    // errorRenderer.setDrawXError(false);
    plot.setRenderer(errorRenderer);

    plot.setBackgroundPaint(Color.WHITE);
    plot.setRangeGridlinePaint(Color.DARK_GRAY);
    plot.setDomainGridlinePaint(Color.DARK_GRAY);
    upperDomainBound = (time / 1000) + ((interval - 1) * step / 1000);
    DateAxis domain = (DateAxis) plot.getDomainAxis();
    domain.setAutoRange(false);
    domain.setRange((time / 1000), upperDomainBound);
    RelativeDateFormat rdf = new RelativeDateFormat();
    rdf.setHourSuffix(":");
    rdf.setMinuteSuffix(":");
    rdf.setSecondSuffix("");
    rdf.setSecondFormatter(new DecimalFormat("0"));
    domain.setDateFormatOverride(rdf);
    plot.setDomainAxis(domain);
    plotPanel = new ChartPanel(chart, true);
    setSizeOfComponent(plotPanel, new Dimension(plotWidth, plotHeight));
    container.add(plotPanel, BorderLayout.CENTER);
    container.add(createRadioBoxes(visType == VisualizationType.Metric), BorderLayout.SOUTH);
    setSizeOfComponent(container, new Dimension(plotWidth, plotHeight + boxOffset));
}

From source file:edu.ku.brc.specify.plugins.ipadexporter.ChartHelper.java

/**
 * @param list/*from   w ww.  j av  a 2s .co m*/
 * @param title
 * @param xAxisTitle
 * @param yAxisTitle
 * @param isVertical
 * @param width
 * @param height
 */
public JFreeChart createLineChart(final List<Object> list, final String title, final String xAxisTitle,
        final String yAxisTitle, final boolean isVertical, final int width, final int height) {
    DefaultCategoryDataset catDataSet = new DefaultCategoryDataset();
    for (int i = 0; i < list.size(); i++) {
        Object xVal = list.get(i++);
        Object yVal = list.get(i);

        double xv = getDbl(xVal);
        numMin = Math.min(numMin, xv);
        numMax = Math.max(numMax, xv);

        catDataSet.addValue(getDbl(yVal), "X", xVal.toString());
    }

    /*XYDataset dataset = createXYDataSet(list);
    JFreeChart chart = ChartFactory.createXYLineChart( 
        title,      // chart title 
        xAxisTitle, // domain axis label 
        yAxisTitle, // range axis label 
        dataset,    // data 
        isVertical ? PlotOrientation.VERTICAL : PlotOrientation.HORIZONTAL, 
        false,       // include legend 
        true,       // tooltips? 
        false       // URLs? 
    ); 
            
    XYPlot xyplot = chart.getXYPlot();
    NumberAxis numberAxis = (NumberAxis) xyplot.getDomainAxis();
    numberAxis.setRange(numMin, numMax);
            
    //ValueAxis axis = xyplot.getDomainAxis();
    //axis = xyplot.getRangeAxis();
    //((NumberAxis) axis).setTickUnit(new NumberTickUnit(1));
    //axis.setRange(1870,2010);*/

    /*
    JFreeChart jfreechart = ChartFactory.createLineChart3D(
        title, 
        xAxisTitle, 
        yAxisTitle, 
        catDataSet, 
        PlotOrientation.VERTICAL, 
        false, 
        true, 
        false);
    jfreechart.setBackgroundPaint(new Color(187, 187, 221));
    CategoryPlot categoryplot = (CategoryPlot)jfreechart.getPlot();
            
    NumberAxis numberaxis = (NumberAxis)categoryplot.getRangeAxis();
    numberaxis.setAutoRangeIncludesZero(false);
    numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
            
    CategoryItemRenderer renderer = categoryplot.getRenderer(); 
    renderer.setSeriesPaint(0, new Color(95, 158, 160)); 
    renderer.setSeriesOutlinePaint(0, Color.DARK_GRAY); 
    */
    JFreeChart jfreechart = ChartFactory.createLineChart(title, xAxisTitle, yAxisTitle, catDataSet,
            PlotOrientation.VERTICAL, false, true, false);

    CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
    categoryplot.setRangeGridlinePaint(Color.DARK_GRAY);
    categoryplot.setBackgroundPaint(null);

    NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis();
    numberaxis.setAutoRangeIncludesZero(false);
    numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    CategoryItemRenderer renderer = categoryplot.getRenderer();
    renderer.setSeriesPaint(0, new Color(95, 158, 160));
    renderer.setSeriesOutlinePaint(0, Color.DARK_GRAY);

    BasicStroke lineStroke = new BasicStroke(3.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
    renderer.setBaseStroke(lineStroke);
    renderer.setBaseOutlineStroke(lineStroke);
    renderer.setSeriesStroke(0, lineStroke);

    //renderer.setOutlineStroke(lineStroke);
    //renderer.setStroke(lineStroke);

    return jfreechart;
}