Example usage for java.awt Color PINK

List of usage examples for java.awt Color PINK

Introduction

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

Prototype

Color PINK

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

Click Source Link

Document

The color pink.

Usage

From source file:com.att.aro.ui.view.diagnostictab.plot.AlarmPlot.java

@Override
public void populate(XYPlot plot, AROTraceData analysis) {
    if (analysis == null) {
        logger.info("analysis data is null");
    } else {/*from w w w. j av a  2  s. com*/
        alarmDataCollection.removeAllSeries();
        pointerAnnotation.clear();

        TraceResultType resultType = analysis.getAnalyzerResult().getTraceresult().getTraceResultType();
        if (resultType.equals(TraceResultType.TRACE_FILE)) {
            logger.info("didn't get analysis trace data!");

        } else {
            // Remove old annotation from previous plots
            Iterator<XYPointerAnnotation> pointers = pointerAnnotation.iterator();
            while (pointers.hasNext()) {
                plot.removeAnnotation(pointers.next());
            }

            for (AlarmType eventType : AlarmType.values()) {
                XYIntervalSeries series = new XYIntervalSeries(eventType);
                seriesMap.put(eventType, series);
                alarmDataCollection.addSeries(series);
            }
            TraceDirectoryResult traceresult = (TraceDirectoryResult) analysis.getAnalyzerResult()
                    .getTraceresult();
            List<AlarmInfo> alarmInfos = traceresult.getAlarmInfos();
            List<ScheduledAlarmInfo> pendingAlarms = getHasFiredAlarms(traceresult.getScheduledAlarms());
            Iterator<ScheduledAlarmInfo> iterPendingAlarms = pendingAlarms.iterator();
            double firedTime = 0;
            while (iterPendingAlarms.hasNext()) {
                ScheduledAlarmInfo scheduledEvent = iterPendingAlarms.next();
                AlarmType pendingAlarmType = scheduledEvent.getAlarmType();
                if (pendingAlarmType != null) {
                    firedTime = (scheduledEvent.getTimeStamp() - scheduledEvent.getRepeatInterval()) / 1000;
                    seriesMap.get(pendingAlarmType).add(firedTime, firedTime, firedTime, 1, 0.8, 1);
                    eventMapPending.put(firedTime, scheduledEvent);
                    // logger.fine("populateAlarmScheduledPlot type:\n" +
                    // pendingAlarmType
                    // + "\ntime " + scheduledEvent.getTimeStamp()
                    // + "\nrepeating " + firedTime);
                }
            }

            Iterator<AlarmInfo> iter = alarmInfos.iterator();
            while (iter.hasNext()) {
                AlarmInfo currEvent = iter.next();
                if (currEvent != null) {
                    AlarmType alarmType = currEvent.getAlarmType();
                    if (alarmType != null) {
                        firedTime = currEvent.getTimeStamp() / 1000;

                        /*
                         * Catching any alarms align to quanta as being
                         * inexactRepeating alarms
                         */
                        if ((currEvent.getTimestampElapsed() / 1000) % 900 < 1) {
                            seriesMap.get(alarmType).add(firedTime, firedTime, firedTime, 1, 0, 0.7);

                            // Adding an arrow to mark these
                            // inexactRepeating alarms
                            XYPointerAnnotation xypointerannotation = new XYPointerAnnotation(alarmType.name(),
                                    firedTime, 0.6, 3.92699082D);
                            xypointerannotation.setBaseRadius(20D);
                            xypointerannotation.setTipRadius(1D);
                            pointerAnnotation.add(xypointerannotation);
                            plot.addAnnotation(xypointerannotation);

                            // logger.info("SetInexactRepeating alarm type: "
                            // + alarmType
                            // + " time " + firedTime
                            // + " epoch " + currEvent.getTimestampEpoch()
                            // + " elapsed:\n" +
                            // currEvent.getTimestampElapsed()/1000);
                        } else {
                            seriesMap.get(alarmType).add(firedTime, firedTime, firedTime, 1, 0, 0.5);
                        }
                        eventMap.put(firedTime, currEvent);
                    }
                }
            }
            XYItemRenderer renderer = plot.getRenderer();
            renderer.setSeriesPaint(alarmDataCollection.indexOf(AlarmType.RTC_WAKEUP), Color.red);

            renderer.setSeriesPaint(alarmDataCollection.indexOf(AlarmType.RTC), Color.pink);

            renderer.setSeriesPaint(alarmDataCollection.indexOf(AlarmType.ELAPSED_REALTIME_WAKEUP), Color.blue);

            renderer.setSeriesPaint(alarmDataCollection.indexOf(AlarmType.ELAPSED_REALTIME), Color.cyan);

            renderer.setSeriesPaint(alarmDataCollection.indexOf(AlarmType.UNKNOWN), Color.black);

            // Assign ToolTip to renderer
            renderer.setBaseToolTipGenerator(new XYToolTipGenerator() {
                @Override
                public String generateToolTip(XYDataset dataset, int series, int item) {
                    AlarmInfo info = eventMap.get(dataset.getX(series, item));
                    Date epochTime = new Date();
                    if (info != null) {

                        epochTime.setTime((long) info.getTimestampEpoch());

                        StringBuffer displayInfo = new StringBuffer(
                                ResourceBundleHelper.getMessageString("alarm.tooltip.prefix"));
                        displayInfo.append(MessageFormat.format(
                                ResourceBundleHelper.getMessageString("alarm.tooltip.content"),
                                info.getAlarmType(), info.getTimeStamp() / 1000, epochTime.toString()));
                        if ((info.getTimestampElapsed() / 1000) % 900 < 1) {
                            displayInfo.append(
                                    ResourceBundleHelper.getMessageString("alarm.tooltip.setInexactRepeating"));
                        }
                        displayInfo.append(ResourceBundleHelper.getMessageString("alarm.tooltip.suffix"));
                        return displayInfo.toString();
                    }
                    ScheduledAlarmInfo infoPending = eventMapPending.get(dataset.getX(series, item));
                    if (infoPending != null) {

                        epochTime.setTime(
                                (long) (infoPending.getTimestampEpoch() - infoPending.getRepeatInterval()));

                        StringBuffer displayInfo = new StringBuffer(
                                ResourceBundleHelper.getMessageString("alarm.tooltip.prefix"));
                        displayInfo.append(MessageFormat.format(
                                ResourceBundleHelper.getMessageString("alarm.tooltip.contentWithName"),
                                infoPending.getAlarmType(),
                                (infoPending.getTimeStamp() - infoPending.getRepeatInterval()) / 1000,
                                epochTime.toString(), infoPending.getApplication(),
                                infoPending.getRepeatInterval() / 1000));
                        displayInfo.append(ResourceBundleHelper.getMessageString("alarm.tooltip.suffix"));
                        return displayInfo.toString();
                    }
                    return null;
                }
            });

        }
    }
    plot.setDataset(alarmDataCollection);
    //      return plot;
}

From source file:net.lmxm.ute.gui.validation.AbstractInputValidator.java

@Override
public final boolean verify(final JComponent component) {
    final List<String> messages = validate(component);

    if (CollectionUtils.isEmpty(messages)) {
        component.setBackground(getDefaultBackgroundColor());

        return true;
    } else {/*from   www.  j a  v a 2 s.  co  m*/
        component.setBackground(Color.PINK);
        displayMessagesDialog(component, messages);

        return false;
    }
}

From source file:uk.ac.ncl.aries.entanglement.cli.export.MongoGraphToGDF.java

private static Map<String, Color> loadColorMappings(File propFile) throws IOException {
    FileInputStream is = new FileInputStream(propFile);
    Properties props = new Properties();
    props.load(is);//from  w ww.  j ava2s.c om
    is.close();

    Map<String, Color> nodeTypeToColour = new HashMap<>();
    for (String nodeType : props.stringPropertyNames()) {
        String colorString = props.getProperty(nodeType);
        Color color;

        switch (colorString) {
        case "BLACK":
            color = Color.BLACK;
            break;
        case "BLUE":
            color = Color.BLUE;
            break;
        case "CYAN":
            color = Color.CYAN;
            break;
        case "DARK_GRAY":
            color = Color.DARK_GRAY;
            break;
        case "GRAY":
            color = Color.GRAY;
            break;
        case "GREEN":
            color = Color.GREEN;
            break;
        case "LIGHT_GRAY":
            color = Color.LIGHT_GRAY;
            break;
        case "MAGENTA":
            color = Color.MAGENTA;
            break;
        case "ORANGE":
            color = Color.ORANGE;
            break;
        case "PINK":
            color = Color.PINK;
            break;
        case "RED":
            color = Color.RED;
            break;
        case "WHITE":
            color = Color.WHITE;
            break;
        case "YELLOW":
            color = Color.YELLOW;
            break;
        default:
            color = DEFAULT_COLOR;
        }

        nodeTypeToColour.put(nodeType, color);
    }
    return nodeTypeToColour;
}

From source file:no.uio.medicine.virsurveillance.charts.StackedChart_AWT.java

private Color getColor(int index) {
    int index2 = index + this.colorOffset;
    switch (index2) {
    case 0://from   w w  w.  ja va 2s.  co  m
        return Color.RED;
    case 1:
        return Color.BLUE;
    case 2:
        return Color.GREEN;
    case 3:
        return Color.YELLOW;
    case 4:
        return Color.DARK_GRAY;
    case 5:
        return Color.ORANGE;
    case 6:
        return Color.BLACK;
    case 7:
        return Color.CYAN;
    case 8:
        return Color.GRAY;
    case 9:
        return Color.LIGHT_GRAY;
    case 10:
        return Color.MAGENTA;
    case 11:
        return Color.PINK;
    case 12:
        return Color.WHITE;
    default:
        return getColor((int) Math.floor(Math.random() * 14));
    }

}

From source file:org.jfree.chart.demo.ThermometerDemo.java

/**
 * Initialises the class.//from www .  j av a2s. co m
 *
 * @throws Exception for any exception.
 */
void jbInit() throws Exception {

    //data.setRange(new Double(-20), new Double(20));
    this.thermo[0] = this.thermo1;
    this.thermo[1] = this.thermo2;
    this.thermo[2] = this.thermo3;

    this.thermo[0].setValue(0.0);
    this.thermo[1].setValue(0.2);
    this.thermo[2].setValue(0.3);

    this.thermo[0].setBackground(Color.white);
    this.thermo[2].setBackground(Color.white);

    this.thermo[0].setOutlinePaint(null);
    this.thermo[1].setOutlinePaint(null);
    this.thermo[2].setOutlinePaint(null);

    this.thermo[0].setUnits(0);
    this.thermo[1].setUnits(1);
    this.thermo[2].setUnits(2);

    //thermo[0].setFont(new Font("SansSerif", Font.BOLD, 20));
    this.thermo[0].setShowValueLines(true);
    this.thermo[0].setFollowDataInSubranges(true);
    this.thermo[1].setValueLocation(1);

    this.thermo[1].setForeground(Color.blue);
    this.thermo[2].setForeground(Color.pink);

    this.thermo[0].setRange(-10.0, 40.0);
    this.thermo[0].setSubrangeInfo(0, -50.0, 20.0, -10.0, 22.0);
    this.thermo[0].setSubrangeInfo(1, 20.0, 24.0, 18.0, 26.0);
    this.thermo[0].setSubrangeInfo(2, 24.0, 100.0, 22.0, 40.0);

    this.thermo[0].addSubtitle("Sea Water Temp");
    this.thermo[1].addSubtitle("Air Temp", new Font("SansSerif", Font.PLAIN, 16));
    this.thermo[2].addSubtitle("Ship Temp", new Font("SansSerif", Font.ITALIC + Font.BOLD, 20));

    this.thermo[1].setValueFormat(new DecimalFormat("#0.0"));
    this.thermo[2].setValueFormat(new DecimalFormat("#0.00"));

    this.pickShow[0] = this.pickShow0;
    this.pickShow[1] = this.pickShow1;
    this.pickShow[2] = this.pickShow2;

    this.pickAxis[0] = this.pickAxis0;
    this.pickAxis[1] = this.pickAxis1;
    this.pickAxis[2] = this.pickAxis2;

    this.pickAxis[0].setSelectedIndex(2);
    this.pickAxis[1].setSelectedIndex(2);
    this.pickAxis[2].setSelectedIndex(2);

    setLayout(this.gridLayout1);
    this.butDown3.setText("<");
    this.butDown3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(2, -1);
        }
    });
    this.butUp3.setText(">");
    this.butUp3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(2, 1);
        }
    });
    this.jPanel1.setLayout(this.borderLayout2);
    this.jPanel3.setLayout(this.borderLayout3);
    this.butDown2.setText("<");
    this.butDown2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(1, -1);
        }
    });
    this.butUp2.setText(">");
    this.butUp2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(1, 1);
        }
    });
    this.butUp1.setText(">");
    this.butUp1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(0, 1);
        }
    });
    this.butDown1.setText("<");
    this.butDown1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setValue(0, -1);
        }
    });
    this.jPanel5.setLayout(this.borderLayout1);
    this.pickShow0.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowValue(0);
        }
    });
    this.pickShow1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowValue(1);
        }
    });
    this.pickShow2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowValue(2);
        }
    });

    this.pickAxis0.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowAxis(0);
        }
    });
    this.pickAxis1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowAxis(1);
        }
    });
    this.pickAxis2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setShowAxis(2);
        }
    });

    this.jPanel9.setLayout(this.gridLayout2);
    this.gridLayout2.setColumns(1);
    this.jPanel8.setLayout(this.gridLayout3);
    this.jPanel7.setLayout(this.gridLayout4);
    this.jPanel5.setBorder(BorderFactory.createEtchedBorder());
    this.jPanel3.setBorder(BorderFactory.createEtchedBorder());
    this.jPanel1.setBorder(BorderFactory.createEtchedBorder());
    this.jPanel6.setBackground(Color.white);
    this.jPanel2.setBackground(Color.white);
    this.jPanel9.setBackground(Color.white);
    this.jPanel10.setLayout(this.borderLayout4);
    this.butDown4.setText("<");
    this.butDown4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setMeterValue(-1.1);
        }
    });
    this.butUp4.setText(">");
    this.butUp4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            setMeterValue(1.1);
        }
    });
    this.jPanel1.add(this.thermo3, BorderLayout.CENTER);
    this.jPanel1.add(this.jPanel2, BorderLayout.SOUTH);
    this.jPanel2.add(this.butDown3, null);
    this.jPanel2.add(this.butUp3, null);
    this.jPanel1.add(this.jPanel9, BorderLayout.NORTH);
    this.jPanel9.add(this.pickShow2, null);
    this.jPanel9.add(this.pickAxis2, null);
    add(this.jPanel10, null);
    this.jPanel10.add(this.jPanel11, BorderLayout.SOUTH);
    this.jPanel11.add(this.butDown4, null);
    this.jPanel11.add(this.butUp4, null);
    this.jPanel4.add(this.butDown2, null);
    this.jPanel4.add(this.butUp2, null);
    this.jPanel3.add(this.jPanel8, BorderLayout.NORTH);
    this.jPanel8.add(this.pickShow1, null);
    this.jPanel8.add(this.pickAxis1, null);
    this.jPanel3.add(this.thermo2, BorderLayout.CENTER);
    this.jPanel3.add(this.jPanel4, BorderLayout.SOUTH);
    add(this.jPanel5, null);
    this.jPanel5.add(this.thermo1, BorderLayout.CENTER);
    this.jPanel5.add(this.jPanel6, BorderLayout.SOUTH);
    this.jPanel6.add(this.butDown1, null);
    this.jPanel6.add(this.butUp1, null);
    this.jPanel5.add(this.jPanel7, BorderLayout.NORTH);
    this.jPanel7.add(this.pickShow0, null);
    this.jPanel7.add(this.pickAxis0, null);
    add(this.jPanel3, null);
    add(this.jPanel1, null);
    this.jPanel10.add(this.panelMeter, BorderLayout.CENTER);
}

From source file:TrackerPanel.java

private void hideBackground(int[] cameraPixels) {
    depthMD = depthGen.getMetaData();/*from ww w.j a  v a 2 s . c o  m*/

    ShortBuffer usersBuf = sceneMD.getData().createShortBuffer();
    int userCount = 0;
    int maxUserCount = 0;
    int userCountMaxRow = 0;
    int maxY = 0;
    int row = 0;
    int rowCount = 0;

    while (usersBuf.remaining() > 0) {
        int pos = usersBuf.position();
        short userID = usersBuf.get();
        if (userID == 0) {
            // if not a user (i.e. is part of the background)
            cameraPixels[pos] = hideBGPixel; // make pixel transparent
        } else {
            userCount++;
            int y = imHeight - row;
            if (y > maxY) {
                maxY = y;
            }
        }
        rowCount++;
        if (rowCount == imWidth) {
            if (userCount > maxUserCount) {
                maxUserCount = userCount;
                userCountMaxRow = row;
            }
            row++;
            rowCount = 0;
            userCount = 0;
        }
    }
    int startPoint = imWidth * (imHeight - maxY);
    int finalPoint = startPoint + imWidth;
    if (maxY != 0) {
        printLine(startPoint, finalPoint, Color.YELLOW.getRGB());
    }
    startPoint = imWidth * (userCountMaxRow);
    finalPoint = startPoint + imWidth;
    if (userCountMaxRow != 0) {
        SimpleHTTPPOSTRequester httpPost = new SimpleHTTPPOSTRequester();
        try {
            httpPost.makeHTTPPOSTRequest(userCountMaxRow);
        } catch (ParseException e1) {
            e1.printStackTrace();
        }
        Util.insertLastPoint(userCountMaxRow);
        int response = Util.analyzeLastFivePoints();

        if (response == Util.NOT_READY) {
            printLine(startPoint, finalPoint, Color.RED.getRGB());
        } else if (response == Util.READY) {
            printLine(startPoint, finalPoint, Color.WHITE.getRGB());
        } else if (response == Util.GOING_UP) {
            printLine(startPoint, finalPoint, Color.GREEN.getRGB());
        } else if (response == Util.GOING_DOWN) {
            printLine(startPoint, finalPoint, Color.PINK.getRGB());
        }

    }
}

From source file:dk.sdu.mmmi.featureous.views.codecharacterization.TanglingViewChart.java

private void createView() {
    Controller c = Controller.getInstance();
    Set<TraceModel> traces = c.getTraceSet().getFirstLevelTraces();

    List<Result> ress = new ArrayList<Result>(new StaticTangling(pkg).calculateAndReturnAll(traces, null));

    for (Result r : ress) {
        //            OutputUtil.log(r.name + ";" +r.value);
    }/*from  ww  w .  jav  a2  s  .co m*/
    Result.sortByName(ress);

    if (sortByValue) {
        Collections.sort(ress);
        //            Collections.reverse(ress);
    }

    double max = 0;
    for (Result r : ress) {
        if (r.value > max) {
            max = r.value;
        }
    }

    for (Result r : ress) {
        String label = "" + (ress.indexOf(r) + 1);
        data.addValue(r.value, r.name, label);
        //            data.addValue(max - r.value, r.name + "f", label);
    }

    double total = 0;
    for (Result r : ress) {
        total += r.value;
    }

    jchart.setTitle(jchart.getTitle().getText());// + "\n" + "Total tang = " + String.format("%.5f", total));

    CategoryPlot plot = jchart.getCategoryPlot();
    ((StackedBarRenderer) plot.getRenderer()).setDrawBarOutline(true);
    plot.getRenderer().setOutlineStroke(new BasicStroke(0.1f));

    for (int i = 0; i < data.getRowCount(); i++) {
        Set<Object> elems = new HashSet<Object>();
        for (ClassModel cm : c.getTraceSet().getAllClassIDs()) {
            if (!pkg) {
                elems.add(cm);
            } else {
                elems.add(cm.getPackageName());
            }
        }
        for (Object cm : elems) {
            String key = data.getRowKey(i).toString();
            String name = "";
            if (!pkg) {
                name = ((ClassModel) cm).getName();
            } else {
                name = (String) cm;
            }
            if (key != null && key.startsWith(name)) {
                Color col = Color.pink;
                if (!pkg) {
                    col = Controller.getInstance().getAffinity()
                            .getClassAffinity(((ClassModel) cm).getName()).color;
                } else {
                    col = Controller.getInstance().getAffinity().getPkgAffinity((String) cm).color;
                }

                plot.getRenderer().setSeriesPaint(i, col);
                //                    if(key.endsWith("f")){
                //                        plot.getRenderer().setSeriesOutlinePaint(i, col);
                //                    }else{
                plot.getRenderer().setSeriesOutlinePaint(i, Color.DARK_GRAY);
                //                    }
                break;
            }
        }
    }
    //        plot.setRowRenderingOrder(SortOrder.DESCENDING);

}

From source file:controller.VisLP.java

/**
 * Draw the linear constraints of an {@code LP} and color
 * it's feasible region in a given {@code CCSystem}.
 * /*from  w  w  w. jav a2s.c om*/
 * @param cs
 *        a {@code CCSystem}.
 * @param lp
 *        a {@code LP}.
 */
static void drawLP(CCSystem cs, LP lp) {
    cs.clear();

    /* Don't draw the LP if it is not in two variables */
    if (lp == null || lp.getNoBasic() != 2) {
        cs.setVisibleAxes(false);
        return;
    }
    cs.setVisibleAxes(true);

    CCSLine line;
    FieldMatrix<BigFraction> cons = lp.getConstraints();
    cons = checkForBounds(cons);

    /* Draw all constraints as lines, except hidden bounded constraint */
    for (int i = 0; i < cons.getRowDimension() - 1; i++) {
        line = new CCSLine(cons.getEntry(i, 0).doubleValue(), cons.getEntry(i, 1).doubleValue(),
                cons.getEntry(i, 2).doubleValue(), Color.gray);
        cs.addLine(line);
    }

    Point2D[] fpoints = getFeasibleIntersections(cons);

    /* 
     * Move the center of the coordinate system
     * to the center of the feasible region.
     */
    if (readScope) {
        scopeArea(cs, fpoints, true);
        readScope = false;
    }
    if (feasScope && lp.feasible(false)) {
        scopeArea(cs, fpoints, false);
        feasScope = false;
    }

    /* If there is no feasible region there is no need to try to color it */
    if (fpoints.length == 0)
        return;

    /* Draw all feasible solutions as points */
    Point2D[] pconv = convex(fpoints);
    for (Point2D p2d : pconv) {
        CCSPoint ccsp = new CCSPoint(p2d.getX(), p2d.getY());
        if (!unb.contains(p2d))
            cs.addPoint(ccsp);
    }

    /* Color the region depending on whether it is unbounded or not. */
    if (unb.size() == 0) {
        cs.addPolygon(new CCSPolygon(pconv, Color.pink, true));
    } else if (unb.size() == 1) {
        GradientPaint gp = new GradientPaint(pconv[0], Color.pink, unb.get(0), cs.getBackground());
        cs.addPolygon(new CCSPolygon(pconv, gp, true));
    } else {
        Point2D p1 = unb.get(0);
        Point2D p2 = unb.get(1);
        double xavg = (p1.getX() + p2.getX()) / 2.0;
        double yavg = (p1.getY() + p2.getY()) / 2.0;
        /* 
         * Move the end point of the gradient further away from the
         * polygon edge to make the end of the gradient look less sudden.
         */
        xavg *= 0.9;
        yavg *= 0.9;

        Point2D pavg = new Point2D.Double(xavg, yavg);

        /* Fade into the background color */
        GradientPaint gp = new GradientPaint(pconv[0], Color.pink, pavg, cs.getBackground());

        cs.addPolygon(new CCSPolygon(pconv, gp, true));
    }

    /* Draw the current objective function */
    FieldVector<BigFraction> obj = lp.getObjFunction();
    line = new CCSLine(obj.getEntry(0).doubleValue(), obj.getEntry(1).doubleValue(), lp.objVal().doubleValue(),
            Color.red);
    cs.addLine(line);

    /* Draw the current basic solution as a point. */
    BigFraction[] point = lp.point();
    cs.addPoint(new CCSPoint(point[0].doubleValue(), point[1].doubleValue(), Color.red, true));
}

From source file:Engine.Projectile.java

@Override
public DPolygon[] GetPolygons() {
    Cube nc = null;/*from   w  ww.  j  ava  2s  .co  m*/
    if (size != null) {
        nc = new Cube(actualPosition.getX() - (size.getX() / 2.0), actualPosition.getY() - (size.getY() / 2.0),
                actualPosition.getZ() - (size.getZ() / 2.0), size.getX(), size.getY(), size.getZ(), Color.PINK,
                null);
    } else {
        nc = new Cube(actualPosition.getX() - 0.5, actualPosition.getY() - 0.5, actualPosition.getZ() - 0.5, 1,
                1, 1, Color.PINK, null);
    }
    return nc.GetPolygons();
}

From source file:gov.nih.nci.caintegrator.common.Cai2Util.java

/**
 * Used by classes to retrieve a color based on a number from a ten color palette.
 * (1-10) are colors and anything else returns black.
 * @param colorNumber - number to use.//from w  ww  . j a  v a  2  s . co m
 * @return - Color object for that number.
 */
public static Color getBasicColor(int colorNumber) {
    switch (colorNumber) {
    case 1:
        return Color.GREEN;
    case 2:
        return Color.BLUE;
    case 3:
        return Color.RED;
    case 4:
        return Color.CYAN;
    case 5:
        return Color.DARK_GRAY;
    case 6:
        return Color.YELLOW;
    case 7:
        return Color.LIGHT_GRAY;
    case 8:
        return Color.MAGENTA;
    case 9:
        return Color.ORANGE;
    case 10:
        return Color.PINK;
    default:
        return Color.BLACK;
    }
}