Java Code Examples for java.awt.Color#lightGray()

The following examples show how to use java.awt.Color#lightGray() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: netbeans   File: TableSheetCell.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Set how to paint renderer.
 * @param f <code>true</code> means flat, <code>false</code> means with button border
 */
public void setFlat(boolean f) {
    Color controlDkShadow = Color.lightGray;

    if (UIManager.getColor("controlDkShadow") != null) {
        controlDkShadow = UIManager.getColor("controlDkShadow"); // NOI18N
    }

    Color controlLtHighlight = Color.black;

    if (UIManager.getColor("controlLtHighlight") != null) {
        controlLtHighlight = UIManager.getColor("controlLtHighlight"); // NOI18N
    }

    Color buttonFocusColor = Color.blue;

    if (UIManager.getColor("Button.focus") != null) {
        buttonFocusColor = UIManager.getColor("Button.focus"); // NOI18N
    }

    flat = f ? Boolean.TRUE : Boolean.FALSE;
}
 
Example 2
Source Project: coming   File: arja3_three_s.java    License: MIT License 6 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 */
public MultiplePiePlot(CategoryDataset dataset) {
    super();
    this.dataset = dataset;
    PiePlot piePlot = new PiePlot(null);
    this.pieChart = new JFreeChart(piePlot);
    this.pieChart.removeLegend();
    this.dataExtractOrder = TableOrder.BY_COLUMN;
    this.pieChart.setBackgroundPaint(null);
    TextTitle seriesTitle = new TextTitle("Series Title",
            new Font("SansSerif", Font.BOLD, 12));
    seriesTitle.setPosition(RectangleEdge.BOTTOM);
    this.pieChart.setTitle(seriesTitle);
    this.aggregatedItemsKey = "Other";
    this.aggregatedItemsPaint = Color.lightGray;
    this.sectionPaints = new HashMap();
}
 
Example 3
Source Project: coming   File: Chart_12_MultiplePiePlot_s.java    License: MIT License 6 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 */
public MultiplePiePlot(CategoryDataset dataset) {
    super();
    this.dataset = dataset;
    PiePlot piePlot = new PiePlot(null);
    this.pieChart = new JFreeChart(piePlot);
    this.pieChart.removeLegend();
    this.dataExtractOrder = TableOrder.BY_COLUMN;
    this.pieChart.setBackgroundPaint(null);
    TextTitle seriesTitle = new TextTitle("Series Title",
            new Font("SansSerif", Font.BOLD, 12));
    seriesTitle.setPosition(RectangleEdge.BOTTOM);
    this.pieChart.setTitle(seriesTitle);
    this.aggregatedItemsKey = "Other";
    this.aggregatedItemsPaint = Color.lightGray;
    this.sectionPaints = new HashMap();
}
 
Example 4
Source Project: coming   File: Arja_00174_t.java    License: MIT License 6 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 */
public MultiplePiePlot(CategoryDataset dataset) {
    super();
    this.dataset = dataset;
    PiePlot piePlot = new PiePlot(null);
    this.pieChart = new JFreeChart(piePlot);
    this.pieChart.removeLegend();
    this.dataExtractOrder = TableOrder.BY_COLUMN;
    this.pieChart.setBackgroundPaint(null);
    TextTitle seriesTitle = new TextTitle("Series Title",
            new Font("SansSerif", Font.BOLD, 12));
    seriesTitle.setPosition(RectangleEdge.BOTTOM);
    this.pieChart.setTitle(seriesTitle);
    this.aggregatedItemsKey = "Other";
    if (dataset != null) {
        setDatasetGroup(dataset.getGroup());
        dataset.addChangeListener(this);
    }
    this.aggregatedItemsPaint = Color.lightGray;
    this.sectionPaints = new HashMap();
}
 
Example 5
Source Project: coming   File: Arja_00162_s.java    License: MIT License 6 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 */
public MultiplePiePlot(CategoryDataset dataset) {
    super();
    this.dataset = dataset;
    PiePlot piePlot = new PiePlot(null);
    this.pieChart = new JFreeChart(piePlot);
    this.pieChart.removeLegend();
    this.dataExtractOrder = TableOrder.BY_COLUMN;
    this.pieChart.setBackgroundPaint(null);
    TextTitle seriesTitle = new TextTitle("Series Title",
            new Font("SansSerif", Font.BOLD, 12));
    seriesTitle.setPosition(RectangleEdge.BOTTOM);
    this.pieChart.setTitle(seriesTitle);
    this.aggregatedItemsKey = "Other";
    this.aggregatedItemsPaint = Color.lightGray;
    this.sectionPaints = new HashMap();
}
 
Example 6
Source Project: coming   File: arja3_three_t.java    License: MIT License 6 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 */
public MultiplePiePlot(CategoryDataset dataset) {
    super();
    this.dataset = dataset;
    PiePlot piePlot = new PiePlot(null);
    this.pieChart = new JFreeChart(piePlot);
    this.pieChart.removeLegend();
    setDataset(dataset);
    this.dataExtractOrder = TableOrder.BY_COLUMN;
    this.pieChart.setBackgroundPaint(null);
    TextTitle seriesTitle = new TextTitle("Series Title",
            new Font("SansSerif", Font.BOLD, 12));
    seriesTitle.setPosition(RectangleEdge.BOTTOM);
    this.pieChart.setTitle(seriesTitle);
    this.aggregatedItemsKey = "Other";
    this.aggregatedItemsPaint = Color.lightGray;
    this.sectionPaints = new HashMap();
}
 
Example 7
Source Project: coming   File: Arja_0063_t.java    License: MIT License 6 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 */
public MultiplePiePlot(CategoryDataset dataset) {
    super();
    this.dataset = dataset;
    PiePlot piePlot = new PiePlot(null);
    this.pieChart = new JFreeChart(piePlot);
    if (dataset != null) {
    	  dataset.addChangeListener(this);
    	}
    this.dataExtractOrder = TableOrder.BY_COLUMN;
    this.pieChart.setBackgroundPaint(null);
    TextTitle seriesTitle = new TextTitle("Series Title",
            new Font("SansSerif", Font.BOLD, 12));
    seriesTitle.setPosition(RectangleEdge.BOTTOM);
    this.pieChart.setTitle(seriesTitle);
    this.aggregatedItemsKey = "Other";
    this.aggregatedItemsPaint = Color.lightGray;
    this.sectionPaints = new HashMap();
}
 
Example 8
/**
 * Paints this JLayeredPane within the specified graphics context.
 *
 * @param g  the Graphics context within which to paint
 */
public void paint(Graphics g) {
    if(isOpaque()) {
        Rectangle r = g.getClipBounds();
        Color c = getBackground();
        if(c == null)
            c = Color.lightGray;
        g.setColor(c);
        if (r != null) {
            g.fillRect(r.x, r.y, r.width, r.height);
        }
        else {
            g.fillRect(0, 0, getWidth(), getHeight());
        }
    }
    super.paint(g);
}
 
Example 9
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 */
public MultiplePiePlot(CategoryDataset dataset) {
    super();
    setDataset(dataset);
    PiePlot piePlot = new PiePlot(null);
    piePlot.setIgnoreNullValues(true);
    this.pieChart = new JFreeChart(piePlot);
    this.pieChart.removeLegend();
    this.dataExtractOrder = TableOrder.BY_COLUMN;
    this.pieChart.setBackgroundPaint(null);
    TextTitle seriesTitle = new TextTitle("Series Title",
            new Font("SansSerif", Font.BOLD, 12));
    seriesTitle.setPosition(RectangleEdge.BOTTOM);
    this.pieChart.setTitle(seriesTitle);
    this.aggregatedItemsKey = "Other";
    this.aggregatedItemsPaint = Color.lightGray;
    this.sectionPaints = new HashMap();
    this.legendItemShape = new Ellipse2D.Double(-4.0, -4.0, 8.0, 8.0);
}
 
Example 10
Source Project: netbeans   File: TaskListTable.java    License: Apache License 2.0 6 votes vote down vote up
/** Get the system-wide unfocused selection background color */
private static Color getUnfocusedSelectionBackground() {
    if (unfocusedSelBg == null) {
        //allow theme/ui custom definition
        unfocusedSelBg = UIManager.getColor("nb.explorer.unfocusedSelBg"); //NOI18N
        
        if (unfocusedSelBg == null) {
            //try to get standard shadow color
            unfocusedSelBg = UIManager.getColor("controlShadow"); //NOI18N
            
            if (unfocusedSelBg == null) {
                //Okay, the look and feel doesn't suport it, punt
                unfocusedSelBg = Color.lightGray;
            }

            //Lighten it a bit because disabled text will use controlShadow/
            //gray
            if (!Color.WHITE.equals(unfocusedSelBg.brighter())) {
                unfocusedSelBg = unfocusedSelBg.brighter();
            }
        }
    }

    return unfocusedSelBg;
}
 
Example 11
Source Project: coming   File: Arja_00162_t.java    License: MIT License 6 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 */
public MultiplePiePlot(CategoryDataset dataset) {
    super();
    this.dataset = dataset;
    PiePlot piePlot = new PiePlot(null);
    this.pieChart = new JFreeChart(piePlot);
    this.pieChart.removeLegend();
    this.dataExtractOrder = TableOrder.BY_COLUMN;
    this.pieChart.setBackgroundPaint(null);
    TextTitle seriesTitle = new TextTitle("Series Title",
            new Font("SansSerif", Font.BOLD, 12));
    seriesTitle.setPosition(RectangleEdge.BOTTOM);
    this.pieChart.setTitle(seriesTitle);
    if (dataset != null) {
        setDatasetGroup(dataset.getGroup());
        dataset.addChangeListener(this);
    }
    this.aggregatedItemsKey = "Other";
    this.aggregatedItemsPaint = Color.lightGray;
    this.sectionPaints = new HashMap();
}
 
Example 12
Source Project: SIMVA-SoS   File: MultiplePiePlot.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 */
public MultiplePiePlot(CategoryDataset dataset) {
    super();
    setDataset(dataset);
    PiePlot piePlot = new PiePlot(null);
    piePlot.setIgnoreNullValues(true);
    this.pieChart = new JFreeChart(piePlot);
    this.pieChart.removeLegend();
    this.dataExtractOrder = TableOrder.BY_COLUMN;
    this.pieChart.setBackgroundPaint(null);
    TextTitle seriesTitle = new TextTitle("Series Title",
            new Font("SansSerif", Font.BOLD, 12));
    seriesTitle.setPosition(RectangleEdge.BOTTOM);
    this.pieChart.setTitle(seriesTitle);
    this.aggregatedItemsKey = "Other";
    this.aggregatedItemsPaint = Color.lightGray;
    this.sectionPaints = new HashMap();
    this.legendItemShape = new Ellipse2D.Double(-4.0, -4.0, 8.0, 8.0);
}
 
Example 13
/** draw application objects */
@Override
public void draw(Graphics g, int x, int y, int object) {
    Location lRobot = hmodel.getAgPos(0);
    super.drawAgent(g, x, y, Color.lightGray, -1);
    switch (object) {
    case HouseModel.FRIDGE:
        if (lRobot.equals(hmodel.lFridge)) {
            super.drawAgent(g, x, y, Color.yellow, -1);
        }
        g.setColor(Color.black);
        drawString(g, x, y, defaultFont, "Fridge ("+hmodel.availableBeers+")");
        break;
    case HouseModel.OWNER:
        if (lRobot.equals(hmodel.lOwner)) {
            super.drawAgent(g, x, y, Color.yellow, -1);
        }
        String o = "Owner";
        if (hmodel.sipCount > 0) {
            o +=  " ("+hmodel.sipCount+")";
        }
        g.setColor(Color.black);
        drawString(g, x, y, defaultFont, o);
        break;
    }
    repaint();
}
 
Example 14
public Paint transform(Edge e) {
    if (e.getType().equals("mandatory")) {
        return Color.RED;
    }
    if (vv.getPickedEdgeState().isPicked(e)) {
        return Color.lightGray;
    }
    return Color.BLACK;
}
 
Example 15
public static Color getColor(String string)
{
    if (string.equals("blue"))
        return Color.blue;
    if (string.equals("cyan"))
        return Color.cyan;
    if (string.equals("green"))
        return Color.green;
    if (string.equals("gray"))
        return Color.lightGray;
    if (string.equals("magenta"))
        return Color.magenta;
    if (string.equals("pink"))
        return Color.pink;
    if (string.equals("red"))
        return Color.red;
    if (string.equals("yellow"))
        return Color.yellow;
    if (string.equals("black"))
        return Color.black;
    if (string.equals("white"))
        return Color.white;
    try
    {
        return Color.decode(string);
    }
    catch (NumberFormatException e)
    {
        return null;
    }
}
 
Example 16
Source Project: astor   File: ChartColor.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Convenience method to return an array of <code>Paint</code> objects that
 * represent the pre-defined colors in the <code>Color<code> and
 * <code>ChartColor</code> objects.
 *
 * @return An array of objects with the <code>Paint</code> interface.
 */
public static Paint[] createDefaultPaintArray() {

    return new Paint[] {
        new Color(0xFF, 0x55, 0x55),
        new Color(0x55, 0x55, 0xFF),
        new Color(0x55, 0xFF, 0x55),
        new Color(0xFF, 0xFF, 0x55),
        new Color(0xFF, 0x55, 0xFF),
        new Color(0x55, 0xFF, 0xFF),
        Color.pink,
        Color.gray,
        ChartColor.DARK_RED,
        ChartColor.DARK_BLUE,
        ChartColor.DARK_GREEN,
        ChartColor.DARK_YELLOW,
        ChartColor.DARK_MAGENTA,
        ChartColor.DARK_CYAN,
        Color.darkGray,
        ChartColor.LIGHT_RED,
        ChartColor.LIGHT_BLUE,
        ChartColor.LIGHT_GREEN,
        ChartColor.LIGHT_YELLOW,
        ChartColor.LIGHT_MAGENTA,
        ChartColor.LIGHT_CYAN,
        Color.lightGray,
        ChartColor.VERY_DARK_RED,
        ChartColor.VERY_DARK_BLUE,
        ChartColor.VERY_DARK_GREEN,
        ChartColor.VERY_DARK_YELLOW,
        ChartColor.VERY_DARK_MAGENTA,
        ChartColor.VERY_DARK_CYAN,
        ChartColor.VERY_LIGHT_RED,
        ChartColor.VERY_LIGHT_BLUE,
        ChartColor.VERY_LIGHT_GREEN,
        ChartColor.VERY_LIGHT_YELLOW,
        ChartColor.VERY_LIGHT_MAGENTA,
        ChartColor.VERY_LIGHT_CYAN
    };
}
 
Example 17
Source Project: netbeans   File: SheetCell.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Set how to paint renderer.
 * @param f <code>true</code> means flat, <code>false</code> means with button border
 */
public void setFlat(boolean f) {
    
    Color controlDkShadow = Color.lightGray;
    if (UIManager.getColor ("controlDkShadow") != null) controlDkShadow = UIManager.getColor ("controlDkShadow"); // NOI18N
    Color controlLtHighlight = Color.black;
    if (UIManager.getColor ("controlLtHighlight") != null) controlLtHighlight = UIManager.getColor ("controlLtHighlight"); // NOI18N
    Color buttonFocusColor = Color.blue;
    if (UIManager.getColor ("Button.focus") != null) buttonFocusColor = UIManager.getColor ("Button.focus"); // NOI18N
    
    flat = f ? Boolean.TRUE : Boolean.FALSE;
}
 
Example 18
public void initialize() {
  // Fonts
  this.setExtraLargeFont(new Font("Arial", Font.BOLD, 16));
  this.setLargeFont(new Font("Arial", Font.BOLD, 11));
  this.setRegularFont(new Font("Arial", Font.PLAIN, 11));
  this.setSmallFont(new Font("Arial", Font.PLAIN, 11));

  // paints
  this.setTitlePaint(Color.black);
  this.setSubtitlePaint(Color.black);
  this.setLegendItemPaint(Color.black);
  this.setPlotOutlinePaint(Color.black);
  this.setBaselinePaint(Color.black);
  this.setCrosshairPaint(Color.black);
  this.setLabelLinkPaint(Color.black);
  this.setTickLabelPaint(Color.black);
  this.setAxisLabelPaint(Color.black);
  this.setShadowPaint(Color.black);
  this.setItemLabelPaint(Color.black);

  this.setLegendBackgroundPaint(Color.white);
  this.setChartBackgroundPaint(Color.white);
  this.setPlotBackgroundPaint(Color.white);

  Paint[] colors = new Paint[] {Color.BLACK, new Color(0xFF, 0x55, 0x55),
      new Color(0x55, 0x55, 0xFF), new Color(0x55, 0xFF, 0x55), new Color(0xFF, 0xFF, 0x55),
      new Color(0xFF, 0x55, 0xFF), new Color(0x55, 0xFF, 0xFF), Color.pink, Color.gray,
      ChartColor.DARK_RED, ChartColor.DARK_BLUE, ChartColor.DARK_GREEN, ChartColor.DARK_YELLOW,
      ChartColor.DARK_MAGENTA, ChartColor.DARK_CYAN, Color.darkGray, ChartColor.LIGHT_RED,
      ChartColor.LIGHT_BLUE, ChartColor.LIGHT_GREEN, ChartColor.LIGHT_YELLOW,
      ChartColor.LIGHT_MAGENTA, ChartColor.LIGHT_CYAN, Color.lightGray, ChartColor.VERY_DARK_RED,
      ChartColor.VERY_DARK_BLUE, ChartColor.VERY_DARK_GREEN, ChartColor.VERY_DARK_YELLOW,
      ChartColor.VERY_DARK_MAGENTA, ChartColor.VERY_DARK_CYAN, ChartColor.VERY_LIGHT_RED,
      ChartColor.VERY_LIGHT_BLUE, ChartColor.VERY_LIGHT_GREEN, ChartColor.VERY_LIGHT_YELLOW,
      ChartColor.VERY_LIGHT_MAGENTA, ChartColor.VERY_LIGHT_CYAN};

  this.setDrawingSupplier(
      new DefaultDrawingSupplier(colors, DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));

  this.setRangeGridlinePaint(Color.GRAY);
  this.setDomainGridlinePaint(Color.GRAY);

  this.setAxisLinePaint(Color.black);
}
 
Example 19
Source Project: netbeans   File: WindowsLFCustoms.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Object[] createGuaranteedKeysAndValues() {
    return new Object[] {
         "InternalFrame.activeTitleBackground",
            new GuaranteedValue("InternalFrame.activeTitleBackground",
            Color.BLUE),
            
        "InternalFrame.borderShadow",
            new GuaranteedValue("InternalFrame.borderShadow", Color.gray),

        "InternalFrame.borderHighlight",
            new GuaranteedValue("InternalFrame.borderHighlight",
            Color.white),

        "InternalFrame.borderDarkShadow",
            new GuaranteedValue("InternalFrame.borderDarkShadow",
            Color.darkGray),

        "InternalFrame.borderLight",
            new GuaranteedValue("InternalFrame.borderLight",
            Color.lightGray),

        "TabbedPane.background",
            new GuaranteedValue("TabbedPane.background", Color.LIGHT_GRAY),

        "TabbedPane.focus",
            new GuaranteedValue("TabbedPane.focus", Color.GRAY),

        "TabbedPane.highlight",
            new GuaranteedValue("TabbedPane.highlight", Color.WHITE) ,
         
        "Button.dashedRectGapX",
           new GuaranteedValue("Button.dashedRectGapX", Integer.valueOf(5)),
           
        "Button.dashedRectGapY",
           new GuaranteedValue("Button.dashedRectGapY", Integer.valueOf(4)),
           
        "Button.dashedRectGapWidth",
           new GuaranteedValue("Button.dashedRectGapWidth", Integer.valueOf(10)),
           
        "Button.dashedRectGapHeight",
           new GuaranteedValue("Button.dashedRectGapHeight", Integer.valueOf(8)),
                 
        "Tree.expandedIcon", new TreeIcon(false),
        "Tree.collapsedIcon", new TreeIcon(true)
    };
}
 
Example 20
/**
 * Creates the sprite for this entity. It is an extra pain to create
 * transparent images in AWT.
 */
@Override
public void prepare() {
    // figure out size
    String shortName = entity.getShortName();
    Font font = new Font("SansSerif", Font.PLAIN, 10); //$NON-NLS-1$
    Rectangle tempRect = new Rectangle(47, 55, bv.getFontMetrics(font)
            .stringWidth(shortName) + 1, bv.getFontMetrics(font)
            .getAscent());

    // create image for buffer
    image = ImageUtil.createAcceleratedImage(bounds.width, bounds.height);
    Graphics graph = image.getGraphics();

    // Draw wreck image,if we've got one.
    Image wreck = bv.tileManager.wreckMarkerFor(entity, -1);
    if (null != wreck) {
        graph.drawImage(wreck, 0, 0, this);
    }

    if ((secondaryPos == -1) && GUIPreferences.getInstance()
            .getBoolean(GUIPreferences.ADVANCED_DRAW_ENTITY_LABEL)) {
        // draw box with shortName
        Color text = Color.lightGray;
        Color bkgd = Color.darkGray;
        Color bord = Color.black;

        graph.setFont(font);
        graph.setColor(bord);
        graph.fillRect(tempRect.x, tempRect.y, tempRect.width,
                tempRect.height);
        tempRect.translate(-1, -1);
        graph.setColor(bkgd);
        graph.fillRect(tempRect.x, tempRect.y, tempRect.width,
                tempRect.height);
        graph.setColor(text);
        graph.drawString(shortName, tempRect.x + 1,
                (tempRect.y + tempRect.height) - 1);
    }

    // create final image
    image = bv.getScaledImage(image, false);
    graph.dispose();
}