Example usage for java.awt Color gray

List of usage examples for java.awt Color gray

Introduction

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

Prototype

Color gray

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

Click Source Link

Document

The color gray.

Usage

From source file:com.silkroad.ui.renderer.node.BuddyNode.java

public BuddyNode(UIBuddy buddy) {
    super(buddy);
    this.buddy = buddy;

    // ?/*from   w ww .ja v a  2s  . com*/
    avatarImage = new WebDecoratedImage();
    avatarImage.setShadeWidth(1);
    avatarImage.setRound(4);
    avatarImage.setDrawGlassLayer(false);

    // 
    nickLbl = new WebLabel();
    signLbl = new WebLabel();
    nickLbl.setFontSize(14);
    signLbl.setFontSize(13);
    signLbl.setForeground(Color.GRAY);
    GroupPanel textGroup = new GroupPanel(0, false, nickLbl, signLbl);
    textGroup.setMargin(0, 5, 0, 5);

    view.add(avatarImage, BorderLayout.WEST);
    view.add(new CenterPanel(textGroup, false, true), BorderLayout.CENTER);
    view.setMargin(5);
}

From source file:dbseer.gui.panel.DBSeerPredictionInformationChartPanel.java

public DBSeerPredictionInformationChartPanel(JFreeChart chart) {
    super(chart);
    verticalCrossHair = new Crosshair(Double.NaN, Color.GRAY, new BasicStroke(0f));
    CrosshairOverlay crosshairOverlay = new CrosshairOverlay();
    crosshairOverlay.addDomainCrosshair(verticalCrossHair);
    this.addOverlay(crosshairOverlay);
}

From source file:iqq.app.ui.renderer.node.BuddyNode.java

public BuddyNode(IMBuddy buddy) {
    super(buddy);
    this.buddy = buddy;

    // ?// ww  w. j  a  v a2s .  c om
    avatarImage = new WebDecoratedImage();
    avatarImage.setShadeWidth(1);
    avatarImage.setRound(4);
    avatarImage.setDrawGlassLayer(false);

    // 
    nickLbl = new WebLabel();
    signLbl = new WebLabel();
    nickLbl.setFontSize(14);
    signLbl.setFontSize(13);
    signLbl.setForeground(Color.GRAY);
    GroupPanel textGroup = new GroupPanel(0, false, nickLbl, signLbl);
    textGroup.setMargin(0, 5, 0, 5);

    view.add(avatarImage, BorderLayout.WEST);
    view.add(new CenterPanel(textGroup, false, true), BorderLayout.CENTER);
    view.setMargin(5);
}

From source file:DialogSeparator.java

public void paint(Graphics g) {
    g.setColor(getBackground());/*w ww .  j a  va 2  s.  c o m*/
    g.fillRect(0, 0, getWidth(), getHeight());

    Dimension d = getSize();
    int y = (d.height - 3) / 2;
    g.setColor(Color.white);
    g.drawLine(1, y, d.width - 1, y);
    y++;
    g.drawLine(0, y, 1, y);
    g.setColor(Color.gray);
    g.drawLine(d.width - 1, y, d.width, y);
    y++;
    g.drawLine(1, y, d.width - 1, y);

    String text = getText();
    if (text.length() == 0)
        return;

    g.setFont(getFont());
    FontMetrics fm = g.getFontMetrics();
    y = (d.height + fm.getAscent()) / 2;
    int fontWidth = fm.stringWidth(text);

    g.setColor(getBackground());
    g.fillRect(OFFSET - 5, 0, OFFSET + fontWidth, d.height);

    g.setColor(getForeground());
    g.drawString(text, OFFSET, y);
}

From source file:de.ep3.ftpc.view.designer.UIDesigner.java

public UIDesigner() {
    defaultBorderColor = Color.GRAY;
    defaultBorder = BorderFactory.createLineBorder(defaultBorderColor);
}

From source file:org.jfree.chart.demo.XYLineAndShapeRendererDemo2.java

private static JFreeChart createChart() {
    XYDataset xydataset = createDataset(1, 1.0D);
    JFreeChart jfreechart = ChartFactory.createXYLineChart("XYLineAndShapeRenderer Demo 2", "X", "Y", xydataset,
            PlotOrientation.VERTICAL, true, true, false);
    jfreechart.setBackgroundPaint(Color.white);
    TextTitle texttitle = new TextTitle(
            "This chart shows various combinations of the useFillPaint and useOutlinePaint flags.");
    texttitle.setFont(new Font("Dialog", 0, 10));
    jfreechart.addSubtitle(texttitle);//from   w w  w .  ja  v a2  s.  c o  m
    XYPlot xyplot = (XYPlot) jfreechart.getPlot();
    xyplot.setBackgroundPaint(Color.lightGray);
    xyplot.setDomainGridlinePaint(Color.white);
    xyplot.setRangeGridlinePaint(Color.white);
    NumberAxis numberaxis = (NumberAxis) xyplot.getRangeAxis();
    numberaxis.setAutoRangeIncludesZero(false);
    java.awt.geom.Ellipse2D.Double double1 = new java.awt.geom.Ellipse2D.Double(-4D, -4D, 8D, 8D);
    XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
    xylineandshaperenderer.setBaseShapesVisible(true);
    xylineandshaperenderer.setSeriesShape(0, double1);
    xylineandshaperenderer.setSeriesPaint(0, Color.red);
    xylineandshaperenderer.setSeriesFillPaint(0, Color.yellow);
    xylineandshaperenderer.setSeriesOutlinePaint(0, Color.gray);
    XYDataset xydataset1 = createDataset(2, 2D);
    XYLineAndShapeRenderer xylineandshaperenderer1 = new XYLineAndShapeRenderer();
    xyplot.setDataset(1, xydataset1);
    xyplot.setRenderer(1, xylineandshaperenderer1);
    xylineandshaperenderer1.setSeriesShape(0, double1);
    xylineandshaperenderer1.setSeriesPaint(0, Color.red);
    xylineandshaperenderer1.setSeriesFillPaint(0, Color.yellow);
    xylineandshaperenderer1.setSeriesOutlinePaint(0, Color.gray);
    xylineandshaperenderer1.setUseFillPaint(true);
    XYDataset xydataset2 = createDataset(3, 3D);
    XYLineAndShapeRenderer xylineandshaperenderer2 = new XYLineAndShapeRenderer();
    xyplot.setDataset(2, xydataset2);
    xyplot.setRenderer(2, xylineandshaperenderer2);
    xylineandshaperenderer2.setSeriesShape(0, double1);
    xylineandshaperenderer2.setSeriesPaint(0, Color.red);
    xylineandshaperenderer2.setSeriesFillPaint(0, Color.yellow);
    xylineandshaperenderer2.setSeriesOutlinePaint(0, Color.gray);
    xylineandshaperenderer2.setUseOutlinePaint(true);
    XYDataset xydataset3 = createDataset(4, 4D);
    XYLineAndShapeRenderer xylineandshaperenderer3 = new XYLineAndShapeRenderer();
    xyplot.setDataset(3, xydataset3);
    xyplot.setRenderer(3, xylineandshaperenderer3);
    xylineandshaperenderer3.setSeriesShape(0, double1);
    xylineandshaperenderer3.setSeriesPaint(0, Color.red);
    xylineandshaperenderer3.setSeriesFillPaint(0, Color.yellow);
    xylineandshaperenderer3.setSeriesOutlinePaint(0, Color.gray);
    xylineandshaperenderer3.setUseOutlinePaint(true);
    xylineandshaperenderer3.setUseFillPaint(true);
    XYDataset xydataset4 = createDataset(5, 5D);
    XYLineAndShapeRenderer xylineandshaperenderer4 = new XYLineAndShapeRenderer();
    xyplot.setDataset(4, xydataset4);
    xyplot.setRenderer(4, xylineandshaperenderer4);
    xylineandshaperenderer4.setSeriesShape(0, double1);
    xylineandshaperenderer4.setSeriesPaint(0, Color.red);
    xylineandshaperenderer4.setSeriesFillPaint(0, Color.yellow);
    xylineandshaperenderer4.setSeriesOutlinePaint(0, Color.gray);
    xylineandshaperenderer4.setUseOutlinePaint(true);
    xylineandshaperenderer4.setUseFillPaint(true);
    xylineandshaperenderer4.setDrawOutlines(false);
    return jfreechart;
}

From source file:net.noday.core.utils.Captcha.java

public static BufferedImage gen(String text, int width, int height) throws IOException {
    BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_BGR);
    Graphics2D g = (Graphics2D) bi.getGraphics();
    g.setColor(Color.GRAY);
    g.fillRect(0, 0, width, height);/*from w  w w.ja v a  2  s .  c om*/
    for (int i = 0; i < 10; i++) {
        g.setColor(randColor(150, 250));
        g.drawOval(random.nextInt(110), random.nextInt(24), 5 + random.nextInt(10), 5 + random.nextInt(10));
        Font f = new Font("Arial", Font.ITALIC, 20);
        g.setFont(f);
        g.setColor(randColor(10, 240));
        g.drawString(text, 4, 24);
    }
    return bi;
}

From source file:JToolbarSeparator.java

protected void paintComponent(Graphics g) {
    super.paintComponent(g);

    Dimension size = getSize();//from ww  w .j a v  a2 s. c  om
    int pos = size.width / 2;
    g.setColor(Color.gray);
    g.drawLine(pos, 3, pos, size.height - 5);
    g.drawLine(pos, 2, pos + 1, 2);
    g.setColor(Color.white);
    g.drawLine(pos + 1, 3, pos + 1, size.height - 5);
    g.drawLine(pos, size.height - 4, pos + 1, size.height - 4);
}

From source file:com.haulmont.cuba.desktop.sys.WindowBreadCrumbs.java

public WindowBreadCrumbs() {
    FlowLayout layout = new FlowLayout(FlowLayout.LEFT, 5, 5);
    setLayout(layout);//from  w  w  w  .  j a  v  a  2s  .  co  m
    setBorder(BorderFactory.createLineBorder(Color.gray));
    setVisible(false);
}

From source file:ColorMenu.java

public ColorMenu(String name) {
    super(name);//from w w  w .  jav  a 2  s .c  om

    _unselectedBorder = new CompoundBorder(new MatteBorder(1, 1, 1, 1, getBackground()),
            new BevelBorder(BevelBorder.LOWERED, Color.WHITE, Color.GRAY));

    _selectedBorder = new CompoundBorder(new MatteBorder(2, 2, 2, 2, Color.RED),
            new MatteBorder(1, 1, 1, 1, getBackground()));

    _activeBorder = new CompoundBorder(new MatteBorder(2, 2, 2, 2, Color.BLUE),
            new MatteBorder(1, 1, 1, 1, getBackground()));

    JPanel p = new JPanel();
    p.setBorder(new EmptyBorder(5, 5, 5, 5));
    p.setLayout(new GridLayout(8, 8));
    _colorPanes = new HashMap();

    int values[] = new int[] { 0, 128, 192, 255 };

    for (int r = 0; r < values.length; r++)
        for (int g = 0; g < values.length; g++)
            for (int b = 0; b < values.length; b++) {
                Color color = new Color(values[r], values[g], values[b]);
                ColorPane colorPane = new ColorPane(color);
                p.add(colorPane);
                _colorPanes.put(color, colorPane);
            }

    add(p);

}