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:netplot.DialPlotPanel.java

public void init() {
    finalize();//w  w  w .  j a  v a  2  s . c  o  m
    this.dataset1 = new DefaultValueDataset(10.0);
    this.dataset2 = new DefaultValueDataset(50.0);

    // get data for diagrams
    plot = new DialPlot();
    plot.setView(0.0, 0.0, 1.0, 1.0);
    plot.setDataset(0, this.dataset1);
    plot.setDataset(1, this.dataset2);
    StandardDialFrame dialFrame = new StandardDialFrame();
    dialFrame.setBackgroundPaint(Color.lightGray);
    dialFrame.setForegroundPaint(Color.darkGray);
    plot.setDialFrame(dialFrame);

    GradientPaint gp = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(),
            new Color(170, 170, 220));
    DialBackground db = new DialBackground(gp);
    db.setGradientPaintTransformer(new StandardGradientPaintTransformer(GradientPaintTransformType.VERTICAL));
    plot.setBackground(db);

    DialCap cap = new DialCap();
    cap.setRadius(0.10);
    plot.setCap(cap);

    chart = new JFreeChart(plot);
    ChartPanel cp1 = new ChartPanel(chart);
    cp1.setPreferredSize(new Dimension(400, 400));

    add(cp1);
}

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

/**
 * Creates the MeterChart .//from  w w  w . ja  va 2s  .  com
 * 
 * @return A MeterChart .
 */
public JFreeChart createChart() {
    logger.debug("IN");
    if (dataset == null) {
        logger.debug("The dataset to be represented is null");
        return null;
    }
    MeterPlot plot = new MeterPlot((ValueDataset) dataset);
    logger.debug("Created new plot");
    plot.setRange(new Range(lower, upper));
    logger.debug("Setted plot range");

    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()));
        logger.debug("Added new interval to the plot");
    }

    plot.setNeedlePaint(Color.darkGray);
    plot.setDialBackgroundPaint(Color.white);
    plot.setDialOutlinePaint(Color.gray);
    plot.setDialShape(DialShape.CHORD);
    plot.setMeterAngle(260);
    plot.setTickLabelsVisible(true);
    Font f = new Font("Arial", Font.PLAIN, 11);
    plot.setTickLabelFont(f);
    plot.setTickLabelPaint(Color.darkGray);
    plot.setTickSize(5.0);
    plot.setTickPaint(Color.lightGray);
    plot.setValuePaint(Color.black);
    plot.setValueFont(new Font("Arial", Font.PLAIN, 14));
    logger.debug("Setted all properties of the plot");

    JFreeChart chart = new JFreeChart(name, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    logger.debug("Created the chart");
    chart.setBackgroundPaint(color);
    logger.debug("Setted background color of the chart");

    TextTitle title = setStyleTitle(name, styleTitle);
    chart.setTitle(title);
    logger.debug("Setted the title of the chart");
    if (subName != null && !subName.equals("")) {
        TextTitle subTitle = setStyleTitle(subName, styleSubTitle);
        chart.addSubtitle(subTitle);
        logger.debug("Setted the subtitle of the chart");
    }
    logger.debug("OUT");
    return chart;
}

From source file:Clock.java

public void paint(Graphics g) {
    int xhour, yhour, xminute, yminute, xsecond, ysecond, second, minute, hour;
    drawStructure(g);//from w  w  w  .j a v a  2s.  c om

    currentDate = new Date();

    formatter.applyPattern("s");
    second = Integer.parseInt(formatter.format(currentDate));
    formatter.applyPattern("m");
    minute = Integer.parseInt(formatter.format(currentDate));

    formatter.applyPattern("h");
    hour = Integer.parseInt(formatter.format(currentDate));

    xsecond = (int) (Math.cos(second * 3.14f / 30 - 3.14f / 2) * 45 + xcenter);
    ysecond = (int) (Math.sin(second * 3.14f / 30 - 3.14f / 2) * 45 + ycenter);
    xminute = (int) (Math.cos(minute * 3.14f / 30 - 3.14f / 2) * 40 + xcenter);
    yminute = (int) (Math.sin(minute * 3.14f / 30 - 3.14f / 2) * 40 + ycenter);
    xhour = (int) (Math.cos((hour * 30 + minute / 2) * 3.14f / 180 - 3.14f / 2) * 30 + xcenter);
    yhour = (int) (Math.sin((hour * 30 + minute / 2) * 3.14f / 180 - 3.14f / 2) * 30 + ycenter);

    // Erase if necessary, and redraw
    g.setColor(Color.lightGray);
    if (xsecond != lastxs || ysecond != lastys) {
        g.drawLine(xcenter, ycenter, lastxs, lastys);
    }
    if (xminute != lastxm || yminute != lastym) {
        g.drawLine(xcenter, ycenter - 1, lastxm, lastym);
        g.drawLine(xcenter - 1, ycenter, lastxm, lastym);
    }
    if (xhour != lastxh || yhour != lastyh) {
        g.drawLine(xcenter, ycenter - 1, lastxh, lastyh);
        g.drawLine(xcenter - 1, ycenter, lastxh, lastyh);
    }

    g.setColor(Color.darkGray);
    g.drawLine(xcenter, ycenter, xsecond, ysecond);

    g.setColor(Color.red);
    g.drawLine(xcenter, ycenter - 1, xminute, yminute);
    g.drawLine(xcenter - 1, ycenter, xminute, yminute);
    g.drawLine(xcenter, ycenter - 1, xhour, yhour);
    g.drawLine(xcenter - 1, ycenter, xhour, yhour);
    lastxs = xsecond;
    lastys = ysecond;
    lastxm = xminute;
    lastym = yminute;
    lastxh = xhour;
    lastyh = yhour;
}

From source file:be.ac.ua.comp.scarletnebula.gui.DecoratedGraph.java

/**
 * @see Graph//  ww  w.j  a v  a2 s. c  om
 */
@Override
public ChartPanel getChartPanel() {
    final XYPlot plot = new XYPlot(dataset, domain, range, renderer);
    plot.setBackgroundPaint(Color.darkGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    // plot.setInsets(new RectangleInsets(0, 0, 0, 0));
    plot.setDomainGridlinesVisible(true);
    plot.setRangeGridlinesVisible(true);

    if (stream.getMax() != null) {
        log.info("Getting chart panel for stream with maximum.");
        range.setAutoRange(false);

        range.setTickUnit(new NumberTickUnit(stream.getMax() / 10, new DecimalFormat(), 1));
        range.setRange(0, stream.getMax());
    } else if (stream.getType() == Type.RELATIVE) {
        range.setAutoRange(false);

        range.setTickUnit(new NumberTickUnit(0.1, new DecimalFormat(), 1));
        range.setRange(0, 1);
    } else {
        double sum = 0;
        final List<TimedDatapoint> datapoints = stream.getRecentlyProcessedDatapoints();

        range.setTickUnit(
                new NumberTickUnit((int) (Utils.max(datapoints).getValue() / 5) + 1, new DecimalFormat(), 1));
    }

    final JFreeChart chart = new JFreeChart(stream.getStreamname(), new Font("SansSerif", Font.PLAIN, 20), plot,
            true);
    chart.setBackgroundPaint(Color.white);
    chart.removeLegend();
    final ChartPanel chartPanel = new ChartPanel(chart);
    // chartPanel.setBorder(BorderFactory
    // .createBevelBorder(BevelBorder.LOWERED));

    return chartPanel;
}

From source file:graficarordenamiento.Graficador.java

public void crearGrafico() {
    // Creando el Grafico
    chart = ChartFactory.createBarChart("Grfico de barras", null, null, dataset, PlotOrientation.VERTICAL,
            false, false, false);//from   www .  j  ava  2s.  c o m

    chart.setBackgroundPaint(new GradientPaint(0, 0, Color.WHITE, 700, 0, Color.BLACK.brighter(), false));
    chart.setBackgroundImageAlpha(0.5f);
    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setNoDataMessage("NO DATA!");
    plot.setRangeGridlinePaint(Color.red);
    plot.setBackgroundPaint(new GradientPaint(0, 0, Color.LIGHT_GRAY, 0, 100, Color.darkGray));
    plot.setBackgroundImageAlpha(0.5f);
    //plot.setDomainGridlinesVisible(true);

    BarRenderer rend = (BarRenderer) plot.getRenderer();

    final ItemLabelPosition e = new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER,
            TextAnchor.CENTER, 45.0);

    GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, new Color(0, 0, 64));
    GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, new Color(0, 64, 0));
    GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, new Color(64, 0, 0));

    rend.setSeriesPaint(0, gp0);
    rend.setSeriesPaint(1, gp1);
    rend.setSeriesPaint(2, gp2);
    plot.setRenderer(rend);

    // change the margin at the top of the range axis...
    final ValueAxis rangeAxis = plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    rangeAxis.setLowerMargin(0.15);
    rangeAxis.setUpperMargin(0.15);

    // set up gradient paints for series...

}

From source file:it.eng.spagobi.engines.kpi.bo.charttypes.dialcharts.SimpleDial.java

/**
 * Creates the chart .//from w  w w .  j a v  a2  s.co  m
 * 
 * @return A Simple Dial chart .
 */
public JFreeChart createChart() {
    logger.debug("IN");

    if (dataset == null) {
        logger.debug("The dataset to be represented is null");
        return null;
    }

    DialPlot plot = new DialPlot();
    plot.setDataset((ValueDataset) dataset);
    logger.debug("Created the new Dial Plot");

    ArcDialFrame dialFrame = null;
    plot.setView(0.21, 0.0, 0.58, 0.30);
    dialFrame = new ArcDialFrame(60.0, 60.0);
    dialFrame.setInnerRadius(0.65);
    dialFrame.setOuterRadius(0.90);
    dialFrame.setForegroundPaint(Color.darkGray);
    dialFrame.setStroke(new BasicStroke(3.0f));
    plot.setDialFrame(dialFrame);

    GradientPaint gp = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(),
            new Color(240, 240, 240));
    DialBackground sdb = new DialBackground(gp);

    GradientPaintTransformType gradientPaintTransformType = GradientPaintTransformType.HORIZONTAL;

    sdb.setGradientPaintTransformer(new StandardGradientPaintTransformer(gradientPaintTransformType));
    plot.addLayer(sdb);

    increment = (upper - lower) / 4;
    StandardDialScale scale = null;
    scale = new StandardDialScale(lower, upper, 115.0, -50.0, increment, minorTickCount);

    // sets intervals
    for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
        KpiInterval interval = (KpiInterval) iterator.next();
        StandardDialRange range = new StandardDialRange(interval.getMin(), interval.getMax(),
                interval.getColor());
        range.setInnerRadius(0.70);
        range.setOuterRadius(0.75);
        plot.addLayer(range);

    }

    scale.setTickRadius(0.88);
    scale.setTickLabelOffset(0.07);
    Font f = new Font("Arial", Font.PLAIN, 11);
    scale.setTickLabelFont(f);
    //scale.setMajorTickIncrement(25.0);
    plot.addScale(0, scale);

    DialPointer needle = new DialPointer.Pin();
    needle.setRadius(0.82);
    plot.addLayer(needle);

    JFreeChart chart1 = new JFreeChart(plot);
    logger.debug("Created the chart");
    chart1.setBackgroundPaint(color);
    logger.debug("Setted background color of the chart");

    TextTitle title = setStyleTitle(name, styleTitle);
    chart1.setTitle(title);
    logger.debug("Setted the title of the chart");
    if (subName != null && !subName.equals("")) {
        TextTitle subTitle = setStyleTitle(subName, styleSubTitle);
        chart1.addSubtitle(subTitle);
        logger.debug("Setted the subtitle of the chart");
    }

    logger.debug("OUT");
    return chart1;
}

From source file:org.esa.nest.dat.views.polarview.Axis.java

public Axis(int orientation) {

    font = getFont("default.font.plot.axis.tick", "SansSerif-plain-12");
    titleFont = getFont("default.font.plot.axis.title", "SansSerif-plain-12");
    axisColor = Color.black;//from   ww w . j  a va 2 s  .c  om
    labelColor = Color.black;
    gridColor = Color.darkGray;
    setLocation(orientation);
}

From source file:datavis.BarGraph.java

public JFreeChart getChartPanel() {
    JFreeChart chart = ChartFactory.createBarChart(getBarGraphName(), getIntervalTypeName(),
            getNumberTypeName(), getBarGraph(), PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(Color.white);

    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.darkGray);
    plot.setDomainGridlinePaint(new Color(240, 180, 180));
    plot.setRangeGridlinePaint(new Color(240, 180, 180));

    final BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setBarPainter(new StandardBarPainter());

    final GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, new Color(170, 240, 240), 0.0f, 0.0f,
            new Color(170, 240, 240));

    renderer.setSeriesPaint(0, gp0);/*from   w  ww.  j  av  a  2  s.  c  o  m*/

    final CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0));

    return chart;
}

From source file:de.dakror.villagedefense.game.entity.Entity.java

public void drawBump(Graphics2D g, boolean above) {
    if (bump == null || (!hovered && !clicked))
        return;//  w w  w .j a  va 2  s.c o m

    Color oldColor = g.getColor();
    g.setColor(clicked ? Color.black : Color.darkGray);
    if (above) {
        g.drawLine((int) x + bump.x, (int) y + bump.y, (int) x + bump.x, (int) y + bump.y + bump.height); // left
        g.drawLine((int) x + bump.x, (int) y + bump.y + bump.height, (int) x + bump.x + bump.width,
                (int) y + bump.y + bump.height); // bottom
        g.drawLine((int) x + bump.x + bump.width, (int) y + bump.y, (int) x + bump.x + bump.width,
                (int) y + bump.y + bump.height); // right
    } else {
        g.drawLine((int) x + bump.x, (int) y + bump.y, (int) x + bump.x + bump.width, (int) y + bump.y); // top
    }
    g.setColor(oldColor);
}

From source file:motordrivertxrx.View.MainView.java

/**
 * Creates new form MainView/*w  ww.j a va  2 s  .  c o m*/
 */
public MainView() {
    initComponents();

    this.dataset1 = new DefaultValueDataset(10.0);
    this.dataset2 = new DefaultValueDataset(50.0);

    // get data for diagrams
    DialPlot plot = new DialPlot();
    plot.setView(0.0, 0.0, 1.0, 1.0);
    plot.setDataset(0, this.dataset1);
    plot.setDataset(1, this.dataset2);
    SimpleDialFrame dialFrame = new SimpleDialFrame();
    dialFrame.setBackgroundPaint(Color.lightGray);
    dialFrame.setForegroundPaint(Color.DARK_GRAY);
    plot.setDialFrame(dialFrame);
    /*
    GradientPaint gp = new GradientPaint(new Point(), 
        new Color(255, 255, 255), new Point(), 
        new Color(170, 170, 220));
    */
    GradientPaint gp = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(), Color.ORANGE);

    DialBackground db = new DialBackground(gp);
    db.setGradientPaintTransformer(
            new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_HORIZONTAL));
    plot.setBackground(db);

    DialTextAnnotation annotation1 = new DialTextAnnotation("Velocidad");
    annotation1.setFont(new Font("Dialog", Font.BOLD, 14));
    annotation1.setRadius(0.7);

    plot.addLayer(annotation1);

    DialValueIndicator dvi = new DialValueIndicator(0, "c");
    dvi.setFont(new Font("Dialog", Font.PLAIN, 10));
    dvi.setOutlinePaint(Color.darkGray);
    dvi.setRadius(0.60);
    dvi.setAngle(-103.0);
    plot.addLayer(dvi);

    DialValueIndicator dvi2 = new DialValueIndicator(1, "c");
    dvi2.setFont(new Font("Dialog", Font.PLAIN, 10));
    dvi2.setOutlinePaint(Color.red);
    dvi2.setRadius(0.60);
    dvi2.setAngle(-77.0);
    plot.addLayer(dvi2);

    StandardDialScale scale = new StandardDialScale(0, 127, -120, -300);
    scale.setTickRadius(0.88);
    scale.setTickLabelOffset(0.15);
    scale.setTickLabelFont(new Font("Dialog", Font.PLAIN, 14));
    plot.addScale(0, scale);

    StandardDialScale scale2 = new StandardDialScale(0, 100, -120, -300);
    scale2.setTickRadius(0.50);
    scale2.setTickLabelOffset(0.15);
    scale2.setTickLabelFont(new Font("Dialog", Font.PLAIN, 10));
    scale2.setMajorTickPaint(Color.red);
    plot.addScale(1, scale2);
    plot.mapDatasetToScale(1, 1);

    DialPointer needle2 = new DialPointer.Pin(1);
    needle2.setRadius(0.55);
    plot.addLayer(needle2);

    DialPointer needle = new DialPointer.Pointer(0);
    plot.addLayer(needle);

    DialCap cap = new DialCap();
    cap.setRadius(0.10);
    plot.setCap(cap);

    JFreeChart chart1 = new JFreeChart(plot);
    chart1.setTitle("Velocidad motor");
    ChartPanel cp1 = new ChartPanel(chart1);
    cp1.setPreferredSize(new Dimension(400, 400));

    /*JPanel sliderPanel = new JPanel(new GridLayout(2, 2));
    sliderPanel.add(new JLabel("Outer Needle:"));
    sliderPanel.add(new JLabel("Inner Needle:"));
    this.slider1 = new JSlider(-40, 60);
    this.slider1.setMajorTickSpacing(20);
    this.slider1.setPaintTicks(true);
    this.slider1.setPaintLabels(true);
    this.slider1.addChangeListener(this);
    sliderPanel.add(this.slider1);
    sliderPanel.add(this.slider1);
    this.slider2 = new JSlider(0, 100);
    this.slider2.setMajorTickSpacing(20);
    this.slider2.setPaintTicks(true);
    this.slider2.setPaintLabels(true);
    this.slider2.addChangeListener(this);
    sliderPanel.add(this.slider2);*/

    velocimetroPanel.add(cp1);

}