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.joliciel.jochre.graphics.SegmenterImpl.java
public void segment() { LOG.debug("########## segment #########"); if (currentMonitor != null) { currentMonitor.setCurrentAction("imageMonitor.findingShapes"); }//from w ww . j a va 2s . c om List<Shape> shapes = this.findContiguousShapes(sourceImage); if (this.isDrawSegmentation()) { segmentedImage = new BufferedImage(sourceImage.getWidth(), sourceImage.getHeight(), BufferedImage.TYPE_INT_ARGB); graphics2D = segmentedImage.createGraphics(); graphics2D.drawImage(sourceImage.getOriginalImage(), 0, 0, sourceImage.getWidth(), sourceImage.getHeight(), null); } this.removeSpecks(sourceImage, shapes); this.removeOversizedShapes(shapes); if (currentMonitor != null) { currentMonitor.setCurrentAction("imageMonitor.groupingShapesIntoRows"); currentMonitor.setPercentComplete(0.2); } List<Rectangle> whiteAreas = sourceImage.getWhiteAreas(shapes); // if (this.drawSegmentation) { // graphics2D.setStroke(new BasicStroke(1)); // graphics2D.setPaint(Color.ORANGE); // for (Rectangle whiteArea : whiteAreas) { // graphics2D.drawRect(whiteArea.getLeft(), whiteArea.getTop(), whiteArea.getRight() - whiteArea.getLeft(), whiteArea.getBottom()-whiteArea.getTop()); // } // } // first we group shapes into rows based on white areas which don't rely on knowledge of page slope // having the rows allows us to estimate page slope List<RowOfShapes> rows = this.groupShapesIntoRows(sourceImage, shapes, whiteAreas, false); this.addRowsToJochreImage(sourceImage, rows); this.findGuideLines(sourceImage); List<Rectangle> columnSeparators = sourceImage.findColumnSeparators(); if (this.drawSegmentation) { graphics2D.setStroke(new BasicStroke(3)); graphics2D.setPaint(Color.ORANGE); for (Rectangle whiteArea : columnSeparators) { int topLeft = (int) Math.round(whiteArea.getLeft() + sourceImage.getXAdjustment(whiteArea.getTop())) + 3; int bottomLeft = (int) Math .round(whiteArea.getLeft() + sourceImage.getXAdjustment(whiteArea.getBottom())) + 3; int topRight = (int) Math .round(whiteArea.getRight() + sourceImage.getXAdjustment(whiteArea.getTop())) - 3; int bottomRight = (int) Math .round(whiteArea.getRight() + sourceImage.getXAdjustment(whiteArea.getBottom())) - 3; graphics2D.drawLine(topLeft, whiteArea.getTop() + 3, bottomLeft, whiteArea.getBottom() - 3); graphics2D.drawLine(topRight, whiteArea.getTop() + 3, bottomRight, whiteArea.getBottom() - 3); graphics2D.drawLine(topLeft, whiteArea.getTop() + 3, topRight, whiteArea.getTop() + 3); graphics2D.drawLine(bottomLeft, whiteArea.getBottom() - 3, bottomRight, whiteArea.getBottom() - 3); } } // now we re-do the grouping of shapes into rows, this time with proper column breaks to avoid // rows that cross-over columns rows = this.groupShapesIntoRows(sourceImage, shapes, columnSeparators, true); this.addRowsToJochreImage(sourceImage, rows); this.findGuideLines(sourceImage); this.splitRows(sourceImage); if (this.splitAndJoin) { // figure out if the shapes contain a lot of "holes" // if they do, join them together // if they don't, try to split them int fillFactor = this.getFillFactor(sourceImage); if (fillFactor >= 2) { this.joinShapesHorizontally(sourceImage); } if (currentMonitor != null) { currentMonitor.setCurrentAction("imageMonitor.splittingShapes"); currentMonitor.setPercentComplete(0.4); } this.splitShapes(sourceImage, fillFactor); } //this.removeSpecks(sourceImage); this.joinShapesVertically(sourceImage); this.findGuideLines(sourceImage); this.combineRows(sourceImage); this.removeOrphans(sourceImage, false); if (currentMonitor != null) { currentMonitor.setCurrentAction("imageMonitor.groupingShapesIntoWords"); currentMonitor.setPercentComplete(0.6); } this.groupShapesIntoWords(sourceImage); this.removeOrphans(sourceImage, true); this.cleanMargins(sourceImage); if (currentMonitor != null) { currentMonitor.setCurrentAction("imageMonitor.analysingFontSize"); currentMonitor.setPercentComplete(0.7); } this.splitRowsByFontSize(sourceImage); if (currentMonitor != null) { currentMonitor.setCurrentAction("imageMonitor.groupingRowsIntoParagraphs"); currentMonitor.setPercentComplete(0.9); } this.groupRowsIntoParagraphs(sourceImage); sourceImage.setShapeCount(this.getShapeCount(sourceImage)); if (this.isDrawSegmentation()) { this.drawSegmentation(sourceImage); } if (currentMonitor != null) { currentMonitor.setFinished(true); } }
From source file:logdruid.ui.table.StatRecordingEditorTable.java
public void FixValues() { String patternString = ""; Matcher matcher;//from w w w . jav a 2s . co m PatternCache patternCache = new PatternCache(); Iterator it = data.iterator(); Object[] obj; while (it.hasNext()) { obj = (Object[]) it.next(); String stBefore = (String) obj[1]; String stType = (String) obj[2]; String stAfter = (String) obj[3]; logger.info("stType: " + stType); if (stType.equals("date") && rep.getDateFormat(recording.getDateFormatID()).getPattern() != null) { patternString += stBefore + "(" + rep.getDateFormat(recording.getDateFormatID()).getPattern() + ")" + stAfter; logger.info("getTypeString(stType) getPattern -: " + rep.getDateFormat(recording.getDateFormatID()).getPattern()); logger.info("getTypeString(stType) getDateFormat -: " + rep.getDateFormat(recording.getDateFormatID()).getDateFormat()); } else { patternString += stBefore + "(" + DataMiner.getTypeString(stType) + ")" + stAfter; logger.info("getTypeString(stType) -: " + DataMiner.getTypeString(stType)); } } try { logger.info("theLine: " + examplePane.getText()); logger.info("patternString: " + patternString); Highlighter h = examplePane.getHighlighter(); h.removeAllHighlights(); int currIndex = 0; String[] lines = examplePane.getText().split(System.getProperty("line.separator")); if (lines.length >= 1) { for (int i = 0; i < lines.length; i++) { matcher = patternCache.getPattern(patternString).matcher(lines[i]); if (matcher.find()) { // int currIndex = 0; // doc.insertString(doc.getLength(),line+"\n", null); for (int i2 = 1; i2 <= matcher.groupCount(); i2++) { model.setValueAt(matcher.group(i2), i2 - 1, 5); h.addHighlight(currIndex + matcher.start(i2), +currIndex + matcher.end(i2), new DefaultHighlighter.DefaultHighlightPainter(Color.ORANGE)); } } currIndex += lines[i].length() + 1; } } } catch (Exception e1) { e1.printStackTrace(); // System.exit(1); } }
From source file:cytoscape.render.immed.GraphGraphicsTest.java
private long drawOldFull(Random rand) { final float nodeSizeFactor = 50f; float size = (float) canvasSize; long begin = System.nanoTime(); for (int i = 0; i < numNodes; i++) { float x = rand.nextFloat() * (rand.nextBoolean() ? size : -size); float y = rand.nextFloat() * (rand.nextBoolean() ? size : -size); oldGraphGraphics.drawNodeFull((byte) (i % (int) OldGraphGraphics.s_last_shape), x, y, (x + (rand.nextFloat() * nodeSizeFactor)), (y + (rand.nextFloat() * nodeSizeFactor)), Color.blue, 1.0f + (i % 10), Color.yellow); }//from www.j a v a2s . c o m long end = System.nanoTime(); long nodeDur = end - begin; BasicStroke edgeStroke = new BasicStroke(1f); begin = System.nanoTime(); for (int i = 0; i < numEdges; i++) { oldGraphGraphics.drawEdgeFull((byte) ((i % 7) - 8), rand.nextFloat() * (20f), Color.red, (byte) ((i % 7) - 8), rand.nextFloat() * (20f), Color.orange, rand.nextFloat() * (rand.nextBoolean() ? size : -size), rand.nextFloat() * (rand.nextBoolean() ? size : -size), oldGraphGraphics.m_noAnchors, rand.nextFloat() * (rand.nextBoolean() ? size : -size), rand.nextFloat() * (rand.nextBoolean() ? size : -size), 1f, Color.green, 0f); } end = System.nanoTime(); long duration = (end - begin) + nodeDur; // try { // ImageIO.write(image,"PNG",new File("/tmp/homer-old-" + rand.nextInt(100) + ".png")); // } catch (IOException ioe) { ioe.printStackTrace(); } return duration; }
From source file:visualizer.datamining.dataanalysis.NeighborhoodHit.java
private JFreeChart createChart(XYDataset xydataset) { JFreeChart chart = ChartFactory.createXYLineChart("Neighborhood Hit", "Number Neighbors", "Precision", 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:com.esprit.gui.Statistique.java
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed UserDAO us = new UserDAO(); DefaultCategoryDataset barChartData = new DefaultCategoryDataset(); barChartData.setValue(us.calculNombreClient(), "Nombre des utilisateurs", "Clients"); barChartData.setValue(us.calculNombreAnnonceur(), "Nombre des utilisateurs", "Annonceurs"); JFreeChart barChart = ChartFactory.createBarChart3D("Statistiques des membres", "Type", "Nombre des utilisateurs", barChartData, PlotOrientation.VERTICAL, rootPaneCheckingEnabled, rootPaneCheckingEnabled, rootPaneCheckingEnabled); CategoryPlot barchrt = barChart.getCategoryPlot(); barchrt.setRangeGridlinePaint(Color.ORANGE); ChartPanel barPanel = new ChartPanel(barChart); jPanel2.removeAll();// w w w. jav a 2 s. c o m jPanel2.add(barPanel, BorderLayout.CENTER); jPanel2.validate(); /** // */ }
From source file:logdruid.ui.table.EventRecordingEditorTable.java
public void FixValues() { String patternString = ""; Matcher matcher = null;/*from w w w . j a va 2 s. c om*/ PatternCache patternCache = new PatternCache(); Iterator it = data.iterator(); Object[] obj; while (it.hasNext()) { obj = (Object[]) it.next(); String stBefore = (String) obj[1]; String stType = (String) obj[2]; String stAfter = (String) obj[4]; logger.info("stType: " + stType); if (stType.equals("date") && rep.getDateFormat(recording.getDateFormatID()).getPattern() != null) { patternString += stBefore + "(" + rep.getDateFormat(recording.getDateFormatID()).getPattern() + ")" + stAfter; logger.info("getTypeString(stType) getPattern -: " + rep.getDateFormat(recording.getDateFormatID()).getPattern()); logger.info("getTypeString(stType) getDateFormat -: " + rep.getDateFormat(recording.getDateFormatID()).getDateFormat()); } else { patternString += stBefore + "(" + DataMiner.getTypeString(stType) + ")" + stAfter; logger.info("getTypeString(stType) -: " + DataMiner.getTypeString(stType)); } } try { logger.info("theLine: " + examplePane.getText()); logger.info("patternString: " + patternString); Highlighter h = examplePane.getHighlighter(); h.removeAllHighlights(); int currIndex = 0; String[] lines = examplePane.getText().split(System.getProperty("line.separator")); if (lines.length >= 1) { for (int i = 0; i < lines.length; i++) { matcher = patternCache.getPattern(patternString).matcher(lines[i]); if (matcher.find()) { // int currIndex = 0; // doc.insertString(doc.getLength(),line+"\n", null); for (int i2 = 1; i2 <= matcher.groupCount(); i2++) { model.setValueAt(matcher.group(i2), i2 - 1, 6); h.addHighlight(currIndex + matcher.start(i2), +currIndex + matcher.end(i2), new DefaultHighlighter.DefaultHighlightPainter(Color.ORANGE)); } } logger.info("currIndex: " + currIndex + "matcher.end(i2): " + lines[i].length() + ",l: " + lines[i]); currIndex += lines[i].length() + 1; } } } catch (Exception e1) { e1.printStackTrace(); // System.exit(1); } }
From source file:com.artnaseef.jmeter.report.ResultCodesStackedReport.java
protected void createChart() { // create the chart... this.chart = ChartFactory.createStackedBarChart("Average Result Codes per Second", // chart title this.yAxisLabel, // x axis label "Samples", // y axis label dataset, // data PlotOrientation.VERTICAL, true, // include legend true, // tooltips false // urls );//from w w w . j a v a2 s . c om // // Adjust colors for the chart. // CategoryPlot categoryPlot; categoryPlot = (CategoryPlot) this.chart.getPlot(); categoryPlot.setBackgroundPaint(Color.WHITE); categoryPlot.setDomainGridlinePaint(Color.BLACK); categoryPlot.setRangeGridlinePaint(Color.BLACK); // // Customize the bar colors. // CategoryItemRenderer renderer = this.chart.getCategoryPlot().getRenderer(); List rowKeys = this.dataset.getRowKeys(); int cur = 0; Map<Integer, Integer> colorAdjustMap = new HashMap<>(); while (cur < rowKeys.size()) { Integer resultCode = (Integer) rowKeys.get(cur); Color color; int group = resultCode / 100; switch (group) { case 2: color = Color.GREEN; break; case 3: color = Color.BLUE; break; case 4: color = Color.ORANGE; break; case 5: color = Color.RED; break; default: color = Color.GRAY; break; } color = this.adjustColor(colorAdjustMap, group, color); renderer.setSeriesPaint(cur, color); renderer.setSeriesOutlinePaint(cur, Color.BLACK); cur++; } }
From source file:org.csa.rstb.dat.toolviews.HaAlphaPlotPanel.java
private void initColorModels() { for (int j = 0; j <= 1; j++) { final int palSize = 256; final byte[] r = new byte[palSize]; final byte[] g = new byte[palSize]; final byte[] b = new byte[palSize]; final byte[] a = new byte[palSize]; r[0] = (byte) backgroundColor.getRed(); g[0] = (byte) backgroundColor.getGreen(); b[0] = (byte) backgroundColor.getBlue(); a[0] = (byte) backgroundColor.getAlpha(); final Palette pal = new Palette("Rainbow", new Color[] { Color.black, Color.blue, Color.cyan, Color.green, Color.yellow, Color.orange, Color.red }); for (int i = 1; i < 256; ++i) { float value = i / 255f; if (j == 0) value = (255 - i) / 255f; Color c = pal.lookupColor(value); r[i] = (byte) c.getRed(); g[i] = (byte) c.getGreen(); b[i] = (byte) c.getBlue(); a[i] = (byte) 255; }//from www . j a va 2 s. c om if (j == 0) { toggledColorModel = new IndexColorModel(8, palSize, r, g, b, a); } else { untoggledColorModel = new IndexColorModel(8, palSize, r, g, b, a); } } }
From source file:de.naoth.xabsleditor.graphpanel.AgentVisualizer.java
private void doSetGraph(final XABSLContext context, final String selectedNodeName, String selectedAgentName) { // build graph final DirectedGraph<XabslNode, XabslEdge> graph = new DirectedSparseGraph<XabslNode, XabslEdge>(); selectedNode = createAgentGraph(context, graph, selectedNodeName, selectedAgentName); if (selectedAgentName == null) { layout = new SuperDAGLayout<XabslNode, XabslEdge>(graph); } else {//w w w .ja v a 2 s . c om layout = new SuperDAGLayout<XabslNode, XabslEdge>(graph, 80, 120); } layout.initialize(); if (scrollPane != null) { remove(scrollPane); scrollPane = null; } vv = new VisualizationViewer<XabslNode, XabslEdge>(layout); DefaultModalGraphMouse<XabslNode, XabslEdge> mouse = new DefaultModalGraphMouse<XabslNode, XabslEdge>(); vv.setGraphMouse(mouse); // enable selecting the nodes mouse.setMode(ModalGraphMouse.Mode.TRANSFORMING); // add external mouse listener if (externalMouseListener != null) { vv.addGraphMouseListener(externalMouseListener); } vv.getRenderContext().setVertexShapeTransformer(new VertexTransformer(graph)); vv.getRenderContext().setVertexLabelTransformer(new Transformer<XabslNode, String>() { @Override public String transform(XabslNode n) { return "<html><center>" + n.getName().replaceAll("_", "_<br>") + "</center></html>"; } }); vv.getRenderContext().setVertexFillPaintTransformer(new Transformer<XabslNode, Paint>() { @Override public Paint transform(XabslNode n) { if (n == selectedNode) { return Color.green; } if (selectedNode != null && graph.getSuccessors(selectedNode).contains(n)) { return Color.red; } if (selectedNode != null && graph.getPredecessors(selectedNode).contains(n)) { return Color.orange; } if (graph.getOutEdges(n).size() == 0) { return Color.lightGray; } return Color.white; } }); // label is placed in the center of the node vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR); vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.QuadCurve<XabslNode, XabslEdge>()); vv.getRenderContext().setEdgeDrawPaintTransformer(new Transformer<XabslEdge, Paint>() { @Override public Paint transform(XabslEdge e) { if (selectedNode != null && graph.getSource(e) == selectedNode) { return Color.red; } else if (selectedNode != null && graph.getDest(e) == selectedNode) { return Color.ORANGE; } else { return Color.black; } } }); // add to a zoomable container scrollPane = new GraphZoomScrollPane(vv); panelGraph.add(scrollPane, BorderLayout.CENTER); validate(); fitGraphinPanel(); recreateAgentSelector(context); }
From source file:visualizer.datamining.dataanalysis.NeighborhoodPreservation.java
private JFreeChart createChart(XYDataset xydataset) { JFreeChart chart = ChartFactory.createXYLineChart("Neighborhood Preservation", "Number Neighbors", "Precision", 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; }