List of usage examples for java.awt Color RED
Color RED
To view the source code for java.awt Color RED.
Click Source Link
From source file:org.jfree.chart.demo.DeviationRendererDemo3.java
private static JFreeChart createChart(XYDataset xydataset) { JFreeChart chart = ChartFactory.createXYLineChart("DeviationRenderer - Demo 3", "X", "Y", xydataset, PlotOrientation.VERTICAL, false, true, false); XYPlot plot = (XYPlot) chart.getPlot(); ///*w w w. ja va 2 s. c o m*/ DeviationRenderer renderer = new DeviationRenderer(false, false); renderer.setSeriesStroke(0, new BasicStroke(3F, 1, 1)); renderer.setSeriesStroke(0, new BasicStroke(3F, 1, 1)); renderer.setSeriesStroke(1, new BasicStroke(3F, 1, 1)); renderer.setSeriesFillPaint(0, Color.red); renderer.setSeriesFillPaint(1, Color.orange); renderer.setSeriesFillPaint(2, Color.green); plot.setRenderer(renderer); // DateAxis domainAxis = new DateAxis("Date"); domainAxis.setLowerMargin(0.0D); domainAxis.setUpperMargin(0.0D); plot.setDomainAxis(domainAxis); NumberAxis valueAxis = (NumberAxis) plot.getRangeAxis(); valueAxis.setRange(-40D, 40D); valueAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); ChartUtilities.applyCurrentTheme(chart); return chart; }
From source file:cl.almejo.vsim.gui.ColorScheme.java
public ColorScheme(String name) { _name = name;/* ww w. ja v a2s.c om*/ _colors.put("background", Color.GRAY); _colors.put("bus-on", Color.RED); _colors.put("gates", Color.BLUE); _colors.put("ground", Color.GREEN); _colors.put("off", Color.BLACK); _colors.put("wires-on", Color.RED); _colors.put("signal", Color.RED); _colors.put("grid", Color.GRAY); _colors.put("label", Color.YELLOW); }
From source file:name.dlazerka.gm.shell.store.GraphmlStorerTest.java
@Before public void setUp() { graph = new BasicGraph(false); BasicVertex vertex1 = graph.createVertex(); vertex1.getVisual().setColor(Color.RED); BasicVertex vertex2 = graph.createVertex(); vertex2.getVisual().setColor(Color.WHITE); BasicVertex vertex3 = graph.createVertex(); vertex3.getVisual().setColor(Color.RED); BasicEdge edge1 = graph.createEdge(vertex1, vertex2); edge1.getVisual().setColor(Color.BLACK); BasicEdge edge2 = graph.createEdge(vertex1, vertex3, true); edge2.getVisual().setColor(Color.GREEN); }
From source file:grafix.graficos.indices.IndiceADX.java
@Override public void plotar(final XYPlot plot, final JanelaGraficos janela, final int contador) { XYLineAndShapeRenderer r = new XYLineAndShapeRenderer(); r.setSeriesLinesVisible(0, true);/*from w w w . j a v a 2s .c o m*/ r.setSeriesShapesVisible(0, false); r.setSeriesPaint(0, Color.BLUE); r.setSeriesStroke(0, new BasicStroke(.75f)); r.setSeriesPaint(1, Color.RED); r.setSeriesStroke(1, new BasicStroke(.6f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f, new float[] { 3.0f, 4.0f }, 0.0f)); r.setSeriesLinesVisible(1, true); r.setSeriesShapesVisible(1, false); r.setSeriesPaint(2, new Color(0f, .6f, 0f)); r.setSeriesStroke(2, new BasicStroke(.6f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 2.0f, new float[] { 3.0f, 4.0f }, 0.0f)); r.setSeriesLinesVisible(2, true); r.setSeriesShapesVisible(2, false); r.setToolTipGenerator(new IndiceToolTipGenerator(this)); plot.setRenderer(contador, r); plot.setDataset(contador, getDataSet(janela)); }
From source file:org.jfree.chart.demo.DrawStringPanel.java
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D graphics2d = (Graphics2D) g; Dimension dimension = getSize(); Insets insets = getInsets();/* w ww .j av a 2s . co m*/ java.awt.geom.Rectangle2D.Double double1 = new java.awt.geom.Rectangle2D.Double(insets.left, insets.top, dimension.getWidth() - (double) insets.left - (double) insets.right, dimension.getHeight() - (double) insets.top - (double) insets.bottom); double d = double1.getCenterX(); double d1 = double1.getCenterY(); java.awt.geom.Line2D.Double double2 = new java.awt.geom.Line2D.Double(d - 2D, d1 + 2D, d + 2D, d1 - 2D); java.awt.geom.Line2D.Double double3 = new java.awt.geom.Line2D.Double(d - 2D, d1 - 2D, d + 2D, d1 + 2D); graphics2d.setPaint(Color.red); graphics2d.draw(double2); graphics2d.draw(double3); graphics2d.setFont(font); graphics2d.setPaint(Color.black); if (rotate) TextUtilities.drawRotatedString(text, graphics2d, (float) d, (float) d1, anchor, angle, rotationAnchor); else TextUtilities.drawAlignedString(text, graphics2d, (float) d, (float) d1, anchor); }
From source file:edu.asu.mgb.gui.IndividualTransformer.java
@Override public Transformer<State, Paint> getVertexPaintTransformer() { return new Transformer<State, Paint>() { @Override//from www .ja v a2s .co m public Paint transform(State state) { boolean isInCorrect = state.isStudentCorrect(student); boolean isInWrong = state.isStudentWrong(student); if (isInCorrect) { return Color.GREEN; } else if (isInWrong) { return Color.RED; } else { return Color.WHITE; } } }; }
From source file:QandE.StripeBorder.java
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { g.setColor(Color.RED); g.fillRect(x, y, c.getWidth(), HEIGHT); }
From source file:userInterface.ManufactureRole.DecisionChartJPanel.java
private static JFreeChart createChart1(CategoryDataset categorydataset) { JFreeChart jfreechart = ChartFactory.createBarChart("Vaccine Sales", "Vaccine", "quantity", categorydataset, PlotOrientation.VERTICAL, true, true, false); CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot(); categoryplot.setDomainGridlinesVisible(true); categoryplot.setRangeCrosshairVisible(true); categoryplot.setRangeCrosshairPaint(Color.blue); NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); BarRenderer barrenderer = (BarRenderer) categoryplot.getRenderer(); barrenderer.setDrawBarOutline(false); GradientPaint gradientpaint = new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, new Color(0, 0, 64)); GradientPaint gradientpaint1 = new GradientPaint(0.0F, 0.0F, Color.green, 0.0F, 0.0F, new Color(0, 64, 0)); GradientPaint gradientpaint2 = new GradientPaint(0.0F, 0.0F, Color.red, 0.0F, 0.0F, new Color(64, 0, 0)); barrenderer.setSeriesPaint(0, gradientpaint); barrenderer.setSeriesPaint(1, gradientpaint1); barrenderer.setSeriesPaint(2, gradientpaint2); barrenderer.setLegendItemToolTipGenerator(new StandardCategorySeriesLabelGenerator("Tooltip: {0}")); CategoryAxis categoryaxis = categoryplot.getDomainAxis(); categoryaxis.setCategoryLabelPositions( CategoryLabelPositions.createUpRotationLabelPositions(0.52359877559829882D)); return jfreechart; }
From source file:com.google.code.facebook.graph.sna.applet.VisualizationImageServerDemo.java
/** * /*from w w w . j a v a 2 s. c o m*/ */ public VisualizationImageServerDemo() { // create a simple graph for the demo graph = new DirectedSparseMultigraph<String, Number>(); String[] v = createVertices(10); createEdges(v); vv = new VisualizationImageServer<String, Number>(new KKLayout<String, Number>(graph), new Dimension(600, 600)); vv.getRenderer().setVertexRenderer(new GradientVertexRenderer<String, Number>(Color.white, Color.red, Color.white, Color.blue, vv.getPickedVertexState(), false)); vv.getRenderContext().setEdgeDrawPaintTransformer(new ConstantTransformer(Color.lightGray)); vv.getRenderContext().setArrowFillPaintTransformer(new ConstantTransformer(Color.lightGray)); vv.getRenderContext().setArrowDrawPaintTransformer(new ConstantTransformer(Color.lightGray)); vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller()); vv.getRenderer().getVertexLabelRenderer().setPositioner(new InsidePositioner()); vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.AUTO); // create a frome to hold the graph final JFrame frame = new JFrame(); Container content = frame.getContentPane(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Image im = vv.getImage(new Point2D.Double(300, 300), new Dimension(600, 600)); Icon icon = new ImageIcon(im); JLabel label = new JLabel(icon); content.add(label); frame.pack(); frame.setVisible(true); }
From source file:edu.virginia.speclab.juxta.author.view.DocumentSourceCard.java
public void setEditable(boolean editable) { this.dsTextArea.setEditable(editable); if (editable) { this.textScroller.setBorder(BorderFactory.createLineBorder(Color.RED)); } else {//w w w .j a va 2s . c o m this.textScroller.setBorder(null); } }