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:uk.ac.abdn.csd.p2p.server.VertexPainter.java
/** * Method to tranform the colour asscoiated with a {@code Vertex} * @param v Instance of a {@code Vertex} * @return Instance of {@code Paint} object *//*w w w. jav a 2s .c om*/ public Paint transform(Vertex v) //So for each node that we draw... { //We check the member variable, mColor, of the node. if (v.getColor().equalsIgnoreCase("yellow")) //If the node's mColor value is "yellow" we... return (Color.yellow); // Return our color, Color.yellow. else if (v.getColor().equalsIgnoreCase("red")) return (Color.red); else if (v.getColor().equalsIgnoreCase("blue")) return (Color.blue); else if (v.getColor().equalsIgnoreCase("green")) return (Color.green); else if (v.getColor().equalsIgnoreCase("orange")) return (Color.orange); else if (v.getColor().equalsIgnoreCase("pink")) return (Color.pink); else if (v.getColor().equalsIgnoreCase("black")) return (Color.black); else if (v.getColor().equalsIgnoreCase("cyan")) return (Color.cyan); else if (v.getColor().equalsIgnoreCase("dark_grey")) return (Color.DARK_GRAY); else if (v.getColor().equalsIgnoreCase("grey")) return (Color.gray); else if (v.getColor().equalsIgnoreCase("light_grey")) return (Color.lightGray); else if (v.getColor().equalsIgnoreCase("white")) return (Color.white); else return (Color.MAGENTA); }
From source file:net.sf.dynamicreports.test.jasper.chart.XyAreaChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<Integer> column1; TextColumnBuilder<Integer> column2; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", Integer.class), column2 = col.column("Column2", "field2", Integer.class)) .summary(cht.xyAreaChart().setXValue(column1).series(cht.xySerie(column2)) .setXAxisFormat(cht.axisFormat().setLabel("category").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()).setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setLineColor(Color.LIGHT_GRAY)), cht.xyAreaChart().setXValue(column1).series(cht.xySerie(column2)) .setYAxisFormat(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))); }
From source file:com.google.code.facebook.graph.sna.applet.DrawnIconVertexDemo.java
public DrawnIconVertexDemo() { // create a simple graph for the demo graph = new DirectedSparseGraph<Integer, Number>(); Integer[] v = createVertices(10); createEdges(v);//from w w w . j a va 2s .com vv = new VisualizationViewer<Integer, Number>(new FRLayout<Integer, Number>(graph)); vv.getRenderContext().setVertexLabelTransformer(new Transformer<Integer, String>() { public String transform(Integer v) { return "Vertex " + v; } }); vv.getRenderContext().setVertexLabelRenderer(new DefaultVertexLabelRenderer(Color.cyan)); vv.getRenderContext().setEdgeLabelRenderer(new DefaultEdgeLabelRenderer(Color.cyan)); vv.getRenderContext().setVertexIconTransformer(new Transformer<Integer, Icon>() { /* * Implements the Icon interface to draw an Icon with background color and * a text label */ public Icon transform(final Integer v) { return new Icon() { public int getIconHeight() { return 20; } public int getIconWidth() { return 20; } public void paintIcon(Component c, Graphics g, int x, int y) { if (vv.getPickedVertexState().isPicked(v)) { g.setColor(Color.yellow); } else { g.setColor(Color.red); } g.fillOval(x, y, 20, 20); if (vv.getPickedVertexState().isPicked(v)) { g.setColor(Color.black); } else { g.setColor(Color.white); } g.drawString("" + v, x + 6, y + 15); } }; } }); vv.getRenderContext().setVertexFillPaintTransformer( new PickableVertexPaintTransformer<Integer>(vv.getPickedVertexState(), Color.white, Color.yellow)); vv.getRenderContext().setEdgeDrawPaintTransformer( new PickableEdgePaintTransformer<Number>(vv.getPickedEdgeState(), Color.black, Color.lightGray)); vv.setBackground(Color.white); // add my listener for ToolTips vv.setVertexToolTipTransformer(new ToStringLabeller<Integer>()); // create a frome to hold the graph final JFrame frame = new JFrame(); Container content = frame.getContentPane(); final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); content.add(panel); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); final ModalGraphMouse gm = new DefaultModalGraphMouse<Integer, Number>(); vv.setGraphMouse(gm); 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()); } }); JPanel controls = new JPanel(); controls.add(plus); controls.add(minus); controls.add(((DefaultModalGraphMouse<Integer, Number>) gm).getModeComboBox()); content.add(controls, BorderLayout.SOUTH); frame.pack(); frame.setVisible(true); }
From source file:edu.uci.ics.jung.samples.DrawnIconVertexDemo.java
@SuppressWarnings("unchecked") public DrawnIconVertexDemo() { // create a simple graph for the demo graph = new DirectedSparseGraph<Integer, Number>(); Integer[] v = createVertices(10); createEdges(v);/*from w w w . java2 s. c om*/ vv = new VisualizationViewer<Integer, Number>(new FRLayout<Integer, Number>(graph)); vv.getRenderContext().setVertexLabelTransformer(new Transformer<Integer, String>() { public String transform(Integer v) { return "Vertex " + v; } }); vv.getRenderContext().setVertexLabelRenderer(new DefaultVertexLabelRenderer(Color.cyan)); vv.getRenderContext().setEdgeLabelRenderer(new DefaultEdgeLabelRenderer(Color.cyan)); vv.getRenderContext().setVertexIconTransformer(new Transformer<Integer, Icon>() { /* * Implements the Icon interface to draw an Icon with background color and * a text label */ public Icon transform(final Integer v) { return new Icon() { public int getIconHeight() { return 20; } public int getIconWidth() { return 20; } public void paintIcon(Component c, Graphics g, int x, int y) { if (vv.getPickedVertexState().isPicked(v)) { g.setColor(Color.yellow); } else { g.setColor(Color.red); } g.fillOval(x, y, 20, 20); if (vv.getPickedVertexState().isPicked(v)) { g.setColor(Color.black); } else { g.setColor(Color.white); } g.drawString("" + v, x + 6, y + 15); } }; } }); vv.getRenderContext().setVertexFillPaintTransformer( new PickableVertexPaintTransformer<Integer>(vv.getPickedVertexState(), Color.white, Color.yellow)); vv.getRenderContext().setEdgeDrawPaintTransformer( new PickableEdgePaintTransformer<Number>(vv.getPickedEdgeState(), Color.black, Color.lightGray)); vv.setBackground(Color.white); // add my listener for ToolTips vv.setVertexToolTipTransformer(new ToStringLabeller<Integer>()); // create a frome to hold the graph final JFrame frame = new JFrame(); Container content = frame.getContentPane(); final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); content.add(panel); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); final ModalGraphMouse gm = new DefaultModalGraphMouse<Integer, Number>(); vv.setGraphMouse(gm); 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()); } }); JPanel controls = new JPanel(); controls.add(plus); controls.add(minus); controls.add(((DefaultModalGraphMouse<Integer, Number>) gm).getModeComboBox()); content.add(controls, BorderLayout.SOUTH); frame.pack(); frame.setVisible(true); }
From source file:com.google.code.facebook.graph.sna.applet.ImageEdgeLabelDemo.java
public ImageEdgeLabelDemo() { // create a simple graph for the demo graph = new DirectedSparseMultigraph<Number, Number>(); createGraph(VERTEX_COUNT);/*from w w w.j a v a 2 s . com*/ FRLayout<Number, Number> layout = new FRLayout<Number, Number>(graph); layout.setMaxIterations(100); vv = new VisualizationViewer<Number, Number>(layout, new Dimension(400, 400)); vv.getRenderContext().setEdgeDrawPaintTransformer( new PickableEdgePaintTransformer<Number>(vv.getPickedEdgeState(), Color.black, Color.cyan)); vv.setBackground(Color.white); vv.getRenderContext().setVertexLabelRenderer(new DefaultVertexLabelRenderer(Color.cyan)); vv.getRenderContext().setEdgeLabelRenderer(new DefaultEdgeLabelRenderer(Color.cyan)); vv.getRenderContext().setEdgeLabelTransformer(new Transformer<Number, String>() { URL url = getClass().getResource("/images/lightning-s.gif"); public String transform(Number input) { return "<html><img src=" + url + " height=10 width=21>"; } }); // add a listener for ToolTips vv.setVertexToolTipTransformer(new ToStringLabeller<Number>()); vv.setEdgeToolTipTransformer(new ToStringLabeller<Number>()); Container content = getContentPane(); final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); content.add(panel); final DefaultModalGraphMouse<Number, Number> graphMouse = new DefaultModalGraphMouse<Number, Number>(); 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()); } }); JComboBox modeBox = graphMouse.getModeComboBox(); JPanel modePanel = new JPanel(); modePanel.setBorder(BorderFactory.createTitledBorder("Mouse Mode")); modePanel.add(modeBox); JPanel scaleGrid = new JPanel(new GridLayout(1, 0)); scaleGrid.setBorder(BorderFactory.createTitledBorder("Zoom")); JPanel controls = new JPanel(); scaleGrid.add(plus); scaleGrid.add(minus); controls.add(scaleGrid); controls.add(modePanel); content.add(controls, BorderLayout.SOUTH); }
From source file:edu.uci.ics.jung.samples.ImageEdgeLabelDemo.java
@SuppressWarnings("rawtypes") public ImageEdgeLabelDemo() { // create a simple graph for the demo graph = new DirectedSparseMultigraph<Number, Number>(); createGraph(VERTEX_COUNT);/*from ww w. j a v a 2s. c om*/ FRLayout<Number, Number> layout = new FRLayout<Number, Number>(graph); layout.setMaxIterations(100); vv = new VisualizationViewer<Number, Number>(layout, new Dimension(400, 400)); vv.getRenderContext().setEdgeDrawPaintTransformer( new PickableEdgePaintTransformer<Number>(vv.getPickedEdgeState(), Color.black, Color.cyan)); vv.setBackground(Color.white); vv.getRenderContext().setVertexLabelRenderer(new DefaultVertexLabelRenderer(Color.cyan)); vv.getRenderContext().setEdgeLabelRenderer(new DefaultEdgeLabelRenderer(Color.cyan)); vv.getRenderContext().setEdgeLabelTransformer(new Transformer<Number, String>() { URL url = getClass().getResource("/images/lightning-s.gif"); public String transform(Number input) { return "<html><img src=" + url + " height=10 width=21>"; } }); // add a listener for ToolTips vv.setVertexToolTipTransformer(new ToStringLabeller<Number>()); vv.setEdgeToolTipTransformer(new ToStringLabeller<Number>()); Container content = getContentPane(); final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); content.add(panel); final DefaultModalGraphMouse<Number, Number> graphMouse = new DefaultModalGraphMouse<Number, Number>(); 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()); } }); JComboBox modeBox = graphMouse.getModeComboBox(); JPanel modePanel = new JPanel(); modePanel.setBorder(BorderFactory.createTitledBorder("Mouse Mode")); modePanel.add(modeBox); JPanel scaleGrid = new JPanel(new GridLayout(1, 0)); scaleGrid.setBorder(BorderFactory.createTitledBorder("Zoom")); JPanel controls = new JPanel(); scaleGrid.add(plus); scaleGrid.add(minus); controls.add(scaleGrid); controls.add(modePanel); content.add(controls, BorderLayout.SOUTH); }
From source file:net.sf.dynamicreports.test.jasper.chart.AreaChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1; TextColumnBuilder<Integer> column2; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", String.class), column2 = col.column("Column2", "field2", Integer.class)) .summary(cht.areaChart().setCategory(column1).series(cht.serie(column2)) .setCategoryAxisFormat(cht.axisFormat().setLabel("category").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()).setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelRotation(45d) .setLineColor(Color.LIGHT_GRAY)), cht.areaChart().setCategory(column1).series(cht.serie(column2)) .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))); }
From source file:net.sf.dynamicreports.test.jasper.chart.StackedAreaChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1; TextColumnBuilder<Integer> column2; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", String.class), column2 = col.column("Column2", "field2", Integer.class)) .summary(cht.stackedAreaChart().setCategory(column1).series(cht.serie(column2)) .setCategoryAxisFormat(cht.axisFormat().setLabel("category").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()).setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelRotation(45d) .setLineColor(Color.LIGHT_GRAY)), cht.stackedAreaChart().setCategory(column1).series(cht.serie(column2)) .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))); }
From source file:net.sf.dynamicreports.test.jasper.chart.XyStepChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<Integer> column1; TextColumnBuilder<Integer> column2; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", Integer.class), column2 = col.column("Column2", "field2", Integer.class)) .summary(cht.xyStepChart().setXValue(column1).series(cht.xySerie(column2)).setStepPoint(0.5d), cht .xyStepChart().setXValue(column1).series(cht.xySerie(column2)) .setXAxisFormat(cht.axisFormat().setLabel("category").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()).setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setLineColor(Color.LIGHT_GRAY)), cht.xyStepChart().setXValue(column1).series(cht.xySerie(column2)) .setYAxisFormat(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))); }
From source file:net.sf.dynamicreports.test.jasper.chart.XyBarChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<Integer> column1; TextColumnBuilder<Integer> column2; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", Integer.class), column2 = col.column("Column2", "field2", Integer.class)) .summary(cht.xyBarChart().setXValue(column1).series(cht.xySerie(column2)).setShowLabels(true) /*.setShowTickLabels(false) .setShowTickMarks(false)*/, cht.xyBarChart().setXValue(column1).series(cht.xySerie(column2)) .setXAxisFormat(cht.axisFormat().setLabel("category").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()).setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setLineColor(Color.LIGHT_GRAY)), cht.xyBarChart().setXValue(column1).series(cht.xySerie(column2)) .setYAxisFormat(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))); }