List of usage examples for java.awt Color magenta
Color magenta
To view the source code for java.awt Color magenta.
Click Source Link
From source file:gov.llnl.lc.infiniband.opensm.plugin.gui.chart.PortCounterPlotWorker.java
@Override protected Void doInBackground() throws Exception { // 1. counter value (already done, just add following to this) // 2. delta/period ///* ww w . j ava2 s.com*/ // -- if error counter -- // 3. include xmit and rcv traffic deltas? (own scale) // // // -- if traffic counter -- // 3. include rate and utilization values? // // this is a SwingWorker thread from its pool, give it a recognizable name Thread.currentThread().setName("PortCounterPlotWorker"); logger.info("Worker Building Plot"); SMT_UpdateService updateService = SMT_UpdateService.getInstance(); OMS_Collection history = updateService.getCollection(); OSM_FabricDeltaCollection deltaHistory = history.getOSM_FabricDeltaCollection(); XYPlot plot = (XYPlot) Chart.getPlot(); // AXIS 2 - the change, or delta value of the desired counter NumberAxis axis2 = new NumberAxis(PortCounterAxisLabel.DELTA.getName()); axis2.setFixedDimension(10.0); axis2.setAutoRangeIncludesZero(false); plot.setRangeAxis(1, axis2); XYDataset dataset2 = createDeltaDataset(deltaHistory, PortCounter, PortCounterAxisLabel.DELTA.getName()); plot.setDataset(1, dataset2); plot.mapDatasetToRangeAxis(1, 1); XYItemRenderer renderer2 = new StandardXYItemRenderer(); plot.setRenderer(1, renderer2); // the other two axis are optional, and vary depending on the // type of counter NumberAxis axis3 = null; XYDataset dataset3 = null; XYItemRenderer renderer3 = null; NumberAxis axis4 = null; XYDataset dataset4 = null; XYItemRenderer renderer4 = null; if (AddExtra) { if (isError) { // add rcv deltas PortCounterName pcr = PortCounterName.rcv_data; axis3 = new NumberAxis(PortCounterAxisLabel.RCV_DELTA.getName()); axis3.setFixedDimension(10.0); axis3.setAutoRangeIncludesZero(false); plot.setRangeAxis(2, axis3); dataset3 = createDeltaDataset(deltaHistory, pcr, pcr.getName()); plot.setDataset(2, dataset3); plot.mapDatasetToRangeAxis(2, 2); renderer3 = new StandardXYItemRenderer(); plot.setRenderer(2, renderer3); // add xmit deltas pcr = PortCounterName.xmit_data; axis4 = new NumberAxis(PortCounterAxisLabel.XMT_DELTA.getName()); axis4.setFixedDimension(10.0); axis4.setAutoRangeIncludesZero(false); plot.setRangeAxis(3, axis4); dataset4 = createDeltaDataset(deltaHistory, pcr, pcr.getName()); plot.setDataset(3, dataset4); plot.mapDatasetToRangeAxis(3, 3); renderer4 = new StandardXYItemRenderer(); plot.setRenderer(3, renderer4); // use a common scale for both xmit and rcv counters double minRange = axis3.getLowerBound() < axis4.getLowerBound() ? axis3.getLowerBound() : axis4.getLowerBound(); double maxRange = axis3.getUpperBound() < axis4.getUpperBound() ? axis4.getUpperBound() : axis3.getUpperBound(); axis3.setAutoRange(false); axis4.setAutoRange(false); axis3.setRange(minRange, maxRange); axis4.setRange(minRange, maxRange); } else { // add rate PortCounterName pcr = PortCounter; axis3 = new NumberAxis(pcr.getName() + " " + PortCounterAxisLabel.RATE.getUnits()); axis3.setFixedDimension(10.0); axis3.setAutoRangeIncludesZero(true); plot.setRangeAxis(2, axis3); dataset3 = createRateDataset(deltaHistory, pcr, PortCounterAxisLabel.RATE.getName()); plot.setDataset(2, dataset3); plot.mapDatasetToRangeAxis(2, 2); renderer3 = new StandardXYItemRenderer(); plot.setRenderer(2, renderer3); // add utilization axis4 = new NumberAxis(pcr.getName() + " " + PortCounterAxisLabel.UTILIZATION.getUnits()); axis4.setFixedDimension(10.0); // axis4.setAutoRangeIncludesZero(true); axis4.setRange(0.0, 100.0); plot.setRangeAxis(3, axis4); dataset4 = createUtilizationDataset(deltaHistory, pcr, PortCounterAxisLabel.UTILIZATION.getName()); plot.setDataset(3, dataset4); plot.mapDatasetToRangeAxis(3, 3); renderer4 = new StandardXYItemRenderer(); plot.setRenderer(3, renderer4); } } ChartUtilities.applyCurrentTheme(Chart); Color c1 = Color.black; Color c2 = Color.blue; Color c3 = Color.green; Color c4 = Color.magenta; Color ce = Color.red; if (isError) c2 = ce; // change the series and axis colours after the theme has // been applied... plot.getRenderer().setSeriesPaint(0, c1); renderer2.setSeriesPaint(0, c2); axis2.setLabelPaint(c2); axis2.setTickLabelPaint(c2); if (AddExtra) { renderer3.setSeriesPaint(0, c3); axis3.setLabelPaint(c3); axis3.setTickLabelPaint(c3); renderer4.setSeriesPaint(0, c4); axis4.setLabelPaint(c4); axis4.setTickLabelPaint(c4); } return null; }
From source file:monitor.processing.OLD.Drawing3D.java
public void drawTree(BaseNode n, RealVector v) { Color c = Color.WHITE; if (n instanceof TransformNode) { //v = ((TransformNode) n).getTrasformMatrix().getColumnVector(3); v = ((TransformNode) n).getTrasformMatrix().operate(v); //stroke(0, 0, 255); // line((float) bef[0] * scale, (float) bef[1] * scale, (float) bef[2] * scale, (float) att[0] * scale, (float) att[1] * scale, (float) att[2] * scale); c = Color.BLACK;// ww w . j a va 2 s. c om } else if (n instanceof StaticMesh) { StaticMesh sm = (StaticMesh) n; if (sm.isTransparent()) { c = Color.BLUE; } else if (sm.isVisible()) { // System.out.println(n.getInfo()); // System.out.println(v); c = Color.RED; if (sm.getModel().contains("naohead") || sm.getModel().contains("naobody")) { c = Color.PINK; } } else { c = Color.CYAN; } } else if (n instanceof StaticMeshNode) { StaticMeshNode smn = (StaticMeshNode) n; if (smn.isTransparent()) { c = Color.GREEN; // cameraSceneX = (float)v.getEntry(0); // cameraSceneY = (float)v.getEntry(1); // cameraSceneZ = (float)v.getEntry(2); } else if (smn.isVisible()) { c = Color.YELLOW; } else { c = Color.MAGENTA; } } // if (n.getInfo().contains("naohead")){ // c = Color.CYAN; // pushMatrix(); // fill(c.getRed(), c.getGreen(), c.getBlue()); // // noStroke(); // translate((float) (scale * v.getEntry(0)), (float) (-scale * v.getEntry(1)), (float) (scale * v.getEntry(2))); // box(50); // popMatrix(); // } pushMatrix(); fill(c.getRed(), c.getGreen(), c.getBlue()); noStroke(); translate((float) (scale * v.getEntry(0)), (float) (-scale * v.getEntry(1)), (float) (scale * v.getEntry(2))); box(0.05f * scale); popMatrix(); if (n.getAddress() == selected) { path.add(v); pushMatrix(); fill(0, 255, 255, selectedAlpha); selectedAlpha += (selectedAlpha >= 255) ? -255 : 10; noStroke(); translate((float) (scale * v.getEntry(0)), (float) (-scale * v.getEntry(1)), (float) (scale * v.getEntry(2))); pushMatrix(); //rotateX(t); rotateZ(selectedTheta); selectedTheta += 1 / 8f; box(0.1f * scale); popMatrix(); // info rotateZ(PI / 2); rotateX(-PI / 2); translate(0.1f * scale, -0.1f * scale); fill(0); textSize(0.1f * scale); text(n.getInfo(), 0, 0, 0); popMatrix(); RealVector ant = null; int o = 0; for (RealVector w : path) { if (ant != null) { stroke(o, 255 - o, 0, 200); // System.out.println(ant); // System.out.println(w); line((float) ant.getEntry(0) * scale, (float) ant.getEntry(1) * -scale, (float) ant.getEntry(2) * scale, (float) w.getEntry(0) * scale, (float) w.getEntry(1) * -scale, (float) w.getEntry(2)); o += (o >= 255) ? -200 : 10; } ant = w; pushMatrix(); stroke(255, 255, 0, 200); translate((float) (scale * w.getEntry(0)), (float) (-scale * w.getEntry(1)), (float) (scale * w.getEntry(2))); box(2); popMatrix(); } } for (int a = n.getChildren().size() - 1; a >= 0; a--) { drawTree(((ArrayList<BaseNode>) n.getChildren()).get(a), v); } }
From source file:uk.co.real_logic.aeron.tools.perf_tools.AeronLatencyUnderLoadPublisher.java
private void generateScatterPlot() throws IOException { final BufferedImage image = new BufferedImage(1800, 1000, BufferedImage.TYPE_INT_ARGB); final Graphics2D g2 = image.createGraphics(); final FontMetrics fm = g2.getFontMetrics(); final String filename = "throughputency.png"; final File imageFile = new File(filename); final int height = 940; double min = Double.MAX_VALUE; double max = Double.MIN_VALUE; for (final long timestamp : timestamps) { final double ts = timestamp / 1000.0; if (ts < min) { min = ts;/*from w w w. java2s .c o m*/ } if (ts > max) { max = ts; } } final double stepY = height / max; g2.setColor(Color.white); g2.fillRect(0, 0, 1800, 1000); g2.setColor(Color.black); g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g2.drawString("Latency ScatterPlot (microseconds)", 900 - fm.stringWidth("Latency ScatterPlot (microseconds)") / 2, 20); g2.drawString("" + max, 10, 20); g2.drawLine(100, 20, 100, 960); g2.drawLine(100, 960, 1790, 960); int start = 0; int end = 100; final double width = 1690.0 / 7.0; g2.setColor(Color.red); plotSubset(g2, start, end, "10 msgs/sec", 100, width, stepY, means[0]); start = 100; end = 1100; g2.setColor(Color.green); plotSubset(g2, start, end, "100 msgs/sec", 100 + width, width, stepY, means[1]); start = 1100; end = 11100; g2.setColor(Color.blue); plotSubset(g2, start, end, "1K msgs/sec", 100 + width * 2, width, stepY, means[2]); start = 11100; end = 111100; g2.setColor(Color.cyan); plotSubset(g2, start, end, "10K msgs/sec", 100 + width * 3, width, stepY, means[3]); start = 111100; end = 1111100; g2.setColor(Color.magenta); plotSubset(g2, start, end, "100K msgs/sec", 100 + width * 4, width, stepY, means[4]); start = 1111100; end = 11111100; g2.setColor(Color.yellow); plotSubset(g2, start, end, "1M msgs/sec", 100 + width * 5, width, stepY, means[5]); start = 11111100; end = 41111100; g2.setColor(Color.orange); plotSubset(g2, start, end, "3M msgs/sec", 100 + width * 6, width, stepY, means[6]); ImageIO.write(image, "png", imageFile); }
From source file:com.joey.software.Tools.AScanViewerTool.java
public void setMax(float max) { for (int i = 0; i < maxData.length; i++) { maxData[i] = max;/*from ww w .j av a 2 s. c om*/ } XYSeriesCollection maxCol = PlotingToolkit.getCollection(xData, maxData, "Max"); XYLineAndShapeRenderer maxRender = new XYLineAndShapeRenderer(true, false); maxRender.setSeriesPaint(0, Color.MAGENTA); previewPlot.getXYPlot().setRenderer(2, maxRender); dataPlot.getXYPlot().setRenderer(2, maxRender); dataPlot.getXYPlot().setDataset(2, maxCol); previewPlot.getXYPlot().setDataset(2, maxCol); }
From source file:dumbara.view.Chart1.java
public static void ViewLineChart(String[] agencyID, String[] sslesDate, ArrayList<String[]> arrayList) throws SQLException, ClassNotFoundException { XYSeries series1 = new XYSeries("Agency 1"); XYSeries series2 = new XYSeries("Agency 2"); XYSeries series3 = new XYSeries("Agency 3"); XYSeries series4 = new XYSeries("Agency 4"); for (String[] strings : arrayList) { for (int i = 0; i < sslesDate.length; i++) { System.out.println(sslesDate[i].split("-")[1] + ""); series1.add(Double.parseDouble(sslesDate[i].split("-")[1] + ""), Double.parseDouble(arrayList.get(0)[i])); }/*from w ww .ja v a 2 s . com*/ for (int i = 0; i < sslesDate.length; i++) { series2.add(Double.parseDouble(sslesDate[i].split("-")[1] + ""), Double.parseDouble(arrayList.get(1)[i])); } for (int i = 0; i < sslesDate.length; i++) { series3.add(Double.parseDouble(sslesDate[i].split("-")[1] + ""), Double.parseDouble(arrayList.get(2)[i])); } for (int i = 0; i < sslesDate.length; i++) { series4.add(Double.parseDouble(sslesDate[i].split("-")[1] + ""), Double.parseDouble(arrayList.get(3)[i])); } } XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(series1); dataset.addSeries(series2); dataset.addSeries(series3); dataset.addSeries(series4); XYDataset dataset1 = dataset; JFreeChart chart = ChartFactory.createXYLineChart("", "Test Id", "Average Marks", dataset1, PlotOrientation.VERTICAL, true, false, false); XYPlot plot = (XYPlot) chart.getPlot(); XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); renderer.setSeriesLinesVisible(0, true); renderer.setSeriesShapesVisible(0, true); renderer.setSeriesLinesVisible(1, true); renderer.setSeriesShapesVisible(1, true); renderer.setSeriesLinesVisible(2, true); renderer.setSeriesShapesVisible(2, true); renderer.setSeriesFillPaint(2, Color.MAGENTA); plot.setRenderer(renderer); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(500, 300)); //(chartPanel); ChartFrame frame = new ChartFrame("Dumbara Water Management System", chart); frame.setLocationRelativeTo(null); frame.pack(); frame.setVisible(true); }
From source file:org.spoutcraft.launcher.skin.ConsoleFrame.java
/** * Track a process in a separate daemon thread. * /*w w w.j a va2s . co m*/ * @param process process */ private void track(Process process) { final PrintWriter out = new PrintWriter(getOutputStream(Color.MAGENTA), true); Thread thread = new Thread(new Runnable() { public void run() { try { int code = trackProc.waitFor(); out.println("Process ended with code " + code); } catch (InterruptedException e) { out.println("Process tracking interrupted!"); } } }); thread.setDaemon(true); thread.start(); }
From source file:com.icesoft.faces.component.outputchart.AbstractChart.java
public ColorMap() { this.put("black", Color.BLACK); this.put("blue", Color.BLUE); this.put("cyan", Color.CYAN); this.put("darkGray", Color.DARK_GRAY); this.put("gray", Color.GRAY); this.put("green", Color.GREEN); this.put("lightGray", Color.LIGHT_GRAY); this.put("magenta", Color.MAGENTA); this.put("orange", Color.ORANGE); this.put("pink", Color.PINK); this.put("red", Color.RED); this.put("white", Color.WHITE); this.put("yellow", Color.YELLOW); }
From source file:nz.govt.natlib.ndha.manualdeposit.customui.IconRenderer.java
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); this.setToolTipText(""); DepositTreeModel model = null;/*w w w . ja v a2s.c o m*/ // MD5Digest digest = null; ChecksumDigest digest = null; if (tree.getModel() instanceof DepositTreeModel) { model = (DepositTreeModel) tree.getModel(); digest = model.getChecksumDigest(); } DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; if ((node.getParent() != null) && (node.getUserObject() instanceof FileGroupCollection) && (model.getChecksumDigest() != null) && !(model.getChecksumDigest().isFixitySuccessful(node))) { setIcon(folderHomeIcon); this.setForeground(java.awt.Color.red); } else if (node.getUserObject() instanceof FileSystemObject) { FileSystemObject fso = (FileSystemObject) node.getUserObject(); if (digest != null && fso.getOriginalChecksum() != null) { if (!fso.checksumMatches()) { this.setForeground(java.awt.Color.red); this.setToolTipText("Invalid Fixity value"); } else { this.setForeground(new Color(0, 125, 0)); this.setToolTipText("File has correct fixity value"); } } else if (digest != null && fso.getIsDuplicate()) { this.setForeground(new Color(255, 127, 80)); this.setToolTipText("Duplicate filename in checksum digest"); } else if (digest != null && digest.getFileStatus(fso) == null && fso.getIsFile()) { this.setForeground(java.awt.Color.blue); this.setToolTipText("File is not listed in checksum Digest"); } if (model != null && model.getTreeType() == ETreeType.FileSystemTree) { if (fso.getIsFile()) { setIcon(getMimeTypeIcon(fso)); } else { setIcon(folderFileSystemIcon); } } else if (model != null && model.getTreeType() == ETreeType.EntityTree) { if (fso.getIsFile()) { setIcon(getMimeTypeIcon(fso)); } else { setIcon(folderEntityIcon); } } else if (model != null && model.getTreeType() == ETreeType.StructMapTree) { if (fso.getIsFile()) { setIcon(getMimeTypeIcon(fso)); } else { setIcon(folderFileSystemIcon); } } } else if (node.getUserObject() instanceof FileGroup) { FileGroup group = (FileGroup) node.getUserObject(); if (group.getEntityType() == RepresentationTypes.DigitalOriginal) { setIcon(digitalOriginalIcon); } else if (group.getEntityType() == RepresentationTypes.PreservationMaster) { setIcon(preservationCopyIcon); } else if (group.getEntityType() == RepresentationTypes.ModifiedMaster) { setIcon(modifiedMasterIcon); } else if (group.getEntityType() == RepresentationTypes.AccessCopy || group.getEntityType() == RepresentationTypes.AccessCopy_High || group.getEntityType() == RepresentationTypes.AccessCopy_Medium || group.getEntityType() == RepresentationTypes.AccessCopy_Low || group.getEntityType() == RepresentationTypes.AccessCopy_Epub || group.getEntityType() == RepresentationTypes.AccessCopy_Pdf) { setIcon(accessCopyIcon); } else { setIcon(digitalOriginalIcon); } } else if (node.getUserObject() instanceof StructMap) { setIcon(structMapIcon); } else { setIcon(folderHomeIcon); // Build tooltip at SIP level, to inform user of all colour coded issues with this SIP. String toolTipText = ""; if ((node.getParent() == null) && (node.getUserObject() != null) && (model != null) && (model.getChecksumDigest() != null)) { if (model.getChecksumDigest().getMissingFiles().size() > 0) { toolTipText = "Some files from checksum digest can't be located."; } if (model.getChecksumDigest().getFilesMissingFromDigest(node).size() > 0) { if (toolTipText.isEmpty()) toolTipText = "Some files not listed in the checksum digest. (BLUE)"; else toolTipText = toolTipText + "<br>" + "Some files not listed in the checksum digest. (BLUE)"; } if (model.getChecksumDigest().hasDuplicateFiles(node)) { if (toolTipText.isEmpty()) toolTipText = "Duplicate files in checksum digest. (ORANGE)"; else toolTipText = toolTipText + "<br>" + "Duplicate files in checksum digest. (ORANGE)"; } if (!(model.getChecksumDigest().isFixitySuccessful(node))) { if (toolTipText.isEmpty()) toolTipText = "Files with invalid fixity values. (RED)"; else toolTipText = toolTipText + "<br>" + "Files with invalid fixity values. (RED)"; } } if (!toolTipText.isEmpty()) { this.setForeground(java.awt.Color.red); toolTipText = "<html>" + toolTipText + "</html>"; this.setToolTipText(toolTipText); } // If an IE has customized Metadata then change colour of entity if (node.getUserObject() != null) { if (node.getUserObject() instanceof FileGroupCollection && (!node.getUserObject().toString().equals("Preservation Master"))) { FileGroupCollection entity = (FileGroupCollection) node.getUserObject(); if (entity.isCustomized()) { this.setForeground(java.awt.Color.MAGENTA); this.setToolTipText("IE has customized Metadata."); } } } } repaint(); return this; }
From source file:bicat.gui.GraphicPane.java
/** * Default constructor, initializes some values. *///w w w. j a v a 2s .c om public GraphicPane() { geneList = null; graphDataList = null; filledRect = new Rectangle(0, 0); xStep = 10; yStep = 160; // sta ovo tacno znaci??? (size of the cells of the // visualized matrix?) colorWheel = new Color[8]; // samo 8? colorWheel[0] = Color.BLUE; colorWheel[1] = Color.CYAN; colorWheel[2] = Color.GREEN; colorWheel[3] = Color.MAGENTA; colorWheel[4] = Color.ORANGE; colorWheel[5] = Color.PINK; colorWheel[6] = Color.RED; colorWheel[7] = Color.YELLOW; // /* * DefaultPieDataset dpd = new DefaultPieDataset(); * dpd.setValue("Category 1",50); dpd.setValue("Category 2",50); */ // create a dataset... /* * DefaultPieDataset data = new DefaultPieDataset(); * data.setValue("Java", new Double(43.2)); data.setValue("Visual * Basic", new Double(0.0)); data.setValue("C/C++", new Double(17.5)); * * JFreeChart chart = ChartFactory.createPieChart("Sample",data, * true,true,false); ChartFrame frame = new ChartFrame("See", chart); * frame.pack(); // this.add(frame); //frame.pack(); * frame.setVisible(true); */ /* * chart = ChartFactory.createXYLineChart("Expression Profiles of a * Bicluster","genes","conditions", new * org.jfree.data.xy.DefaultTableXYDataset(), * org.jfree.chart.plot.PlotOrientation.HORIZONTAL, false,false,false); * * //ChartPanel cp = new ChartPanel(chart_1); chartPanel = new * ChartPanel(chart); this.add(chartPanel); //cp); * //,BorderLayout.WEST); this.setVisible(true); * //this.add("Proba",chart_1); //ChartFrame frame_1 = new * ChartFrame("XY",chart_1); //frame_1.pack(); * //frame_1.setVisible(true); */ }
From source file:net.sf.maltcms.chromaui.charts.GradientPaintScale.java
/** * * @return/*from ww w . j ava2s . c o m*/ */ public static Color[] getDefaultColorRamp() { Color[] c = new Color[] { Color.BLUE, Color.MAGENTA, Color.RED, Color.ORANGE, Color.YELLOW, Color.WHITE }; return c; }