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.AreaChartTest.java
@Override public void test() { super.test(); numberOfPagesTest(1);/*from w ww .jav a 2 s . c om*/ JFreeChart chart = getChart("summary.chart1", 0); Axis axis = chart.getCategoryPlot().getDomainAxis(); CategoryPlot categoryPlot = chart.getCategoryPlot(); Assert.assertEquals("renderer", AreaRenderer.class, categoryPlot.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()); CategoryLabelPosition labelPosition = chart.getCategoryPlot().getDomainAxis().getCategoryLabelPositions() .getLabelPosition(RectangleEdge.LEFT); Assert.assertEquals("plot label rotation", (45d / 180) * Math.PI, labelPosition.getAngle()); Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint()); chart = getChart("summary.chart2", 0); axis = chart.getCategoryPlot().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:net.sf.dynamicreports.test.jasper.chart.MeterChartTest.java
@Override public void test() { super.test(); numberOfPagesTest(1);// w w w . j a v a 2s. com JFreeChart chart = getChart("summary.chart1", 0); Plot plot = chart.getPlot(); Assert.assertEquals("renderer", MeterPlot.class, plot.getClass()); MeterPlot meterPlot = (MeterPlot) plot; Assert.assertEquals("value", 15, meterPlot.getDataset().getValue()); Assert.assertEquals("data range low", 3d, meterPlot.getRange().getLowerBound()); Assert.assertEquals("data range high", 30d, meterPlot.getRange().getUpperBound()); Assert.assertEquals("value color", Color.BLUE, meterPlot.getValuePaint()); Assert.assertEquals("value mask", "15.0", meterPlot.getTickLabelFormat().format(15)); Assert.assertEquals("value font", new Font("Arial", Font.PLAIN, 10), meterPlot.getValueFont()); Assert.assertEquals("shape", DialShape.CIRCLE, meterPlot.getDialShape()); Assert.assertEquals("meter angle", 270, meterPlot.getMeterAngle()); Assert.assertEquals("units", "units", meterPlot.getUnits()); Assert.assertEquals("tick interval", 3d, meterPlot.getTickSize()); Assert.assertEquals("background color", Color.LIGHT_GRAY, meterPlot.getDialBackgroundPaint()); Assert.assertEquals("needle color", Color.CYAN, meterPlot.getNeedlePaint()); Assert.assertEquals("tick color", Color.MAGENTA, meterPlot.getTickPaint()); Assert.assertEquals("tick label font", new Font("Courier New", Font.PLAIN, 10), meterPlot.getTickLabelFont()); Assert.assertEquals("intervals size", 2, meterPlot.getIntervals().size()); intervalTest((MeterInterval) meterPlot.getIntervals().get(0), "red", new Color(1f, 0f, 0f, 0.8f), 25d, 30d); intervalTest((MeterInterval) meterPlot.getIntervals().get(1), "yellow", new Color(1f, 1f, 0f, 0.5f), 20d, 25d); }
From source file:net.sf.dynamicreports.test.jasper.chart.StackedAreaChartTest.java
@Override public void test() { super.test(); numberOfPagesTest(1);// w w w . ja v a 2 s. c o m JFreeChart chart = getChart("summary.chart1", 0); Axis axis = chart.getCategoryPlot().getDomainAxis(); CategoryPlot categoryPlot = chart.getCategoryPlot(); Assert.assertEquals("renderer", StackedAreaRenderer.class, categoryPlot.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()); CategoryLabelPosition labelPosition = chart.getCategoryPlot().getDomainAxis().getCategoryLabelPositions() .getLabelPosition(RectangleEdge.LEFT); Assert.assertEquals("plot label rotation", (45d / 180) * Math.PI, labelPosition.getAngle()); Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint()); chart = getChart("summary.chart2", 0); axis = chart.getCategoryPlot().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:net.sf.dynamicreports.test.jasper.chart.XyStepChartTest.java
@Override public void test() { super.test(); numberOfPagesTest(1);/*from w w w . j a v a2 s . c om*/ JFreeChart chart = getChart("summary.chart1", 0); XYItemRenderer renderer = chart.getXYPlot().getRenderer(); Assert.assertEquals("renderer", XYStepRenderer.class, renderer.getClass()); Assert.assertEquals("step point", 0.5d, ((XYStepRenderer) renderer).getStepPoint()); chart = getChart("summary.chart2", 0); Axis axis = chart.getXYPlot().getDomainAxis(); 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.chart3", 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:it.alus.GPSreceiver.instruments.Speedometer.java
public Speedometer(int Vs0, int Vfe, int Vs, int Vno, int Vne, int endScaleKmh) { super(null);/*from ww w. j a va 2 s . c o m*/ currentGroundSpeedKmh = 0; if (!setArcs(Vs0, Vfe, Vs, Vno, Vne, endScaleKmh)) { this.Vx = 90; this.Vy = 100; this.Vs0 = 45; this.Vs = 55; this.Vfe = 86; this.Va = 135; this.Vno = 160; this.Vne = 180; this.endScale = 185; } groundSpeedDataset = new DefaultValueDataset(0); totalSpeedDataset = new DefaultValueDataset(0); DialPlot dialplot = new DialPlot(); dialplot.setDataset(0, groundSpeedDataset); dialplot.setDataset(1, totalSpeedDataset); StandardDialFrame dialFrame = new StandardDialFrame(); dialFrame.setBackgroundPaint(Color.lightGray); dialFrame.setForegroundPaint(Color.gray); DialBackground db = new DialBackground(Color.black); dialplot.setBackground(db); dialplot.setDialFrame(dialFrame); DialTextAnnotation dialtextannotation = new DialTextAnnotation("Km/h"); dialtextannotation.setFont(new Font("Arial", 1, 14)); dialtextannotation.setRadius(0.4D); dialtextannotation.setPaint(Color.lightGray); dialplot.addLayer(dialtextannotation); //DialValueIndicator dialvalueindicator = new DialValueIndicator(0); //dialplot.addLayer(dialvalueindicator); DialValueIndicator groundIndicator = new DialValueIndicator(0); groundIndicator.setFont(new Font("Dialog", 0, 10)); groundIndicator.setOutlinePaint(Color.green); groundIndicator.setRadius(0.3); groundIndicator.setAngle(-110D); dialplot.addLayer(groundIndicator); DialValueIndicator realIndicator = new DialValueIndicator(1); realIndicator.setFont(new Font("Dialog", 0, 10)); realIndicator.setOutlinePaint(Color.cyan); realIndicator.setRadius(0.3); realIndicator.setAngle(-70); dialplot.addLayer(realIndicator); StandardDialScale scale = new StandardDialScale(0, endScale, 90, -350, 10, 5); scale.setFirstTickLabelVisible(true); scale.setTickRadius(0.9D); scale.setTickLabelOffset(0.14999999999999999D); NumberFormat formatter = new DecimalFormat("#"); scale.setTickLabelFormatter(formatter); scale.setTickLabelFont(new Font("Arial", Font.BOLD, 16)); scale.setMajorTickPaint(Color.white); scale.setMinorTickPaint(Color.lightGray); scale.setTickLabelPaint(Color.white); dialplot.addScale(0, scale); dialplot.addPointer(new org.jfree.chart.plot.dial.DialPointer.Pin()); DialCap dialcap = new DialCap(); dialcap.setRadius(0.10); dialcap.setFillPaint(Color.lightGray); dialplot.setCap(dialcap); jChart = new JFreeChart(dialplot); StandardDialRange standarddialrange = new StandardDialRange(this.Vne, endScale, Color.red); standarddialrange.setInnerRadius(0.54D); standarddialrange.setOuterRadius(0.56D); dialplot.addLayer(standarddialrange); StandardDialRange standarddialrange1 = new StandardDialRange(this.Vno, this.Vne, Color.yellow); standarddialrange1.setInnerRadius(0.54D); standarddialrange1.setOuterRadius(0.56D); dialplot.addLayer(standarddialrange1); StandardDialRange standarddialrange2 = new StandardDialRange(this.Vs, this.Vno, Color.green); standarddialrange2.setInnerRadius(0.54D); standarddialrange2.setOuterRadius(0.56D); dialplot.addLayer(standarddialrange2); StandardDialRange standarddialrange3 = new StandardDialRange(this.Vs0, this.Vfe, Color.white); standarddialrange3.setInnerRadius(0.50D); standarddialrange3.setOuterRadius(0.52D); dialplot.addLayer(standarddialrange3); //dialplot.removePointer(0); Pointer realPointer = new Pointer(1); realPointer.setFillPaint(Color.cyan); dialplot.addPointer(realPointer); Pointer groundPointer = new Pointer(0); groundPointer.setFillPaint(Color.green); dialplot.addPointer(groundPointer); /* PER NASCONDERE GLI INDICATORI groundIndicator.setVisible(false); realIndicator.setVisible(false); groundPointer.setVisible(false); realPointer.setVisible(false); */ super.setChart(jChart); super.setPreferredSize(new Dimension(400, 400)); }
From source file:cl.apr.pdf.chart.BarChartAviso.java
public CustomRenderer() { this.colors = new Paint[] { Color.red, Color.blue, Color.green, Color.yellow, Color.orange, Color.cyan, Color.magenta, Color.blue }; }
From source file:net.sf.dynamicreports.test.jasper.chart.XyBarChartTest.java
@Override public void test() { super.test(); numberOfPagesTest(1);//from w w w . j ava 2s . c o m JFreeChart chart = getChart("summary.chart1", 0); XYPlot plot = chart.getXYPlot(); Assert.assertEquals("renderer", XYBarRenderer.class, plot.getRenderer().getClass()); Assert.assertTrue("show labels", plot.getRenderer().getBaseItemLabelsVisible()); //Assert.assertFalse("show tick labels", plot.getDomainAxis().isTickMarksVisible()); //Assert.assertFalse("show tick marks", plot.getDomainAxis().isTickLabelsVisible()); chart = getChart("summary.chart2", 0); Axis axis = chart.getXYPlot().getDomainAxis(); 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.chart3", 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:org.polymap.core.style.geotools.DefaultStyles.java
/** * Create a Style to draw polygon features with a thin blue outline and * a cyan fill/* w w w.j a v a2s . c o m*/ */ private Style createPolygonStyle(Style style) { // create a partially opaque outline stroke Stroke stroke = styleFactory.createStroke(filterFactory.literal(Color.DARK_GRAY), filterFactory.literal(0.5), filterFactory.literal(0.5)); // create a partial opaque fill Fill fill = styleFactory.createFill(filterFactory.literal(Color.CYAN), filterFactory.literal(0.5)); /* * Setting the geometryPropertyName arg to null signals that we want to * draw the default geometry of features */ PolygonSymbolizer sym = styleFactory.createPolygonSymbolizer(stroke, fill, null); Rule rule = styleFactory.createRule(); rule.setName("Rule for PolygonSymbolizer"); rule.symbolizers().add(sym); style.featureTypeStyles().get(0).rules().add(rule); return style; }
From source file:org.encog.workbench.tabs.visualize.structure.GenomeStructureTab.java
public GenomeStructureTab(NEATGenome genome) { super(null);/*w ww . j a va 2s.com*/ this.genome = genome; // Graph<V, E> where V is the type of the vertices // and E is the type of the edges Graph<DrawnNeuron, DrawnConnection> g = null; g = buildGraph(genome); if (g == null) { throw new WorkBenchError("Can't visualize genome"); } Transformer<DrawnNeuron, Point2D> staticTranformer = new Transformer<DrawnNeuron, Point2D>() { public Point2D transform(DrawnNeuron n) { int x = (int) (n.getX() * 600); int y = (int) (n.getY() * 300); Point2D result = new Point(x + 32, y); return result; } }; Transformer<DrawnNeuron, Paint> vertexPaint = new Transformer<DrawnNeuron, Paint>() { public Paint transform(DrawnNeuron neuron) { switch (neuron.getType()) { case Bias: return Color.yellow; case Input: return Color.white; case Output: return Color.green; case Context: return Color.cyan; case Linear: return Color.blue; case Sigmoid: return Color.magenta; case Gaussian: return Color.cyan; case SIN: return Color.gray; default: return Color.red; } } }; Transformer<DrawnConnection, Paint> edgePaint = new Transformer<DrawnConnection, Paint>() { public Paint transform(DrawnConnection connection) { if (connection.isContext()) { return Color.lightGray; } else { return Color.black; } } }; // The Layout<V, E> is parameterized by the vertex and edge types StaticLayout<DrawnNeuron, DrawnConnection> layout = new StaticLayout<DrawnNeuron, DrawnConnection>(g, staticTranformer); layout.setSize(new Dimension(5000, 5000)); // sets the initial size of // the space // The BasicVisualizationServer<V,E> is parameterized by the edge types // BasicVisualizationServer<DrawnNeuron, DrawnConnection> vv = new // BasicVisualizationServer<DrawnNeuron, DrawnConnection>( // layout); // Dimension d = new Dimension(600,600); vv = new VisualizationViewer<DrawnNeuron, DrawnConnection>(layout); // vv.setPreferredSize(d); //Sets the viewing area size vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR); vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller()); vv.getRenderContext().setVertexFillPaintTransformer(vertexPaint); vv.getRenderContext().setEdgeDrawPaintTransformer(edgePaint); vv.getRenderContext().setArrowDrawPaintTransformer(edgePaint); vv.getRenderContext().setArrowFillPaintTransformer(edgePaint); vv.setVertexToolTipTransformer(new ToStringLabeller()); vv.setVertexToolTipTransformer(new Transformer<DrawnNeuron, String>() { public String transform(DrawnNeuron edge) { return edge.getToolTip(); } }); vv.setEdgeToolTipTransformer(new Transformer<DrawnConnection, String>() { public String transform(DrawnConnection edge) { return edge.getToolTip(); } }); final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); this.setLayout(new BorderLayout()); add(panel, BorderLayout.CENTER); final AbstractModalGraphMouse graphMouse = new DefaultModalGraphMouse(); vv.setGraphMouse(graphMouse); vv.addKeyListener(graphMouse.getModeKeyListener()); final ScalingControl scaler = new CrossoverScalingControl(); JButton plus = new JButton("+"); plus.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scaler.scale(vv, 1.1f, vv.getCenter()); } }); JButton minus = new JButton("-"); minus.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scaler.scale(vv, 1 / 1.1f, vv.getCenter()); } }); JButton reset = new JButton("reset"); reset.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT).setToIdentity(); vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.VIEW).setToIdentity(); } }); JPanel controls = new JPanel(); controls.setLayout(new FlowLayout(FlowLayout.LEFT)); controls.add(plus); controls.add(minus); controls.add(reset); Border border = BorderFactory.createEtchedBorder(); controls.setBorder(border); add(controls, BorderLayout.NORTH); add(new LegendPanel(true), BorderLayout.SOUTH); }
From source file:s3ml.DFABuilder.java
public DFABuilder() { super.setName("DFA Builder"); super.setLayout(new BorderLayout()); textArea.setFont(new Font("monospaced", Font.PLAIN, 15)); add(new JButton(new AbstractAction("Build DFA") { {/*www . j a v a 2 s .co m*/ setPreferredSize(new Dimension(200, 100)); } @Override public void actionPerformed(ActionEvent ae) { new Thread() { @Override public void run() { BuildDFA(); } }.start(); } }), BorderLayout.PAGE_START); Layout<State, Transition> layout = new SpringLayout<>(graph); layout.setSize(new Dimension(1400, 1300)); final VisualizationViewer<State, Transition> vv = new VisualizationViewer<>(layout); vv.getRenderContext().setVertexLabelTransformer(new Transformer<State, String>() { @Override public String transform(State i) { return i.name + "-" + i.outputSymbol; } }); vv.getRenderContext().setEdgeLabelTransformer(new Transformer<Transition, String>() { @Override public String transform(Transition i) { return "" + i.symbol; } }); final Stroke stroke = new Stroke() { private Stroke stroke1, stroke2; { this.stroke1 = new BasicStroke(5f); this.stroke2 = new BasicStroke(1f); } @Override public Shape createStrokedShape(Shape shape) { return stroke2.createStrokedShape(stroke1.createStrokedShape(shape)); } }; vv.getRenderContext().setVertexStrokeTransformer(new Transformer<State, Stroke>() { @Override public Stroke transform(State i) { if (i.startState) { return new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, new float[] { 2.0f }, 0.0f); } else if (i.finalState) { return stroke; } else { return vv.getRenderContext().getGraphicsContext().getStroke(); } } }); vv.getRenderContext().setVertexFillPaintTransformer(new Transformer<State, Paint>() { @Override public Paint transform(State i) { if (i.finalState) { return Color.RED; } else if (i.startState) { return Color.CYAN; } else { return Color.LIGHT_GRAY; } } }); add(new JScrollPane(textArea), BorderLayout.CENTER); }