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:org.sakaiproject.sitestats.impl.chart.ChartServiceImpl.java
private static Color parseColor(String color) { if (color != null) { if (color.trim().startsWith("#")) { // HTML colors (#FFFFFF format) return new Color(Integer.parseInt(color.substring(1), 16)); } else if (color.trim().startsWith("rgb")) { // HTML colors (rgb(255, 255, 255) format) String values = color.substring(color.indexOf("(") + 1, color.indexOf(")")); String rgb[] = values.split(","); return new Color(Integer.parseInt(rgb[0].trim()), Integer.parseInt(rgb[1].trim()), Integer.parseInt(rgb[2].trim())); } else {/*ww w.j av a2 s .c om*/ // Colors by name if (color.equalsIgnoreCase("black")) return Color.black; if (color.equalsIgnoreCase("grey")) return Color.gray; if (color.equalsIgnoreCase("yellow")) return Color.yellow; if (color.equalsIgnoreCase("green")) return Color.green; if (color.equalsIgnoreCase("blue")) return Color.blue; if (color.equalsIgnoreCase("red")) return Color.red; if (color.equalsIgnoreCase("orange")) return Color.orange; if (color.equalsIgnoreCase("cyan")) return Color.cyan; if (color.equalsIgnoreCase("magenta")) return Color.magenta; if (color.equalsIgnoreCase("darkgray")) return Color.darkGray; if (color.equalsIgnoreCase("lightgray")) return Color.lightGray; if (color.equalsIgnoreCase("pink")) return Color.pink; if (color.equalsIgnoreCase("white")) return Color.white; } } LOG.info("Unable to parse body background-color (color:" + color + "). Assuming white."); return Color.white; }
From source file:nosqltools.MainForm.java
public void connect() { String user;/*from ww w. j av a 2 s . com*/ String pass; String dbname; String serveradd; int port; LoginDialog dlg_login = new LoginDialog(null); dlg_login.setVisible(true); //If user chose login and not cancel option on dialog box if (dlg_login.isToLogin()) { Text_MessageBar.setText(Initializations.DBATTEMPTING); Text_MessageBar.setForeground(Color.ORANGE); user = dlg_login.getUsername(); pass = dlg_login.getPassword(); dbname = dlg_login.getDatabase(); serveradd = dlg_login.getServerAddr(); port = dlg_login.getPort(); if (dbcon.connect(user, pass, dbname, serveradd, port)) { DefaultTreeModel defTableMod = dbcon.buildDBTree(); if (defTableMod != null && dbcon.isConnectionSuccess()) { jTree1.setModel(defTableMod); Text_MessageBar.setText(Initializations.DBCONNSUCCESS); Text_MessageBar.setForeground(Color.GREEN); Menu_Collections.setEnabled(true); //load the data of collection in panel_text on double click jTree1.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent me) { if (me.getButton() == MouseEvent.BUTTON1) { if (me.getClickCount() == 2) { //get the path of the mouse click ex:[localhost,test,testData] Op_Refresh.setEnabled(true); tp = jTree1.getPathForLocation(me.getX(), me.getY()); if (tp != null) { List<String> coll_db = dbcon.getAllCollections(); int cnt = tp.getPathCount(); for (int i = 0; i < cnt; i++) { //if one of the collection matches the coll that was clicked by the user load data if (coll_db.contains(tp.getPathComponent(i).toString())) { indexOfCurrentCollection = i; sb = dbcon.getCollectionData(tp.getPathComponent(i).toString()); if (sb != null) { Panel_Text.setVisible(true); JsonNode jNode1; try { jNode1 = mapper.readTree(sb.toString()); textArea.setText(mapper.writerWithDefaultPrettyPrinter() .writeValueAsString(jNode1)); } catch (IOException ex) { Logger.getLogger(MainForm.class.getName()).log(Level.SEVERE, null, ex); } Text_MessageBar.setText(Initializations.INITSTRING); // textArea.setText(sb.toString()); validateDataPanel_text(sb); /* if (json_util.isValid(sb.toString())) { json_util.isDataParsed(textArea.getText()); Text_MessageBar.setText(Initializations.JSONFILESUCCESS); } else { sb.setLength(0); //JOptionPane.showMessageDialog(this, Initializations.JSONINCORRECTFORMAT , Initializations.VALIDATIONERROR , JOptionPane.ERROR_MESSAGE); try { Object obj = parser.parse(sb.toString()); } catch(org.json.simple.parser.ParseException pe) { Text_MessageBar.setText(Initializations.ERRORLINE + json_util.getLineNumber(pe.getPosition(), textArea.getText()) + " - " + pe); } } */ } else { Panel_Text.setVisible(false); Text_MessageBar.setText(Initializations.SYSTEMCOLL); Text_MessageBar.setForeground(Color.RED); } } } } } } } }); } else { jTree1.setModel(null); Text_MessageBar.setText(Initializations.DBCONNFAIL); Text_MessageBar.setForeground(Color.RED); } } else { jTree1.setModel(null); Text_MessageBar.setText(Initializations.DBCONNFAIL); Text_MessageBar.setForeground(Color.RED); } } else { jTree1.setModel(null); Text_MessageBar.setText(Initializations.DBCONNFAIL); Text_MessageBar.setForeground(Color.RED); } }
From source file:org.sakaiproject.sitestats.impl.ServerWideReportManagerImpl.java
public static Color parseColor(String color) { if (color != null) { if (color.trim().startsWith("#")) { // HTML colors (#FFFFFF format) return new Color(Integer.parseInt(color.substring(1), 16)); } else if (color.trim().startsWith("rgb")) { // HTML colors (rgb(255, 255, 255) format) String values = color.substring(color.indexOf("(") + 1, color.indexOf(")")); String rgb[] = values.split(","); return new Color(Integer.parseInt(rgb[0].trim()), Integer.parseInt(rgb[1].trim()), Integer.parseInt(rgb[2].trim())); } else {//from w w w.jav a2s. c o m // Colors by name if (color.equalsIgnoreCase("black")) return Color.black; if (color.equalsIgnoreCase("grey")) return Color.gray; if (color.equalsIgnoreCase("yellow")) return Color.yellow; if (color.equalsIgnoreCase("green")) return Color.green; if (color.equalsIgnoreCase("blue")) return Color.blue; if (color.equalsIgnoreCase("red")) return Color.red; if (color.equalsIgnoreCase("orange")) return Color.orange; if (color.equalsIgnoreCase("cyan")) return Color.cyan; if (color.equalsIgnoreCase("magenta")) return Color.magenta; if (color.equalsIgnoreCase("darkgray")) return Color.darkGray; if (color.equalsIgnoreCase("lightgray")) return Color.lightGray; if (color.equalsIgnoreCase("pink")) return Color.pink; if (color.equalsIgnoreCase("white")) return Color.white; } } log.info("Unable to parse body background-color (color:" + color + "). Assuming white."); return Color.white; }
From source file:com.isti.traceview.common.TraceViewChartPanel.java
/** * Draws a vertical line used to trace the mouse position to the horizontal axis. * //ww w .j ava2 s.co m * @param g2 * the graphics device. * @param x * the x-coordinate of the trace line. */ private void drawHorizontalAxisTrace(Graphics2D g2, int x) { Rectangle2D dataArea = getScreenDataArea(); g2.setXORMode(Color.orange); if (((int) dataArea.getMinX() < x) && (x < (int) dataArea.getMaxX())) { if (this.verticalTraceLine != null) { g2.draw(this.verticalTraceLine); this.verticalTraceLine.setLine(x, (int) dataArea.getMinY(), x, (int) dataArea.getMaxY()); } else { this.verticalTraceLine = new Line2D.Float(x, (int) dataArea.getMinY(), x, (int) dataArea.getMaxY()); } g2.draw(this.verticalTraceLine); } // Reset to the default 'overwrite' mode g2.setPaintMode(); }
From source file:com.isti.traceview.common.TraceViewChartPanel.java
/** * Draws a horizontal line used to trace the mouse position to the vertical axis. * /*from w w w . j ava 2 s.c om*/ * @param g2 * the graphics device. * @param y * the y-coordinate of the trace line. */ private void drawVerticalAxisTrace(Graphics2D g2, int y) { Rectangle2D dataArea = getScreenDataArea(); g2.setXORMode(Color.orange); if (((int) dataArea.getMinY() < y) && (y < (int) dataArea.getMaxY())) { if (this.horizontalTraceLine != null) { g2.draw(this.horizontalTraceLine); this.horizontalTraceLine.setLine((int) dataArea.getMinX(), y, (int) dataArea.getMaxX(), y); } else { this.horizontalTraceLine = new Line2D.Float((int) dataArea.getMinX(), y, (int) dataArea.getMaxX(), y); } g2.draw(this.horizontalTraceLine); } // Reset to the default 'overwrite' mode g2.setPaintMode(); }
From source file:org.rdv.viz.chart.ChartPanel.java
/** * Draws a vertical line used to trace the mouse position to the horizontal * axis.//w w w . j av a 2 s . co m * * @param g2 the graphics device. * @param x the x-coordinate of the trace line. */ private void drawHorizontalAxisTrace(Graphics2D g2, int x) { Rectangle2D dataArea = getScreenDataArea(); g2.setXORMode(Color.orange); if (((int) dataArea.getMinX() < x) && (x < (int) dataArea.getMaxX())) { if (this.verticalTraceLine != null) { g2.draw(this.verticalTraceLine); this.verticalTraceLine.setLine(x, (int) dataArea.getMinY(), x, (int) dataArea.getMaxY()); } else { this.verticalTraceLine = new Line2D.Float(x, (int) dataArea.getMinY(), x, (int) dataArea.getMaxY()); } g2.draw(this.verticalTraceLine); } // Reset to the default 'overwrite' mode g2.setPaintMode(); }
From source file:org.rdv.viz.chart.ChartPanel.java
/** * Draws a horizontal line used to trace the mouse position to the vertical * axis./*from w w w.j a v a2s . co m*/ * * @param g2 the graphics device. * @param y the y-coordinate of the trace line. */ private void drawVerticalAxisTrace(Graphics2D g2, int y) { Rectangle2D dataArea = getScreenDataArea(); g2.setXORMode(Color.orange); if (((int) dataArea.getMinY() < y) && (y < (int) dataArea.getMaxY())) { if (this.horizontalTraceLine != null) { g2.draw(this.horizontalTraceLine); this.horizontalTraceLine.setLine((int) dataArea.getMinX(), y, (int) dataArea.getMaxX(), y); } else { this.horizontalTraceLine = new Line2D.Float((int) dataArea.getMinX(), y, (int) dataArea.getMaxX(), y); } g2.draw(this.horizontalTraceLine); } // Reset to the default 'overwrite' mode g2.setPaintMode(); }
From source file:com.rapidminer.gui.plotter.charts.AbstractChartPanel.java
/** * Draws a vertical line used to trace the mouse position to the horizontal axis. * /* ww w .ja v a 2s . c o m*/ * @param g2 * the graphics device. * @param x * the x-coordinate of the trace line. */ private void drawHorizontalAxisTrace(Graphics2D g2, int x) { Rectangle2D dataArea = getScreenDataArea(); g2.setXORMode(Color.orange); if ((int) dataArea.getMinX() < x && x < (int) dataArea.getMaxX()) { if (this.verticalTraceLine != null) { g2.draw(this.verticalTraceLine); this.verticalTraceLine.setLine(x, (int) dataArea.getMinY(), x, (int) dataArea.getMaxY()); } else { this.verticalTraceLine = new Line2D.Float(x, (int) dataArea.getMinY(), x, (int) dataArea.getMaxY()); } g2.draw(this.verticalTraceLine); } // Reset to the default 'overwrite' mode g2.setPaintMode(); }
From source file:com.rapidminer.gui.plotter.charts.AbstractChartPanel.java
/** * Draws a horizontal line used to trace the mouse position to the vertical axis. * /*from w w w .j a v a2 s . c o m*/ * @param g2 * the graphics device. * @param y * the y-coordinate of the trace line. */ private void drawVerticalAxisTrace(Graphics2D g2, int y) { Rectangle2D dataArea = getScreenDataArea(); g2.setXORMode(Color.orange); if ((int) dataArea.getMinY() < y && y < (int) dataArea.getMaxY()) { if (this.horizontalTraceLine != null) { g2.draw(this.horizontalTraceLine); this.horizontalTraceLine.setLine((int) dataArea.getMinX(), y, (int) dataArea.getMaxX(), y); } else { this.horizontalTraceLine = new Line2D.Float((int) dataArea.getMinX(), y, (int) dataArea.getMaxX(), y); } g2.draw(this.horizontalTraceLine); } // Reset to the default 'overwrite' mode g2.setPaintMode(); }
From source file:com.att.aro.main.GraphPanel.java
/** * Sets rendering color for all different network type data series. * @param renderer Renderer for the data series * @param dataSeries Data series// w ww.j a v a 2s .c o m */ static void setRenderingColorForDataSeries(XYItemRenderer renderer, final XYIntervalSeriesCollection dataSeries) { renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.none), Color.WHITE); renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.LTE), Color.RED); renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.WIFI), Color.BLUE); renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.UMTS), Color.PINK); renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.ETHERNET), Color.BLACK); renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.HSDPA), Color.YELLOW); renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.HSPA), Color.ORANGE); renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.HSPAP), Color.MAGENTA); renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.HSUPA), Color.CYAN); renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.GPRS), Color.GRAY); }