Example usage for java.awt Color LIGHT_GRAY

List of usage examples for java.awt Color LIGHT_GRAY

Introduction

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

Prototype

Color LIGHT_GRAY

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

Click Source Link

Document

The color light gray.

Usage

From source file:ChartPanelMaker.java

public static ChartPanel createChart(ArrayList<Voter> voters, ArrayList<Candidate> candidates,
        ArrayList<Candidate> committee, String title) {
    XYSeriesCollection dataset = new XYSeriesCollection();
    XYSeries comitteeDataset = new XYSeries("Committee");
    for (Candidate c : committee) {
        comitteeDataset.add(c.getX(), c.getY());
    }/*w  w  w. ja  v  a2  s  .c om*/
    dataset.addSeries(comitteeDataset);

    int n = voters.size();
    int m = candidates.size();

    int skipN = n / 150;
    if (skipN < 1) {
        skipN = 1;
    }

    int skipM = m / 150;
    if (skipM < 1) {
        skipM = 1;
    }

    Collections.sort(voters, Election.VoterNameComparator);
    Collections.sort(candidates, Election.CandidateNameComparator);

    XYSeries voterDataset = new XYSeries("Voters");
    for (int i = 0; i < n; i++) {
        Voter v = voters.get(i);
        if (i % skipN == 0) {
            voterDataset.add(v.getX(), v.getY());
        }
    }
    dataset.addSeries(voterDataset);

    XYSeries candidateDataset = new XYSeries("Candidates");
    for (int i = 0; i < m; i++) {
        Candidate c = candidates.get(i);
        if (i % skipM == 0) {
            candidateDataset.add(c.getX(), c.getY());
        }
    }
    dataset.addSeries(candidateDataset);

    Shape committeeShape = ShapeUtilities.createDiamond(5);
    Shape voterShape = ShapeUtilities.createDownTriangle(3);
    Shape candidateShape = ShapeUtilities.createUpTriangle(3);

    Color committeeColor = Color.DARK_GRAY;
    Color voterColor = Color.ORANGE;
    Color candidateColor = Color.LIGHT_GRAY;

    JFreeChart chart = ChartFactory.createScatterPlot(title, "", "", dataset, PlotOrientation.VERTICAL, true,
            true, true);
    XYPlot plot = chart.getXYPlot();
    XYItemRenderer r = plot.getRenderer();
    r.setSeriesShape(0, committeeShape);
    r.setSeriesPaint(0, committeeColor);
    r.setSeriesShape(1, voterShape);
    r.setSeriesPaint(1, voterColor);
    r.setSeriesShape(2, candidateShape);
    r.setSeriesPaint(2, candidateColor);
    ChartPanel chartPanel = new ChartPanel(chart);

    return chartPanel;
}

From source file:de.ipk_gatersleben.ag_nw.graffiti.services.GUIhelper.java

public static Component getHelpTextComponent(String plainText, String title, String helpTopic) {
    JPanel result = new JPanel();
    plainText = plainText.replaceAll("<br>", "\n");
    plainText = plainText.replaceAll("<html>", "");
    plainText = plainText.replaceAll("<small>", "");
    FolderPanel fp = new FolderPanel(title, false, false, false,
            JLabelJavaHelpLink.getHelpActionListener(helpTopic));
    JTextArea helpText = new JTextArea();
    helpText.setLineWrap(true);// w  w  w.  j a  va  2s  .c  om
    helpText.setWrapStyleWord(true);
    helpText.setText(plainText);
    helpText.setEditable(false);
    fp.addGuiComponentRow(new JLabel(""), helpText, false);
    fp.layoutRows();
    fp.setFrameColor(Color.LIGHT_GRAY, Color.WHITE, 1, 5);

    double border = 2;
    double topBorder = 12;
    double[][] size = { { border, TableLayoutConstants.FILL, border }, // Columns
            { topBorder, TableLayoutConstants.PREFERRED, border } }; // Rows
    result.setLayout(new TableLayout(size));
    result.add(fp, "1,1");
    return result;
}

From source file:com.rapidminer.gui.new_plotter.engine.jfreechart.renderer.FormattedAreaRenderer.java

@Override
public Paint getItemOutlinePaint(int seriesIdx, int valueIdx) {
    if (getFormatDelegate().isItemSelected(seriesIdx, valueIdx)) {
        return super.getItemOutlinePaint(seriesIdx, valueIdx);
    } else {//from   w w  w  .  ja  va  2s. com
        return DataStructureUtils.setColorAlpha(Color.LIGHT_GRAY, 20);
    }
}

From source file:ar.com.fdvs.dj.test.ConditionalStylesReportTest.java

public DynamicReport buildReport() throws Exception {

    Style detailStyle = new Style();
    Style headerStyle = new Style();
    headerStyle.setFont(Font.ARIAL_BIG_BOLD);
    headerStyle.setBorderBottom(Border.PEN_2_POINT);
    headerStyle.setHorizontalAlign(HorizontalAlign.CENTER);
    headerStyle.setVerticalAlign(VerticalAlign.MIDDLE);
    headerStyle.setBackgroundColor(Color.LIGHT_GRAY);
    headerStyle.setTextColor(Color.WHITE);
    headerStyle.setTransparency(Transparency.OPAQUE);

    Style titleStyle = new Style();
    titleStyle.setFont(new Font(18, Font._FONT_VERDANA, true));
    Style amountStyle = new Style();
    amountStyle.setHorizontalAlign(HorizontalAlign.RIGHT);
    Style oddRowStyle = new Style();
    oddRowStyle.setBorder(Border.NO_BORDER);
    Color veryLightGrey = new Color(230, 230, 230);
    oddRowStyle.setBackgroundColor(veryLightGrey);
    oddRowStyle.setTransparency(Transparency.OPAQUE);

    DynamicReportBuilder drb = new DynamicReportBuilder();
    Integer margin = new Integer(20);
    drb.setTitle("November 2006 sales report")
            .setSubtitle("The items in this report correspond "
                    + "to the main products: DVDs, Books, Foods and Magazines")
            .setTitleStyle(titleStyle).setTitleHeight(new Integer(30)).setSubtitleHeight(new Integer(20))
            .setDetailHeight(new Integer(15)).setLeftMargin(margin).setRightMargin(margin).setTopMargin(margin)
            .setBottomMargin(margin).setPrintBackgroundOnOddRows(true).setOddRowBackgroundStyle(oddRowStyle)
            .setColumnsPerPage(new Integer(1)).setColumnSpace(new Integer(5));

    AbstractColumn columnState = ColumnBuilder.getNew().setColumnProperty("state", String.class.getName())
            .setTitle("State").setWidth(new Integer(85)).setStyle(detailStyle).setHeaderStyle(headerStyle)
            .build();/*from  www . ja v a  2 s .c  o m*/

    AbstractColumn columnBranch = ColumnBuilder.getNew().setColumnProperty("branch", String.class.getName())
            .setTitle("Branch").setWidth(new Integer(85)).setStyle(detailStyle).setHeaderStyle(headerStyle)
            .build();

    AbstractColumn columnaProductLine = ColumnBuilder.getNew()
            .setColumnProperty("productLine", String.class.getName()).setTitle("Product Line")
            .setWidth(new Integer(85)).setStyle(detailStyle).setHeaderStyle(headerStyle).build();

    AbstractColumn columnaItem = ColumnBuilder.getNew().setColumnProperty("item", String.class.getName())
            .setTitle("Item").setWidth(new Integer(85)).setStyle(detailStyle).setHeaderStyle(headerStyle)
            .build();

    AbstractColumn columnCode = ColumnBuilder.getNew().setColumnProperty("id", Long.class.getName())
            .setTitle("ID").setWidth(new Integer(40)).setStyle(amountStyle).setHeaderStyle(headerStyle).build();

    AbstractColumn columnaCantidad = ColumnBuilder.getNew().setColumnProperty("quantity", Long.class.getName())
            .setTitle("Quantity").setWidth(new Integer(80)).setStyle(amountStyle).setHeaderStyle(headerStyle)
            .build();

    //Define Conditional Styles

    ArrayList conditionalStyles = createConditionalStyles(amountStyle);

    AbstractColumn columnAmount = ColumnBuilder.getNew().setColumnProperty("amount", Float.class.getName())
            .setTitle("Amount").setWidth(new Integer(90)).setPattern("$ 0.00")
            .addConditionalStyles(conditionalStyles).setStyle(amountStyle).setHeaderStyle(headerStyle).build();

    drb.addColumn(columnState);
    drb.addColumn(columnBranch);
    drb.addColumn(columnaProductLine);
    drb.addColumn(columnaItem);
    drb.addColumn(columnCode);
    drb.addColumn(columnaCantidad);
    drb.addColumn(columnAmount);

    drb.setUseFullPageWidth(true);

    DynamicReport dr = drb.build();
    return dr;
}

From source file:DashboardInterface.CableOutSpeedDial.java

public CableOutSpeedDial(JPanel parentIn) {
    super(new BorderLayout());
    parent = parentIn;//from  w ww .j  av a  2 s .co m
    dataset1 = new DefaultValueDataset(0D);
    dataset2 = new DefaultValueDataset(0D);
    pipe = MessagePipeline.getInstance();
    pipe.attach(this);
    DialPlot dialplot = new DialPlot();
    dialplot.setView(0.0D, 0.0D, 1.0D, 1.0D);
    dialplot.setDataset(0, dataset1);
    dialplot.setDataset(1, dataset2);
    setBackground(Color.WHITE);
    StandardDialFrame standarddialframe = new StandardDialFrame();
    standarddialframe.setBackgroundPaint(Color.lightGray);
    standarddialframe.setForegroundPaint(Color.darkGray);

    dialplot.setDialFrame(standarddialframe);

    DialBackground dialbackground = new DialBackground(Color.LIGHT_GRAY);

    dialbackground.setGradientPaintTransformer(
            new StandardGradientPaintTransformer(GradientPaintTransformType.VERTICAL));
    dialplot.setBackground(dialbackground);

    DialTextAnnotation dialtextannotation = new DialTextAnnotation("Cable Out (ft)");
    dialtextannotation.setFont(new Font("Dialog", 1, 12));
    dialtextannotation.setPaint(new Color(36, 130, 9));
    dialtextannotation.setRadius(0.47999999999999996D);
    dialplot.addLayer(dialtextannotation);

    DialTextAnnotation dialtextannotation2 = new DialTextAnnotation("Speed (kts)");
    dialtextannotation2.setFont(new Font("Dialog", 1, 12));
    dialtextannotation2.setPaint(Color.BLUE);
    dialtextannotation2.setRadius(0.78999999999999996D);
    dialplot.addLayer(dialtextannotation2);

    /*DialValueIndicator dialvalueindicator = new DialValueIndicator(0);
    dialvalueindicator.setFont(new Font("Dialog", 0, 10));
    dialvalueindicator.setOutlinePaint(Color.BLACK);
    dialvalueindicator.setRadius(0.84999999999999998D);
    dialvalueindicator.setAngle(-90D);
    dialplot.addLayer(dialvalueindicator);
            
    DialValueIndicator dialvalueindicator1 = new DialValueIndicator(1);
    dialvalueindicator1.setFont(new Font("Dialog", 0, 10));
    dialvalueindicator1.setOutlinePaint(Color.BLACK);
    dialvalueindicator1.setRadius(0.60999999999999998D);
    dialvalueindicator1.setAngle(-90D);
    dialplot.addLayer(dialvalueindicator1);*/

    StandardDialScale standarddialscale = new StandardDialScale(0D, 90D, -110D, -320D, 10D, 4);
    standarddialscale.setTickRadius(0.88D);
    standarddialscale.setTickLabelOffset(0.14999999999999999D);
    standarddialscale.setTickLabelFont(new Font("Dialog", 0, 14));
    standarddialscale.setMajorTickPaint(Color.BLUE);
    standarddialscale.setMinorTickPaint(Color.BLUE);
    dialplot.addScale(0, standarddialscale);

    StandardDialScale standarddialscale1 = new StandardDialScale(0.0D, 6000D, -110D, -320D, 750D, 4);
    standarddialscale1.setTickRadius(0.5D);
    standarddialscale1.setTickLabelOffset(0.14999999999999999D);
    standarddialscale1.setTickLabelFont(new Font("Dialog", 0, 10));
    standarddialscale1.setTickLabelPaint(new Color(36, 130, 9));
    standarddialscale1.setMajorTickPaint(new Color(36, 130, 9));
    standarddialscale1.setMinorTickPaint(new Color(36, 130, 9));
    dialplot.addScale(1, standarddialscale1);

    dialplot.mapDatasetToScale(1, 1);

    org.jfree.chart.plot.dial.DialPointer.Pointer pointer = new org.jfree.chart.plot.dial.DialPointer.Pointer(
            0);
    pointer.setFillPaint(Color.BLUE);
    dialplot.addPointer(pointer);

    org.jfree.chart.plot.dial.DialPointer.Pointer pin = new org.jfree.chart.plot.dial.DialPointer.Pointer(1);
    pin.setRadius(0.55000000000000004D);
    pin.setFillPaint(new Color(36, 130, 9));
    dialplot.addPointer(pin);

    DialCap dialcap = new DialCap();
    dialcap.setRadius(0.10000000000000001D);
    dialplot.setCap(dialcap);

    Dimension size = parent.getBounds().getSize();
    int width = parent.getWidth();
    int height = parent.getHeight();

    width = 200;

    JFreeChart jfreechart = new JFreeChart(dialplot);
    jfreechart.setBackgroundPaint(Color.WHITE);
    ChartPanel chartpanel = new ChartPanel(jfreechart);
    chartpanel.setPreferredSize(new Dimension(width, width));

    add(chartpanel);
}

From source file:subterranean.crimson.server.graphics.graphs.LineChart.java

public LineChart() {

    super(new BorderLayout());

    final TimeSeriesCollection dataset = new TimeSeriesCollection(this.s1);
    final JFreeChart chart = createChart(dataset);

    Timer timer = new Timer(900, this);
    timer.setInitialDelay(0);// w  w  w .  j  av  a 2s  .  c  o m

    // Sets background color of chart
    chart.setBackgroundPaint(Color.LIGHT_GRAY);

    // Created Chartpanel for chart area
    final ChartPanel chartPanel = new ChartPanel(chart);

    // Added chartpanel to main panel
    add(chartPanel);

    timer.start();

}

From source file:edu.memphis.ccrg.lida.framework.gui.panels.ActivationChartPanel.java

/** Creates new form JChartGuiPanel */
public ActivationChartPanel() {
    chart = ChartFactory.createXYLineChart("", "Tick", "Activation", dataset, PlotOrientation.VERTICAL, true,
            true, false);/*from  ww w  . ja v  a  2 s .  c o m*/
    chart.setBackgroundPaint(new Color(238, 233, 233));
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.WHITE);
    plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
    plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
    NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
    domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    initComponents();
}

From source file:net.sf.dynamicreports.test.jasper.chart.ChartTest.java

@Override
protected void configureReport(JasperReportBuilder rb) {
    TextColumnBuilder<String> column1;
    TextColumnBuilder<Integer> column2;

    rb.columns(column1 = col.column("Column1", "field1", String.class),
            column2 = col.column("Column2", "field2", Integer.class))
            .summary(cht.barChart().setTitle("title").setTitleColor(Color.BLUE)
                    .setTitleFont(stl.fontArialBold()).setTitlePosition(Position.RIGHT).setSubtitle("subtitle")
                    .setSubtitleColor(Color.CYAN).setSubtitleFont(stl.fontArial()).setLegendColor(Color.BLUE)
                    .setLegendBackgroundColor(Color.LIGHT_GRAY).setLegendFont(stl.fontCourierNew())
                    .setLegendPosition(Position.LEFT).setCategory(column1).series(cht.serie(column2)),
                    cht.barChart().setShowLegend(false).setOrientation(Orientation.HORIZONTAL)
                            .seriesColors(Color.BLUE, Color.GREEN, Color.RED).setCategory(column1)
                            .series(cht.serie(column2), cht.serie(column2).setLabel("2"),
                                    cht.serie(column2).setLabel("3")));
}

From source file:com.griddynamics.jagger.diagnostics.visualization.GraphVisualizationHelper.java

public static <V, E> Image renderGraph(Graph<V, E> graph, int width, int height, GraphLayout graphLayout,
        final ColorTheme colorTheme, final Map<V, Paint> customNodeColors) {

    Layout<V, E> layout;/*from  w  w  w  .ja v  a  2 s.  c om*/
    switch (graphLayout) {
    case CIRCLE:
        layout = new CircleLayout<V, E>(graph);
        break;
    case ISOM:
        layout = new ISOMLayout<V, E>(graph);
        break;
    case FR:
        layout = new FRLayout<V, E>(graph);
        break;
    case KK:
        layout = new KKLayout<V, E>(graph);
        break;
    default:
        throw new RuntimeException("Unknown Graph Layout : [" + graphLayout + "]");
    }

    layout.setSize(new Dimension((int) (width * (1 - IMAGE_HORIZONTAL_MARGIN)),
            (int) (height * (1 - IMAGE_VERTICAL_MARGIN))));

    VisualizationImageServer<V, E> server = new VisualizationImageServer<V, E>(displacementLayout(layout,
            (int) (width * IMAGE_HORIZONTAL_MARGIN / 2), (int) (height * IMAGE_VERTICAL_MARGIN / 2)),
            new Dimension(width, height));

    final Color edgeColor;
    switch (colorTheme) {
    case LIGHT:
        server.setBackground(Color.WHITE);
        edgeColor = Color.BLACK;
        break;
    case DARK:
        server.setBackground(Color.BLACK);
        edgeColor = Color.LIGHT_GRAY;
        break;
    default:
        throw new RuntimeException("Unknown Color Theme : [" + colorTheme + "]");
    }

    Transformer<V, Paint> vertexPaint = new Transformer<V, Paint>() {
        public Paint transform(V v) {
            Paint paint = customNodeColors.get(v);
            if (paint == null) {
                paint = Color.LIGHT_GRAY;
            }
            return paint;
        }
    };

    Transformer<V, Paint> vertexBorderPaint = new Transformer<V, Paint>() {
        public Paint transform(V v) {
            return Color.DARK_GRAY;
        }
    };

    Transformer<E, Paint> edgePaint = new Transformer<E, Paint>() {
        public Paint transform(E e) {
            return edgeColor;
        }
    };

    server.getRenderContext().setVertexFillPaintTransformer(vertexPaint);
    server.getRenderContext().setEdgeDrawPaintTransformer(edgePaint);
    server.getRenderContext().setArrowDrawPaintTransformer(edgePaint);
    server.getRenderContext().setArrowFillPaintTransformer(edgePaint);

    server.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<V>());
    server.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller<E>());
    server.getRenderContext().setVertexDrawPaintTransformer(vertexBorderPaint);

    server.getRenderContext().setVertexLabelTransformer(new ChainedTransformer<V, String>(
            new Transformer[] { new ToStringLabeller<V>(), new Transformer<String, String>() {
                public String transform(String input) {
                    return "<html><center><p>" + formatLabel(input, MAX_LABEL_LENGTH);
                }
            } }));
    VertexLabelAsShapeRenderer<V, E> vlasr = new VertexLabelAsShapeRenderer<V, E>(server.getRenderContext());
    server.getRenderContext().setVertexShapeTransformer(vlasr);
    server.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);

    return server.getImage(new Point(0, 0), new Dimension(width, height));
}

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  ww w. j  a v a  2  s  .  com

    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...

}