List of usage examples for java.awt Color BLACK
Color BLACK
To view the source code for java.awt Color BLACK.
Click Source Link
From source file:NwFontChooserS.java
private void initAll() { getContentPane().setLayout(null);//w w w .j a va 2 s . c o m setBounds(50, 50, 450, 450); addLists(); addButtons(); Sample.setBounds(10, 320, 415, 25); Sample.setForeground(Color.black); getContentPane().add(Sample); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { setVisible(false); } }); }
From source file:app.Plot.java
public void plotDesign(JFreeChart chart) { XYPlot plot = chart.getXYPlot();//from www . jav a2 s .c o m plot.setBackgroundPaint(Color.white); plot.setDomainGridlinePaint(Color.black); plot.setRangeGridlinePaint(Color.black); XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); renderer.setSeriesShapesVisible(0, false); renderer.setSeriesPaint(0, Color.black); plot.setRenderer(renderer); }
From source file:com.googlecode.logVisualizer.chart.HorizontalIntervallBarChartBuilder.java
private JFreeChart createChart(final CategoryDataset dataset) { final JFreeChart chart = ChartFactory.createBarChart(getTitle(), xLable, yLable, dataset, PlotOrientation.HORIZONTAL, isIncludeLegend(), true, false); final CategoryPlot plot = (CategoryPlot) chart.getPlot(); final CategoryAxis categoryAxis = plot.getDomainAxis(); final LayeredBarRenderer renderer = new LayeredBarRenderer(); plot.setBackgroundPaint(Color.white); plot.setDomainGridlinesVisible(false); plot.setRangeGridlinePaint(Color.black); setBarShadowVisible(chart, false);//from w ww. j a v a 2 s . co m plot.getRangeAxis().setStandardTickUnits(NumberAxis.createIntegerTickUnits()); plot.getRangeAxis().setLowerBound(-35); plot.getRangeAxis().setUpperBound(35); renderer.setDrawBarOutline(false); renderer.setSeriesPaint(0, Color.blue); renderer.setSeriesPaint(1, Color.green); renderer.setBaseItemLabelsVisible(true); renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator()); renderer.setSeriesPositiveItemLabelPosition(0, new ItemLabelPosition(ItemLabelAnchor.OUTSIDE3, TextAnchor.CENTER)); renderer.setSeriesPositiveItemLabelPosition(1, new ItemLabelPosition(ItemLabelAnchor.OUTSIDE2, TextAnchor.CENTER)); renderer.setSeriesNegativeItemLabelPosition(0, new ItemLabelPosition(ItemLabelAnchor.OUTSIDE9, TextAnchor.CENTER)); renderer.setSeriesNegativeItemLabelPosition(1, new ItemLabelPosition(ItemLabelAnchor.OUTSIDE10, TextAnchor.CENTER)); renderer.setItemLabelAnchorOffset(9.0); renderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator("{1}, {2}", NumberFormat.getInstance())); plot.setRenderer(renderer); plot.setRowRenderingOrder(SortOrder.DESCENDING); categoryAxis.setCategoryMargin(0.15); categoryAxis.setUpperMargin(0.0175); categoryAxis.setLowerMargin(0.0175); return chart; }
From source file:ComboBoxDemo2.java
public ComboBoxDemo2() { setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); String[] patternExamples = { "dd MMMMM yyyy", "dd.MM.yy", "MM/dd/yy", "yyyy.MM.dd G 'at' hh:mm:ss z", "EEE, MMM d, ''yy", "h:mm a", "H:mm:ss:SSS", "K:mm a,z", "yyyy.MMMMM.dd GGG hh:mm aaa" }; currentPattern = patternExamples[0]; // Set up the UI for selecting a pattern. JLabel patternLabel1 = new JLabel("Enter the pattern string or"); JLabel patternLabel2 = new JLabel("select one from the list:"); JComboBox patternList = new JComboBox(patternExamples); patternList.setEditable(true);/* w w w.j av a 2 s. c o m*/ patternList.addActionListener(this); // Create the UI for displaying result. JLabel resultLabel = new JLabel("Current Date/Time", JLabel.LEADING); // == // LEFT result = new JLabel(" "); result.setForeground(Color.black); result.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.black), BorderFactory.createEmptyBorder(5, 5, 5, 5))); // Lay out everything. JPanel patternPanel = new JPanel(); patternPanel.setLayout(new BoxLayout(patternPanel, BoxLayout.PAGE_AXIS)); patternPanel.add(patternLabel1); patternPanel.add(patternLabel2); patternList.setAlignmentX(Component.LEFT_ALIGNMENT); patternPanel.add(patternList); JPanel resultPanel = new JPanel(new GridLayout(0, 1)); resultPanel.add(resultLabel); resultPanel.add(result); patternPanel.setAlignmentX(Component.LEFT_ALIGNMENT); resultPanel.setAlignmentX(Component.LEFT_ALIGNMENT); add(patternPanel); add(Box.createRigidArea(new Dimension(0, 10))); add(resultPanel); setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); reformat(); }
From source file:phat.sensors.accelerometer.XYAccelerationsChart.java
/** * Creates a new graphic to plot accelerations. * * @param title the frame title./*w w w. j a v a 2s . c om*/ */ public XYAccelerationsChart(final String windowstitle, final String chartTitle, final String domainAxisLabel, final String rangeAxisLabel) { super(windowstitle); //Object[][][] data = new Object[3][50][2]; xAcceleration = new XYSeries("x acc."); yAcceleration = new XYSeries("y acc."); zAcceleration = new XYSeries("z acc."); dataset = new XYSeriesCollection(); dataset.addSeries(xAcceleration); dataset.addSeries(yAcceleration); dataset.addSeries(zAcceleration); chart = ChartFactory.createXYLineChart(chartTitle, // chart title domainAxisLabel, // domain axis label rangeAxisLabel, // range axis label dataset, // data PlotOrientation.VERTICAL, true, // include legend true, false); plot = chart.getXYPlot(); /*final NumberAxis domainAxis = new NumberAxis("x"); final NumberAxis rangeAxis = new LogarithmicAxis("Log(y)"); plot.setDomainAxis(domainAxis); plot.setRangeAxis(rangeAxis);*/ chart.setBackgroundPaint(Color.white); plot.setOutlinePaint(Color.black); chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(500, 270)); setContentPane(chartPanel); }
From source file:org.sonar.plugins.scmstats.charts.PieChart3D.java
@Override protected Plot getPlot(ChartParameters params) { PiePlot3D plot = new PiePlot3D(); String[] colorsHex = params.getValues(PARAM_COLORS, ",", true); String[] serie = params.getValues(PARAM_VALUES, ";", true); DefaultPieDataset set = new DefaultPieDataset(); Color[] colors = COLORS;//from ww w .jav a2s . c om if (colorsHex != null && colorsHex.length > 0) { colors = new Color[colorsHex.length]; for (int i = 0; i < colorsHex.length; i++) { colors[i] = Color.decode("#" + colorsHex[i]); } } String[] keyValue = null; for (int i = 0; i < serie.length; i++) { if (!StringUtils.isEmpty(serie[i])) { keyValue = StringUtils.split(serie[i], "="); set.setValue(keyValue[0], Double.parseDouble(keyValue[1])); plot.setSectionPaint(keyValue[0], colors[i]); } } plot.setDataset(set); plot.setStartAngle(180); plot.setCircular(true); plot.setDirection(Rotation.CLOCKWISE); plot.setNoDataMessage(DEFAULT_MESSAGE_NODATA); plot.setInsets(RectangleInsets.ZERO_INSETS); plot.setForegroundAlpha(1.0f); plot.setBackgroundAlpha(0.0f); plot.setIgnoreNullValues(true); plot.setIgnoreZeroValues(true); plot.setOutlinePaint(Color.WHITE); plot.setShadowPaint(Color.GREEN); plot.setDarkerSides(true); plot.setLabelFont(DEFAULT_FONT); plot.setLabelPaint(Color.BLACK); plot.setLabelBackgroundPaint(Color.WHITE); plot.setLabelOutlinePaint(Color.WHITE); plot.setLabelShadowPaint(Color.GRAY); plot.setLabelPadding(new RectangleInsets(1, 1, 1, 1)); plot.setInteriorGap(0.01); plot.setMaximumLabelWidth(0.25); return plot; }
From source file:Pear.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; Dimension d = getSize();/* www . jav a2 s . c o m*/ int w = d.width; int h = d.height; double ew = w / 2; double eh = h / 2; g2.setColor(Color.green); // Creates the first leaf by filling the intersection of two Area objects // created from an ellipse. leaf.setFrame(ew - 16, eh - 29, 15.0, 15.0); leaf1 = new Area(leaf); leaf.setFrame(ew - 14, eh - 47, 30.0, 30.0); leaf2 = new Area(leaf); leaf1.intersect(leaf2); g2.fill(leaf1); // Creates the second leaf. leaf.setFrame(ew + 1, eh - 29, 15.0, 15.0); leaf1 = new Area(leaf); leaf2.intersect(leaf1); g2.fill(leaf2); g2.setColor(Color.black); // Creates the stem by filling the Area resulting from the subtraction of // two Area objects created from an ellipse. stem.setFrame(ew, eh - 42, 40.0, 40.0); st1 = new Area(stem); stem.setFrame(ew + 3, eh - 47, 50.0, 50.0); st2 = new Area(stem); st1.subtract(st2); g2.fill(st1); g2.setColor(Color.yellow); // Creates the pear itself by filling the Area resulting from the union of // two Area objects created by two different ellipses. circle.setFrame(ew - 25, eh, 50.0, 50.0); oval.setFrame(ew - 19, eh - 20, 40.0, 70.0); circ = new Area(circle); ov = new Area(oval); circ.add(ov); g2.fill(circ); }
From source file:view.FuzzySetView.java
private void fillView() { XYAreaRenderer renderer = new XYAreaRenderer(); renderer.setSeriesPaint(0, Color.CYAN); renderer.setSeriesOutlinePaint(0, Color.BLACK); renderer.setSeriesOutlineStroke(0, new BasicStroke(2f)); renderer.setOutline(true);/*from ww w. jav a 2 s .co m*/ plot.setRenderer(renderer); }
From source file:org.sonar.plugins.abacus.chart.PieChart3D.java
@Override protected Plot getPlot(ChartParameters params) { PiePlot3D plot = new PiePlot3D(); String[] colorsHex = params.getValues(PARAM_COLORS, ",", true); String[] serie = params.getValues(PARAM_VALUES, ";", true); DefaultPieDataset set = new DefaultPieDataset(); Color[] colors = COLORS;//from ww w.j a va 2 s . co m if (colorsHex != null && colorsHex.length > 0) { colors = new Color[colorsHex.length]; for (int i = 0; i < colorsHex.length; i++) { colors[i] = Color.decode("#" + colorsHex[i]); } } String[] keyValue = null; for (int i = 0; i < serie.length; i++) { if (!StringUtils.isEmpty(serie[i])) { keyValue = StringUtils.split(serie[i], "="); set.setValue(keyValue[0], Double.parseDouble(keyValue[1])); plot.setSectionPaint(keyValue[0], colors[i]); } } plot.setDataset(set); plot.setStartAngle(360); plot.setCircular(true); plot.setDirection(Rotation.CLOCKWISE); plot.setNoDataMessage(DEFAULT_MESSAGE_NODATA); plot.setInsets(RectangleInsets.ZERO_INSETS); plot.setForegroundAlpha(1.0f); plot.setBackgroundAlpha(0.0f); plot.setIgnoreNullValues(true); plot.setIgnoreZeroValues(true); plot.setOutlinePaint(Color.WHITE); plot.setShadowPaint(Color.WHITE); plot.setDarkerSides(false); plot.setLabelFont(DEFAULT_FONT); plot.setLabelPaint(Color.BLACK); plot.setLabelBackgroundPaint(Color.WHITE); plot.setLabelOutlinePaint(Color.WHITE); plot.setLabelShadowPaint(Color.WHITE); plot.setLabelPadding(new RectangleInsets(1, 1, 1, 1)); plot.setInteriorGap(0.02); plot.setMaximumLabelWidth(0.15); return plot; }