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.vgi.mafscaling.LogView.java
private void view3dPlots() { if (xAxisColumn.getSelectedItem() == null || xAxisColumn.getSelectedItem().toString().isEmpty() || yAxisColumn.getSelectedItem() == null || yAxisColumn.getSelectedItem().toString().isEmpty() || plotsColumn.getSelectedItems() == null) return;// w ww.ja v a2s. co m plot3d.removeAllPlots(); String val; String xAxisColName = (String) xAxisColumn.getSelectedItem(); String yAxisColName = (String) yAxisColumn.getSelectedItem(); List<String> dataColNames = plotsColumn.getSelectedItems(); if (dataColNames.size() > 5) { JOptionPane.showMessageDialog(null, "Sorry, only 5 plots are supported. More plots will make the graph too slow.", "Too many parameters", JOptionPane.ERROR_MESSAGE); return; } int xColIdx = logDataTable.getColumnByHeaderName(xAxisColName).getModelIndex() - 1; xColIdx = logDataTable.getCurrentIndexForOriginalColumn(xColIdx); int yColIdx = logDataTable.getColumnByHeaderName(yAxisColName).getModelIndex() - 1; yColIdx = logDataTable.getCurrentIndexForOriginalColumn(yColIdx); ArrayList<Color> colorsArray = new ArrayList<Color>(); colorsArray.add(Color.BLUE); colorsArray.add(Color.RED); colorsArray.add(Color.GREEN); colorsArray.add(Color.ORANGE); colorsArray.add(Color.GRAY); double x, y, z; XYZ xyz; for (int j = 0; j < dataColNames.size(); ++j) { HashSet<XYZ> uniqueXYZ = new HashSet<XYZ>(); int zColIdx = logDataTable.getColumnByHeaderName(dataColNames.get(j)).getModelIndex() - 1; zColIdx = logDataTable.getCurrentIndexForOriginalColumn(zColIdx); int count = 0; double[][] xyzArrayTemp = new double[logDataTable.getRowCount()][3]; for (int i = 0; i < logDataTable.getRowCount(); ++i) { val = (String) logDataTable.getValueAt(i, xColIdx); x = Double.valueOf(val); val = (String) logDataTable.getValueAt(i, yColIdx); y = Double.valueOf(val); val = (String) logDataTable.getValueAt(i, zColIdx); z = Double.valueOf(val); xyz = new XYZ(x, y, z); if (uniqueXYZ.contains(xyz)) continue; uniqueXYZ.add(xyz); xyzArrayTemp[count][0] = x; xyzArrayTemp[count][1] = y; xyzArrayTemp[count][2] = z; count += 1; } double[][] xyzArray = new double[uniqueXYZ.size()][3]; for (int k = 0; k < xyzArray.length; ++k) System.arraycopy(xyzArrayTemp[k], 0, xyzArray[k], 0, 3); plot3d.addScatterPlot(dataColNames.get(j), colorsArray.get(j), xyzArray); } plot3d.setAxisLabel(0, xAxisColumn.getSelectedItem().toString()); plot3d.setAxisLabel(1, yAxisColumn.getSelectedItem().toString()); plot3d.setAxisLabel(2, plotsColumn.getSelectedItemsString()); }
From source file:kolacer.Kolacer.java
private void initVariables() { /*String fonts[] = //w ww . j a v a 2s. co m java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); for ( int i = 0; i < fonts.length; i++ ) { System.out.println(fonts[i]); }*/ udaje = new ArrayList<>(); popisekGrafuFont = new Font("Impact", Font.BOLD, 20); podekovaniAutoroviFont = new Font("Impact", Font.PLAIN, 16); barvaGradA = Color.lightGray; barvaGradB = Color.ORANGE; }
From source file:app.HadoopImporterWindowTopComponent.java
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed // TODO add your handling code here: this.jTextField1.setForeground(Color.orange); importDirected = this.jcbDIRECTED.isSelected(); appendAsNewTimeRange = this.jcbAppend.isSelected(); NetworkLayer nl = new NetworkLayer(); nl.edgelistQ = this.edgesStatic.getText(); nl.nodelistQ = this.nodes.getText(); nl.directed = importDirected;/*from ww w .j av a2 s . com*/ MultiLayerNetwork.setDefaultLayer(nl); ImpalaDynamicImportConnector.jta = this.jtaLogPanel; try { jButton2ActionPerformed(null); this.jTextField1.setForeground(Color.green); } catch (Exception ex) { ex.printStackTrace(); this.jTextField1.setForeground(Color.red); } }
From source file:org.cruk.mga.CreateReport.java
/** * Draws the x-axis for the number of sequences and the legend. * * @param g2/*w ww.j av a2 s. co m*/ * @param x0 * @param y * @param tickIntervals * @param maxSequenceCount * @return */ private int drawAxisAndLegend(Graphics2D g2, int x0, int y, int tickIntervals, long maxSequenceCount) { g2.setColor(Color.BLACK); g2.setFont(axisFont); boolean millions = maxSequenceCount / tickIntervals >= 1000000; long largestTickValue = maxSequenceCount; if (millions) largestTickValue /= 1000000; int w = g2.getFontMetrics().stringWidth(Long.toString(largestTickValue)); int x1 = plotWidth - (w / 2) - gapSize; g2.drawLine(x0, y, x1, y); int tickFontHeight = g2.getFontMetrics().getAscent(); int tickHeight = tickFontHeight / 2; for (int i = 0; i <= tickIntervals; i++) { int x = x0 + i * (x1 - x0) / tickIntervals; g2.drawLine(x, y, x, y + tickHeight); long tickValue = i * maxSequenceCount / tickIntervals; if (millions) tickValue /= 1000000; String s = Long.toString(tickValue); int xs = x - g2.getFontMetrics().stringWidth(s) / 2 + 1; int ys = y + tickHeight + tickFontHeight + 1; g2.drawString(s, xs, ys); } g2.setFont(font); int fontHeight = g2.getFontMetrics().getAscent(); String s = "Number of sequences"; if (millions) s += " (millions)"; int xs = x0 + (x1 - x0 - g2.getFontMetrics().stringWidth(s)) / 2; int ys = y + tickHeight + tickFontHeight + fontHeight + fontHeight / 3; g2.drawString(s, xs, ys); int yl = ys + fontHeight * 2; int xl = x0; int barHeight = (int) (fontHeight * 0.7f); int barWidth = 3 * barHeight; int yb = yl + (int) (fontHeight * 0.3f); int gap = (int) (fontHeight * 0.4f); g2.setColor(Color.GREEN); g2.fillRect(xl, yb, barWidth, barHeight); g2.setColor(Color.BLACK); g2.drawRect(xl, yb, barWidth, barHeight); g2.setFont(axisFont); String label = "Sequenced species/genome"; xl += barWidth + gap; g2.drawString(label, xl, yl + fontHeight); xl += g2.getFontMetrics().stringWidth(label) + gap * 3; g2.setColor(Color.ORANGE); g2.fillRect(xl, yb, barWidth, barHeight); g2.setColor(Color.BLACK); g2.drawRect(xl, yb, barWidth, barHeight); label = "Control"; xl += barWidth + gap; g2.drawString(label, xl, yl + fontHeight); xl += g2.getFontMetrics().stringWidth(label) + gap * 3; g2.setColor(Color.RED); g2.fillRect(xl, yb, barWidth, barHeight); g2.setColor(Color.BLACK); g2.drawRect(xl, yb, barWidth, barHeight); label = "Contaminant"; xl += barWidth + gap; g2.drawString(label, xl, yl + fontHeight); xl += g2.getFontMetrics().stringWidth(label) + gap * 3; g2.setColor(ADAPTER_COLOR); g2.fillRect(xl, yb, barWidth, barHeight); g2.setColor(Color.BLACK); g2.drawRect(xl, yb, barWidth, barHeight); label = "Adapter"; xl += barWidth + gap; g2.drawString(label, xl, yl + fontHeight); xl += g2.getFontMetrics().stringWidth(label) + gap * 3; g2.setColor(Color.BLACK); g2.drawRect(xl, yb, barWidth, barHeight); label = "Unmapped"; xl += barWidth + gap; g2.drawString(label, xl, yl + fontHeight); xl += g2.getFontMetrics().stringWidth(label) + gap * 3; g2.setColor(Color.GRAY); g2.fillRect(xl, yb, barWidth, barHeight); g2.setColor(Color.BLACK); g2.drawRect(xl, yb, barWidth, barHeight); label = "Unknown"; xl += barWidth + gap; g2.drawString(label, xl, yl + fontHeight); return x1; }
From source file:app.HadoopImporterWindowTopComponent.java
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed this.jTextField2.setForeground(Color.orange); try {/*from ww w . ja v a 2 s .co m*/ // load the data from WIKI String networkName = this.jTextField1.getText(); String layerName = this.jTextField2.getText(); System.out.println("TMN_name : " + networkName); System.out.println("TMN_layern_name : " + layerName); String[] q = loadQueriesForNetworkLayer(networkName, layerName, this); System.out.println(q[0]); System.out.println(q[1]); this.nodes.setText(q[0]); this.edgesStatic.setText(q[1]); NetworkLayer nl = new NetworkLayer(); nl.edgelistQ = this.edgesStatic.getText(); nl.nodelistQ = this.nodes.getText(); nl.partition_selector = this.jTextField3.getText(); MultiLayerNetwork.setDefaultLayer(nl); this.jTextField2.setForeground(Color.green); } catch (Exception ex) { ex.printStackTrace(); NetworkLayer nl = new NetworkLayer(); nl.edgelistQ = "EL ???"; nl.nodelistQ = "NL ???"; MultiLayerNetwork.setDefaultLayer(nl); this.jTextField2.setForeground(Color.red); } // TODO add your handling code here: }
From source file:nosqltools.MainForm.java
private void Op_RefreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Op_RefreshActionPerformed Text_MessageBar.setText(Initializations.WAITINGFORCONNECTION); Text_MessageBar.setForeground(Color.ORANGE); if (dbcon.isConnectionSuccess()) { if (dbcon.checkDatabaseConnection()) { if (indexOfCurrentCollection != 0) { String loc = tp.getPathComponent(indexOfCurrentCollection).toString(); if (dbcon.checkSystemColl(loc)) { String new_data = dbcon.getCollectionData(loc).toString(); JsonNode jNode1;//from w w w.j av a 2 s . co m try { jNode1 = mapper.readTree(new_data); textArea.setText(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(jNode1)); } catch (IOException ex) { Logger.getLogger(MainForm.class.getName()).log(Level.SEVERE, null, ex); } } } else { Text_MessageBar.setText(Initializations.DBACTIONNOCOLLECTION); Text_MessageBar.setForeground(Color.RED); JOptionPane.showMessageDialog(null, Initializations.DBACTIONNOCOLLECTION, "Error", JOptionPane.ERROR_MESSAGE); } } else { JOptionPane.showMessageDialog(null, Initializations.MONGOSERVERERROR, "Error", JOptionPane.ERROR_MESSAGE); Text_MessageBar.setText(Initializations.MONGOSERVERERROR); Text_MessageBar.setForeground(Color.RED); } } else { Text_MessageBar.setText(Initializations.SYSTEMCOLLNOREFRESH); Text_MessageBar.setForeground(Color.RED); } }
From source file:nosqltools.MainForm.java
private void Op_DBActionsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Op_DBActionsActionPerformed Text_MessageBar.setText(Initializations.WAITINGFORCONNECTION); Text_MessageBar.setForeground(Color.ORANGE); if (dbcon.isConnectionSuccess()) { if (dbcon.checkDatabaseConnection()) { if (indexOfCurrentCollection != 0) { ActionOnDB dbAction = new ActionOnDB(dbcon); Text_MessageBar.setText(Initializations.DBACTIONSSUCCESS); Text_MessageBar.setForeground(Color.GREEN); dbAction.setVisible(true); } else { Text_MessageBar.setText(Initializations.DBACTIONNOCOLLECTION); Text_MessageBar.setForeground(Color.RED); JOptionPane.showMessageDialog(null, Initializations.DBACTIONNOCOLLECTION, "Error", JOptionPane.ERROR_MESSAGE); }/*w w w . j a va2 s .c o m*/ } else { JOptionPane.showMessageDialog(null, Initializations.MONGOSERVERERROR, "Error", JOptionPane.ERROR_MESSAGE); Text_MessageBar.setText(Initializations.MONGOSERVERERROR); Text_MessageBar.setForeground(Color.RED); } } else { JOptionPane.showMessageDialog(null, Initializations.NODBCONNECTION, "Error", JOptionPane.ERROR_MESSAGE); Text_MessageBar.setText(Initializations.NODBCONNECTION); Text_MessageBar.setForeground(Color.RED); } }
From source file:at.becast.youploader.gui.FrmMain.java
private void calcNotifies() { // Special handling for Tags int taglength = TagUtil.calculateTagLenght(txtTags.getText()); if (taglength > 450) { lblTagslenght.setForeground(Color.ORANGE); } else {//from w w w .j av a 2 s . com lblTagslenght.setForeground(Color.BLACK); } if (taglength >= 500) { lblTagslenght.setForeground(Color.RED); } lblTagslenght.setText("(" + taglength + "/500)"); if (txtDescription.getText().length() > 4900) { lblDesclenght.setForeground(Color.ORANGE); } else { lblDesclenght.setForeground(Color.BLACK); } if (txtDescription.getText().length() >= 5000) { lblDesclenght.setForeground(Color.RED); } if (txtDescription.getText().length() >= 5001) { txtDescription.setText(txtDescription.getText().substring(0, 5000)); } lblDesclenght.setText("(" + txtDescription.getText().length() + "/5000)"); if (txtTitle.getText().length() > 90) { lbltitlelenght.setForeground(Color.ORANGE); } else { lbltitlelenght.setForeground(Color.BLACK); } if (txtTitle.getText().length() >= 100) { lbltitlelenght.setForeground(Color.RED); } if (txtTitle.getText().length() >= 101) { txtTitle.setText(txtTitle.getText().substring(0, 100)); } lbltitlelenght.setText("(" + txtTitle.getText().length() + "/100)"); }
From source file:org.cruk.mga.CreateReport.java
/** * Draws bars representing the total number of sequences for each dataset * and the assigned subsets for each species/reference genome to which * these have been aligned./* ww w. j av a 2s . c o m*/ * * @param g2 * @param offset * @param height * @param separation * @param x0 * @param x1 * @param maxSequenceCount * @param multiGenomeAlignmentSummaries */ private void drawAlignmentBars(Graphics2D g2, int offset, int height, int separation, int x0, int x1, long maxSequenceCount, Collection<MultiGenomeAlignmentSummary> multiGenomeAlignmentSummaries) { AlignmentSummaryComparator alignmentSummaryComparator = new AlignmentSummaryComparator(); g2.setColor(Color.BLACK); int y = offset; for (MultiGenomeAlignmentSummary multiGenomeAlignmentSummary : multiGenomeAlignmentSummaries) { int sampledCount = multiGenomeAlignmentSummary.getSampledCount(); long sequenceCount = multiGenomeAlignmentSummary.getSequenceCount(); log.debug(multiGenomeAlignmentSummary.getDatasetId() + " " + sequenceCount); Set<String> species = new HashSet<String>(); Set<String> controls = new HashSet<String>(); for (OrderedProperties sampleProperties : multiGenomeAlignmentSummary.getSampleProperties()) { String value = sampleProperties.getProperty(SPECIES_PROPERTY_NAMES); if (value != null) species.add(value); String control = sampleProperties.getProperty(CONTROL_PROPERTY_NAMES); if ("Yes".equals(control)) controls.add(value); } double width = (double) sequenceCount * (x1 - x0) / maxSequenceCount; int total = 0; int x = x0; // iterate over alignments for various reference genomes drawing bar for each List<AlignmentSummary> alignmentSummaryList = Arrays .asList(multiGenomeAlignmentSummary.getAlignmentSummaries()); Collections.sort(alignmentSummaryList, alignmentSummaryComparator); for (AlignmentSummary alignmentSummary : alignmentSummaryList) { total += alignmentSummary.getAssignedCount(); int w = (int) (width * total / sampledCount) - x + x0; String referenceGenomeId = alignmentSummary.getReferenceGenomeId(); String referenceGenomeName = getReferenceGenomeName(referenceGenomeId); Color color = Color.RED; if (controls.contains(referenceGenomeName)) { color = Color.ORANGE; } else if (species.contains(referenceGenomeName)) { color = Color.GREEN; } else if (species.isEmpty() || species.contains("Other") || species.contains("other")) { color = Color.GRAY; } float alpha = MAX_ALPHA - (MAX_ALPHA - MIN_ALPHA) * (alignmentSummary.getAssignedErrorRate() - MIN_ERROR) / (MAX_ERROR - MIN_ERROR); alpha = Math.max(alpha, MIN_ALPHA); alpha = Math.min(alpha, MAX_ALPHA); if (alignmentSummary.getAssignedCount() >= 100) log.debug(alignmentSummary.getReferenceGenomeId() + "\t" + alignmentSummary.getAssignedCount() + "\t" + alignmentSummary.getErrorRate() * 100.0f + "\t" + alpha); Composite origComposite = g2.getComposite(); g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha)); g2.setColor(color); g2.fillRect(x, y, w, height); g2.setComposite(origComposite); g2.setColor(Color.BLACK); g2.drawRect(x, y, w, height); x += w; } // bar for all sequences g2.drawRect(x0, y, (int) width, height); // bar for adapter sequences int adapterCount = multiGenomeAlignmentSummary.getAdapterCount(); log.debug("Adapter count: " + adapterCount + " / " + sampledCount); int ya = y + height + height / 5; double wa = width * adapterCount / sampledCount; if (wa > 2) { int ha = height / 3; g2.setColor(ADAPTER_COLOR); g2.fillRect(x0, ya, (int) wa, ha); g2.setColor(Color.BLACK); g2.drawRect(x0, ya, (int) wa, ha); } y += separation; } }
From source file:nosqltools.MainForm.java
private void Op_ValidateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Op_ValidateActionPerformed JSONParser parser = new JSONParser(); String text = null;/*from www . j a va 2s .c o m*/ String object = ""; try { if (!Panel_Text.isVisible() && !Panel_Compare.isVisible()) { Text_MessageBar.setText(Initializations.VALIDATEEMPTY); Text_MessageBar.setForeground(Color.ORANGE); } else if (Panel_Text.isVisible()) { text = textArea.getText(); if (textArea.getText().isEmpty()) { Text_MessageBar.setText(Initializations.VALIDATEEMPTY); Text_MessageBar.setForeground(Color.ORANGE); } else parser.parse(textArea.getText()); } else if (Panel_Compare.isVisible()) { if (textArea1Comp.getText().isEmpty() && textArea1Comp.getText().isEmpty()) { Text_MessageBar.setText(Initializations.VALIDATEEMPTY); Text_MessageBar.setForeground(Color.ORANGE); } else { if (textArea1Comp.getText().isEmpty()) { Text_MessageBar .setText(Initializations.VALIDATEEMPTY + Initializations.VALIDATIONTEXTAREA1); Text_MessageBar.setForeground(Color.ORANGE); } else { text = textArea1Comp.getText(); object = "" + Initializations.VALIDATIONTEXTAREA1; text = textArea1Comp.getText(); parser.parse(textArea1Comp.getText()); } if (textArea2Comp.getText().isEmpty()) { Text_MessageBar .setText(Initializations.VALIDATEEMPTY + Initializations.VALIDATIONTEXTAREA2); Text_MessageBar.setForeground(Color.ORANGE); } else { text = textArea2Comp.getText(); object = "" + Initializations.VALIDATIONTEXTAREA2; text = textArea2Comp.getText(); parser.parse(textArea2Comp.getText()); } } } } catch (org.json.simple.parser.ParseException pe) { Text_MessageBar.setText(Initializations.VALIDATIONERROR + object + " - " + Initializations.ERRORLINE + json_util.getLineNumber(pe.getPosition(), text) + " - " + pe); Text_MessageBar.setForeground(Color.RED); } if (json_util.isDataParsed(text)) { Text_MessageBar.setText(Initializations.VALIDATIONSUCCESS); Text_MessageBar.setForeground(Color.GREEN); JOptionPane.showMessageDialog(null, Initializations.VALIDATIONSUCCESS, "Success", JOptionPane.INFORMATION_MESSAGE); } else { Text_MessageBar.setText(Initializations.VALIDATIONERROR); Text_MessageBar.setForeground(Color.RED); JOptionPane.showMessageDialog(null, Initializations.VALIDATIONERROR, "Error", JOptionPane.ERROR_MESSAGE); } }