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:com.adito.upgrade.GUIUpgrader.java
public void warn(String message, Throwable exception) { appendString(message, Color.orange.darker()); log.warn(message, exception); }
From source file:org.tsho.dmc2.core.chart.DmcLyapunovPlot.java
public boolean renderArea(Graphics2D g2, Rectangle2D dataArea) { CoreStatusEvent statusEv = new CoreStatusEvent(this); g2.setPaint(paint);/*from w w w . j a v a 2s . com*/ final double parHStep, parVStep; double parHLower = domainAxis.getRange().getLowerBound(); double parHUpper = domainAxis.getRange().getUpperBound(); double parVLower = rangeAxis.getRange().getLowerBound(); double parVUpper = rangeAxis.getRange().getUpperBound(); parHStep = Math.abs(parHUpper - parHLower) / dataArea.getWidth(); parVStep = Math.abs(parVUpper - parVLower) / dataArea.getHeight(); final BufferedImage image = new BufferedImage((int) dataArea.getWidth(), (int) dataArea.getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster raster = image.getRaster(); DataBufferInt dataBuffer = (DataBufferInt) raster.getDataBuffer(); int[] data = dataBuffer.getData(); final double parHStart = parHLower + parHStep / 2; final double parVStart = parVUpper - parVStep / 2; for (int i = 0; i < (int) dataArea.getWidth(); i++) { for (int j = 0; j < (int) dataArea.getHeight(); j++) { parameters.put(firstParLabel, parHStart + i * parHStep); parameters.put(secondParLabel, parVStart - j * parVStep); double[] result; int color; try { result = Lua.evaluateLyapunovExponents(model, parameters, initialPoint, iterations); } catch (ModelException e) { String mess = "Exception while:\n" + dumpVariableDoubles(parameters) + dumpVariableDoubles(initialPoint); throw new ModelException(mess, e); } if (result == null) { System.out.println("i: " + i + " j: " + j); System.out.println("par1: " + parHStart + i * parHStep); System.out.println("par2: " + parVStart + j * parVStep); g2.drawImage(image, null, (int) dataArea.getX() + 1, (int) dataArea.getY() + 1); statusEv.setStatusString("exception"); statusEv.setType(CoreStatusEvent.STRING); notifyCoreStatusListeners(statusEv); return false; } // both zero if (Math.abs(result[0]) < epsilon && Math.abs(result[1]) < epsilon) { color = Color.black.getRGB(); } // one zero one positive else if (Math.abs(result[0]) < epsilon && result[1] > 0 || Math.abs(result[1]) < epsilon && result[0] > 0) { color = Color.red.getRGB(); } // one zero one negative else if (Math.abs(result[0]) < epsilon && result[1] < 0 || Math.abs(result[1]) < epsilon && result[0] < 0) { color = Color.blue.getRGB(); } // one positive one negative else if (result[0] < 0 && result[1] > 0 || result[1] < 0 && result[0] > 0) { color = Color.green.getRGB(); } // both positive else if (result[0] > 0 && result[1] > 0) { color = Color.orange.getRGB(); } // both negative else if (result[0] < 0 && result[1] < 0) { color = Color.pink.getRGB(); } else { // impossible color = Color.yellow.getRGB(); } data[i + j * (int) dataArea.getWidth()] = color; if (stopped == true) { return false; } if (j == (int) dataArea.getHeight() - 1) { g2.drawImage(image, null, (int) dataArea.getX() + 1, (int) dataArea.getY() + 1); statusEv.setPercent(0); statusEv.setType(CoreStatusEvent.COUNT | CoreStatusEvent.PERCENT); notifyCoreStatusListeners(statusEv); } } } return true; }
From source file:org.n52.server.sos.render.DiagramRenderer.java
/** * <pre>/*from ww w .j ava 2 s . c o m*/ * dataset := associated to one range-axis; * corresponds to one observedProperty; * may contain multiple series; * series := corresponds to a time series for one foi * </pre> * * . * * @param entireCollMap * the entire coll map * @param options * the options * @param begin * the begin * @param end * the end * @param compress * @return the j free chart */ public JFreeChart renderChart(Map<String, OXFFeatureCollection> entireCollMap, DesignOptions options, Calendar begin, Calendar end, boolean compress) { DesignDescriptionList designDescriptions = buildUpDesignDescriptionList(options); /*** FIRST RUN ***/ JFreeChart chart = initializeTimeSeriesChart(); chart.setBackgroundPaint(Color.white); if (!this.isOverview) { chart.addSubtitle(new TextTitle(ConfigurationContext.COPYRIGHT, new Font(LABEL_FONT, Font.PLAIN, 9), Color.black, RectangleEdge.BOTTOM, HorizontalAlignment.RIGHT, VerticalAlignment.BOTTOM, new RectangleInsets(0, 0, 20, 20))); } XYPlot plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.white); plot.setDomainGridlinePaint(Color.lightGray); plot.setRangeGridlinePaint(Color.lightGray); plot.setAxisOffset(new RectangleInsets(2.0, 2.0, 2.0, 2.0)); plot.setDomainCrosshairVisible(true); plot.setRangeCrosshairVisible(true); plot.setDomainGridlinesVisible(options.getGrid()); plot.setRangeGridlinesVisible(options.getGrid()); // add additional datasets: DateAxis dateAxis = (DateAxis) plot.getDomainAxis(); dateAxis.setRange(begin.getTime(), end.getTime()); dateAxis.setDateFormatOverride(new SimpleDateFormat()); // add all axes String[] phenomenaIds = options.getAllPhenomenIds(); // all the axis indices to map them later HashMap<String, Integer> axes = new HashMap<String, Integer>(); for (int i = 0; i < phenomenaIds.length; i++) { axes.put(phenomenaIds[i], i); plot.setRangeAxis(i, new NumberAxis(phenomenaIds[i])); } // list range markers ArrayList<ValueMarker> referenceMarkers = new ArrayList<ValueMarker>(); HashMap<String, double[]> referenceBounds = new HashMap<String, double[]>(); // create all TS collections for (int i = 0; i < options.getProperties().size(); i++) { TimeseriesProperties prop = options.getProperties().get(i); String phenomenonId = prop.getPhenomenon(); TimeSeriesCollection dataset = createDataset(entireCollMap, prop, phenomenonId, compress); dataset.setGroup(new DatasetGroup(prop.getTimeseriesId())); XYDataset additionalDataset = dataset; NumberAxis axe = (NumberAxis) plot.getRangeAxis(axes.get(phenomenonId)); if (this.isOverview) { axe.setAutoRange(true); axe.setAutoRangeIncludesZero(false); } else if (prop.getAxisUpperBound() == prop.getAxisLowerBound() || prop.isAutoScale()) { if (prop.isZeroScaled()) { axe.setAutoRangeIncludesZero(true); } else { axe.setAutoRangeIncludesZero(false); } } else { if (prop.isZeroScaled()) { if (axe.getUpperBound() < prop.getAxisUpperBound()) { axe.setUpperBound(prop.getAxisUpperBound()); } if (axe.getLowerBound() > prop.getAxisLowerBound()) { axe.setLowerBound(prop.getAxisLowerBound()); } } else { axe.setRange(prop.getAxisLowerBound(), prop.getAxisUpperBound()); axe.setAutoRangeIncludesZero(false); } } plot.setDataset(i, additionalDataset); plot.mapDatasetToRangeAxis(i, axes.get(phenomenonId)); // set bounds new for reference values if (!referenceBounds.containsKey(phenomenonId)) { double[] bounds = new double[] { axe.getLowerBound(), axe.getUpperBound() }; referenceBounds.put(phenomenonId, bounds); } else { double[] bounds = referenceBounds.get(phenomenonId); if (bounds[0] >= axe.getLowerBound()) { bounds[0] = axe.getLowerBound(); } if (bounds[1] <= axe.getUpperBound()) { bounds[1] = axe.getUpperBound(); } } double[] bounds = referenceBounds.get(phenomenonId); for (String string : prop.getReferenceValues()) { if (prop.getRefValue(string).show()) { Double value = prop.getRefValue(string).getValue(); if (value <= bounds[0]) { bounds[0] = value; } else if (value >= bounds[1]) { bounds[1] = value; } } } Axis axis = prop.getAxis(); if (axis == null) { axis = new Axis(axe.getUpperBound(), axe.getLowerBound()); } else if (prop.isAutoScale()) { axis.setLowerBound(axe.getLowerBound()); axis.setUpperBound(axe.getUpperBound()); axis.setMaxY(axis.getMaxY()); axis.setMinY(axis.getMinY()); } prop.setAxisData(axis); this.axisMapping.put(prop.getTimeseriesId(), axis); for (String string : prop.getReferenceValues()) { if (prop.getRefValue(string).show()) { referenceMarkers.add(new ValueMarker(prop.getRefValue(string).getValue(), Color.decode(prop.getRefValue(string).getColor()), new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f))); } } plot.mapDatasetToRangeAxis(i, axes.get(phenomenonId)); } for (ValueMarker valueMarker : referenceMarkers) { plot.addRangeMarker(valueMarker); } // show actual time ValueMarker nowMarker = new ValueMarker(System.currentTimeMillis(), Color.orange, new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f)); plot.addDomainMarker(nowMarker); if (!this.isOverview) { Iterator<Entry<String, double[]>> iterator = referenceBounds.entrySet().iterator(); while (iterator.hasNext()) { Entry<String, double[]> boundsEntry = iterator.next(); String phenId = boundsEntry.getKey(); NumberAxis axe = (NumberAxis) plot.getRangeAxis(axes.get(phenId)); axe.setAutoRange(true); // add a margin double marginOffset = (boundsEntry.getValue()[1] - boundsEntry.getValue()[0]) / 25; boundsEntry.getValue()[0] -= marginOffset; boundsEntry.getValue()[1] += marginOffset; axe.setRange(boundsEntry.getValue()[0], boundsEntry.getValue()[1]); } } /**** SECOND RUN ***/ // set domain axis labels: plot.getDomainAxis().setLabelFont(label); plot.getDomainAxis().setLabelPaint(LABEL_COLOR); plot.getDomainAxis().setTickLabelFont(tickLabelDomain); plot.getDomainAxis().setTickLabelPaint(LABEL_COLOR); plot.getDomainAxis().setLabel(designDescriptions.getDomainAxisLabel()); // define the design for each series: for (int datasetIndex = 0; datasetIndex < plot.getDatasetCount(); datasetIndex++) { TimeSeriesCollection dataset = (TimeSeriesCollection) plot.getDataset(datasetIndex); for (int seriesIndex = 0; seriesIndex < dataset.getSeriesCount(); seriesIndex++) { String timeseriesId = (String) dataset.getSeries(seriesIndex).getKey(); RenderingDesign dd = designDescriptions.get(timeseriesId); if (dd != null) { // LINESTYLE: String lineStyle = dd.getLineStyle(); int width = dd.getLineWidth(); if (this.isOverview) { width = width / 2; width = (width == 0) ? 1 : width; } // "1" is lineStyle "line" if (lineStyle.equalsIgnoreCase(LINE)) { XYLineAndShapeRenderer ren = new XYLineAndShapeRenderer(true, false); ren.setStroke(new BasicStroke(width)); plot.setRenderer(datasetIndex, ren); } // "2" is lineStyle "area" else if (lineStyle.equalsIgnoreCase(AREA)) { plot.setRenderer(datasetIndex, new XYAreaRenderer()); } // "3" is lineStyle "dotted" else if (lineStyle.equalsIgnoreCase(DOTTED)) { XYLineAndShapeRenderer ren = new XYLineAndShapeRenderer(false, true); ren.setShape(new Ellipse2D.Double(-width, -width, 2 * width, 2 * width)); plot.setRenderer(datasetIndex, ren); } // "4" is dashed else if (lineStyle.equalsIgnoreCase("4")) { XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false); renderer.setSeriesStroke(0, new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f, new float[] { 4.0f * width, 4.0f * width }, 0.0f)); plot.setRenderer(datasetIndex, renderer); } else if (lineStyle.equalsIgnoreCase("5")) { // lines and dots XYLineAndShapeRenderer ren = new XYLineAndShapeRenderer(true, true); int thickness = 2 * width; ren.setShape(new Ellipse2D.Double(-width, -width, thickness, thickness)); ren.setStroke(new BasicStroke(width)); plot.setRenderer(datasetIndex, ren); } else { // default is lineStyle "line" plot.setRenderer(datasetIndex, new XYLineAndShapeRenderer(true, false)); } plot.getRenderer(datasetIndex).setSeriesPaint(seriesIndex, dd.getColor()); // plot.getRenderer(datasetIndex).setShapesVisible(true); XYToolTipGenerator toolTipGenerator = StandardXYToolTipGenerator.getTimeSeriesInstance(); XYURLGenerator urlGenerator = new MetadataInURLGenerator(designDescriptions); plot.getRenderer(datasetIndex).setBaseToolTipGenerator(toolTipGenerator); plot.getRenderer(datasetIndex).setURLGenerator(urlGenerator); // GRID: // PROBLEM: JFreeChart only allows to switch the grid on/off // for the whole XYPlot. And the // grid will always be displayed for the first series in the // plot. I'll always show the // grid. // --> plot.setDomainGridlinesVisible(visible) // RANGE AXIS LABELS: if (isOverview) { plot.getRangeAxisForDataset(datasetIndex).setTickLabelsVisible(false); plot.getRangeAxisForDataset(datasetIndex).setTickMarksVisible(false); plot.getRangeAxisForDataset(datasetIndex).setVisible(false); } else { plot.getRangeAxisForDataset(datasetIndex).setLabelFont(label); plot.getRangeAxisForDataset(datasetIndex).setLabelPaint(LABEL_COLOR); plot.getRangeAxisForDataset(datasetIndex).setTickLabelFont(tickLabelDomain); plot.getRangeAxisForDataset(datasetIndex).setTickLabelPaint(LABEL_COLOR); StringBuilder unitOfMeasure = new StringBuilder(); unitOfMeasure.append(dd.getPhenomenon().getLabel()); String uomLabel = dd.getUomLabel(); if (uomLabel != null && !uomLabel.isEmpty()) { unitOfMeasure.append(" (").append(uomLabel).append(")"); } plot.getRangeAxisForDataset(datasetIndex).setLabel(unitOfMeasure.toString()); } } } } return chart; }
From source file:org.gumtree.vis.mask.ChartMaskingUtilities.java
public static void drawMaskBoarder(Graphics2D g2, Rectangle2D frame) { g2.setPaint(Color.orange); g2.setStroke(new BasicStroke(1)); g2.draw(frame);/* w ww . j a v a 2s. com*/ Rectangle2D dragPoint = new Rectangle2D.Double(frame.getMinX() - maskDragPointHalfWidth, frame.getMinY() - maskDragPointHalfWidth, maskDragPointWidth, maskDragPointWidth); g2.fill(dragPoint); dragPoint.setRect(frame.getCenterX() - maskDragPointHalfWidth, frame.getMinY() - maskDragPointHalfWidth, maskDragPointWidth, maskDragPointWidth); g2.fill(dragPoint); dragPoint.setRect(frame.getMaxX() - maskDragPointHalfWidth, frame.getMinY() - maskDragPointHalfWidth, maskDragPointWidth, maskDragPointWidth); g2.fill(dragPoint); dragPoint.setRect(frame.getMaxX() - maskDragPointHalfWidth, frame.getCenterY() - maskDragPointHalfWidth, maskDragPointWidth, maskDragPointWidth); g2.fill(dragPoint); dragPoint.setRect(frame.getMinX() - maskDragPointHalfWidth, frame.getCenterY() - maskDragPointHalfWidth, maskDragPointWidth, maskDragPointWidth); g2.fill(dragPoint); dragPoint.setRect(frame.getMinX() - maskDragPointHalfWidth, frame.getMaxY() - maskDragPointHalfWidth, maskDragPointWidth, maskDragPointWidth); g2.fill(dragPoint); dragPoint.setRect(frame.getCenterX() - maskDragPointHalfWidth, frame.getMaxY() - maskDragPointHalfWidth, maskDragPointWidth, maskDragPointWidth); g2.fill(dragPoint); dragPoint.setRect(frame.getMaxX() - maskDragPointHalfWidth, frame.getMaxY() - maskDragPointHalfWidth, maskDragPointWidth, maskDragPointWidth); g2.fill(dragPoint); Color fillColor = new Color(250, 250, 50, 30); g2.setPaint(fillColor); g2.fill(frame); }
From source file:UserInterface.SupplierRole.ProductSalesReviewJPanel.java
private void showTopProductButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showTopProductButtonActionPerformed // TODO add your handling code here: DefaultCategoryDataset barchartDataset = new DefaultCategoryDataset(); if (null != supplier.getProductCatalog()) { int productSalesValue = 0; for (Product product : supplier.getProductCatalog().getProductList()) { productSalesValue = product.getPrice() * (product.getInitialQuantity() - product.getAvailable()); barchartDataset.setValue(productSalesValue, "SALES VALUE", product.getProdName()); }// w w w. j a va 2 s. co m JFreeChart barChartData = ChartFactory.createBarChart("PRODUCT SALES VALUE", "PRODUCT NAME", "SALE AMOUNT", barchartDataset, PlotOrientation.VERTICAL, true, true, true); CategoryPlot barchart = barChartData.getCategoryPlot(); barchart.setRangeGridlinePaint(Color.ORANGE); ChartPanel barPanel = new ChartPanel(barChartData); jPanel1.removeAll(); jPanel1.add(barPanel); } }
From source file:com.bdb.weather.display.freeplot.SummaryFreePlot.java
/** * Create the JFreeChart series for the pressure values. * /* ww w. ja va2 s. co m*/ * @param stroke The stroke for the series */ private List<FreePlotSeries<SummaryRecord>> createPressureSeries(Stroke stroke) { List<FreePlotSeries<SummaryRecord>> list = new ArrayList<>(); int n = 0; list.add(new FreePlotSeries<>(MAX_BARO_PRESSURE_SERIES_NAME, n++, Color.ORANGE, stroke, SummaryRecord::getMaxBaroPressure, dateMethod, period)); list.add(new FreePlotSeries<>(MIN_BARO_PRESSURE_SERIES_NAME, n++, Color.PINK, stroke, SummaryRecord::getMinBaroPressure, dateMethod, period)); list.add(new FreePlotSeries<>(MEAN_BARO_PRESSURE_SERIES_NAME, n++, Color.PINK, stroke, SummaryRecord::getAvgBaroPressure, dateMethod, period)); return list; }
From source file:org.hxzon.demo.jfreechart.CategoryDatasetDemo.java
private static JFreeChart createLineChart3D(CategoryDataset dataset) { JFreeChart chart = ChartFactory.createLineChart3D("Line Chart Demo 1", // chart title "Category", // domain axis label "Value", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips? false // URLs? );//from www .ja v a2 s .com chart.setBackgroundPaint(Color.white); CategoryPlot plot = (CategoryPlot) chart.getPlot(); // set the range axis to display integers only... NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); LineRenderer3D renderer = (LineRenderer3D) plot.getRenderer(); // set up gradient paints for series... GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, new Color(0, 0, 64)); GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, new Color(0, 64, 0)); GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, new Color(64, 0, 0)); renderer.setSeriesPaint(0, gp0); renderer.setSeriesPaint(1, gp1); renderer.setSeriesPaint(2, gp2); GradientPaint gp = new GradientPaint(0.0f, 0.0f, Color.orange, 0.0f, 0.0f, new Color(0, 64, 64)); renderer.setWallPaint(gp); return chart; }
From source file:org.xapagy.ui.tempdyn.GraphEvolution.java
/** * Initializes/*from w w w . ja v a2s.com*/ */ public static void initializeLineStyles() { /** * Conservative line styles: gray and black various thicknesses */ GraphEvolution.lineStylesConservative = new ArrayList<>(); List<Color> colors = new ArrayList<>(); colors.add(Color.black); colors.add(Color.gray); List<Stroke> strokes = new ArrayList<>(); strokes.add(new BasicStroke(3.0f)); strokes.add(new BasicStroke(1.0f)); for (Color color : colors) { for (Stroke stroke : strokes) { GraphEvolution.lineStylesConservative.add(new SimpleEntry<>(color, stroke)); } } /** * Colorful line styles: striking colors */ GraphEvolution.lineStylesColorful = new ArrayList<>(); colors = new ArrayList<>(); colors.add(Color.black); colors.add(Color.blue); colors.add(Color.red); colors.add(Color.green); colors.add(Color.magenta); colors.add(Color.orange); for (Stroke stroke : strokes) { for (Color color : colors) { GraphEvolution.lineStylesColorful.add(new SimpleEntry<>(color, stroke)); } } }
From source file:com.ricemap.spateDB.util.CommandLineArguments.java
public Color getColor() { Color color = Color.BLACK; String colorName = get("color"); if (colorName == null) return color; colorName = colorName.toLowerCase(); if (colorName.equals("red")) { color = Color.RED;// w w w . ja v a 2 s. c o m } else if (colorName.equals("blue")) { color = Color.BLUE; } else if (colorName.equals("green")) { color = Color.GREEN; } else if (colorName.equals("black")) { color = Color.BLACK; } else if (colorName.equals("orange")) { color = Color.ORANGE; } return color; }
From source file:com.moteiv.trawler.Trawler.java
private void processEvent(AbstractButton source) { if (source == vLog) { if (source.isSelected()) { JFileChooser jfc = new JFileChooser(); File logFile;/*from ww w.j a v a 2s . c om*/ int retval; retval = jfc.showSaveDialog(null); if (retval == JFileChooser.APPROVE_OPTION) { mif.setLogFile(jfc.getSelectedFile()); } else { vLog.setSelected(false); } } else { mif.setLogFile(null); } } else if (source == vLabels) { if (source.isSelected()) { pr.setVertexStringer(m_vs); } else { pr.setVertexStringer(new ConstantVertexStringer(null)); } } else if (source == vBlink) { if (source.isSelected()) { pr.setVertexColorFunction(new myVertexColorFunction(Color.RED.darker().darker(), Color.RED, 500)); ; } else { pr.setVertexPaintFunction( new PickableVertexPaintFunction(pr, Color.BLACK, Color.RED, Color.ORANGE)); } } else if (source == vSave) { if (source.isSelected()) { } else { } } else if (source == eLabels) { if (source.isSelected()) { pr.setEdgeStringer(m_es); } else { pr.setEdgeStringer(new ConstantEdgeStringer(null)); } } else if (source == eFilter) { if (source.isSelected()) { pr.setEdgeIncludePredicate(TruePredicate.getInstance()); } else { pr.setEdgeIncludePredicate(new myEdgeFilter()); } } else if (source == graphReset) { GraphIO.resetPrefs(g, layout, mif, Trawler.NODEFILE); } savePrefs(); }