List of usage examples for java.awt Color YELLOW
Color YELLOW
To view the source code for java.awt Color YELLOW.
Click Source Link
From source file:cn.InstFS.wkr.NetworkMining.UIs.TimeSeriesChart1.java
public static Color getcolor(int i) { switch (i) {// w w w . ja va 2s . c o m case 1: return Color.red; case 2: return Color.blue; case 3: return Color.cyan; case 4: return Color.gray; case 5: return Color.green; case 6: return Color.magenta; case 7: return Color.orange; case 8: return Color.yellow; case 9: return Color.white; case 0: return Color.pink; default: return Color.black; } }
From source file:com.NewJFrame.java
private void displayNeutral() { textPane.setText(""); if (neutraltweets != null) { for (TweetAnalyser analyser : neutraltweets) { appendToPane(textPane, analyser.toString() + "\n", Color.yellow); }/*from w w w .j a v a 2 s. c o m*/ } }
From source file:nl.phanos.liteliveresultsclient.gui.ResultsWindows.java
private void initCustumComponents() { logoLabel = new javax.swing.JLabel(); icon = new ImageIcon(getCLub()); logoLabel.setIcon(icon); // NOI18N logoLabel.setBounds(this.getWidth() - icon.getIconWidth(), this.getHeight() - icon.getIconHeight(), icon.getIconWidth(), icon.getIconHeight()); LayerdPane.add(logoLabel, JLayeredPane.PALETTE_LAYER); clockLabel = new javax.swing.JLabel(); clockLabel.setFont(new java.awt.Font("Lucida Grande", 0, fontSize)); // NOI18N clockLabel.setText(""); clockLabel.setForeground(Color.YELLOW); LayerdPane.add(clockLabel, JLayeredPane.PALETTE_LAYER); jTable1.setRowSelectionAllowed(false); jTable1.setModel(new javax.swing.table.DefaultTableModel(new Object[][] {}, new String[] { "Plaats", "Atleet", "Tijd" }) { Class[] types = new Class[] { java.lang.Integer.class, java.lang.String.class, java.lang.String.class }; boolean[] canEdit = new boolean[] { false, false, false }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; }//w w w .ja va2 s . co m public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); jScrollPane1.getViewport().setBackground(Color.black); this.setBackground(Color.black); JTableHeader header = jTable1.getTableHeader(); header.setOpaque(false); jPanel1.setBackground(Color.black); header.setBackground(Color.black); header.setForeground(Color.YELLOW); DefaultTableCellRenderer headerRenderer = new DefaultTableCellRenderer(); headerRenderer.setBackground(Color.BLACK); for (int i = 0; i < jTable1.getModel().getColumnCount(); i++) { if (jTable1.getModel().getColumnCount() > 0) { jTable1.getColumnModel().getColumn(i).setHeaderRenderer(headerRenderer); } } DefaultTableCellRenderer LEFTRenderer = new DefaultTableCellRenderer(); LEFTRenderer.setHorizontalAlignment(JLabel.LEFT); jTable1.getColumnModel().getColumn(0).setCellRenderer(LEFTRenderer); ChangeFont(fontSize); }
From source file:com.voterData.graph.Graph.java
public static JFreeChart getRaceDistbn2008(Map<String, Double> dataMap) { DefaultCategoryDataset defaultcategorydataset = new DefaultCategoryDataset(); for (String key : dataMap.keySet()) { if (key.equals("A_Rep_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "Asian", "REP"); } else if (key.equals("B_Rep_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "African American/Black", "REP"); } else if (key.equals("I_Rep_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "American Indian/Alaska Native", "REP"); } else if (key.equals("O_Rep_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "Other", "REP"); } else if (key.equals("M_Rep_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "Multiracial", "REP"); } else if (key.equals("U_Rep_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "Undefined", "REP"); } else if (key.equals("W_Rep_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "White", "REP"); } else if (key.equals("A_Dem_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "Asian", "DEM"); } else if (key.equals("B_Dem_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "African American/Black", "DEM"); } else if (key.equals("I_Dem_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "American Indian/Alaska Native", "DEM"); } else if (key.equals("O_Dem_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "Other", "DEM"); } else if (key.equals("M_Dem_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "Multiracial", "DEM"); } else if (key.equals("U_Dem_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "Undefined", "DEM"); } else if (key.equals("W_Dem_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "White", "DEM"); } else if (key.equals("A_Una_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "Asian", "UNA"); } else if (key.equals("B_Una_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "African American/Black", "UNA"); } else if (key.equals("I_Una_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "American Indian/Alaska Native", "UNA"); } else if (key.equals("O_Una_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "Other", "UNA"); } else if (key.equals("M_Una_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "Multiracial", "UNA"); } else if (key.equals("U_Una_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "Undefined", "UNA"); } else if (key.equals("W_Una_2008")) { defaultcategorydataset.addValue(dataMap.get(key), "White", "UNA"); }/*from ww w . j a va2 s. co m*/ } JFreeChart jfreechart = ChartFactory.createBarChart("Race Distribution - 2008", "Party", "% of votes", defaultcategorydataset, PlotOrientation.VERTICAL, true, true, false); jfreechart.setBackgroundPaint(Color.white); CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot(); categoryplot.setBackgroundPaint(Color.lightGray); categoryplot.setRangeGridlinePaint(Color.white); BarRenderer renderer = (BarRenderer) categoryplot.getRenderer(); renderer.setDrawBarOutline(false); renderer.setSeriesPaint(0, Color.ORANGE); renderer.setSeriesPaint(1, Color.MAGENTA); renderer.setSeriesPaint(2, Color.PINK); renderer.setSeriesPaint(3, Color.YELLOW); renderer.setSeriesPaint(4, Color.cyan); renderer.setSeriesPaint(5, Color.RED); renderer.setSeriesPaint(6, Color.green); renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator()); renderer.setSeriesItemLabelGenerator(0, new StandardCategoryItemLabelGenerator()); renderer.setItemLabelsVisible(true); categoryplot.setRenderer(renderer); return jfreechart; }
From source file:com.tiempometa.muestradatos.JProgramTags.java
@Override public void handleReadings(List<TagReading> readings) { bibLabel.setText(""); if (readings.size() > 0) { if (readings.size() == 1) { statusLabel.setBackground(Color.cyan); statusLabel.setText("Leyendo tag"); for (TagReading tagReading : readings) { logger.info("Tag data dump"); logger.info(tagReading.getTagReadData().getTag().epcString()); logger.info(String.valueOf(tagReading.getTagReadData().getData().length)); logger.info(Hex.encodeHexString(tagReading.getTagReadData().getData())); logger.info(String.valueOf(tagReading.getTagReadData().getEPCMemData().length)); logger.info(Hex.encodeHexString(tagReading.getTagReadData().getEPCMemData())); logger.info(String.valueOf(tagReading.getTagReadData().getTIDMemData().length)); logger.info(Hex.encodeHexString(tagReading.getTagReadData().getTIDMemData())); logger.info(String.valueOf(tagReading.getTagReadData().getReservedMemData().length)); logger.info(Hex.encodeHexString(tagReading.getTagReadData().getReservedMemData())); logger.info(String.valueOf(tagReading.getTagReadData().getUserMemData().length)); logger.info(Hex.encodeHexString(tagReading.getTagReadData().getUserMemData())); if (tagReading.getTid() == null) { try { tagReading.setTid(ReaderContext.readTid(tagReading.getEpc(), 12)); if (logger.isDebugEnabled()) { logger.debug("Got tag " + tagReading.getEpc() + " - " + tagReading.getTid()); }/*from ww w .j a va2s. c om*/ // try { statusLabel.setBackground(Color.green); statusLabel.setText("Tag leido"); tidTextField.setText(tagReading.getTid().toLowerCase()); epcTextField.setText(tagReading.getEpc().toLowerCase()); programmedEpcTextField.setText(""); // find tag by EPC/TID in database logger.debug("Looking up rfid by epc " + tagReading.getEpc() + " epc char " + Hex.encodeHexString(tagReading.getEpc().getBytes())); Rfid rfid = totalRfidMap.get(tagReading.getEpc().toUpperCase()); if (rfid == null) { logger.debug("Rfid string not in database tag list. Programming tag."); // if in DB, warn // if not then program with next chipnumber programTag(tagReading); } else { logger.debug("Rfid string IN database tag list."); Rfid batchRfid = rfidMap.get(tagReading.getEpc()); if (batchRfid == null) { logger.debug("Rfid string IN current program batch"); int response = JOptionPane.showConfirmDialog(this, "Este tag tiene un cdigo que existe en el evento actual.\n" + "Corresponde al nmero " + rfid.getBib() + "\nDesea sobreescribir este tag?", "Tag ya programado", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (response == JOptionPane.YES_OPTION) { programTag(tagReading); } } else { JOptionPane.showMessageDialog(this, "Este tag tiene un cdigo que ya ha sido programado en este lote.", "Tag ya programado", JOptionPane.ERROR_MESSAGE); } } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } statusLabel.setBackground(Color.white); statusLabel.setText("Remover tag"); try { Thread.sleep(500); } catch (InterruptedException e1) { e1.printStackTrace(); } } catch (ReaderException e) { // TODO Auto-generated catch block e.printStackTrace(); statusLabel.setBackground(Color.red); statusLabel.setText("Error"); try { Thread.sleep(500); } catch (InterruptedException e1) { e1.printStackTrace(); } } } } } else { statusLabel.setBackground(Color.orange); statusLabel.setText("Dos o ms tags"); } } else { statusLabel.setBackground(Color.yellow); statusLabel.setText("Sin tag"); } }
From source file:org.adempiere.apps.graph.ChartBuilder.java
private void setupCategoryChart(JFreeChart chart) { CategoryPlot plot = chart.getCategoryPlot(); CategoryAxis xAxis = (CategoryAxis) plot.getDomainAxis(); xAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45); CategoryItemRenderer renderer = plot.getRenderer(); renderer.setSeriesPaint(0, Color.RED); renderer.setSeriesPaint(1, Color.BLUE); renderer.setSeriesPaint(2, Color.YELLOW); renderer.setSeriesPaint(3, Color.GREEN); renderer.setSeriesPaint(4, Color.ORANGE); renderer.setSeriesPaint(5, Color.CYAN); renderer.setSeriesPaint(6, Color.MAGENTA); renderer.setSeriesPaint(7, Color.GRAY); renderer.setSeriesPaint(8, Color.PINK); plot.setRenderer(renderer);/*from w ww . j a v a2 s. co m*/ }
From source file:graph.plotter.LineGraph.java
/** * This is the main working button for this class... It creates Line Graph analyZing whole data set * /*from w ww. j a v a2s.c om*/ * @param evt */ private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed // TODO add your handling code here: try { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); int i; i = 0; String genre = " "; if (button1 == 2) { if (button2 == 1) while (i < cnt) { double aa = Double.parseDouble(Table.getModel().getValueAt(i, 1).toString()); String str = Table.getModel().getValueAt(i, 0).toString(); dataset.setValue(new Double(aa), genre, str); i++; //genre+=" "; } else { try { BufferedReader br = new BufferedReader(new FileReader(jTextField4.getText())); String Line; while ((Line = br.readLine()) != null) { String[] value = Line.split(","); double val = Double.parseDouble(value[1]); dataset.setValue(new Double(val), genre, value[0]); // genre+=" "; ////System.out.println(value[0]); } } catch (FileNotFoundException ex) { Logger.getLogger(LineGraph.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(LineGraph.class.getName()).log(Level.SEVERE, null, ex); } } } else if (button1 == 1) { String input = jTextField1.getText(); input = input.replaceAll("sin", "@"); input = input.replaceAll("cos", "#"); input = input.replaceAll("tan", "Q"); input = input.replaceAll("log", "~"); input = input.replaceAll("e", "&"); input = input.replaceAll("cosec", "r"); input = input.replaceAll("cot", "w"); input = input.replaceAll("sec", "y"); //System.out.println(input); int len; len = input.length(); String so = "."; for (ind = 0; ind < 360; ind++) { String gini = input; String sa = Integer.toString(ind); gini = gini.replaceAll("X", sa); Polish polish = new Polish(gini); double Calculate = Polish.Calculate(); dataset.setValue(new Double(Calculate), ".", sa); so += "."; } } JFreeChart chart = ChartFactory.createLineChart("Line Graph", "X - Axis", "Y - Axis", dataset, PlotOrientation.VERTICAL, false, true, false); CategoryPlot p = chart.getCategoryPlot(); p.setRangeGridlinePaint(Color.YELLOW); p.setBackgroundPaint(Color.BLACK); ChartFrame frame = new ChartFrame("Line Chart", chart); jButto1 = new JButton("Save"); frame.setLayout(new BorderLayout()); JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); GridBagConstraints gc = new GridBagConstraints(); gc.gridx = 1; gc.gridy = 0; panel.add(jButto1, gc); frame.add(panel, BorderLayout.SOUTH); jButto1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection()); final File file1 = new File("Line_Chart.png"); ChartUtilities.saveChartAsPNG(file1, chart, 600, 400, info); } catch (Exception ex) { } } }); frame.setVisible(true); frame.setSize(858, 513); } catch (Exception e) { } }
From source file:de.codesourcery.planning.swing.PlanningCanvas.java
private SlotLayoutHints renderSlot(IFactorySlot slot, RenderContext ctx, boolean renderDateAxis, boolean layoutOnly) { if (renderDateAxis) { renderDateAxis(ctx, layoutOnly); }/* w ww . java 2 s.co m*/ final BoundingBox slotTitleBounds = renderSlotTitle(slot, ctx, layoutOnly); final BoundingBox timelineBounds = renderSlotTimeline(slotTitleBounds.getWidth(), slotTitleBounds.getHeight(), slot, ctx, layoutOnly); debugBoundingBox(Color.YELLOW, ctx, timelineBounds, layoutOnly); debugBoundingBox(Color.GREEN, ctx, slotTitleBounds, layoutOnly); slotTitleBounds.add(timelineBounds); ctx.currentY += (slotTitleBounds.getHeight() + ctx.options.getSlotYOffset()); final SlotLayoutHints layout = new SlotLayoutHints(); layout.slotTimeline = timelineBounds; layout.slotTitle = slotTitleBounds; layout.total = new BoundingBox(timelineBounds, slotTitleBounds).incHeight(ctx.options.getSlotYOffset()); // include Y offset in bounding box if (!layoutOnly) { addRegionOfInterest(new BoundingBox(slotTitleBounds, timelineBounds), slot, false); } return layout; }
From source file:com.tiempometa.muestradatos.JReadTags.java
@Override public void handleReadings(List<TagReading> readings) { bibLabel.setText(""); if (readings.size() > 0) { if (readings.size() == 1) { statusLabel.setBackground(Color.cyan); statusLabel.setText("Leyendo tag"); for (TagReading tagReading : readings) { logger.info("Tag data dump"); logger.info(tagReading.getTagReadData().getTag().epcString()); logger.info(String.valueOf(tagReading.getTagReadData().getData().length)); logger.info(Hex.encodeHexString(tagReading.getTagReadData().getData())); logger.info(String.valueOf(tagReading.getTagReadData().getEPCMemData().length)); logger.info(Hex.encodeHexString(tagReading.getTagReadData().getEPCMemData())); logger.info(String.valueOf(tagReading.getTagReadData().getTIDMemData().length)); logger.info(Hex.encodeHexString(tagReading.getTagReadData().getTIDMemData())); logger.info(String.valueOf(tagReading.getTagReadData().getReservedMemData().length)); logger.info(Hex.encodeHexString(tagReading.getTagReadData().getReservedMemData())); logger.info(String.valueOf(tagReading.getTagReadData().getUserMemData().length)); logger.info(Hex.encodeHexString(tagReading.getTagReadData().getUserMemData())); if (tagReading.getTid() == null) { try { tagReading.setTid(ReaderContext.readTid(tagReading.getEpc(), 12)); if (logger.isDebugEnabled()) { logger.debug("Got tag " + tagReading.getEpc() + " - " + tagReading.getTid()); }//w ww.j a v a2 s .com try { statusLabel.setBackground(Color.green); statusLabel.setText("Tag leido"); tidTextField.setText(tagReading.getTid()); epcTextField.setText(tagReading.getEpc()); String rfidString = null; switch (dataToStoreComboBox.getSelectedIndex()) { case 0: rfidString = tagReading.getEpc(); break; case 1: rfidString = tagReading.getTid(); break; default: break; } List<Rfid> rfids = rfidDao.findByRfid(rfidString); if (rfids.size() == 0) { String bib = nextBibTextField.getText(); Rfid bibRfid = rfidDao.fetchByBib(bib); if ((bibRfid != null) & (!allowDuplicateBibsCheckBox.isSelected())) { JOptionPane.showMessageDialog(this, "Ese nmero ya ha sido capturado", "Nmero duplicado", JOptionPane.ERROR_MESSAGE); } else { Integer chipNumber = null; try { chipNumber = Integer.valueOf(bib); Rfid rfid = new Rfid(null, null, bib, rfidString, chipNumber, Rfid.STATUS_NOT_ASSIGNED); rfidDao.save(rfid); tagTableModel.getData().add(rfid); tagTableModel.fireTableDataChanged(); statusLabel.setText("Tag guardado"); chipNumber = chipNumber + 1; nextBibTextField.setText(String.valueOf(chipNumber)); } catch (NumberFormatException e) { JOptionPane.showMessageDialog(this, "El valor de nmero debe ser numrico", "Error de datos", JOptionPane.ERROR_MESSAGE); } } } else { statusLabel.setBackground(Color.red); statusLabel.setText("Tag ya leido"); Rfid rfid = rfids.get(0); bibLabel.setText(rfid.getBib()); try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } catch (SQLException e1) { JOptionPane.showMessageDialog(this, "Error guardando tag: " + e1.getMessage(), "Error de base de datos", JOptionPane.ERROR_MESSAGE); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } statusLabel.setBackground(Color.white); statusLabel.setText("Remover tag"); } catch (ReaderException e) { // TODO Auto-generated catch block e.printStackTrace(); statusLabel.setBackground(Color.red); } } } } else { statusLabel.setBackground(Color.orange); statusLabel.setText("Dos o ms tags"); } } else { statusLabel.setBackground(Color.yellow); statusLabel.setText("Sin tag"); } }
From source file:com.NewJFrame.java
private void searchTweets() { textPane.setText(""); if (textField.getText().equals("")) { JOptionPane.showMessageDialog(this, "Please enter a user handle."); return;//from w w w .j av a 2s . c o m } try { tweetlist.clear(); positivetweets.clear(); negativetweets.clear(); neutraltweets.clear(); alltweetNumber = 0; extractor = new TweetExtractor(); tweetlist = extractor.retrieveTweets(textField.getText());//Nuwan_Prabhath TweetAnalyser ta; String tweet_status; if (tweetlist.isEmpty()) { textPane.setText("No Tweets for given handle"); System.out.println("Empty"); // System.exit(0); } else { System.out.println("tweetlist.size(): " + tweetlist.size()); alltweetNumber = tweetlist.size(); for (int j = 0; j < tweetlist.size(); j++) { ta = new TweetAnalyser(); ta.setTweet(tweetlist.get(j).getText()); tweet_status = SentimentalResponse.readJsonFromUrl(tweetlist.get(j).getText()); ta.setTweet_status(tweet_status); switch (tweet_status) { case "positive": System.out.println("Tweet: " + ta.toString()); positivetweets.add(ta); appendToPane(textPane, ta.toString() + "\n", Color.green); break; case "negative": System.out.println("J" + j); negativetweets.add(ta); appendToPane(textPane, ta.toString() + "\n", Color.red); break; case "neutral": System.out.println("J" + j); neutraltweets.add(ta); appendToPane(textPane, ta.toString() + "\n", Color.yellow); break; } } positiveTweetCount.setText(positivetweets.size() + ""); neutralTweetCount.setText(neutraltweets.size() + ""); negativeTweetCount.setText(negativetweets.size() + ""); } } catch (Exception e) { System.out.println(e.getMessage()); } }