List of usage examples for java.awt Color orange
Color orange
To view the source code for java.awt Color orange.
Click Source Link
From source file:drugsupplychain.neu.css.gui.common.pharmaco.ProductDistributionDetailJPanel.java
/** * show distribution/* w w w .j ava 2 s . co m*/ */ private void showDistribution() { // TODO add your handling code here: DefaultCategoryDataset barchartDataset = new DefaultCategoryDataset(); if (null != product && null != product.getProductTracker() && product.getProductTracker().size() > 0) { for (String id : product.getProductTracker().keySet()) { TrackOrganization trackOrganization = product.getProductTracker().get(id); if (trackOrganization.getOrganization() instanceof Distributor) { barchartDataset.setValue(trackOrganization.getQuantity(), "QUANTITY", trackOrganization.getOrganization().getLocation()); } } JFreeChart barChartData = ChartFactory.createBarChart("MEDICINE DISTRIBUTION", "LOCATION", "QUANTITY", barchartDataset, PlotOrientation.VERTICAL, false, true, true); CategoryPlot barchart = barChartData.getCategoryPlot(); barchart.setRangeGridlinePaint(Color.ORANGE); ChartPanel barPanel = new ChartPanel(barChartData); barPanelDisplay.removeAll(); barPanelDisplay.add(barPanel, BorderLayout.CENTER); barPanelDisplay.validate(); } }
From source file:i2p.bote.web.PeerInfoTag.java
private String createRelayChart(RelayPeer[] relayPeers) throws IOException { RingPlot plot;/*w w w . j av a 2 s . co m*/ if (relayPeers.length == 0) { DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue("", 100); plot = new RingPlot(dataset); plot.setSectionPaint("", Color.gray); } else { int good = 0; int untested = 0; for (RelayPeer relayPeer : relayPeers) { int reachability = relayPeer.getReachability(); if (reachability == 0) untested += 1; else if (reachability > 80) good += 1; } int bad = relayPeers.length - good - untested; DefaultPieDataset dataset = new DefaultPieDataset(); if (good > 0) dataset.setValue(_t("Good"), good); if (bad > 0) dataset.setValue(_t("Unreliable"), bad); if (untested > 0) dataset.setValue(_t("Untested"), untested); plot = new RingPlot(dataset); plot.setSectionPaint(_t("Good"), Color.green); plot.setSectionPaint(_t("Unreliable"), Color.red); plot.setSectionPaint(_t("Untested"), Color.orange); } plot.setLabelGenerator(null); plot.setShadowGenerator(null); JFreeChart chart = new JFreeChart(_t("Relay Peers:"), JFreeChart.DEFAULT_TITLE_FONT, plot, relayPeers.length == 0 ? false : true); return ServletUtilities.saveChartAsPNG(chart, 400, 300, null); }
From source file:visualizer.datamining.dataanalysis.CreateLineGraph.java
private JFreeChart createChart(XYDataset xydataset, String title, String xtitle, String ytitle) { JFreeChart chart = ChartFactory.createXYLineChart(title, xtitle, ytitle, xydataset, PlotOrientation.VERTICAL, true, true, false); chart.setBackgroundPaint(Color.WHITE); XYPlot xyplot = (XYPlot) chart.getPlot(); NumberAxis numberaxis = (NumberAxis) xyplot.getRangeAxis(); numberaxis.setAutoRangeIncludesZero(false); xyplot.setDomainGridlinePaint(Color.BLACK); xyplot.setRangeGridlinePaint(Color.BLACK); xyplot.setOutlinePaint(Color.BLACK); xyplot.setOutlineStroke(new BasicStroke(1.0f)); xyplot.setBackgroundPaint(Color.white); xyplot.setDomainCrosshairVisible(true); xyplot.setRangeCrosshairVisible(true); xyplot.setDrawingSupplier(new DefaultDrawingSupplier( new Paint[] { Color.RED, Color.BLUE, Color.GREEN, Color.MAGENTA, Color.CYAN, Color.ORANGE, Color.BLACK, Color.DARK_GRAY, Color.GRAY, Color.LIGHT_GRAY, Color.YELLOW }, DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE, DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE)); XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer(); xylineandshaperenderer.setBaseShapesVisible(true); xylineandshaperenderer.setBaseShapesFilled(true); xylineandshaperenderer.setDrawOutlines(true); return chart; }
From source file:org.heliosphere.thot.akka.chat.client.TerminalActor.java
/** * Handles unknown objects./*ww w . j a v a 2s. c o m*/ * <hr> * @param any Object received. */ @SuppressWarnings("nls") private final void handleUnknown(Object any) { LOG.info(this + "Received an unknown object: " + any); terminal.appendToPane("Received an unknown object: " + any + "\n", Color.ORANGE); terminal.resume(); }
From source file:net.fenyo.gnetwatch.GUI.GenericSrcComponent.java
/** * Paints the chart.//from w w w . ja v a 2 s . c o m * @param now current time. * @return void. */ // AWT thread // AWT thread << sync_value_per_vinterval << events public void paintChart(final long now) { backing_g.setClip(axis_margin_left + 1, axis_margin_top, dimension.width - axis_margin_left - axis_margin_right - 1, dimension.height - axis_margin_top - axis_margin_bottom); synchronized (events) { final int npoints = events.size(); final int point_x[] = new int[npoints]; final int point_y[] = new int[npoints]; final int point_y1[] = new int[npoints]; final int point_y2[] = new int[npoints]; final int point_y3[] = new int[npoints]; final int point_y4[] = new int[npoints]; final int point_y5[] = new int[npoints]; final int point_y6[] = new int[npoints]; final int point_y7[] = new int[npoints]; final int point_y8[] = new int[npoints]; final int point_y9[] = new int[npoints]; final int point_y10[] = new int[npoints]; final long time_to_display = now - now % _getDelayPerInterval(); final int pixels_offset = (pixels_per_interval * (int) (now % _getDelayPerInterval())) / (int) _getDelayPerInterval(); final int last_interval_pos = dimension.width - axis_margin_right - pixels_offset; for (int i = 0; i < events.size(); i++) { final EventGenericSrc event = (EventGenericSrc) events.get(i); final long xpos = ((long) last_interval_pos) + (((long) pixels_per_interval) * (event.getDate().getTime() - time_to_display)) / _getDelayPerInterval(); if (xpos < -1000) point_x[i] = -1000; else if (xpos > 1000 + dimension.width) point_x[i] = 1000 + dimension.width; else point_x[i] = (int) xpos; // cast to double to avoid overflow on int that lead to wrong results point_y[i] = (int) (dimension.height - axis_margin_bottom - pixels_per_vinterval * (double) event.getIntValue() / value_per_vinterval); point_y1[i] = (int) (dimension.height - axis_margin_bottom - pixels_per_vinterval * (double) event.getValue1() / value_per_vinterval); point_y2[i] = (int) (dimension.height - axis_margin_bottom - pixels_per_vinterval * (double) event.getValue2() / value_per_vinterval); point_y3[i] = (int) (dimension.height - axis_margin_bottom - pixels_per_vinterval * (double) event.getValue3() / value_per_vinterval); point_y4[i] = (int) (dimension.height - axis_margin_bottom - pixels_per_vinterval * (double) event.getValue4() / value_per_vinterval); point_y5[i] = (int) (dimension.height - axis_margin_bottom - pixels_per_vinterval * (double) event.getValue5() / value_per_vinterval); point_y6[i] = (int) (dimension.height - axis_margin_bottom - pixels_per_vinterval * (double) event.getValue6() / value_per_vinterval); point_y7[i] = (int) (dimension.height - axis_margin_bottom - pixels_per_vinterval * (double) event.getValue7() / value_per_vinterval); point_y8[i] = (int) (dimension.height - axis_margin_bottom - pixels_per_vinterval * (double) event.getValue8() / value_per_vinterval); point_y9[i] = (int) (dimension.height - axis_margin_bottom - pixels_per_vinterval * (double) event.getValue9() / value_per_vinterval); point_y10[i] = (int) (dimension.height - axis_margin_bottom - pixels_per_vinterval * (double) event.getValue10() / value_per_vinterval); } backing_g.setColor(Color.GREEN); backing_g.drawPolyline(point_x, point_y, events.size()); for (int i = 0; i < events.size(); i++) backing_g.drawRect(point_x[i] - 2, point_y[i] - 2, 4, 4); backing_g.setColor(Color.WHITE); backing_g.drawPolyline(point_x, point_y1, events.size()); for (int i = 0; i < events.size(); i++) backing_g.drawRect(point_x[i] - 2, point_y1[i] - 2, 4, 4); backing_g.setColor(Color.BLUE); backing_g.drawPolyline(point_x, point_y2, events.size()); for (int i = 0; i < events.size(); i++) backing_g.drawRect(point_x[i] - 2, point_y2[i] - 2, 4, 4); backing_g.setColor(Color.GRAY); backing_g.drawPolyline(point_x, point_y3, events.size()); for (int i = 0; i < events.size(); i++) backing_g.drawRect(point_x[i] - 2, point_y3[i] - 2, 4, 4); backing_g.setColor(Color.YELLOW); backing_g.drawPolyline(point_x, point_y4, events.size()); for (int i = 0; i < events.size(); i++) backing_g.drawRect(point_x[i] - 2, point_y4[i] - 2, 4, 4); backing_g.setColor(Color.ORANGE); backing_g.drawPolyline(point_x, point_y5, events.size()); for (int i = 0; i < events.size(); i++) backing_g.drawRect(point_x[i] - 2, point_y5[i] - 2, 4, 4); backing_g.setColor(Color.CYAN); backing_g.drawPolyline(point_x, point_y6, events.size()); for (int i = 0; i < events.size(); i++) backing_g.drawRect(point_x[i] - 2, point_y6[i] - 2, 4, 4); backing_g.setColor(Color.MAGENTA); backing_g.drawPolyline(point_x, point_y7, events.size()); for (int i = 0; i < events.size(); i++) backing_g.drawRect(point_x[i] - 2, point_y7[i] - 2, 4, 4); backing_g.setColor(Color.LIGHT_GRAY); backing_g.drawPolyline(point_x, point_y8, events.size()); for (int i = 0; i < events.size(); i++) backing_g.drawRect(point_x[i] - 2, point_y8[i] - 2, 4, 4); backing_g.setColor(Color.PINK); backing_g.drawPolyline(point_x, point_y9, events.size()); for (int i = 0; i < events.size(); i++) backing_g.drawRect(point_x[i] - 2, point_y9[i] - 2, 4, 4); backing_g.setColor(Color.RED); backing_g.drawPolyline(point_x, point_y10, events.size()); for (int i = 0; i < events.size(); i++) backing_g.drawRect(point_x[i] - 2, point_y10[i] - 2, 4, 4); int cnt = 1; int cnt2 = 1; if (events.size() > 0) for (final String str : ((EventGenericSrc) events.get(0)).getUnits().split(";")) { if (str.length() > 0) { switch (cnt) { case 1: backing_g.setColor(Color.WHITE); break; case 2: backing_g.setColor(Color.BLUE); break; case 3: backing_g.setColor(Color.GRAY); break; case 4: backing_g.setColor(Color.YELLOW); break; case 5: backing_g.setColor(Color.ORANGE); break; case 6: backing_g.setColor(Color.CYAN); break; case 7: backing_g.setColor(Color.MAGENTA); break; case 8: backing_g.setColor(Color.LIGHT_GRAY); break; case 9: backing_g.setColor(Color.PINK); break; case 10: backing_g.setColor(Color.RED); break; } backing_g.fillRect(dimension.width - axis_margin_right - 150, 50 - 5 + 13 * cnt2, 20, 3); backing_g.setColor(Color.WHITE); backing_g.drawString(str, dimension.width - axis_margin_right - 150 + 22, 50 + 13 * cnt2); cnt2++; } cnt++; } backing_g.setClip(null); } }
From source file:gov.nih.nci.caintegrator.common.Cai2Util.java
/** * Used by classes to retrieve a color based on a number from a ten color palette. * (1-10) are colors and anything else returns black. * @param colorNumber - number to use.//from w w w . jav a2s. c o m * @return - Color object for that number. */ public static Color getBasicColor(int colorNumber) { switch (colorNumber) { case 1: return Color.GREEN; case 2: return Color.BLUE; case 3: return Color.RED; case 4: return Color.CYAN; case 5: return Color.DARK_GRAY; case 6: return Color.YELLOW; case 7: return Color.LIGHT_GRAY; case 8: return Color.MAGENTA; case 9: return Color.ORANGE; case 10: return Color.PINK; default: return Color.BLACK; } }
From source file:org.alder.fotobuchconvert.ifolor.IfolorLoader.java
private BorderShadow s2border(org.alder.fotobuchconvert.ifolor.model.Border border) { if (border == null || border.id == null) return null; final String id = border.id; if (id.endsWith(" Line")) { if (id.equals("Green Line")) return new BorderShadow(new Border.LineBorder(2, Color.GREEN), null); if (id.equals("Orange Line")) return new BorderShadow(new Border.LineBorder(2, Color.ORANGE), null); if (id.equals("Red Line")) return new BorderShadow(new Border.LineBorder(2, Color.RED), null); if (id.equals("White Line")) return new BorderShadow(new Border.LineBorder(2, Color.WHITE), null); if (id.equals("Blue Line")) return new BorderShadow(new Border.LineBorder(2, Color.BLUE), null); if (id.equals("Black Line")) return new BorderShadow(new Border.LineBorder(2, Color.BLACK), null); }//from w w w . j ava 2 s . c om if (id.equals("Classic")) // simple gray line return new BorderShadow(new Border.LineBorder(2, Color.GRAY), null); if (id.startsWith("Heavy ")) { if (id.equals("Heavy White")) return new BorderShadow(new Border.HeavyBorder(24, Color.WHITE, 0.6), mkSoftShadow()); if (id.equals("Heavy Black")) return new BorderShadow(new Border.HeavyBorder(24, Color.BLACK, 0.6), mkSoftShadow()); } if (id.equals("Elegant")) // no border, soft shadow return new BorderShadow(null, mkSoftShadow()); if (id.equals("Basic")) // no border, no shadow return null; if (id.equals("Retro")) // white heavy border and soft shadow return new BorderShadow(new Border.HeavyBorder(12, Color.WHITE, 1), mkSoftShadow()); if (id.equals("Solid")) // simple black border and hard shadow return new BorderShadow(new Border.LineBorder(2, Color.BLACK), mkHardShadow()); // also: existing borders [ALPHAMASK01]Border01..06 if (id.equals("[ALPHAMASK01]Border01"))// scratch frame return new BorderShadow(new Border.ScratchBorder(4, 4), null); // // if (input.equals("[ALPHAMASK01]Border02"))// double black/white frame // // without shadow // return new BorderShadow(new Border.LineBorder(20, // Color.BLUE.brighter()), null); // // if (input.equals("[ALPHAMASK01]Border03"))// fat heavy gray frame // // without shadow // return new BorderShadow(new Border.LineBorder(20, // Color.YELLOW.brighter()), null); // // if (input.equals("[ALPHAMASK01]Border04"))// fat white frame with // // centered shadow // return new BorderShadow(new Border.LineBorder(20, // Color.BLUE.brighter()), null); // // if (input.equals("[ALPHAMASK01]Border05"))// heavy white frame with // // centered shadow // return new BorderShadow(new Border.LineBorder(20, // Color.CYAN.brighter()), null); // // if (input.equals("[ALPHAMASK01]Border06"))// smaller heavy white // frame // // without shadow and round corners // return new BorderShadow(new Border.LineBorder(20, // Color.GRAY.brighter()), null); log.warn("Unknown border: " + id); return null; }
From source file:org.heliosphere.thot.akka.chat.client.TerminalActor.java
/** * Handles failures./*from w w w . ja v a 2 s . co m*/ * <hr> * @param failure Failure. */ @SuppressWarnings("nls") private final void handleFailure(final Status.Failure failure) { LOG.error("Received a failure: " + failure.cause().getMessage()); terminal.appendToPane("Failure: " + failure.cause().getMessage() + "\n\n", Color.ORANGE); terminal.resume(); }
From source file:sentimentanalyzer.ChartController.java
public void postTheTimeSeriesChartOnTheGUI_words(JPanel timeSeriesChart, XYSeriesCollection dataset, String title, String y, String x, int row) { this.wordCountsChart = ChartFactory.createXYLineChart(title, x, y, dataset, PlotOrientation.VERTICAL, true, true, false);//from w w w. j av a2s .c om this.wordIndexesOnGraph.add(row); this.plot_counter = this.wordCountsChart.getXYPlot(); XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); //CHECK THIS renderer.setBaseShapesVisible(true); this.plot_counter.setRenderer(renderer); this.plot_counter.setOutlinePaint(Color.orange); NumberAxis rangeAxis = (NumberAxis) this.plot_counter.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); NumberAxis domainAxis = (NumberAxis) this.plot_counter.getDomainAxis(); domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); this.wordCountsChart.setBackgroundPaint(Color.white); this.wordCountsChart.setBorderPaint(Color.orange); ChartPanel CP = new ChartPanel(this.wordCountsChart); timeSeriesChart.setLayout(new java.awt.BorderLayout()); timeSeriesChart.add(CP, BorderLayout.CENTER); timeSeriesChart.revalidate(); }
From source file:convcao.com.caoAgent.convcaoNeptusInteraction.java
@Override public void paint(Graphics2D g, StateRenderer2D renderer) { Point2D center = renderer.getScreenPosition(coords.squareCenter); double width = renderer.getZoom() * coords.cellWidth * coords.numCols; double height = renderer.getZoom() * coords.cellWidth * coords.numRows; g.setColor(new Color(0, 0, 255, 64)); g.translate(center.getX(), center.getY()); g.rotate(-renderer.getRotation());//from w ww . j ava 2 s .co m g.fill(new Rectangle2D.Double(-width / 2, -height / 2, width, height)); g.rotate(renderer.getRotation()); g.translate(-center.getX(), -center.getY()); if (!active) return; g.setColor(Color.orange); int pos = 50; for (String v : nameTable.values()) { g.drawString(v + ": " + depths.get(v) + "m", 15, pos); pos += 20; } for (String vehicle : nameTable.values()) { LocationType src = positions.get(vehicle); LocationType dst = destinations.get(vehicle); if (!arrived.get(vehicle)) g.setColor(Color.red.darker()); else g.setColor(Color.green.darker()); float dash[] = { 4.0f }; g.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 5.0f, dash, 0.0f)); g.draw(new Line2D.Double(renderer.getScreenPosition(src), renderer.getScreenPosition(dst))); Point2D dstPt = renderer.getScreenPosition(dst); if (!arrived.get(vehicle)) g.setColor(Color.red.darker()); else g.setColor(Color.green.darker()); g.fill(new Ellipse2D.Double(dstPt.getX() - 4, dstPt.getY() - 4, 8, 8)); } }