List of usage examples for java.awt Color cyan
Color cyan
To view the source code for java.awt Color cyan.
Click Source Link
From source file:net.sf.dynamicreports.test.jasper.chart.DifferenceChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<Date> column1; TextColumnBuilder<Timestamp> column2; TextColumnBuilder<Integer> column3; TextColumnBuilder<Integer> column4; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", Date.class), column2 = col.column("Column2", "field2", Timestamp.class), column3 = col.column("Column3", "field3", Integer.class), column4 = col.column("Column4", "field4", Integer.class)) .summary(/*from ww w .j av a 2 s .co m*/ cht.differenceChart().customizers(new ChartCustomizer()).setTimePeriod(column1) .series(cht.serie(column3), cht.serie(column4)).setTimePeriodType(TimePeriod.DAY) .setShowShapes(false).setPositiveColor(Color.BLUE).setNegativeColor(Color.MAGENTA), cht.differenceChart().setTimePeriod(column1).series(cht.serie(column3)) .setTimeAxisFormat(cht.axisFormat().setLabel("time").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setLineColor(Color.LIGHT_GRAY) .setVerticalTickLabels(true)), cht.differenceChart().setTimePeriod(column2).series(cht.serie(column3)) .setValueAxisFormat(cht.axisFormat().setLabel("value").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelMask("#,##0.00") .setLineColor(Color.LIGHT_GRAY).setRangeMinValueExpression(1) .setRangeMaxValueExpression(15).setVerticalTickLabels(true))); }
From source file:net.sf.dynamicreports.test.jasper.chart.HighLowChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1; TextColumnBuilder<Date> column2; TextColumnBuilder<Double> column3; TextColumnBuilder<Double> column4; TextColumnBuilder<Double> column5; TextColumnBuilder<Double> column6; TextColumnBuilder<Double> column7; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", String.class), column2 = col.column("Column2", "field2", Date.class), column3 = col.column("Column3", "field3", Double.class), column4 = col.column("Column4", "field4", Double.class), column5 = col.column("Column5", "field5", Double.class), column6 = col.column("Column6", "field6", Double.class), column7 = col.column("Column7", "field7", Double.class)) .summary(// ww w. j a va 2 s . c om cht.highLowChart().setSeries(column1).setDate(column2).setHigh(column3).setLow(column4) .setOpen(column5).setClose(column6).setVolume(column7).setShowOpenTicks(true) .setShowCloseTicks(true), cht.highLowChart().setSeries(column1).setDate(column2).setHigh(column3).setLow(column4) .setOpen(column5).setClose(column6).setVolume(column7) .setTimeAxisFormat(cht.axisFormat().setLabel("time").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setLineColor(Color.LIGHT_GRAY) .setVerticalTickLabels(true)), cht.highLowChart().setSeries(column1).setDate(column2).setHigh(column3).setLow(column4) .setOpen(column5).setClose(column6).setVolume(column7) .setValueAxisFormat(cht.axisFormat().setLabel("value").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelMask("#,##0.00") .setLineColor(Color.LIGHT_GRAY).setRangeMinValueExpression(1) .setRangeMaxValueExpression(15).setVerticalTickLabels(true))); }
From source file:com.bdb.weather.display.current.Hygrometer.java
private ChartViewer createChartElements() { humidityPlot.addLayer(//from w w w . ja v a2 s .co m new DialBackground(new GradientPaint(0.0f, 0.0f, Color.LIGHT_GRAY, 100.0f, 0.0f, Color.blue))); StandardDialScale scale = new StandardDialScale(Humidity.MIN_HUMIDITY.get(), Humidity.MAX_HUMIDITY.get(), 240.0, -300.0, 10.0, 9); scale.setTickLabelFont(scale.getTickLabelFont().deriveFont(14.0F).deriveFont(Font.PLAIN)); scale.setTickRadius(.9); scale.setTickLabelFormatter(new DecimalFormat("#")); scale.setTickLabelOffset(.2); scale.setTickLabelPaint(Color.BLACK); humidityPlot.addScale(0, scale); humidityPlot.setDialFrame(new StandardDialFrame()); DialValueIndicator valueInd = new DialValueIndicator(0); valueInd.setNumberFormat(new DecimalFormat("# '%rH'")); Color c = new Color(255, 255, 255, 0); valueInd.setBackgroundPaint(c); valueInd.setOutlinePaint(c); valueInd.setPaint(Color.cyan); humidityPlot.addLayer(valueInd); double angle = valueInd.getAngle(); double radius = valueInd.getRadius(); trendAnnotation.setPaint(Color.cyan); trendAnnotation.setAngle(angle); trendAnnotation.setRadius(radius + .1); humidityPlot.addLayer(trendAnnotation); DialPointer.Pointer pointer = new DialPointer.Pointer(0); humidityPlot.addPointer(pointer); DialCap cap = new DialCap(); cap.setRadius(cap.getRadius() * 1.5); humidityPlot.setCap(cap); range = new StandardDialRange(Humidity.MIN_HUMIDITY.get(), Humidity.MAX_HUMIDITY.get(), Color.BLACK); range.setInnerRadius(.40); range.setOuterRadius(.45); range.setScaleIndex(0); humidityPlot.addLayer(range); JFreeChart chart = new JFreeChart(humidityPlot); chart.setBackgroundPaint(Color.GRAY); ChartViewer chartViewer = new ChartViewer(chart); //chartViewer.setMinHeight(100); //chartViewer.setMinWidth(100); //chartViewer.setMaxHeight(400); //chartViewer.setMaxWidth(400); //chartViewer.setBackground(Color.GRAY); return chartViewer; }
From source file:net.sf.dynamicreports.test.jasper.chart.ChartTest.java
@Override public void test() { super.test(); numberOfPagesTest(1);/* w ww .j ava 2s . c om*/ chartCountTest("summary.chart1", 1); JFreeChart chart = getChart("summary.chart1", 0); TextTitle title = chart.getTitle(); Assert.assertEquals("title", "title", title.getText()); Assert.assertEquals("title color", Color.BLUE, title.getPaint()); Assert.assertEquals("title font", new Font("Arial", Font.BOLD, 10), title.getFont()); Assert.assertEquals("title position", RectangleEdge.RIGHT, title.getPosition()); TextTitle subtitle = (TextTitle) chart.getSubtitle(1); Assert.assertEquals("subtitle", "subtitle", subtitle.getText()); Assert.assertEquals("subtitle color", Color.CYAN, subtitle.getPaint()); Assert.assertEquals("subtitle font", new Font("Arial", Font.PLAIN, 10), subtitle.getFont()); LegendTitle legend = (LegendTitle) chart.getSubtitle(0); Assert.assertEquals("legend color", Color.BLUE, legend.getItemPaint()); Assert.assertEquals("legend backgroundcolor", Color.LIGHT_GRAY, legend.getBackgroundPaint()); Assert.assertEquals("legend font", new Font("Courier New", Font.PLAIN, 10), legend.getItemFont()); Assert.assertEquals("legend position", RectangleEdge.LEFT, legend.getPosition()); chartCountTest("summary.chart2", 1); chart = getChart("summary.chart2", 0); Assert.assertNull("legend", chart.getLegend()); Assert.assertEquals("plot orientation", PlotOrientation.HORIZONTAL, chart.getCategoryPlot().getOrientation()); Assert.assertEquals("plot series colors", Color.BLUE, chart.getPlot().getDrawingSupplier().getNextPaint()); Assert.assertEquals("plot series colors", Color.GREEN, chart.getPlot().getDrawingSupplier().getNextPaint()); Assert.assertEquals("plot series colors", Color.RED, chart.getPlot().getDrawingSupplier().getNextPaint()); }
From source file:net.sf.dynamicreports.test.jasper.chart.XyAreaChartTest.java
@Override public void test() { super.test(); numberOfPagesTest(1);//from w w w. j a v a2 s . c o m JFreeChart chart = getChart("summary.chart1", 0); Axis axis = chart.getXYPlot().getDomainAxis(); XYPlot plot = chart.getXYPlot(); Assert.assertEquals("renderer", XYAreaRenderer.class, plot.getRenderer().getClass()); Assert.assertEquals("category label", "category", axis.getLabel()); Assert.assertEquals("category label color", Color.BLUE, axis.getLabelPaint()); Assert.assertEquals("category label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont()); Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint()); Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont()); Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint()); chart = getChart("summary.chart2", 0); axis = chart.getXYPlot().getRangeAxis(); Assert.assertEquals("value label", "value", axis.getLabel()); Assert.assertEquals("value label color", Color.BLUE, axis.getLabelPaint()); Assert.assertEquals("value label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont()); Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint()); Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont()); Assert.assertEquals("tick label mask", "10.00", ((NumberAxis) axis).getNumberFormatOverride().format(10)); Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint()); Assert.assertEquals("range min value", 1d, ((ValueAxis) axis).getLowerBound()); Assert.assertEquals("range max value", 15d, ((ValueAxis) axis).getUpperBound()); }
From source file:playground.sergioo.facilitiesGenerator2012.gui.ClustersPanel.java
public ClustersPanel(LayersWindow window, Map<Integer, Cluster<Double>> clusters, int numTotalPoints) { super();//from w ww.ja va2 s.co m this.window = window; for (Cluster<Double> cluster : clusters.values()) { Color color = new Color((float) (Math.random() * 0.5), (float) (Math.random() * 0.5), (float) (Math.random() * 0.5)); //Color color = new Color(5f*(float)(cluster.getPoints().size())/numTotalPoints, 5f*(float)(cluster.getPoints().size())/numTotalPoints, 5f*(float)(cluster.getPoints().size())/numTotalPoints); PointsPainter pointsPainter = new PointsPainter(color); for (PointND<Double> point : cluster.getPoints()) pointsPainter.addPoint(new CoordImpl(point.getElement(0), point.getElement(1))); addLayer(new Layer(pointsPainter)); } this.setBackground(Color.CYAN); calculateBoundaries(); super.setPreferredSize(Toolkit.getDefaultToolkit().getScreenSize().width, Toolkit.getDefaultToolkit().getScreenSize().height); addMouseListener(this); addMouseMotionListener(this); addMouseWheelListener(this); addKeyListener(this); setFocusable(true); }
From source file:components.SizeDisplayer.java
protected void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D) g.create(); //copy g Dimension minSize = getMinimumSize(); Dimension prefSize = getPreferredSize(); Dimension size = getSize();//from w w w . j ava 2 s . co m int prefX = 0, prefY = 0; //Set hints so text looks nice. g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); //Draw the maximum size rectangle if we're opaque. if (isOpaque()) { g2d.setColor(getBackground()); g2d.fillRect(0, 0, size.width, size.height); } //Draw the icon. if (icon != null) { Composite oldComposite = g2d.getComposite(); g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f)); icon.paintIcon(this, g2d, (size.width - icon.getIconWidth()) / 2, (size.height - icon.getIconHeight()) / 2); g2d.setComposite(oldComposite); } //Draw the preferred size rectangle. prefX = (size.width - prefSize.width) / 2; prefY = (size.height - prefSize.height) / 2; g2d.setColor(Color.RED); g2d.drawRect(prefX, prefY, prefSize.width - 1, prefSize.height - 1); //Draw the minimum size rectangle. if (minSize.width != prefSize.width || minSize.height != prefSize.height) { int minX = (size.width - minSize.width) / 2; int minY = (size.height - minSize.height) / 2; g2d.setColor(Color.CYAN); g2d.drawRect(minX, minY, minSize.width - 1, minSize.height - 1); } //Draw the text. if (text != null) { Dimension textSize = getTextSize(g2d); g2d.setColor(getForeground()); g2d.drawString(text, (size.width - textSize.width) / 2, (size.height - textSize.height) / 2 + g2d.getFontMetrics().getAscent()); } g2d.dispose(); }
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>()); }/* ww w . ja v a 2 s.c o m*/ 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:Estadistica.VEstadistica.java
public void graficar(boolean isConcurrente, ArrayList<PaginasWeb> sitiosWeb, ArrayList<EstadisticaPalabra> tiemposPalabras, ArrayList<Resultado> resultados) { DefaultCategoryDataset barChartDatos = new DefaultCategoryDataset();// grafico de secuencial for (PaginasWeb paginas : sitiosWeb) { barChartDatos.setValue(paginas.getIncidencias(), "Sitios", paginas.getListaResultados().get(0).getTitulo()); }// w w w . ja v a2 s .c om //generar los datos de las tablas DefaultTableModel modeloTablaIncidencias; if (isConcurrente == false) { modeloTablaIncidencias = (DefaultTableModel) tablaIncidenciaSec.getModel(); } else { modeloTablaIncidencias = (DefaultTableModel) tablaIncidenciaSConc.getModel(); } Object[] fila = new Object[modeloTablaIncidencias.getColumnCount()]; int cont = 0; for (EstadisticaPalabra palabra : tiemposPalabras) { fila[0] = palabra.getPalabra(); fila[1] = palabra.getTiempo(); modeloTablaIncidencias.addRow(fila); cont++; System.out.println(palabra.getPalabra()); } System.out.println(cont); // Grafico // titulo-titulo arriba JFreeChart grafico = ChartFactory.createBarChart3D("Incidencias por sitio", "Sitios", "Numero de Incidencias", barChartDatos, PlotOrientation.HORIZONTAL, false, true, false); // CategoryPlot barChartCP = grafico.getCategoryPlot(); barChartCP.setRangeGridlinePaint(Color.cyan); ChartPanel barPanel = new ChartPanel(grafico); if (isConcurrente == true) { lienzoConc.removeAll(); lienzoConc.add(barPanel, BorderLayout.CENTER); lienzoConc.validate(); } if (isConcurrente == false) { lienzoSec.removeAll(); lienzoSec.add(barPanel, BorderLayout.CENTER); lienzoSec.validate(); } }
From source file:cs.ucy.ac.cy.osslicense.model.editor.visualizer.LicenseVisualizer.java
public VisualizationViewer<String, Edge> generateGraphView() { Transformer<String, Paint> vertexColor = new Transformer<String, Paint>() { public Paint transform(String licenseTerm) { if (licenseTerm.contains("May")) return Color.GREEN; if (licenseTerm.contains("Must")) return Color.ORANGE; if (licenseTerm.equals("LimitedLiability") || licenseTerm.equals("ProvideWithoutWarranty")) return Color.CYAN; return Color.YELLOW; }/* www . j a va2s . c o m*/ }; Layout<String, Edge> layout = new CircleLayout<String, Edge>(this.licenseGraph); layout.setSize(new Dimension(1024, 768)); VisualizationViewer<String, Edge> vv = new VisualizationViewer<String, Edge>(layout); vv.setPreferredSize(new Dimension(1024, 768)); vv.getRenderContext().setVertexFillPaintTransformer(vertexColor); vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<String>()); vv.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller<Edge>()); AbstractModalGraphMouse gm = new DefaultModalGraphMouse<String, Edge>(); vv.setGraphMouse(gm); popupMenu = new LicenseTermPopupMenu<>(licenseModel); gm.add(popupMenu); return vv; }