Example usage for java.awt Color YELLOW

List of usage examples for java.awt Color YELLOW

Introduction

In this page you can find the example usage for java.awt Color YELLOW.

Prototype

Color YELLOW

To view the source code for java.awt Color YELLOW.

Click Source Link

Document

The color yellow.

Usage

From source file:edu.harvard.i2b2.query.ui.ConceptTreePanel.java

private void jScrollPane1MouseMoved(java.awt.event.MouseEvent evt) {
    jScrollPane1.setBorder(javax.swing.BorderFactory.createLineBorder(Color.YELLOW));
}

From source file:net.sf.jasperreports.engine.export.HtmlExporter.java

private void addSearchAttributes(JRStyledText styledText, JRPrintText textElement) {
    ReportContext reportContext = getReportContext();
    if (reportContext != null) {
        SpansInfo spansInfo = (SpansInfo) reportContext
                .getParameterValue("net.sf.jasperreports.search.term.highlighter");
        PrintElementId pei = PrintElementId.forElement(textElement);

        if (spansInfo != null && spansInfo.hasHitTermsInfo(pei.toString())) {
            List<HitTermInfo> hitTermInfos = JRCloneUtils.cloneList(spansInfo.getHitTermsInfo(pei.toString()));

            short[] lineBreakOffsets = textElement.getLineBreakOffsets();
            if (lineBreakOffsets != null && lineBreakOffsets.length > 0) {
                int sz = lineBreakOffsets.length;
                for (HitTermInfo ti : hitTermInfos) {
                    for (int i = 0; i < sz; i++) {
                        if (lineBreakOffsets[i] <= ti.getStart()) {
                            ti.setStart(ti.getStart() + 1);
                            ti.setEnd(ti.getEnd() + 1);
                        } else {
                            break;
                        }/*w w  w.ja va  2  s.  c o m*/
                    }
                }
            }

            AttributedString attributedString = styledText.getAttributedString();
            for (int i = 0, ln = hitTermInfos.size(); i < ln; i = i + spansInfo.getTermsPerQuery()) {
                attributedString.addAttribute(JRTextAttribute.SEARCH_HIGHLIGHT, Color.yellow,
                        hitTermInfos.get(i).getStart(),
                        hitTermInfos.get(i + spansInfo.getTermsPerQuery() - 1).getEnd());
            }
        }
    } else {
        if (log.isDebugEnabled()) {
            log.debug("No ReportContext to hold search data!");
        }
    }
}

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/*from  w w  w.j  a  va2 s . co  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);
}

From source file:com.att.aro.diagnostics.GraphPanel.java

private static void populateBurstPlot(XYPlot plot, TraceData.Analysis analysis) {

    final XYIntervalSeriesCollection burstDataCollection = new XYIntervalSeriesCollection();
    if (analysis != null) {

        Map<BurstCategory, XYIntervalSeries> seriesMap = new EnumMap<BurstCategory, XYIntervalSeries>(
                BurstCategory.class);
        final Map<BurstCategory, List<Burst>> burstMap = new HashMap<BurstCategory, List<Burst>>();
        for (BurstCategory eventType : BurstCategory.values()) {
            XYIntervalSeries series = new XYIntervalSeries(eventType);
            seriesMap.put(eventType, series);
            burstDataCollection.addSeries(series);
            burstMap.put(eventType, new ArrayList<Burst>());
        }/* w w w .jav a2s  .  c  o  m*/
        final List<Burst> burstStates = analysis.getBurstInfos();
        Iterator<Burst> iter = burstStates.iterator();
        while (iter.hasNext()) {
            Burst currEvent = iter.next();
            if (currEvent != null) {
                BurstCategory burstState = currEvent.getBurstCategory();
                if (burstState != null) {
                    seriesMap.get(burstState).add(currEvent.getBeginTime(), currEvent.getBeginTime(),
                            currEvent.getEndTime(), 0.5, 0, 1);
                    burstMap.get(burstState).add(currEvent);
                }
            }
        }

        Color myGreen = new Color(34, 177, 76);
        Color lightGreen = new Color(134, 232, 162);

        XYItemRenderer renderer = plot.getRenderer();
        renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.TCP_PROTOCOL), Color.blue);
        renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.TCP_LOSS_OR_DUP), Color.black);
        renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.USER_INPUT), myGreen);
        renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.SCREEN_ROTATION), lightGreen);
        renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.CLIENT_APP), Color.red);
        renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.SERVER_NET_DELAY), Color.yellow);
        renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.LONG), Color.gray);
        renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.PERIODICAL), Color.magenta);
        renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.CPU), Color.cyan);
        renderer.setSeriesPaint(burstDataCollection.indexOf(BurstCategory.UNKNOWN), Color.darkGray);

        // Assign ToolTip to renderer
        renderer.setBaseToolTipGenerator(new XYToolTipGenerator() {
            @Override
            public String generateToolTip(XYDataset dataset, int series, int item) {
                BurstCategory eventType = (BurstCategory) burstDataCollection.getSeries(series).getKey();
                Burst b = burstMap.get(eventType).get(item);
                final String PREFIX = "BurstCategory.";
                return MessageFormat.format(rb.getString(PREFIX + eventType.ordinal()), b.getPackets().size(),
                        b.getBurstBytes(), b.getBurstThroughPut());
            }
        });

    }

    plot.setDataset(burstDataCollection);
}

From source file:com.willwinder.universalgcodesender.MainWindow.java

private void setStatusColorForState(String state) {
    if (settings.isDisplayStateColor()) {
        java.awt.Color color = null; // default to a transparent background.
        if (state.equals(Localization.getString("mainWindow.status.alarm"))) {
            color = Color.RED;/*w w w.  j  a  v a2s  .  c  om*/
        } else if (state.equals(Localization.getString("mainWindow.status.hold"))) {
            color = Color.YELLOW;
        } else if (state.equals(Localization.getString("mainWindow.status.queue"))) {
            color = Color.YELLOW;
        } else if (state.equals(Localization.getString("mainWindow.status.run"))) {
            color = Color.GREEN;
        } else {
            color = Color.WHITE;
        }

        this.activeStateLabel.setBackground(color);
        this.activeStateValueLabel.setBackground(color);
    } else {
        this.activeStateLabel.setBackground(null);
        this.activeStateValueLabel.setBackground(null);
    }
}

From source file:com.att.aro.diagnostics.GraphPanel.java

/**
 * Sets rendering color for all different network type data series. 
 * @param renderer Renderer for the data series
 * @param dataSeries Data series//from  w w  w  . j  av  a  2s  .c  om
 */
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);
    renderer.setSeriesPaint(dataSeries.indexOf(NetworkType.EDGE), Color.LIGHT_GRAY);
}

From source file:edu.ku.brc.ui.UIHelper.java

/**
 * @return a Triple containing the platform specific Focus Border, Empty Border and Focus Color
 *//*from   w  w  w  .j  ava 2s . c  o  m*/
public static Triple<Border, Border, Color> getFocusBorders(final Component comp) {
    Triple<Border, Border, Color> focusInfo = new Triple<Border, Border, Color>();
    if (focusInfo.first == null) {
        if (UIHelper.isMacOS()) {
            focusInfo.first = new MacBtnBorder();
            Insets fbInsets = focusInfo.first.getBorderInsets(comp);
            focusInfo.second = new EmptyBorder(fbInsets);

        } else {
            if (UIManager.getLookAndFeel() instanceof PlasticLookAndFeel) {
                focusInfo.third = PlasticLookAndFeel.getFocusColor();
            } else {
                focusInfo.third = UIManager.getColor("Button.focus");
            }

            if (focusInfo.third == null) // Shouldn't happen
            {
                focusInfo.third = Color.YELLOW;
            }

            focusInfo.first = new LineBorder(focusInfo.third, 1, true);
            focusInfo.second = new EmptyBorder(focusBorder.getBorderInsets(comp));
        }
    }
    return focusInfo;
}

From source file:com.monead.semantic.workbench.SemanticWorkbench.java

/**
 * Set the tab background and foreground color based on whether the tab's data
 * is out of synch with the model or other configuration changes
 *//*www  .j  av  a 2 s .  c om*/
private void colorCodeTabs() {
    if (hasIncompleteAssertionsInput) {
        tabbedPane.setForegroundAt(0, Color.orange.darker());
        tabbedPane.setBackgroundAt(0, Color.yellow.brighter());
        tabbedPane.setToolTipTextAt(0, "Only part of the assertions file is displayed");
    } else {
        tabbedPane.setForegroundAt(0, NORMAL_TAB_FG);
        tabbedPane.setBackgroundAt(0, NORMAL_TAB_BG);
        tabbedPane.setToolTipTextAt(0, null);
    }

    if (!areInferencesInSyncWithModel && inferredTriples.getText().trim().length() > 0) {
        tabbedPane.setForegroundAt(1, Color.red);
        tabbedPane.setBackgroundAt(1, Color.pink);
        tabbedPane.setToolTipTextAt(1, "Inferences are out of sync with loaded assertions");
    } else {
        tabbedPane.setForegroundAt(1, NORMAL_TAB_FG);
        tabbedPane.setBackgroundAt(1, NORMAL_TAB_BG);
        tabbedPane.setToolTipTextAt(1, null);
    }

    if (!isTreeInSyncWithModel && !ontModelTree.getModel().isLeaf(ontModelTree.getModel().getRoot())) {
        tabbedPane.setForegroundAt(2, Color.red);
        tabbedPane.setBackgroundAt(2, Color.pink);
        tabbedPane.setToolTipTextAt(2, "Tree is out of sync with loaded assertions");
    } else {
        tabbedPane.setForegroundAt(2, NORMAL_TAB_FG);
        tabbedPane.setBackgroundAt(2, NORMAL_TAB_BG);
        tabbedPane.setToolTipTextAt(2, null);
    }

    if (!areSparqlResultsInSyncWithModel && sparqlResultsTable.getRowCount() > 0) {
        tabbedPane.setForegroundAt(3, Color.red);
        tabbedPane.setBackgroundAt(3, Color.pink);
        tabbedPane.setToolTipTextAt(3, "Results are out of sync with loaded assertions");
    } else {
        tabbedPane.setForegroundAt(3, NORMAL_TAB_FG);
        tabbedPane.setBackgroundAt(3, NORMAL_TAB_BG);
        tabbedPane.setToolTipTextAt(3, null);
    }
}

From source file:com.peterbochs.instrument.InstrumentPanel.java

private JComboBox getJChartGirdColorComboBox() {
    if (jChartGirdColorComboBox == null) {
        ComboBoxModel jChartGirdColorComboBoxModel = new DefaultComboBoxModel(new Color[] { Color.green,
                Color.lightGray, Color.white, Color.black, Color.yellow, Color.red, Color.blue });
        jChartGirdColorComboBox = new JComboBox();
        jChartGirdColorComboBox.setModel(jChartGirdColorComboBoxModel);
        jChartGirdColorComboBox.setPreferredSize(new java.awt.Dimension(71, 22));
        jChartGirdColorComboBox.setRenderer(new ComboBoxRenderer());
        jChartGirdColorComboBox.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                jChartGirdColorComboBoxActionPerformed(evt);
            }/*from ww w.java  2 s . c  o m*/
        });
    }
    return jChartGirdColorComboBox;
}

From source file:de.tor.tribes.ui.windows.TribeTribeAttackFrame.java

/**
 * Create detail frames shown after calculation
 *//*from www  .  j  av a 2s . c o m*/
private void buildDetailedStatistics(HashMap<Village, String> attackMappings,
        List<Village> pNotAssignedVillages) {
    // <editor-fold defaultstate="collapsed" desc="Build not assigned source table">
    Collections.sort(pNotAssignedVillages);
    DefaultTableModel sourcesModel = new javax.swing.table.DefaultTableModel(new Object[][] {},
            new String[] { "Spieler", "Dorf" }) {

        private Class[] cTypes = new Class[] { Tribe.class, Village.class };

        @Override
        public Class getColumnClass(int columnIndex) {
            return cTypes[columnIndex];
        }
    };
    for (Village notAssigned : pNotAssignedVillages) {
        Tribe t = notAssigned.getTribe();
        if (t == null) {
            sourcesModel.addRow(new Object[] { Barbarians.getSingleton(), notAssigned });
        } else {
            sourcesModel.addRow(new Object[] { t, notAssigned });
        }
    }
    jNotAssignedSourcesTable.setModel(sourcesModel);
    TableRowSorter<TableModel> sourcesSorter = new TableRowSorter<TableModel>(sourcesModel);
    jNotAssignedSourcesTable.setRowSorter(sourcesSorter);
    DefaultTableCellRenderer headerRenderer = new SortableTableHeaderRenderer();
    for (int i = 0; i < jNotAssignedSourcesTable.getColumnCount(); i++) {
        jNotAssignedSourcesTable.getColumn(jNotAssignedSourcesTable.getColumnName(i))
                .setHeaderRenderer(headerRenderer);
    }
    jNotAssignedSourcesTable.revalidate();
    //</editor-fold>
    // <editor-fold defaultstate="collapsed" desc="Build attacks per target table">
    DefaultTableModel tableModel = new javax.swing.table.DefaultTableModel(new Object[][] {},
            new String[] { "Spieler", "Dorf", "Angriffe" }) {

        Class[] types = new Class[] { Tribe.class, Village.class, String.class };

        @Override
        public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
        }
    };
    List<Village> notFullTargets = new LinkedList<Village>();
    Iterator<Village> keys = attackMappings.keySet().iterator();
    while (keys.hasNext()) {
        Village key = keys.next();
        Tribe t = key.getTribe();
        //int notAssignedAmount = attackMappings.get(key);
        String attackCount = attackMappings.get(key);
        String[] split = attackCount.split("/");
        int notAssignedAmount = Integer.parseInt(split[1]) - Integer.parseInt(split[0]);
        if (t != Barbarians.getSingleton()) {
            tableModel.addRow(new Object[] { t, key, attackCount });
        } else {
            tableModel.addRow(new Object[] { "Barbaren", key, attackCount });
        }
        if (notAssignedAmount > 0) {
            notFullTargets.add(key);
        }
    }
    jTargetDetailsTable.setModel(tableModel);
    TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(tableModel);
    jTargetDetailsTable.setRowSorter(sorter);
    DefaultTableCellRenderer coloredRenderer = new DefaultTableCellRenderer() {

        @Override
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                boolean hasFocus, int row, int column) {
            Component c = new DefaultTableCellRenderer().getTableCellRendererComponent(table, value, isSelected,
                    hasFocus, row, row);
            String t = ((DefaultTableCellRenderer) c).getText();
            ((DefaultTableCellRenderer) c).setText(t);
            DefaultTableModel model = (DefaultTableModel) table.getModel();
            int r = table.convertRowIndexToModel(row);
            String sVal = (String) model.getValueAt(r, 2);
            String[] split = sVal.split("/");
            long max = Long.parseLong(split[1]);
            long v = Long.parseLong(split[0]);
            long diff = max - v;
            Color back = Color.RED;
            if (v == 0) {
                //color stays red
            } else if (v == max) {
                back = Color.GREEN;
            } else {
                float posv = 100.0f * (float) diff / (float) max;
                posv = ((int) posv / 10) * 10;
                posv /= 100;
                Color LAST_SEGMENT = new Color(255, 100, 0);
                int red = (int) Math.rint(
                        (float) LAST_SEGMENT.getRed() * (1.0f - posv) + (float) Color.YELLOW.getRed() * posv);
                int green = (int) Math.rint((float) LAST_SEGMENT.getGreen() * (1.0f - posv)
                        + (float) Color.YELLOW.getGreen() * posv);
                int blue = (int) Math.rint(
                        (float) LAST_SEGMENT.getBlue() * (1.0f - posv) + (float) Color.YELLOW.getBlue() * posv);
                if (red < 0) {
                    red = 0;
                }
                if (green < 0) {
                    green = 0;
                }
                if (blue < 0) {
                    blue = 0;
                }
                if (red > 254) {
                    red = 254;
                }
                if (green > 254) {
                    green = 254;
                }
                if (blue > 254) {
                    blue = 254;
                }
                back = new Color(red, green, blue);
            }
            DefaultTableCellRenderer renderer = ((DefaultTableCellRenderer) c);
            if (!isSelected) {
                renderer.setBackground(back);
            }
            return c;
        }
    };
    jTargetDetailsTable.setDefaultRenderer(Village.class, coloredRenderer);
    jTargetDetailsTable.setDefaultRenderer(Integer.class, coloredRenderer);
    jTargetDetailsTable.setDefaultRenderer(String.class, coloredRenderer);
    jTargetDetailsTable.setDefaultRenderer(Tribe.class, coloredRenderer);
    for (int i = 0; i < jTargetDetailsTable.getColumnCount(); i++) {
        jTargetDetailsTable.getColumn(jTargetDetailsTable.getColumnName(i)).setHeaderRenderer(headerRenderer);
    }
    jTargetDetailsTable.revalidate();
    //</editor-fold>
}