List of usage examples for java.awt Color blue
Color blue
To view the source code for java.awt Color blue.
Click Source Link
From source file:com.bwc.ora.views.LabelPopupMenu.java
private void initMenu() { //determine if the point clicked already has an annotation boolean hasAnnotationAlready = hasAnnoationAlready(); if (hasAnnotationAlready) { //add label to allow users to deselect the label for a given peak JMenuItem nonItem = new JMenuItem("Remove Label"); nonItem.addActionListener(e -> { removeAnnotation();/*from w w w. j a v a 2 s. c om*/ lrp.setAnnotations(LrpDisplayFrame.getInstance().getAnnotations()); }); add(nonItem); } //add list of possible labels for a point to the popup menu Arrays.stream(RetinalBand.values()).map(RetinalBand::toString).map(label -> { XYPointerAnnotation pointer = new XYPointerAnnotation(label, item.getDataset().getXValue(item.getSeriesIndex(), item.getItem()), item.getDataset().getYValue(item.getSeriesIndex(), item.getItem()), 0); pointer.setBaseRadius(35.0); pointer.setTipRadius(10.0); pointer.setFont(new Font("SansSerif", Font.PLAIN, 9)); pointer.setPaint(Color.blue); pointer.setTextAnchor(TextAnchor.CENTER_LEFT); JMenuItem l = new JMenuItem(label); l.addActionListener(e -> { if (hasAnnotationAlready) { removeAnnotation(); } chartPanel.getChart().getXYPlot().addAnnotation(pointer); lrp.setAnnotations(LrpDisplayFrame.getInstance().getAnnotations()); }); return l; }).forEach(this::add); }
From source file:com.googlecode.snoopycp.controller.DomainController.java
public Transformer<String, Paint> createFillTransformer() { return new Transformer<String, Paint>() { @Override/*from w ww. j a v a2s .com*/ public Paint transform(String vertex) { if (domain.enviroment().get(vertex) == null) { return Color.GRAY; } else { Ice.Identity identity = domain.enviroment().get(vertex); String state = domain.cache(identity).get("state"); if (state.equals("OnlineState")) { return Color.YELLOW; } else if (state.equals("ActiveState")) { return Color.RED; } else { return Color.BLUE; } } } }; }
From source file:net.sf.dynamicreports.test.jasper.chart.ChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1; TextColumnBuilder<Integer> column2; rb.columns(column1 = col.column("Column1", "field1", String.class), column2 = col.column("Column2", "field2", Integer.class)) .summary(cht.barChart().setTitle("title").setTitleColor(Color.BLUE) .setTitleFont(stl.fontArialBold()).setTitlePosition(Position.RIGHT).setSubtitle("subtitle") .setSubtitleColor(Color.CYAN).setSubtitleFont(stl.fontArial()).setLegendColor(Color.BLUE) .setLegendBackgroundColor(Color.LIGHT_GRAY).setLegendFont(stl.fontCourierNew()) .setLegendPosition(Position.LEFT).setCategory(column1).series(cht.serie(column2)), cht.barChart().setShowLegend(false).setOrientation(Orientation.HORIZONTAL) .seriesColors(Color.BLUE, Color.GREEN, Color.RED).setCategory(column1) .series(cht.serie(column2), cht.serie(column2).setLabel("2"), cht.serie(column2).setLabel("3"))); }
From source file:components.ColorChooserDemo2.java
public ColorChooserDemo2() { super(new BorderLayout()); //Set up banner to use as custom preview panel banner = new JLabel("Welcome to the Tutorial Zone!", JLabel.CENTER); banner.setForeground(Color.yellow); banner.setBackground(Color.blue); banner.setOpaque(true);/*from w w w. j a v a 2 s . c o m*/ banner.setFont(new Font("SansSerif", Font.BOLD, 24)); banner.setPreferredSize(new Dimension(100, 65)); JPanel bannerPanel = new JPanel(new BorderLayout()); bannerPanel.add(banner, BorderLayout.CENTER); bannerPanel.setBorder(BorderFactory.createTitledBorder("Banner")); //Set up color chooser for setting background color JPanel panel = new JPanel(); //use FlowLayout JButton bcc = new JButton("Show Color Chooser..."); bcc.addActionListener(this); panel.add(bcc); panel.setBorder(BorderFactory.createTitledBorder("Choose Background Color")); //Set up color chooser for setting text color tcc = new JColorChooser(); tcc.getSelectionModel().addChangeListener(this); tcc.setBorder(BorderFactory.createTitledBorder("Choose Text Color")); //Remove the preview panel tcc.setPreviewPanel(new JPanel()); //Override the chooser panels with our own AbstractColorChooserPanel panels[] = { new CrayonPanel() }; tcc.setChooserPanels(panels); tcc.setColor(banner.getForeground()); add(bannerPanel, BorderLayout.PAGE_START); add(panel, BorderLayout.CENTER); add(tcc, BorderLayout.PAGE_END); }
From source file:com.bdb.weather.display.current.WindDirPointer.java
/** * Draws the pointer.//from w ww.ja v a 2 s . co m * * @param g2 The graphics target. * @param plot The plot. * @param frame The dial's reference frame. * @param view The dial's view. */ @Override public void draw(Graphics2D g2, DialPlot plot, Rectangle2D frame, Rectangle2D view) { g2.setPaint(Color.blue); g2.setStroke(new BasicStroke(1.0f)); DialScale scale = plot.getScaleForDataset(getDatasetIndex()); double value = plot.getValue(getDatasetIndex()); double angle = scale.valueToAngle(value % 360.0); Rectangle2D outerRect = DialPlot.rectangleByRadius(frame, outerRadius, outerRadius); Rectangle2D innerRect = DialPlot.rectangleByRadius(frame, outerRadius - innerOffset, outerRadius - innerOffset); g2.setPaint(getOutlinePaint()); Arc2D arc1 = new Arc2D.Double(outerRect, angle - (ARC_LENGTH / 2), ARC_LENGTH, Arc2D.OPEN); g2.draw(arc1); Arc2D arc2 = new Arc2D.Double(innerRect, angle, 0.0, Arc2D.OPEN); GeneralPath gp = new GeneralPath(); gp.moveTo(arc1.getStartPoint().getX(), arc1.getStartPoint().getY()); gp.lineTo(arc2.getStartPoint().getX(), arc2.getStartPoint().getY()); gp.lineTo(arc1.getEndPoint().getX(), arc1.getEndPoint().getY()); g2.draw(gp); if (fill) { g2.setPaint(getFillPaint()); g2.fill(gp); } }
From source file:edu.jhuapl.graphs.jfreechart.BarEffectsTest.java
public static JFreeChartGraphSource getSource() throws GraphException { Map<String, Object> emptyMap = Collections.emptyMap(); List<PointInterface> ps1 = new LinkedList<PointInterface>(); ps1.add(new DataPoint(3, "Red", emptyMap)); ps1.add(new DataPoint(5, "Green", emptyMap)); ps1.add(new DataPoint(7, "Blue", emptyMap)); Map<String, Object> s1Meta = new HashMap<String, Object>(); s1Meta.put(GraphSource.SERIES_COLOR, Color.green); DataSeries s1 = new DataSeries(ps1, s1Meta); List<PointInterface> ps2 = new LinkedList<PointInterface>(); Map<String, Object> redMap = new HashMap<String, Object>(1); redMap.put(GraphSource.ITEM_COLOR, Color.red); ps2.add(new DataPoint(5, "Red", redMap)); Map<String, Object> greenMap = new HashMap<String, Object>(1); greenMap.put(GraphSource.ITEM_COLOR, Color.green); ps2.add(new DataPoint(2, "Green", greenMap)); Map<String, Object> blueMap = new HashMap<String, Object>(1); blueMap.put(GraphSource.ITEM_COLOR, Color.blue); ps2.add(new DataPoint(14, "Blue", redMap)); Map<String, Object> s2Meta = new HashMap<String, Object>(); s2Meta.put(GraphSource.SERIES_COLOR, Color.orange); DataSeries s2 = new DataSeries(ps2, s2Meta); Map<String, Object> graphParams = new HashMap<String, Object>(); graphParams.put(GraphSource.GRAPH_TYPE, GraphSource.GRAPH_TYPE_BAR); graphParams.put(JFreeChartBarGraphSource.PLOT_ORIENTATION, PlotOrientation.HORIZONTAL); graphParams.put(GraphSource.GRAPH_LEGEND, true); JFreeChartGraphSource source = new JFreeChartGraphSource(); source.setData(Arrays.asList(s1, s2)); source.setParams(graphParams);/* ww w.j a va 2 s. co m*/ source.initialize(); return source; }
From source file:de.fub.maps.project.detector.model.statistics.HistogramPanel.java
/** * Creates new form histogramPanel// w w w. jav a2 s .co m */ public HistogramPanel() { initComponents(); histogramChart = ChartFactory.createHistogram(null, null, null, dataSet, PlotOrientation.VERTICAL, false, true, true); plot = histogramChart.getXYPlot(); chartPanel = new ChartPanel(histogramChart, true); add(chartPanel, BorderLayout.CENTER); XYBarRenderer barRenderer = new XYBarRenderer(.05); barRenderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); barRenderer.setBarPainter(new StandardXYBarPainter()); barRenderer.setBarAlignmentFactor(.1); barRenderer.setBasePaint(Color.blue); // barRenderer.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator()); barRenderer.setBaseItemLabelGenerator( new StandardXYItemLabelGenerator(StandardXYItemLabelGenerator.DEFAULT_ITEM_LABEL_FORMAT, new CustomNumberFormat(), new CustomNumberFormat())); barRenderer.setBaseItemLabelsVisible(true); plot.setRenderer(barRenderer); plot.setBackgroundPaint(Color.white); histogramChart.setBackgroundPaint(Color.white); plot.setRangeGridlinesVisible(true); chartPanel.setVerticalAxisTrace(false); chartPanel.setDisplayToolTips(true); chartPanel.setBackground(Color.white); }
From source file:com.crunchify.jsp.servlet.BarServlet.java
public JFreeChart getChart() { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(15, "1", "451"); dataset.addValue(12, "1", "851"); dataset.addValue(10, "2", "362"); dataset.addValue(5, "2", "142"); JFreeChart chart = ChartFactory.createBarChart("Bar Chart Demo 3", // chart title "Category", // domain axis label "Value", // range axis label dataset, // data PlotOrientation.VERTICAL, // the plot orientation false, // include legend true, false);/* w w w. j av a 2s. co m*/ chart.setBackgroundPaint(Color.lightGray); // get a reference to the plot for further customisation... CategoryPlot plot = chart.getCategoryPlot(); plot.setNoDataMessage("NO DATA!"); CategoryItemRenderer renderer = new CustomRenderer(new Paint[] { Color.red, Color.blue, Color.green, Color.yellow, Color.orange, Color.cyan, Color.magenta, Color.blue }); renderer.setItemLabelsVisible(true); ItemLabelPosition p = new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER, TextAnchor.CENTER, 45.0); renderer.setPositiveItemLabelPosition(p); plot.setRenderer(renderer); // change the margin at the top of the range axis... ValueAxis rangeAxis = plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); rangeAxis.setLowerMargin(0.15); rangeAxis.setUpperMargin(0.15); return chart; }
From source file:edu.asu.mgb.gui.AggregateTransformer.java
@Override public Transformer<State, Paint> getVertexPaintTransformer() { return new Transformer<State, Paint>() { @Override// w w w. j a v a 2 s .c om public Paint transform(State state) { float ratio; float intensity = state.getNormalizedIntensity(); if (intensity == Problem.INITIAL) { // Initial position return Color.BLUE; } else if (intensity == Problem.CORRECT) { ratio = state.getCorrectRatio(); return new Color(1 - ratio, 1, 1 - ratio); } else if (intensity == Problem.INCORRECT) { ratio = state.getWrongRatio(); return new Color(1, 1 - ratio, 1 - ratio); } else { return Color.WHITE; } } }; }
From source file:components.CrayonPanel.java
public void updateChooser() { Color color = getColorFromModel(); if (Color.red.equals(color)) { redCrayon.setSelected(true);//from w w w . java2 s.c o m } else if (Color.yellow.equals(color)) { yellowCrayon.setSelected(true); } else if (Color.green.equals(color)) { greenCrayon.setSelected(true); } else if (Color.blue.equals(color)) { blueCrayon.setSelected(true); } }