List of usage examples for java.awt Color darkGray
Color darkGray
To view the source code for java.awt Color darkGray.
Click Source Link
From source file:org.ut.biolab.medsavant.client.view.util.PeekingPanel.java
public PeekingPanel(String label, String borderLayoutPosition, JComponent panel, boolean isExpanded, int size) { final boolean isVertical = borderLayoutPosition.equals(BorderLayout.EAST) || borderLayoutPosition.equals(BorderLayout.WEST); this.setAnimated(false); if (borderLayoutPosition.equals(BorderLayout.NORTH)) { dockedSide = DockedSide.NORTH;//from ww w. ja v a2s .c o m this.setDirection(JXCollapsiblePane.Direction.UP); } else if (borderLayoutPosition.equals(BorderLayout.SOUTH)) { dockedSide = DockedSide.SOUTH; this.setDirection(JXCollapsiblePane.Direction.DOWN); } else if (borderLayoutPosition.equals(BorderLayout.EAST)) { dockedSide = DockedSide.EAST; this.setDirection(JXCollapsiblePane.Direction.RIGHT); } else { dockedSide = DockedSide.WEST; this.setDirection(JXCollapsiblePane.Direction.LEFT); } this.setLayout(new BorderLayout()); this.panel = panel; if (isVertical) { panel.setPreferredSize(new Dimension(size, 999)); } else { panel.setPreferredSize(new Dimension(999, size)); } titlePanel = new JPanel(); titlePanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); titlePanel.setBorder(ViewUtil.getTinyBorder()); if (isVertical) { titlePanel.setLayout(new BoxLayout(titlePanel, BoxLayout.Y_AXIS)); } else { titlePanel.setLayout(new BoxLayout(titlePanel, BoxLayout.X_AXIS)); } titlePanel.add(Box.createHorizontalGlue()); this.titleString = label.toUpperCase(); title = new JLabel(" ");//titleString); title.setForeground(Color.darkGray); if (borderLayoutPosition.equals(BorderLayout.EAST)) { title.setUI(new VerticalLabelUI(true)); } else if (borderLayoutPosition.equals(BorderLayout.WEST)) { title.setUI(new VerticalLabelUI(false)); } titlePanel.add(title); if (!isVertical) { titlePanel.add(Box.createHorizontalGlue()); } titlePanel.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { toggleExpanded(); } }); this.add(titlePanel, borderLayoutPosition); this.add(panel, BorderLayout.CENTER); setExpanded(isExpanded); }
From source file:net.sf.mzmine.chartbasics.chartthemes.ChartThemeFactory.java
public static EStandardChartTheme createBlackNWhiteTheme() { EStandardChartTheme theme = new EStandardChartTheme(THEME.BNW_PRINT, "BnW"); // Fonts/* w w w .jav a 2 s. com*/ theme.setExtraLargeFont(new Font("Arial", Font.BOLD, 16)); theme.setLargeFont(new Font("Arial", Font.BOLD, 11)); theme.setRegularFont(new Font("Arial", Font.PLAIN, 11)); theme.setSmallFont(new Font("Arial", Font.PLAIN, 11)); // Paints theme.setTitlePaint(Color.black); theme.setSubtitlePaint(Color.black); theme.setLegendItemPaint(Color.black); theme.setPlotOutlinePaint(Color.black); theme.setBaselinePaint(Color.black); theme.setCrosshairPaint(Color.black); theme.setLabelLinkPaint(Color.black); theme.setTickLabelPaint(Color.black); theme.setAxisLabelPaint(Color.black); theme.setShadowPaint(Color.black); theme.setItemLabelPaint(Color.black); theme.setLegendBackgroundPaint(Color.white); theme.setChartBackgroundPaint(Color.white); theme.setPlotBackgroundPaint(Color.white); // paint sequence: add black 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 }; theme.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)); theme.setErrorIndicatorPaint(Color.black); theme.setGridBandPaint(new Color(255, 255, 255, 20)); theme.setGridBandAlternatePaint(new Color(255, 255, 255, 40)); // axis Color transp = new Color(0, 0, 0, 200); theme.setRangeGridlinePaint(transp); theme.setDomainGridlinePaint(transp); theme.setAxisLinePaint(Color.black); // axis offset theme.setAxisOffset(new RectangleInsets(0, 0, 0, 0)); return theme; }
From source file:com.att.aro.ui.view.diagnostictab.plot.BurstPlot.java
public void populate(XYPlot plot, AROTraceData analysis) { if (analysis != null) { burstDataCollection.removeAllSeries(); Map<BurstCategory, XYIntervalSeries> seriesMap = new EnumMap<BurstCategory, XYIntervalSeries>( BurstCategory.class); final Map<BurstCategory, List<Burst>> burstMap = new HashMap<BurstCategory, List<Burst>>(); for (BurstCategory eventType : BurstCategory.values()) { XYIntervalSeries series = new XYIntervalSeries(eventType); seriesMap.put(eventType, series); burstDataCollection.addSeries(series); burstMap.put(eventType, new ArrayList<Burst>()); }/* w ww .j a v a 2s.c om*/ final List<Burst> burstStates = analysis.getAnalyzerResult().getBurstcollectionAnalysisData() .getBurstCollection(); Iterator<Burst> iter = burstStates.iterator(); while (iter.hasNext()) { Burst currEvent = iter.next(); if (currEvent != null) { BurstCategory burstState = currEvent.getBurstCategory(); if (burstState != null) { seriesMap.get(burstState).add(currEvent.getBeginTime(), currEvent.getBeginTime(), currEvent.getEndTime(), 0.5, 0, 1); burstMap.get(burstState).add(currEvent); } } } Color myGreen = new Color(34, 177, 76); Color lightGreen = new Color(134, 232, 162); XYItemRenderer renderer = plot.getRenderer(); renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.TCP_PROTOCOL), Color.blue); renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.TCP_LOSS_OR_DUP), Color.black); renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.USER_INPUT), myGreen); renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.SCREEN_ROTATION), lightGreen); renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.CLIENT_APP), Color.red); renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.SERVER_NET_DELAY), Color.yellow); renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.LONG), Color.gray); renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.PERIODICAL), Color.magenta); renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.CPU), Color.cyan); renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.UNKNOWN), Color.darkGray); // Assign ToolTip to renderer renderer.setBaseToolTipGenerator(new XYToolTipGenerator() { @Override public String generateToolTip(XYDataset dataset, int series, int item) { BurstCategory eventType = (BurstCategory) burstDataCollection.getSeries(series).getKey(); Burst b; int size = burstMap.get(eventType).size(); if (size > item) { b = burstMap.get(eventType).get(item); } else { b = burstMap.get(eventType).get(size); } final String PREFIX = "BurstCategory."; return MessageFormat.format(ResourceBundleHelper.getMessageString(PREFIX + eventType.ordinal()), b.getPackets().size(), b.getBurstBytes(), b.getBurstThroughPut()); } }); } plot.setDataset(burstDataCollection); // return plot; }
From source file:com.wattzap.view.graphs.MMPGraph.java
public MMPGraph(XYSeries series) { super();/*from w w w .j av a2s.c o m*/ NumberAxis yAxis = new NumberAxis(userPrefs.messages.getString("poWtt")); yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); double maxY = series.getMaxY(); yAxis.setRange(0, maxY + 20); yAxis.setTickLabelPaint(Color.white); yAxis.setLabelPaint(Color.white); LogAxis xAxis = new LogAxis(userPrefs.messages.getString("time")); xAxis.setTickLabelPaint(Color.white); xAxis.setBase(4); xAxis.setAutoRange(false); xAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); xAxis.setRange(1, series.getMaxX() + 500); xAxis.setNumberFormatOverride(new NumberFormat() { @Override public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos) { long millis = (long) number * 1000; if (millis >= 60000) { return new StringBuffer(String.format("%d m %d s", TimeUnit.MILLISECONDS.toMinutes((long) millis), TimeUnit.MILLISECONDS.toSeconds((long) millis) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes((long) millis)))); } else { return new StringBuffer(String.format("%d s", TimeUnit.MILLISECONDS.toSeconds((long) millis) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes((long) millis)))); } } @Override public StringBuffer format(long number, StringBuffer toAppendTo, FieldPosition pos) { return new StringBuffer(String.format("%s", number)); } @Override public Number parse(String source, ParsePosition parsePosition) { return null; } }); XYPlot plot = new XYPlot(new XYSeriesCollection(series), xAxis, yAxis, new XYLineAndShapeRenderer(true, false)); JFreeChart chart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, plot, false); chart.setBackgroundPaint(Color.gray); plot = chart.getXYPlot(); plot.setBackgroundPaint(Color.darkGray); /*plot.setDomainGridlinePaint(Color.lightGray); plot.setRangeGridlinePaint(Color.lightGray);*/ ValueAxis domainAxis = plot.getDomainAxis(); domainAxis.setTickLabelPaint(Color.white); domainAxis.setLabelPaint(Color.white); chartPanel = new ChartPanel(chart); chartPanel.setSize(100, 800); chartPanel.setFillZoomRectangle(true); chartPanel.setMouseWheelEnabled(true); chartPanel.setBackground(Color.gray); setLayout(new BorderLayout()); add(chartPanel, BorderLayout.CENTER); setBackground(Color.black); chartPanel.revalidate(); setVisible(true); }
From source file:org.cytoscape.dyn.internal.graphMetrics.GraphMetricsPanel.java
public GraphMetricsPanel(org.cytoscape.dyn.internal.CyActivator<T, C> cyActivator, DynNetwork<T> dynamicNetwork) { this.cyactivator = cyActivator; this.dynamicNetwork = dynamicNetwork; attributesTable = new JTable(new MyTableModel(dynamicNetwork.getNodeAttributes())); attributesTable.setPreferredScrollableViewportSize(new Dimension(300, 400)); attributesTable.setFillsViewportHeight(true); attributesTable.setShowGrid(false);/*from w ww .java 2s . c o m*/ JScrollPane tablePanel = new JScrollPane(attributesTable); tablePanel.setSize(new Dimension(250, 400)); edgeAttributesTable = new JTable(new MyTableModel(dynamicNetwork.getEdgeAttributes())); edgeAttributesTable.setPreferredScrollableViewportSize(new Dimension(300, 400)); edgeAttributesTable.setFillsViewportHeight(true); edgeAttributesTable.setShowGrid(false); JScrollPane edgeTablePanel = new JScrollPane(edgeAttributesTable); edgeTablePanel.setSize(new Dimension(250, 400)); plotChartButton = new JButton("Plot Selected Attributes"); closeTab = new JButton("Close Tab"); plotChartButton.addActionListener(this); closeTab.addActionListener(this); buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout()); buttonPanel.add(plotChartButton); buttonPanel.add(closeTab); buttonPanel.setBorder(BorderFactory.createTitledBorder(null, "Options", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("SansSerif", 0, 12), Color.darkGray)); tablePanel.setBorder( BorderFactory.createTitledBorder(null, "Node Attributes", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("SansSerif", 0, 12), Color.darkGray)); edgeTablePanel.setBorder( BorderFactory.createTitledBorder(null, "Edge Attributes", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("SansSerif", 0, 12), Color.darkGray)); GroupLayout cytoLayout = new GroupLayout(this); this.setLayout(cytoLayout); this.add(tablePanel); this.add(buttonPanel); cytoLayout.setHorizontalGroup(cytoLayout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(tablePanel, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE) .addComponent(edgeTablePanel, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE) .addComponent(buttonPanel, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)); cytoLayout.setVerticalGroup( cytoLayout.createSequentialGroup().addComponent(tablePanel, 200, GroupLayout.DEFAULT_SIZE, 300) .addComponent(edgeTablePanel, 200, GroupLayout.DEFAULT_SIZE, 300) .addComponent(buttonPanel, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)); this.setVisible(true); }
From source file:com.wattzap.view.Profile.java
@Override public void callback(Messages message, Object o) { double distance = 0.0; switch (message) { case SPEED:/* ww w.j a va2s.com*/ Telemetry t = (Telemetry) o; distance = t.getDistanceKM(); break; case STARTPOS: distance = (Double) o; break; case CLOSE: if (this.isVisible()) { remove(chartPanel); setVisible(false); revalidate(); } return; case GPXLOAD: // Note if we are loading a Power Profile there is no GPX data so we don't show the chart panel RouteReader routeData = (RouteReader) o; if (chartPanel != null) { remove(chartPanel); if (routeData.routeType() == RouteReader.POWER) { setVisible(false); chartPanel.revalidate(); return; } } else if (routeData.routeType() == RouteReader.POWER) { return; } logger.debug("Load " + routeData.getFilename()); XYDataset xyDataset = new XYSeriesCollection(routeData.getSeries()); // create the chart... final JFreeChart chart = ChartFactory.createXYAreaChart(routeData.getName(), // chart // title userPrefs.messages.getString("distancekm"), // domain axis label userPrefs.messages.getString("heightMeters"), // range axis label xyDataset, // data PlotOrientation.VERTICAL, // orientation false, // include legend false, // tooltips false // urls ); chart.setBackgroundPaint(Color.darkGray); plot = chart.getXYPlot(); // plot.setForegroundAlpha(0.85f); plot.setBackgroundPaint(Color.white); plot.setDomainGridlinePaint(Color.lightGray); plot.setRangeGridlinePaint(Color.lightGray); ValueAxis rangeAxis = plot.getRangeAxis(); rangeAxis.setTickLabelPaint(Color.white); rangeAxis.setLabelPaint(Color.white); ValueAxis domainAxis = plot.getDomainAxis(); domainAxis.setTickLabelPaint(Color.white); domainAxis.setLabelPaint(Color.white); double minY = routeData.getSeries().getMinY(); double maxY = routeData.getSeries().getMaxY(); rangeAxis.setRange(minY - 100.0, maxY + 100.0); chartPanel = new ChartPanel(chart); chartPanel.setSize(100, 800); setLayout(new BorderLayout()); add(chartPanel, BorderLayout.CENTER); setBackground(Color.black); chartPanel.revalidate(); setVisible(true); break; }// switch if (plot == null) { return; } if (marker != null) { plot.removeDomainMarker(marker); } marker = new ValueMarker(distance); marker.setPaint(Color.blue); BasicStroke stroke = new BasicStroke(2); marker.setStroke(stroke); plot.addDomainMarker(marker); }
From source file:hudson.plugins.robot.graph.RobotGraph.java
/** * Creates a Robot trend graph//from w w w .j a v a 2 s . co m * @return the JFreeChart graph object */ protected JFreeChart createGraph() { final JFreeChart chart = ChartFactory.createStackedAreaChart(null, null, yLabel, categoryDataset, PlotOrientation.VERTICAL, true, true, false); final LegendTitle legend = chart.getLegend(); legend.setPosition(RectangleEdge.RIGHT); chart.setBackgroundPaint(Color.white); final CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setForegroundAlpha(0.7f); plot.setBackgroundPaint(Color.white); plot.setRangeGridlinePaint(Color.darkGray); final CategoryAxis domainAxis = new ShiftedCategoryAxis(xLabel); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45); domainAxis.setLowerMargin(0.0); domainAxis.setUpperMargin(0.0); domainAxis.setCategoryMargin(0.0); plot.setDomainAxis(domainAxis); final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); if (binaryData) { rangeAxis.setUpperBound(1); } else if (upperBound != 0) { rangeAxis.setUpperBound(upperBound); } else { rangeAxis.setAutoRange(true); } rangeAxis.setLowerBound(lowerBound); Font font = new Font("Dialog", Font.PLAIN, fontSize); plot.getDomainAxis().setLabelFont(font); plot.getDomainAxis().setTickLabelFont(font); plot.getRangeAxis().setLabelFont(font); plot.getRangeAxis().setTickLabelFont(font); legend.setItemFont(font); final CategoryItemRenderer renderer = plot.getRenderer(); for (int i = 0; i < colors.length; i++) { renderer.setSeriesPaint(i, colors[i]); } plot.setInsets(new RectangleInsets(15.0, 0, 0, 5.0)); return chart; }
From source file:org.ut.biolab.medsavant.client.view.component.ListViewTablePanel.java
public ListViewTablePanel(Object[][] data, String[] columnNames, Class[] columnClasses, int[] hiddenColumns, boolean allowSearch, boolean allowSort, boolean allowPages, boolean allowSelection) { this.hiddenColumns = hiddenColumns; table = new SortableTable() { @Override//from w w w .j av a 2 s . c o m public Component prepareRenderer(TableCellRenderer renderer, int Index_row, int Index_col) { Component comp = super.prepareRenderer(renderer, Index_row, Index_col); //even index, selected or not selected if (isRowSelected(Index_row)) { comp.setBackground(ViewUtil.detailSelectedBackground); } else { if (Index_row % 2 == 0) { comp.setBackground(evenRowColor); } else { comp.setBackground(oddRowColor); } } comp.setForeground(ViewUtil.detailForeground); comp.setFont(comp.getFont().deriveFont(fontSize)); return comp; } }; table.setBorder(null); table.setSelectionForeground(Color.darkGray); table.setRowHeight(30); table.setClearSelectionOnTableDataChanges(true); table.setOptimized(true); table.setColumnAutoResizable(true); table.setAutoResort(false); //table.setDragEnabled(false); //table.setRowHeight(20); table.setSortable(allowSort); table.setSortingEnabled(allowSort); table.setFocusable(allowSelection); table.setCellSelectionEnabled(allowSelection); table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); table.setAutoResizeMode(SortableTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); //table.setMinimumSize(new Dimension(500,999)); //table.setPreferredSize(new Dimension(500,999)); //column chooser TableHeaderPopupMenuInstaller installer = new TableHeaderPopupMenuInstaller(table); installer.addTableHeaderPopupMenuCustomizer(new AutoResizePopupMenuCustomizer()); columnChooser = new ColumnChooser(table); installer.addTableHeaderPopupMenuCustomizer(columnChooser); AutoFilterTableHeader header = new AutoFilterTableHeader(table); header.setAutoFilterEnabled(true); header.setShowFilterIcon(true); header.setShowFilterName(true); table.setTableHeader(header); filterField = new QuickTableFilterField(model); filterField.setHintText("Type to search"); setLayout(new BorderLayout(3, 3)); fieldPanel = ViewUtil.getClearPanel(); fieldPanel.setLayout(new GridBagLayout()); setOpaque(false); GridBagConstraints gbc = new GridBagConstraints(); gbc.weightx = 1.0; //gbc.fill = GridBagConstraints.HORIZONTAL; gbc.fill = GridBagConstraints.BOTH; if (allowSearch) { fieldPanel.add(filterField, gbc); } if (columnNames.length > 1) { JButton chooseColumnButton = new JButton("Fields"); chooseColumnButton.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { columnChooser.showDialog(); } }); gbc.weightx = 0.0; gbc.fill = GridBagConstraints.NONE; fieldPanel.add(chooseColumnButton, gbc); } setTableModel(data, columnNames, columnClasses); if (allowSort) { add(fieldPanel, BorderLayout.NORTH); } JScrollPane jsp = new JScrollPane(table); jsp.setBorder(null); add(jsp, BorderLayout.CENTER); updateData(data); updateView(); }
From source file:org.openscience.cdk.applications.taverna.basicutilities.ChartTool.java
/** * Creates an area chart./* w ww. j a v a2s .co m*/ * * @param title * @param categoryAxisLabel * (X-Axis label) * @param valueAxisLabel * (Y-Axis label) * @param dataset * @return JfreeChart instance. */ public JFreeChart createAreaChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset dataset) { JFreeChart chart = ChartFactory.createAreaChart(title, categoryAxisLabel, valueAxisLabel, dataset, this.orientation, this.drawLegend, false, false); // set the background color for the chart... chart.setBackgroundPaint(Color.white); chart.setAntiAlias(true); CategoryPlot plot = chart.getCategoryPlot(); CategoryAxis domainAxis = plot.getDomainAxis(); domainAxis.setLowerMargin(0); domainAxis.setUpperMargin(0); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_90); AreaRenderer renderer = (AreaRenderer) plot.getRenderer(); renderer.setSeriesPaint(0, Color.blue); renderer.setSeriesPaint(1, Color.red); renderer.setSeriesPaint(2, Color.green); renderer.setSeriesPaint(3, Color.darkGray); renderer.setSeriesPaint(4, Color.yellow); return chart; }
From source file:com.liferay.server.admin.web.internal.portlet.action.ViewChartMVCResourceCommand.java
protected MeterPlot getMeterPlot(ThemeDisplay themeDisplay, ValueDataset valueDataset) { MeterPlot meterPlot = new MeterPlot(valueDataset); meterPlot.addInterval(new MeterInterval(themeDisplay.translate("normal"), new Range(0.0D, 75D), Color.lightGray, new BasicStroke(2.0F), new Color(0, 255, 0, 64))); meterPlot.addInterval(new MeterInterval(themeDisplay.translate("warning"), new Range(75D, 90D), Color.lightGray, new BasicStroke(2.0F), new Color(255, 255, 0, 64))); meterPlot.addInterval(new MeterInterval(themeDisplay.translate("critical"), new Range(90D, 100D), Color.lightGray, new BasicStroke(2.0F), new Color(255, 0, 0, 128))); meterPlot.setDialBackgroundPaint(Color.white); meterPlot.setDialShape(DialShape.PIE); meterPlot.setDialOutlinePaint(Color.gray); meterPlot.setTickLabelFont(new Font(null, Font.PLAIN, 10)); meterPlot.setTickLabelPaint(Color.darkGray); meterPlot.setTickLabelsVisible(true); meterPlot.setTickPaint(Color.lightGray); meterPlot.setTickSize(5D);// w w w . j a v a 2 s .co m meterPlot.setMeterAngle(180); meterPlot.setNeedlePaint(Color.darkGray); meterPlot.setRange(new Range(0.0D, 100D)); meterPlot.setValueFont(new Font(null, Font.PLAIN, 10)); meterPlot.setValuePaint(Color.black); meterPlot.setUnits("%"); return meterPlot; }