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:Layers.java

Layers(String s, int w, int h) {
    setTitle(s);/*from  w ww.  j av  a  2  s.  c o  m*/
    setSize(width = w, height = h); // a short form
    setBackground(Color.black);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
}

From source file:QandE.XMarksTheSpot.java

public XMarksTheSpot() {
    setOpaque(true);//  ww  w  . j  av a2  s  .  c  o m

    //Set the border using either a MatteBorder (standard, used in 
    //Exercise 1) or a StripeBorder (custom, used in Exercise 3).
    //You can find the exercises here:
    //  http://docs.oracle.com/javase/javatutorials/tutorial/uiswing/QandE/questions-ch6.html
    setBorder(BorderFactory.createMatteBorder(5, 5, 5, 5, Color.BLACK));
    //setBorder(new StripeBorder());
}

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

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

From source file:painting.SwingPaintDemo2.java

public MyPanel() {
    setBorder(BorderFactory.createLineBorder(Color.black));
}

From source file:edu.cuny.jfree.chart.annotations.CategoryIntervalAnnotation.java

public CategoryIntervalAnnotation(final Comparable category, final double value1, final double value2,
        final Paint paint, final Stroke stroke) {
    this.paint = Color.black;
    this.stroke = new BasicStroke(1.0F);
    if (category == null) {
        throw new IllegalArgumentException("Null 'category' argument.");
    }/*from   w  w w. j a  v a  2 s . com*/
    if (paint == null) {
        throw new IllegalArgumentException("Null 'paint' argument.");
    }
    if (stroke == null) {
        throw new IllegalArgumentException("Null 'stroke' argument.");
    } else {
        this.category = category;
        this.value1 = value1;
        this.value2 = value2;
        this.paint = paint;
        this.stroke = stroke;
        return;
    }
}

From source file:bayesGame.ui.painter.AndNodePainter.java

public static Image paintPercentage(Color gridColor, Color falseColor, int size, int squaresize, BayesNode node,
        Fraction parentNode1Probability, Fraction parentNode2Probability) {

    BufferedImage img = new BufferedImage(size, size, BufferedImage.TYPE_INT_RGB);
    Graphics g = img.getGraphics();

    NodePainter.graphicBackgroundPainter(g, 0, 0, size, size);

    // get non-zero truth table entries from the node
    List<Map<Object, Boolean>> nonZeroEntries = node.getNonZeroProbabilities();

    // get the identities of its parents by taking the first map and querying it 
    // for KeySet, subtracting the object representing the node itself
    Set<Object> nodeParents = nonZeroEntries.get(0).keySet();
    nodeParents.remove(node.type);// w  w w .j a v  a  2 s .c o m

    if (nodeParents.size() > 2) {
        throw new IllegalArgumentException("AND node with more than 2 parents not yet implemented");
    }

    Object[] nodeParentsArray = nodeParents.toArray();
    Object parent1 = nodeParentsArray[0];
    Object parent2 = nodeParentsArray[1];

    // for each map, check the truth table entry it corresponds to and color
    // those appropriately
    boolean p1true_p2true = false;
    boolean p1true_p2false = false;
    boolean p1false_p2true = false;
    boolean p1false_p2false = false;

    for (Map<Object, Boolean> map : nonZeroEntries) {
        Boolean parent1truth = map.get(parent1);
        Boolean parent2truth = map.get(parent2);

        if (parent1truth && parent2truth) {
            p1true_p2true = true;
        } else if (parent1truth && !parent2truth) {
            p1true_p2false = true;
        } else if (!parent1truth && parent2truth) {
            p1false_p2true = true;
        } else if (!parent1truth && !parent2truth) {
            p1false_p2false = true;
        }
    }

    Color whiteColor = Color.WHITE;

    int XSize = parentNode1Probability.multiply(size).intValue();
    int X_Size = size - XSize;
    int YSize = parentNode2Probability.multiply(size).intValue();
    int Y_Size = size - YSize;

    if (p1true_p2true) {
        NodePainter.squarePainter(g, 0, 0, XSize, YSize, gridColor, Color.BLACK);
    } else {
        NodePainter.squarePainter(g, 0, 0, XSize, YSize, NodePainter.RECTANGLE_BOX_BACKGROUND_COLOR,
                Color.BLACK);
    }

    NodePainter.squarePainter(g, XSize, 0, X_Size, YSize, falseColor, Color.BLACK);
    NodePainter.squarePainter(g, 0, YSize, XSize, Y_Size, falseColor, Color.BLACK);

    if (p1false_p2false) {
        NodePainter.squarePainter(g, XSize, YSize, X_Size, Y_Size, falseColor, Color.BLACK);
    } else {
        NodePainter.squarePainter(g, XSize, YSize, X_Size, Y_Size, NodePainter.RECTANGLE_BOX_BACKGROUND_COLOR,
                Color.BLACK);
    }

    return img;
}

From source file:org.gvsig.remotesensing.scatterplot.chart.ScatterPlotChart.java

/**
  * Crea un nuevo  FastScatterPlot/*from www  . j  a va 2s . c om*/
  * @param data  datos que se muestran en el diagrama (<code>null</code> permitted).
  * @param domainAxis  rango en eje x.
  * @param rangeAxis  rango en eje y.
  *   
  */
public ScatterPlotChart(float[][] data, ValueAxis domainAxis, ValueAxis rangeAxis) {

    super(data, domainAxis, rangeAxis);
    setPaint(Color.BLACK);

}

From source file:ColorConvertDemo.java

ColorPanel() {
    setBackground(Color.black);
    loadImage();
    setSize(displayImage.getWidth(this), displayImage.getWidth(this));

    createBufferedImage();
}

From source file:net.sf.jasperreports.engine.xml.JRBoxFactory.java

public static void setBoxAttributes(Attributes atts, JRLineBox box) {
    PenEnum border = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_border));
    if (border != null) {
        if (log.isWarnEnabled()) {
            log.warn("The 'border' attribute is deprecated. Use the <pen> tag instead.");
        }//from  ww  w.java  2 s.  co  m
        JRPenUtil.setLinePenFromPen(border, box.getPen());
    }

    Color borderColor = JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_borderColor), null);
    if (borderColor != null) {
        if (log.isWarnEnabled()) {
            log.warn("The 'borderColor' attribute is deprecated. Use the <pen> tag instead.");
        }
        box.getPen().setLineColor(borderColor);
    }

    String padding = atts.getValue(JRXmlConstants.ATTRIBUTE_padding);
    if (padding != null && padding.length() > 0) {
        box.setPadding(Integer.valueOf(padding));
    }

    border = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_topBorder));
    if (border != null) {
        if (log.isWarnEnabled()) {
            log.warn("The 'topBorder' attribute is deprecated. Use the <pen> tag instead.");
        }
        JRPenUtil.setLinePenFromPen(border, box.getTopPen());
    }

    borderColor = JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_topBorderColor), Color.black);
    if (borderColor != null) {
        if (log.isWarnEnabled()) {
            log.warn("The 'topBorderColor' attribute is deprecated. Use the <pen> tag instead.");
        }
        box.getTopPen().setLineColor(borderColor);
    }

    padding = atts.getValue(JRXmlConstants.ATTRIBUTE_topPadding);
    if (padding != null && padding.length() > 0) {
        box.setTopPadding(Integer.valueOf(padding));
    }

    border = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_leftBorder));
    if (border != null) {
        if (log.isWarnEnabled()) {
            log.warn("The 'leftBorder' attribute is deprecated. Use the <pen> tag instead.");
        }
        JRPenUtil.setLinePenFromPen(border, box.getLeftPen());
    }

    borderColor = JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_leftBorderColor), Color.black);
    if (borderColor != null) {
        if (log.isWarnEnabled()) {
            log.warn("The 'leftBorderColor' attribute is deprecated. Use the <pen> tag instead.");
        }
        box.getLeftPen().setLineColor(borderColor);
    }

    padding = atts.getValue(JRXmlConstants.ATTRIBUTE_leftPadding);
    if (padding != null && padding.length() > 0) {
        box.setLeftPadding(Integer.valueOf(padding));
    }

    border = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_bottomBorder));
    if (border != null) {
        if (log.isWarnEnabled()) {
            log.warn("The 'bottomBorder' attribute is deprecated. Use the <pen> tag instead.");
        }
        JRPenUtil.setLinePenFromPen(border, box.getBottomPen());
    }

    borderColor = JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_bottomBorderColor), Color.black);
    if (borderColor != null) {
        if (log.isWarnEnabled()) {
            log.warn("The 'bottomBorderColor' attribute is deprecated. Use the <pen> tag instead.");
        }
        box.getBottomPen().setLineColor(borderColor);
    }

    padding = atts.getValue(JRXmlConstants.ATTRIBUTE_bottomPadding);
    if (padding != null && padding.length() > 0) {
        box.setBottomPadding(Integer.valueOf(padding));
    }

    border = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_rightBorder));
    if (border != null) {
        if (log.isWarnEnabled()) {
            log.warn("The 'rightBorder' attribute is deprecated. Use the <pen> tag instead.");
        }
        JRPenUtil.setLinePenFromPen(border, box.getRightPen());
    }

    borderColor = JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_rightBorderColor), Color.black);
    if (borderColor != null) {
        if (log.isWarnEnabled()) {
            log.warn("The 'rightBorderColor' attribute is deprecated. Use the <pen> tag instead.");
        }
        box.getRightPen().setLineColor(borderColor);
    }

    padding = atts.getValue(JRXmlConstants.ATTRIBUTE_rightPadding);
    if (padding != null && padding.length() > 0) {
        box.setRightPadding(Integer.valueOf(padding));
    }
}

From source file:io.narayana.perf.product.BarChart.java

public JFreeChart generateChart(String title, String xaxisLabel, String yaxisLabel) {
    JFreeChart chart = ChartFactory.createBarChart(title, xaxisLabel, yaxisLabel, dataset,
            PlotOrientation.VERTICAL, true, false, false);
    CategoryPlot plot = chart.getCategoryPlot();
    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();

    chart.setBackgroundPaint(Color.white);

    plot.setBackgroundPaint(Color.white);
    plot.setDomainGridlinesVisible(true);

    plot.setDomainGridlinePaint(Color.black);
    plot.setRangeGridlinePaint(Color.black);

    rangeAxis.setStandardTickUnits(NumberAxis.createStandardTickUnits());

    BarRenderer renderer = (BarRenderer) chart.getCategoryPlot().getRenderer();

    for (int i = 0; i < dataset.getRowCount(); i++) {
        Color color = i < COLORS.length ? COLORS[i] : COLORS[0];
        renderer.setSeriesPaint(i, color);
    }//w w w  . j  a  v  a 2  s. com

    return chart;
}