Example usage for java.awt Color BLACK

List of usage examples for java.awt Color BLACK

Introduction

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

Prototype

Color BLACK

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

Click Source Link

Document

The color black.

Usage

From source file:cn.edu.thss.iise.bpmdemo.charts.SWTMultipleAxisDemo1.java

/**
 * Creates the demo chart.//w  ww.  jav a  2s .  c om
 *
 * @return The chart.
 */
private static JFreeChart createChart() {

    XYDataset dataset1 = createDataset("Series 1", 100.0, new Day(), 200);

    JFreeChart chart = ChartFactory.createTimeSeriesChart("Multiple Axis Demo 3", "Time of Day",
            "Primary Range Axis", dataset1, true, true, false);

    chart.setBackgroundPaint(Color.white);
    chart.setBorderVisible(true);
    chart.setBorderPaint(Color.BLACK);
    TextTitle subtitle = new TextTitle("Four datasets and four range axes.");
    chart.addSubtitle(subtitle);
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setOrientation(PlotOrientation.VERTICAL);
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);

    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
    XYItemRenderer renderer = plot.getRenderer();
    renderer.setSeriesPaint(0, Color.black);

    // AXIS 2
    NumberAxis axis2 = new NumberAxis("Range Axis 2");
    axis2.setAutoRangeIncludesZero(false);
    axis2.setLabelPaint(Color.red);
    axis2.setTickLabelPaint(Color.red);
    plot.setRangeAxis(1, axis2);
    plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_LEFT);

    XYDataset dataset2 = createDataset("Series 2", 1000.0, new Day(), 170);
    plot.setDataset(1, dataset2);
    plot.mapDatasetToRangeAxis(1, 1);
    XYItemRenderer renderer2 = new StandardXYItemRenderer();
    renderer2.setSeriesPaint(0, Color.red);
    plot.setRenderer(1, renderer2);

    // AXIS 3
    NumberAxis axis3 = new NumberAxis("Range Axis 3");
    axis3.setLabelPaint(Color.blue);
    axis3.setTickLabelPaint(Color.blue);
    // axis3.setPositiveArrowVisible(true);
    plot.setRangeAxis(2, axis3);

    XYDataset dataset3 = createDataset("Series 3", 10000.0, new Day(), 170);
    plot.setDataset(2, dataset3);
    plot.mapDatasetToRangeAxis(2, 2);
    XYItemRenderer renderer3 = new StandardXYItemRenderer();
    renderer3.setSeriesPaint(0, Color.blue);
    plot.setRenderer(2, renderer3);

    // AXIS 4
    NumberAxis axis4 = new NumberAxis("Range Axis 4");
    axis4.setLabelPaint(Color.green);
    axis4.setTickLabelPaint(Color.green);
    plot.setRangeAxis(3, axis4);

    XYDataset dataset4 = createDataset("Series 4", 25.0, new Day(), 200);
    plot.setDataset(3, dataset4);
    plot.mapDatasetToRangeAxis(3, 3);

    XYItemRenderer renderer4 = new StandardXYItemRenderer();
    renderer4.setSeriesPaint(0, Color.green);
    plot.setRenderer(3, renderer4);

    return chart;
}

From source file:net.sf.firemox.AbstractMainForm.java

/**
 * Create a new instance of this class./*from  ww w  .  j a va2  s. c  om*/
 * 
 * @param title
 *          the form 's title
 */
protected AbstractMainForm(String title) {
    super(title);
    setBackground(Color.BLACK);
}

From source file:net.sf.fspdfs.chartthemes.spring.ScaledDialPointer.java

/**
 * Creates a new instance.
 */
public ScaledDialPointer() {
    this(0, 0.03, Color.BLACK, Color.BLACK, 1);
}

From source file:com.floreantpos.swing.BarTabButton.java

public void update() {
    setEnabled(true);
    setBackground(Color.white);
    setForeground(Color.black);
}

From source file:CombiningShapes.java

public void paintComponent(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

    String option = (String) mOptions.getSelectedItem();
    if (option.equals("outline")) {
        // draw the outlines and return.
        g2.draw(mShapeOne);//from   ww  w  .  j a  va  2  s  . c  o m
        g2.draw(mShapeTwo);
        return;
    }

    // Create Areas from the shapes.
    Area areaOne = new Area(mShapeOne);
    Area areaTwo = new Area(mShapeTwo);
    // Combine the Areas according to the selected option.
    if (option.equals("add"))
        areaOne.add(areaTwo);
    else if (option.equals("intersection"))
        areaOne.intersect(areaTwo);
    else if (option.equals("subtract"))
        areaOne.subtract(areaTwo);
    else if (option.equals("exclusive or"))
        areaOne.exclusiveOr(areaTwo);

    // Fill the resulting Area.
    g2.setPaint(Color.orange);
    g2.fill(areaOne);
    // Draw the outline of the resulting Area.
    g2.setPaint(Color.black);
    g2.draw(areaOne);
}

From source file:edworld.pdfreader4humans.PDFReaderTest.java

@Test
public void createPageImageWithoutStructure() throws IOException {
    File outputFile = new File("target/outputWithoutStructure.png");
    ImageIO.write(reader.createPageImage(1, 3, Color.BLACK, Color.WHITE, false), "png", outputFile);
    assertImagesAreSimilar(getClass().getResourceAsStream("/testcase1/outputWithoutStructure.png"),
            ImageIO.read(outputFile));
}

From source file:MainClass.java

public int print(Graphics g, PageFormat pf, int pageIndex) throws PrinterException {
    Graphics2D g2 = (Graphics2D) g;

    double w = pf.getImageableWidth();
    double h = pf.getImageableHeight();

    int xo = (int) pf.getImageableX();
    int yo = (int) pf.getImageableY();

    Rectangle2D r = new Rectangle2D.Double(xo, yo, w, h);

    g2.setColor(Color.red);//from  w  ww.  j a va  2  s.co m
    g2.draw(r);

    PrinterGraphics p = (PrinterGraphics) g2;
    String s = p.getPrinterJob().getJobName();

    g2.setPaint(Color.black);
    g2.drawString(s, 0, 0);

    return Printable.PAGE_EXISTS;
}

From source file:org.gvsig.gui.beans.graphic.GraphicChartPanel.java

public GraphicChartPanel() {
    dataset = new XYSeriesCollection();

    createChart();/*from w  w  w  .  ja  va 2  s  . c  om*/

    initialize();

    Plot plot = this.jPanelChart.getChart().getPlot();
    plot.setOutlineStroke(new BasicStroke(1));
    plot.setOutlinePaint(Color.black);

    chart.setBackgroundPaint(Color.white);
    plot.setBackgroundPaint(new Color(245, 245, 245));
}

From source file:de.d3web.empiricaltesting.casevisualization.jung.VertexColorTransformer.java

/**
 * Returns a color depending on the information given in a RatedTestCase.
 * //from w w w .  j  a v a  2  s.c o m
 * @param rtc RatedTestCase
 * 
 * @return GREEN, if RatedTestCase.isCorrect(), RED, if
 *         !RatedTestCase.isCorrect(), GRAY, if
 *         RatedTestCase.wasTestedBefore()
 */
@Override
public Paint transform(RatedTestCase rtc) {

    // String color =
    // ConfigLoader.getInstance().getProperty("edgeColorNewCase");
    //       
    // if (!rtc.isCorrect()) {
    // color =
    // ConfigLoader.getInstance().getProperty("edgeColorIncorrectCase");
    // } else if (rtc.wasTestedBefore()
    // &&
    // ConfigLoader.getInstance().getProperty("renderOldCasesLikeNewCases").equals("false"))
    // {
    // color = ConfigLoader.getInstance().getProperty("edgeColorOldCase");
    // }
    //       
    // return ColorConverter.getInstance().convert(color);

    return Color.BLACK;
}

From source file:IHM.NewClass.java

/**
 *
 * @param title//from www  .  ja v a 2 s .c  o  m
 */
public NewClass(String title /*,*JInternalFrame jp*/) {
    super(title);
    // jp = new JInternalFrame("courbes");

    JFreeChart chart = createChart(createDataset());
    ChartPanel panel = new ChartPanel(chart);
    panel.setPreferredSize(new Dimension(500, 300));
    setContentPane(panel);
    //  jp.add(panel, BorderLayout.EAST);
    //  jp.setVisible(true);
    panel.setVisible(true);
    XYPlot plot = chart.getXYPlot();
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    plot.setRenderer(renderer);
    renderer.setSeriesPaint(0, Color.RED);
    renderer.setSeriesPaint(1, Color.GREEN);
    renderer.setSeriesPaint(2, Color.YELLOW);
    // sets thickness for series (using strokes)
    renderer.setSeriesStroke(0, new BasicStroke(4.0f));
    renderer.setSeriesStroke(1, new BasicStroke(3.0f));
    renderer.setSeriesStroke(2, new BasicStroke(2.0f));
    plot.setRenderer(renderer);
    plot.setOutlinePaint(Color.BLUE);
    plot.setOutlineStroke(new BasicStroke(2.0f));
    plot.setBackgroundPaint(Color.DARK_GRAY);
    plot.setRangeGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.BLACK);
    plot.setDomainGridlinesVisible(true);
    plot.setDomainGridlinePaint(Color.BLACK);

}