Example usage for java.awt Color orange

List of usage examples for java.awt Color orange

Introduction

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

Prototype

Color orange

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

Click Source Link

Document

The color orange.

Usage

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   w  w w .j a va 2 s.c o 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.  ja  v a 2  s  .  c  o m
                        // 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:tufts.vue.ds.DataAction.java

private static LWLink makeLink(final LWComponent src, final LWComponent dest, final Relation r) {
    if (DEBUG.Enabled)
        Log.debug("makeLink: " + r);

    final Color color;

    final LWLink link = makeLink(src, dest, null, r.getDescription(), null);

    if (link == null) {
        Log.error("link=null " + r);
        return null;
    }/*from   w ww.jav a 2s .  c  o  m*/

    if (r.isCrossSchema()) {
        link.mStrokeStyle.setTo(LWComponent.StrokeStyle.DASH3);
        link.setStrokeWidth(2);
    }

    // todo: count style priority over join style

    if (r.type == Relation.AUTOMATIC) {
        color = Color.lightGray;
    } else if (r.type == Relation.USER) {
        color = Color.black;
    } else if (r.type == Relation.COUNT) {
        //if (true) return null;
        color = Color.lightGray;
        if (r.count == 1)
            link.setStrokeWidth(0.3f);
        else
            link.setStrokeWidth((float) Math.log(r.count));
        link.setTextColor(color);
        link.setLabel(String.format(" %d ", r.getCount()));
    } else if (r.type == Relation.JOIN) {
        color = Color.orange;
    } else
        color = Color.magenta; // unknown type!

    link.setStrokeColor(color);

    //         if (r.type == Relation.JOIN)
    //         else if (r.type == Relation.COUNT)

    return link;
}

From source file:org.heliosphere.thot.akka.chat.client.TerminalActor.java

@SuppressWarnings("nls")
@Override/*w  w  w  .java2 s.c  o m*/
public final void onCommand(final ICommand command) {
    // Pauses the terminal thread until the command response has been received.
    terminal.pause();

    try {
        // Before issuing a command, the end-user must register its user name.
        if (user == null && command.getProtocol() != ChatCommandProtocol.USER_REGISTER) {
            throw new CommandException("Please register a user before trying to issue a command!");
        }

        if (command.getProtocol() instanceof DefaultCommandProtocol) {
            handleDefaultCommandProtocol(command);
        } else if (command.getProtocol() instanceof ChatCommandProtocol) {
            switch ((ChatCommandDomainType) ((ICommandProtocolType) command.getProtocol()).getDomain()) {
            case USER:
                handleUserCommand(command);
                break;

            case LOBBY:
                handleLobbyCommand(command);
                break;

            case ROOM:
                handleRoomCommand(command);
                break;

            case MESSAGE:
                handleMessageCommand(command);
                break;

            default:
                break;
            }
        }
    } catch (CommandException e) {
        terminal.appendToPane(String.format("Error-> %1s\n\n", e.getMessage()), Color.ORANGE);
        terminal.resume();
    }
}

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);/* w  w  w  .  j  a v  a 2 s  . c o m*/
}

From source file:org.heliosphere.thot.akka.chat.client.TerminalActor.java

/**
 * Handles command from protocol: {@link DefaultCommandProtocol}.
 * <hr>// w  w w  .  java  2  s .c  o  m
 * @param command Command to handle.
 */
@SuppressWarnings("nls")
private final void handleDefaultCommandProtocol(final ICommand command) {
    switch ((DefaultCommandProtocol) command.getMetadata().getProtocolType()) {
    case HELP:
        // This command is handled by a pre-defined command processor.
        try {
            coordinator.execute(command);
        } catch (CommandNotFoundException e) {
            terminal.appendToPane(String.format("[ERROR] %1s\n", e.getMessage()), Color.ORANGE);
        } finally {
            terminal.resume();
        }
        break;

    case AFK:
        break;

    case QUIT:
        break;

    default:
        handleCommandUnknown(command);
        break;
    }
}

From source file:org.gumtree.vis.awt.JChartPanel.java

private void drawTextInputBox(Graphics2D g2) {
    if (textInputFlag && textInputPoint != null) {
        //         g2.drawChars("Input Text Here".toCharArray(), 1, 60, (int) textInputPoint.getX(), (int) textInputPoint.getY());
        Color oldColor = g2.getColor();
        g2.setColor(Color.BLACK);
        String inputText = textInputContent == null ? "" : textInputContent;
        FontMetrics fm = g2.getFontMetrics();
        //         int sWidth;
        //         if (textInputCursorIndex == 0 || inputText.length() == 0) {
        //            sWidth = 0;
        //         } else if (textInputCursorIndex < inputText.length()){
        //            sWidth = fm.stringWidth(inputText.substring(0, textInputCursorIndex));
        //         } else {
        //            sWidth = fm.stringWidth(inputText);
        //         }

        String[] lines = inputText.split("\n", 100);
        int cursorY = 0;
        int cursorX = 0;
        int charCount = 0;
        int maxWidth = 0;
        int maxHeight = 0;
        for (int i = 0; i < lines.length; i++) {
            g2.drawString(lines[i], (int) textInputPoint.getX() + 3, (int) textInputPoint.getY() - 3 + i * 15);
            //            charCount += lines[i].length() + 1;
            if (textInputCursorIndex > charCount && textInputCursorIndex < charCount + lines[i].length() + 1) {
                cursorY = i;//from  w  w  w.  j  a  v a2s .  c om
                cursorX = fm.stringWidth(lines[i].substring(0, textInputCursorIndex - charCount));
            } else if (textInputCursorIndex == charCount + lines[i].length() + 1) {
                cursorY = i + 1;
                cursorX = 0;
            }
            charCount += lines[i].length() + 1;
            int lineWidth = fm.stringWidth(lines[i]);
            if (lineWidth > maxWidth) {
                maxWidth = lineWidth;
            }
        }
        maxHeight = 15 * lines.length;
        //         g2.drawString(inputText, (int) textInputPoint.getX() + 3, (int) textInputPoint.getY() - 3);
        g2.setColor(Color.MAGENTA);
        //         g2.drawString("|", (float) textInputPoint.getX() + 2 + sWidth, (float) textInputPoint.getY() - 3);
        g2.drawLine((int) textInputPoint.getX() + 3 + cursorX, (int) textInputPoint.getY() + (cursorY - 1) * 15,
                (int) textInputPoint.getX() + 3 + cursorX, (int) textInputPoint.getY() + cursorY * 15);
        g2.setColor(Color.BLACK);
        g2.setColor(oldColor);

        //         int boxWidth = fm.stringWidth(inputText) + 10;
        if (maxWidth < 100) {
            maxWidth = 100;
        }
        Rectangle2D inputBox = new Rectangle2D.Double(textInputPoint.getX(), textInputPoint.getY() - 15,
                maxWidth + 8, maxHeight);
        //         ChartMaskingUtilities.drawMaskBoarder(g2, inputBox);
        Color fillColor = new Color(250, 250, 50, 30);
        g2.setPaint(fillColor);
        g2.fill(inputBox);
        g2.setColor(Color.ORANGE);
        g2.drawRect((int) textInputPoint.getX(), (int) textInputPoint.getY() - 15, maxWidth + 8, maxHeight);
    }
    if (textContentMap.size() > 0) {
        Color oldColor = g2.getColor();
        g2.setColor(Color.BLACK);
        Rectangle2D imageArea = getScreenDataArea();
        for (Entry<Rectangle2D, String> entry : textContentMap.entrySet()) {
            Rectangle2D rect = entry.getKey();
            Point2D screenPoint = ChartMaskingUtilities
                    .translateChartPoint(new Point2D.Double(rect.getX(), rect.getY()), imageArea, getChart());
            String text = entry.getValue();
            if (text == null) {
                continue;
            }
            String[] lines = text.split("\n");
            g2.setColor(Color.BLACK);
            for (int i = 0; i < lines.length; i++) {
                g2.drawString(lines[i], (int) screenPoint.getX() + 3, (int) screenPoint.getY() - 3 + i * 15);
            }
            if (rect == selectedTextWrapper) {
                FontMetrics fm = g2.getFontMetrics();
                int maxWidth = 0;
                int maxHeight = 0;
                for (int i = 0; i < lines.length; i++) {
                    int lineWidth = fm.stringWidth(lines[i]);
                    if (lineWidth > maxWidth) {
                        maxWidth = lineWidth;
                    }
                }
                maxHeight = 15 * lines.length;
                if (maxWidth < 100) {
                    maxWidth = 100;
                }
                Rectangle2D inputBox = new Rectangle2D.Double(screenPoint.getX(), screenPoint.getY() - 15,
                        maxWidth + 8, maxHeight);
                Color fillColor = new Color(250, 250, 50, 30);
                g2.setPaint(fillColor);
                g2.fill(inputBox);
                g2.setColor(Color.ORANGE);
                g2.drawRect((int) screenPoint.getX(), (int) screenPoint.getY() - 15, maxWidth + 8, maxHeight);

            }
            //            g2.drawString(text == null ? "" : text, (int) screenPoint.getX() + 3, (int) screenPoint.getY() - 3);
        }
        g2.setColor(oldColor);
    }
}

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());
                        }/*ww w .j a  v a 2  s. c  om*/
                        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:org.gridchem.client.gui.panels.myccg.resource.HPCChartPanel.java

/**
 * Renders the bar chart./*from   w  ww. j  av a 2  s.c  om*/
 * 
 * @param dataset  the dataset.
 * 
 * @return The chart.
 */
private JFreeChart renderBarChart(JFreeChart chart) {

    // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...

    // get a reference to the plot for further customisation...
    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.white);
    plot.setDomainGridlinePaint(Color.lightGray);
    plot.setRangeGridlinePaint(Color.lightGray);

    // set the range axis to display integers only...
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    rangeAxis.setUpperBound(100);

    // disable bar outlines...
    final BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    // set up gradient paints for series...
    final GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, Color.black);
    final GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, Color.black);
    final GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, Color.black);
    final GradientPaint gp3 = new GradientPaint(0.0f, 0.0f, Color.orange, 0.0f, 0.0f, Color.black);

    renderer.setSeriesPaint(0, gp0);
    renderer.setSeriesPaint(1, gp1);
    renderer.setSeriesPaint(2, gp2);
    renderer.setSeriesPaint(3, gp3);

    //        final CategoryAxis domainAxis = plot.getDomainAxis();
    //        domainAxis.setCategoryLabelPositions(
    //            CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)
    //        );
    // OPTIONAL CUSTOMISATION COMPLETED.
    return chart;
}

From source file:ngat.opsgui.xcomp.SeeingPanel2.java

private JPanel makeChartPanel() {

    tac = new TimeAxisChart("Seeing");
    tac.setTimeLabel("Time [UTC]");
    tac.setYLabel("Seeing [asec]");
    tac.setShowGridLines(true);//from  w  ww.j ava2  s . com
    tac.setTimeAxisRange(6 * 3600 * 1000L);
    tac.setYAxisStart(0.0);
    tac.setYAxisEnd(3.0);
    tac.setChartBackgroundColor(jPanel5.getBackground());

    tac.addRangeBackground(0.0, 0.8, new Color(192, 248, 193));
    tac.addRangeBackground(0.8, 1.3, new Color(248, 233, 192));
    tac.addRangeBackground(1.3, 2.0, new Color(248, 198, 192));
    tac.addRangeBackground(2.0, 3.0, new Color(192, 236, 248));

    try {
        tac.createPlot("RAW_STD", "Standards Raw", TimeAxisChart.SHAPE_TRIANGLE, 0, Color.magenta, false, true);
    } catch (Exception e) {
        e.printStackTrace();
    }

    try {
        tac.createPlot("CORR_STD", "Standards Corrected", TimeAxisChart.SHAPE_RECTANGLE, 0, Color.orange, false,
                true);
    } catch (Exception e) {
        e.printStackTrace();
    }

    try {
        tac.createPlot("RAW_SCI", "Science Raw", TimeAxisChart.SHAPE_TRIANGLE, 0, Color.blue, false, true);
    } catch (Exception e) {
        e.printStackTrace();
    }

    try {
        tac.createPlot("CORR_SCI", "Science Corrected", TimeAxisChart.SHAPE_RECTANGLE, 0, Color.green, false,
                true);
    } catch (Exception e) {
        e.printStackTrace();
    }

    try {
        tac.createPlot("PRED", "Prediction", TimeAxisChart.SHAPE_NONE, 0, Color.red, true, true);
    } catch (Exception e) {
        e.printStackTrace();
    }

    JPanel cp = tac.createChartPanel();

    cp.setLayout(new BorderLayout());
    cp.setPreferredSize(new Dimension(550, 320));

    return cp;

}