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:base.BasePlayer.ClusterTable.java

void drawHeader() {
    for (int i = 0; i < header.size(); i++) {
        buf.setColor(Color.darkGray);
        buf.fillRect((int) header.get(i)[1], 0, (int) (header.get(i)[2]) + 1, rowHeight);

        if (mouseY - tablescroll.getVerticalScrollBar().getValue() <= rowHeight) {
            if (mouseX >= (int) ((int) header.get(i)[1])
                    && mouseX <= (int) ((int) header.get(i)[1]) + (int) (header.get(i)[2])) {
                headerHover = i;//from ww w  .  j a v a  2s.  c  o m
                buf.setColor(Color.yellow);
            } else if (mouseX >= (int) (header.get(header.size() - 1)[1])
                    + (int) (header.get(header.size() - 1)[2])) {
                headerHover = header.size();
                buf.setColor(Color.white);
            } else {
                buf.setColor(Color.white);
            }
        } else {

            buf.setColor(Color.white);
        }
        if (!mouseDrag && headerHover > -1 && i > 0 && i < header.size()) {
            if (mouseX > (int) ((int) header.get(i)[1]) - 5 && mouseX < (int) ((int) header.get(i)[1]) + 5) {
                resizeColumn = i;

            }
        }
        if (header.get(i)[0] instanceof String) {
            buf.drawString((String) header.get(i)[0], (int) ((int) header.get(i)[1]) + 4, rowHeight - 2);
        } else if (header.get(i)[0] instanceof BedTrack) {
            BedTrack track = (BedTrack) header.get(i)[0];

            if (track.file != null) {
                buf.drawString(track.file.getName(), (int) ((int) header.get(i)[1]) + 4, rowHeight - 2);
            } else {
                buf.drawString(FilenameUtils.getName(track.url.getFile()), (int) ((int) header.get(i)[1]) + 4,
                        rowHeight - 2);
            }
            track = null;
        }

        buf.setColor(Color.black);
        buf.drawLine((int) ((int) header.get(i)[1]), 0, (int) ((int) header.get(i)[1]), rowHeight);
        if (sorter.index > -1) {
            if (sorter.ascending) {
                buf.setColor(Color.white);
                buf.fillPolygon(this.sortTriangle);
            } else {
                buf.setColor(Color.white);
                buf.fillPolygon(this.sortTriangle);
            }
        }
    }
    buf.setColor(Color.darkGray);
    buf.fillRect((int) header.get(header.size() - 1)[1] + (int) header.get(header.size() - 1)[2] + 2, 0,
            this.width, rowHeight);
    buf.setColor(Color.black);
    buf.drawLine((int) header.get(header.size() - 1)[1] + (int) header.get(header.size() - 1)[2] + 1, 0,
            (int) header.get(header.size() - 1)[1] + (int) header.get(header.size() - 1)[2] + 1, rowHeight);
    if (!mouseDrag && headerHover > -1 && resizeColumn == -1) {

        if (mouseX > ((int) header.get(header.size() - 1)[1] + (int) header.get(header.size() - 1)[2]) - 5
                && mouseX < ((int) header.get(header.size() - 1)[1] + (int) header.get(header.size() - 1)[2])
                        + 5) {
            resizeColumn = header.size();

        }
    }

}

From source file:windows.sensorWindow.java

/**
 * add a value to the main field of the sensor
 * //  w w  w  .  jav a 2s .  c  o  m
 * @param sensorUID
 * @param value
 */
public void addValue(String sensorUID, double value) {
    // TODO: make this method more elegant by evolving
    // plotStateMap.get-things

    // if (seriesCollectionMap.containsKey(sensorUID))
    // seriesCollectionMap.get(sensorUID).getSeries(0).add(new
    // Millisecond(), value);
    Millisecond ms = new Millisecond();

    if (seriesCollectionMap.containsKey(sensorUID)) {
        seriesCollectionMap.get(sensorUID).getSeries(0).addOrUpdate(ms, value);
    }

    // add timestamp to slider
    sliderData.addMS(ms);

    // if we have moved the slider at least once, but now it is on it's
    // start position
    // which means we want to auto-update the charts again
    if (sliderUpdate == true) {
        DateRange range = new DateRange(sliderData.getMilliseconds(0).getFirstMillisecond(),
                sliderData.getMilliseconds(sliderValuesNumber).getFirstMillisecond());
        plot.getDomainAxis().setRange(range);
    }

    // add measurement value
    if (valuesMap.containsKey(sensorUID))
        valuesMap.get(sensorUID).addValue(value);

    // if template control is turned on and template control variables exist
    // proof whether current value is in template's area
    Brick tmpBrick = Brick.getBrick(connectionData.BrickList, sensorUID);
    if ((Brick.getBrick(connectionData.BrickList, sensorUID).ctrlTmpl[0] == true)
            && (tmplCollection1_1.containsKey(sensorUID)) && (tmplStartMs.containsKey(sensorUID))
            && ((tmpBrick.ctrlTmplruns[0] == true) || (tmpBrick.ctrlTmplruns[0] == true))) {
        long timeNow = System.currentTimeMillis();
        double tmplValue = tmpBrick.tmplPlot[0].getYValue(timeNow, tmplStartMs.get(sensorUID));
        if (((tmplValue + tmpBrick.tmpl1Width) < value) || ((tmplValue - tmpBrick.tmpl1Width) > value)) {
            // set alarm state
            plot1StateMap.put(sensorUID, 3);
        }
    }

    // check whether the value is below the threshold
    if (markerMapMin1Critical.containsKey(sensorUID)) {
        // critical
        if ((value < markerMapMin1Critical.get(sensorUID).getValue())
                || (value > markerMapMax1Critical.get(sensorUID).getValue())) {
            if (plot1StateMap.get(sensorUID) < 3) {
                plot1StateMap.put(sensorUID, 3);
            }
        }

        // warning
        else if ((value < markerMapMin1Warning.get(sensorUID).getValue())
                || (value > markerMapMax1Warning.get(sensorUID).getValue())) {
            if (plot1StateMap.get(sensorUID) < 2) {
                plot1StateMap.put(sensorUID, 2);
            }
        }

        // normal level
        else {
            if (plot1StateMap.get(sensorUID) < 1) {
                plot1StateMap.put(sensorUID, 1);
            }
        }
    }

    // color the plot's background according to it's current state,
    // but only if the state of the 2nd plot is below the state of the
    // current plot
    // a higher state means higher warning level and therefore a higher
    // priority
    if (plot2StateMap.get(sensorUID) <= plot1StateMap.get(sensorUID)) {
        switch (plot1StateMap.get(sensorUID)) {
        case 1:
            plotMap.get(sensorUID).setBackgroundPaint(Color.white);
            break;
        case 2:
            plotMap.get(sensorUID).setBackgroundPaint(Color.yellow);
            break;
        case 3:
            plotMap.get(sensorUID).setBackgroundPaint(Color.red);
            break;
        }
    }
    /*
     * // check whether the value is below the threshold if
     * (markerMapMin1Critical.containsKey(sensorUID)) { if ( (value >
     * markerMapMin1Critical.get(sensorUID).getValue()) && (value <=
     * (markerMapMin1Warning.get(sensorUID).getValue())) ) { //under warning
     * level if (plotStateMap.get(sensorUID)<2) {
     * plotStateMap.put(sensorUID,2);
     * plotMap.get(sensorUID).setBackgroundPaint(Color.yellow); } } else if
     * (value <= markerMapMin1Critical.get(sensorUID).getValue()) { //under
     * threshold level if (plotStateMap.get(sensorUID)<3) {
     * plotStateMap.put(sensorUID,3);
     * plotMap.get(sensorUID).setBackgroundPaint(Color.pink); } } else {
     * //normal level
     * //plotMap.get(sensorUID).setBackgroundPaint(Color.white);
     * 
     * // check whether the value is above the threshold if
     * (markerMapMax1Critical.containsKey(sensorUID)) { if ( (value <
     * markerMapMax1Critical.get(sensorUID).getValue()) && (value >=
     * (markerMapMax1Warning.get(sensorUID).getValue())) ) { //between the
     * warning and critical plotStateMap.put(sensorUID,2);
     * plotMap.get(sensorUID).setBackgroundPaint(Color.yellow); } else if
     * (value >= markerMapMax1Critical.get(sensorUID).getValue()) { //above
     * the max threshold level plotStateMap.put(sensorUID,3);
     * plotMap.get(sensorUID).setBackgroundPaint(Color.pink); } else {
     * //normal level
     * 
     * //if (!(plotMap.get(sensorUID).getBackgroundPaint() == Color.pink) &&
     * // !(plotMap.get(sensorUID).getBackgroundPaint() == Color.yellow))
     * 
     * if (plotStateMap.get(sensorUID) != 1) {
     * plotStateMap.put(sensorUID,0);
     * plotMap.get(sensorUID).setBackgroundPaint(Color.white); } if
     * (plotStateMap.get(sensorUID) == 1) {
     * plotMap.get(sensorUID).setBackgroundPaint(Color.gray); } } } } }
     */
}

From source file:base.BasePlayer.AminoTable.java

void drawHeader() {
    for (int i = 0; i < header.length; i++) {
        buf.setColor(Color.darkGray);
        buf.fillRect((int) (headerlengths[i][0]), 0, (int) (headerlengths[i][1]) + 1, rowHeight);

        if (mouseY - tablescroll.getVerticalScrollBar().getValue() <= rowHeight) {
            if (mouseX >= (int) (headerlengths[i][0])
                    && mouseX <= (int) (headerlengths[i][0]) + (int) (headerlengths[i][1])) {
                headerHover = i;//from  w w w.j  a  va  2 s  .co m
                buf.setColor(Color.yellow);
            } else if (mouseX >= (int) (headerlengths[headerlengths.length - 1][0])
                    + (int) (headerlengths[headerlengths.length - 1][1])) {
                headerHover = headerlengths.length;
                buf.setColor(Color.white);
            } else {
                buf.setColor(Color.white);
            }

        } else {

            buf.setColor(Color.white);
        }
        if (!mouseDrag && headerHover > -1 && i > 0 && i < header.length) {
            if (mouseX > (int) (headerlengths[i][0]) - 5 && mouseX < (int) (headerlengths[i][0]) + 5) {
                resizeColumn = i;

            }
        }
        buf.drawString(header[i], (int) (headerlengths[i][0]) + 4, rowHeight - 2);
        buf.setColor(Color.black);
        buf.drawLine((int) (headerlengths[i][0]), 0, (int) (headerlengths[i][0]), rowHeight);
        if (sorter.index > -1) {
            if (sorter.ascending) {
                buf.setColor(Color.white);
                buf.fillPolygon(this.sortTriangle);
            } else {
                buf.setColor(Color.white);
                buf.fillPolygon(this.sortTriangle);
            }
        }
    }
    buf.setColor(Color.darkGray);
    buf.fillRect((int) headerlengths[header.length - 1][0] + (int) headerlengths[header.length - 1][1] + 2, 0,
            this.width, rowHeight);
    buf.setColor(Color.black);
    buf.drawLine((int) headerlengths[header.length - 1][0] + (int) headerlengths[header.length - 1][1] + 1, 0,
            (int) headerlengths[header.length - 1][0] + (int) headerlengths[header.length - 1][1] + 1,
            rowHeight);
    if (!mouseDrag && headerHover > -1 && resizeColumn == -1) {

        if (mouseX > (int) ((int) headerlengths[header.length - 1][0]
                + (int) headerlengths[header.length - 1][1]) - 5
                && mouseX < ((int) headerlengths[header.length - 1][0]
                        + (int) headerlengths[header.length - 1][1]) + 5) {
            resizeColumn = header.length;

        }
    }

}

From source file:base.BasePlayer.BedTable.java

void drawGeneheader(int y) {
    for (int i = 0; i < geneheader.size(); i++) {
        buf.setColor(Color.darkGray);
        buf.fillRect((int) ((int) geneheader.get(i)[1]) + 10, y, (int) geneheader.get(i)[2], rowHeight);

        if (mouseY - tablescroll.getVerticalScrollBar().getValue() <= y + rowHeight
                && mouseY - tablescroll.getVerticalScrollBar().getValue() >= y) {

            if (mouseX >= (int) geneheader.get(i)[1] + 10
                    && mouseX <= (int) geneheader.get(i)[1] + (int) geneheader.get(i)[2] + 10) {

                geneHeaderHover = i;/*from  w  w  w  .ja  v  a 2s  .  c  o  m*/
                buf.setColor(Color.yellow);
            } else if (mouseX >= (int) geneheader.get(geneheader.size() - 1)[1]
                    + (int) geneheader.get(geneheader.size() - 1)[2] + 10) {
                geneHeaderHover = geneheader.size();
                buf.setColor(Color.white);
            } else {
                buf.setColor(Color.white);
            }

        } else {

            buf.setColor(Color.white);
        }
        if (!mouseDrag && geneHeaderHover > -1 && i > 0 && i < geneheader.size()) {
            if (mouseX > (int) geneheader.get(i)[1] + 5 && mouseX < (int) geneheader.get(i)[1] + 15) {
                if (resizeColumn != i) {
                    resizeColumn = i;
                }
            }
        }

        if (geneheader.get(i)[0] instanceof String) {
            buf.drawString((String) geneheader.get(i)[0], (int) geneheader.get(i)[1] + 14, y + rowHeight - 3);
        } else if (geneheader.get(i)[0] instanceof ControlFile) {
            ControlFile ctrlfile = (ControlFile) geneheader.get(i)[0];
            buf.drawString("AF: " + ctrlfile.getName(), (int) geneheader.get(i)[1] + 14, y + rowHeight - 3);
            ctrlfile = null;
        } else {
            BedTrack track = (BedTrack) geneheader.get(i)[0];

            if (track.file != null) {
                buf.drawString(track.file.getName(), (int) geneheader.get(i)[1] + 14, y + rowHeight - 3);
            } else {
                buf.drawString(FilenameUtils.getName(track.url.getFile()), (int) geneheader.get(i)[1] + 14,
                        y + rowHeight - 3);
            }
            track = null;
        }
        buf.setColor(Color.black);
        buf.drawLine((int) geneheader.get(i)[1] + 10, y, (int) ((int) geneheader.get(i)[1]) + 10,
                y + rowHeight);

    }

    if (!mouseDrag && geneHeaderHover > -1 && resizeColumn == -1) {

        if (mouseX > (int) geneheader.get(geneheader.size() - 1)[1]
                + (int) geneheader.get(geneheader.size() - 1)[2] - 5
                && mouseX < (int) geneheader.get(geneheader.size() - 1)[1]
                        + (int) geneheader.get(geneheader.size() - 1)[2] + 15) {
            resizeColumn = geneheader.size();

        }
    }
    buf.setColor(Color.darkGray);
    buf.fillRect((int) geneheader.get(geneheader.size() - 1)[1] + (int) geneheader.get(geneheader.size() - 1)[2]
            + 11, y, this.width, rowHeight);
    buf.setColor(Color.black);
    buf.drawLine(
            (int) geneheader.get(geneheader.size() - 1)[1] + (int) geneheader.get(geneheader.size() - 1)[2]
                    + 10,
            y, (int) geneheader.get(geneheader.size() - 1)[1] + (int) geneheader.get(geneheader.size() - 1)[2]
                    + 10,
            y + rowHeight);
}

From source file:base.BasePlayer.ClusterTable.java

void drawGeneheader(int y) {
    for (int i = 0; i < geneheader.size(); i++) {
        buf.setColor(Color.darkGray);
        buf.fillRect((int) ((int) geneheader.get(i)[1]) + 10, y, (int) geneheader.get(i)[2], rowHeight);

        if (mouseY - tablescroll.getVerticalScrollBar().getValue() <= y + rowHeight
                && mouseY - tablescroll.getVerticalScrollBar().getValue() >= y) {

            if (mouseX >= (int) geneheader.get(i)[1] + 10
                    && mouseX <= (int) geneheader.get(i)[1] + (int) geneheader.get(i)[2] + 10) {

                geneHeaderHover = i;/*  w  w  w . j  a va2 s  .com*/
                buf.setColor(Color.yellow);
            } else if (mouseX >= (int) geneheader.get(geneheader.size() - 1)[1]
                    + (int) geneheader.get(geneheader.size() - 1)[2] + 10) {
                geneHeaderHover = geneheader.size();
                buf.setColor(Color.white);
            } else {
                buf.setColor(Color.white);
            }

        } else {

            buf.setColor(Color.white);
        }
        if (!mouseDrag && geneHeaderHover > -1 && i > 0 && i < geneheader.size()) {
            if (mouseX > (int) geneheader.get(i)[1] + 5 && mouseX < (int) geneheader.get(i)[1] + 15) {
                if (resizeColumn != i) {
                    resizeColumn = i;
                }
            }
        }
        if (geneheader.get(i)[0] instanceof String) {
            buf.drawString((String) geneheader.get(i)[0], (int) geneheader.get(i)[1] + 14, y + rowHeight - 3);
        } else if (geneheader.get(i)[0] instanceof ControlFile) {
            ControlFile ctrlfile = (ControlFile) geneheader.get(i)[0];
            buf.drawString("AF: " + ctrlfile.getName(), (int) geneheader.get(i)[1] + 14, y + rowHeight - 3);
            ctrlfile = null;
        } else {
            BedTrack track = (BedTrack) geneheader.get(i)[0];
            if (track.file != null) {
                buf.drawString(track.file.getName(), (int) geneheader.get(i)[1] + 14, y + rowHeight - 3);
            } else {
                buf.drawString(track.url.getFile().toString(), (int) geneheader.get(i)[1] + 14,
                        y + rowHeight - 3);
            }
            track = null;
        }
        buf.setColor(Color.black);
        buf.drawLine((int) geneheader.get(i)[1] + 10, y, (int) ((int) geneheader.get(i)[1]) + 10,
                y + rowHeight);

    }

    if (!mouseDrag && geneHeaderHover > -1 && resizeColumn == -1) {
        if (mouseX > (int) geneheader.get(geneheader.size() - 1)[1]
                + (int) geneheader.get(geneheader.size() - 1)[2] - 5
                && mouseX < (int) geneheader.get(geneheader.size() - 1)[1]
                        + (int) geneheader.get(geneheader.size() - 1)[2] + 15) {
            resizeColumn = geneheader.size();
        }
    }
    buf.setColor(Color.darkGray);
    buf.fillRect((int) geneheader.get(geneheader.size() - 1)[1] + (int) geneheader.get(geneheader.size() - 1)[2]
            + 11, y, this.width, rowHeight);
    buf.setColor(Color.black);
    buf.drawLine(
            (int) geneheader.get(geneheader.size() - 1)[1] + (int) geneheader.get(geneheader.size() - 1)[2]
                    + 10,
            y, (int) geneheader.get(geneheader.size() - 1)[1] + (int) geneheader.get(geneheader.size() - 1)[2]
                    + 10,
            y + rowHeight);
}

From source file:base.BasePlayer.AminoTable.java

void drawGeneheader(int y) {
    for (int i = 0; i < geneheader.size(); i++) {
        buf.setColor(Color.darkGray);
        buf.fillRect((int) ((int) geneheader.get(i)[1]) + 10, y, (int) geneheader.get(i)[2], rowHeight);

        if (mouseY - tablescroll.getVerticalScrollBar().getValue() <= y + rowHeight
                && mouseY - tablescroll.getVerticalScrollBar().getValue() >= y) {

            if (mouseX >= (int) geneheader.get(i)[1] + 10
                    && mouseX <= (int) geneheader.get(i)[1] + (int) geneheader.get(i)[2] + 10) {

                geneHeaderHover = i;/*from   w  ww . j a v  a  2 s.  c  o m*/
                buf.setColor(Color.yellow);
            } else if (mouseX >= (int) geneheader.get(geneheader.size() - 1)[1]
                    + (int) geneheader.get(geneheader.size() - 1)[2] + 10) {
                geneHeaderHover = geneheader.size();
                buf.setColor(Color.white);
            } else {
                buf.setColor(Color.white);
            }

        } else {

            buf.setColor(Color.white);
        }
        if (!mouseDrag && geneHeaderHover > -1 && i > 0 && i < geneheader.size()) {
            if (mouseX > (int) geneheader.get(i)[1] + 5 && mouseX < (int) geneheader.get(i)[1] + 15) {
                if (resizeColumn != i) {
                    resizeColumn = i;
                }
            }
        }
        if (geneheader.get(i)[0] instanceof String) {
            buf.drawString((String) geneheader.get(i)[0], (int) geneheader.get(i)[1] + 14, y + rowHeight - 3);
        } else if (geneheader.get(i)[0] instanceof ControlFile) {
            ControlFile ctrlfile = (ControlFile) geneheader.get(i)[0];
            buf.drawString("AF: " + ctrlfile.getName(), (int) geneheader.get(i)[1] + 14, y + rowHeight - 3);
            ctrlfile = null;
        } else {
            BedTrack track = (BedTrack) geneheader.get(i)[0];
            if (track.file != null) {
                buf.drawString(track.file.getName(), (int) geneheader.get(i)[1] + 14, y + rowHeight - 3);
            } else {
                buf.drawString(FilenameUtils.getName(track.url.getFile()), (int) geneheader.get(i)[1] + 14,
                        y + rowHeight - 3);
            }
            track = null;
        }
        buf.setColor(Color.black);
        buf.drawLine((int) geneheader.get(i)[1] + 10, y, (int) ((int) geneheader.get(i)[1]) + 10,
                y + rowHeight);

    }

    if (!mouseDrag && geneHeaderHover > -1 && resizeColumn == -1) {

        if (mouseX > (int) geneheader.get(geneheader.size() - 1)[1]
                + (int) geneheader.get(geneheader.size() - 1)[2] - 5
                && mouseX < (int) geneheader.get(geneheader.size() - 1)[1]
                        + (int) geneheader.get(geneheader.size() - 1)[2] + 15) {
            resizeColumn = geneheader.size();

        }
    }
    buf.setColor(Color.darkGray);
    buf.fillRect((int) geneheader.get(geneheader.size() - 1)[1] + (int) geneheader.get(geneheader.size() - 1)[2]
            + 11, y, this.width, rowHeight);
    buf.setColor(Color.black);
    buf.drawLine(
            (int) geneheader.get(geneheader.size() - 1)[1] + (int) geneheader.get(geneheader.size() - 1)[2]
                    + 10,
            y, (int) geneheader.get(geneheader.size() - 1)[1] + (int) geneheader.get(geneheader.size() - 1)[2]
                    + 10,
            y + rowHeight);
}

From source file:base.BasePlayer.BedTable.java

void drawScreen2(Graphics g) {

    buf.setColor(Color.black);//from ww  w .  j a  va  2s.c o  m
    buf.fillRect(0, 0, this.getWidth(), this.getHeight());

    //Header Draw   
    if (aminoarray.size() > 0) {
        samplecount = 0;
        genemutcount = 0;
        for (int i = 0; i < aminoarray.size(); i++) {

            if ((i + 1) * rowHeight < tablescroll.getVerticalScrollBar().getValue()) {
                continue;
            }
            if (i * rowHeight > tablescroll.getVerticalScrollBar().getValue() + this.getHeight()) {
                break;
            }

            /*if(mouseY >= (rowHeight*(i+samplecount+1)) && mouseY < (rowHeight*(i+samplecount+2))) {
               hoverNode = aminoarray.get(i).getNode();
               hoverString = aminoarray.get(i).getRow();
            }*/

            for (int j = 0; j < aminoarray.get(i).getRow().length; j++) {
                try {

                    //   buf.setColor(Color.gray);
                    //   buf.drawLine(this.getWidth()/header.length*(j+1), rowHeight, this.getWidth()/header.length*(j+1), this.getHeight());

                    if (selectedNode != null && selectedNode.equals(aminoarray.get(i).getNode())) {
                        //   samplecount = selectedNode.getSamples().size();
                        /*         buf.setColor(Color.black);
                                         
                                 buf.fillRect(this.getWidth()/header.length*j, ((rowHeight)*((i+1)+samplecount))+2-tablescroll.getVerticalScrollBar().getValue(), this.getWidth()/header.length, rowHeight);
                                 buf.setColor(Color.darkGray);
                                 buf.drawRect(this.getWidth()/header.length*j, ((rowHeight)*((i+1)+samplecount))+2-tablescroll.getVerticalScrollBar().getValue(), this.getWidth()/header.length, rowHeight);
                                 */
                        buf.setColor(Color.yellow);
                        if (j < 2) {
                            buf.drawString(aminoarray.get(i).getRow()[j],
                                    10 + this.getWidth() / header.length * j, (rowHeight * (i + 1))
                                            - tablescroll.getVerticalScrollBar().getValue() + rowHeight);
                        } else {
                            buf.setColor(Color.yellow);

                            for (int s = 0; s < samplecount; s++) {
                                if (j == 2) {
                                    buf.setColor(Color.yellow);
                                    //         buf.drawString(selectedNode.getSamples().get(s).getSample().getName(), 10, (rowHeight*(i+s+2))-tablescroll.getVerticalScrollBar().getValue()+rowHeight);            
                                }
                                buf.setColor(Color.black);
                                buf.fillRect(this.getWidth() / header.length * j,
                                        ((rowHeight) * ((i + s + 2))) + 2
                                                - tablescroll.getVerticalScrollBar().getValue(),
                                        this.getWidth() / header.length + 1, rowHeight);
                                buf.setColor(Color.yellow);
                                buf.drawString(aminoarray.get(i).getRow()[j],
                                        10 + this.getWidth() / header.length * j,
                                        (rowHeight * ((i + s + 2))) + 2
                                                - tablescroll.getVerticalScrollBar().getValue() + rowHeight);

                            }
                        }
                        /*   
                           for(int s = 0; s<samplecount; s++) {
                                      
                              buf.setColor(Color.black);
                              buf.fillRect(this.getWidth()/header.length*j, ((rowHeight)*((i+1)+samplecount))+2-tablescroll.getVerticalScrollBar().getValue(), this.getWidth()/header.length+1, rowHeight);
                                      
                              buf.setColor(Color.yellow);
                              buf.drawString(aminoarray.get(i).getRow()[j], 10+this.getWidth()/header.length*j, (rowHeight*((i+1)+samplecount))-tablescroll.getVerticalScrollBar().getValue()+rowHeight);            
                                      
                              buf.drawString(selectedNode.getSamples().get(s).getSample().getName(), 10, (rowHeight*(i+s+2))-tablescroll.getVerticalScrollBar().getValue()+rowHeight);            
                                      
                           }
                        */

                    } else {
                        buf.setColor(Color.black);

                        buf.fillRect(this.getWidth() / header.length * j,
                                ((rowHeight) * ((i + 1) + samplecount)) + 2
                                        - tablescroll.getVerticalScrollBar().getValue(),
                                this.getWidth() / header.length, rowHeight);
                        buf.setColor(Color.darkGray);
                        buf.drawRect(this.getWidth() / header.length * j,
                                ((rowHeight) * ((i + 1) + samplecount)) + 2
                                        - tablescroll.getVerticalScrollBar().getValue(),
                                this.getWidth() / header.length, rowHeight);
                        if (hoverNode != null && hoverNode.equals(aminoarray.get(i).getNode())) {
                            buf.setColor(Color.yellow);
                        } else {
                            buf.setColor(Color.white);
                        }
                        buf.drawString(aminoarray.get(i).getRow()[j], 10 + this.getWidth() / header.length * j,
                                (rowHeight * ((i + 1) + samplecount))
                                        - tablescroll.getVerticalScrollBar().getValue() + rowHeight);

                    }

                } catch (Exception e) {
                    e.printStackTrace();
                    ErrorLog.addError(e.getStackTrace());
                }
            }

        }
    }
    for (int i = 0; i < header.length; i++) {
        buf.setColor(Color.darkGray);
        buf.fillRect(i * this.getWidth() / header.length, 0, this.getWidth() / header.length + 1, rowHeight);
        buf.setColor(Color.white);
        buf.drawString(header[i], i * this.getWidth() / header.length + 4, rowHeight - 2);
        buf.setColor(Color.black);
        buf.drawLine(i * this.getWidth() / header.length, 0, i * this.getWidth() / header.length, rowHeight);
    }
    g.drawImage(bufImage, 0, tablescroll.getVerticalScrollBar().getValue(), null);

}

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

/**
 * Returns a XYPlot for Wakelock state/*  w w w . ja v a2 s .com*/
 * 
 * @return XYPlot.
 */
private static XYPlot createWakelockStatePlot() {

    // Create renderer
    XYBarRenderer wakelockStateRenderer = new XYBarRenderer();
    wakelockStateRenderer.setDrawBarOutline(false);
    wakelockStateRenderer.setUseYInterval(true);
    wakelockStateRenderer.setBasePaint(Color.yellow);
    wakelockStateRenderer.setAutoPopulateSeriesPaint(false);
    wakelockStateRenderer.setShadowVisible(false);
    wakelockStateRenderer.setGradientPaintTransformer(null);
    wakelockStateRenderer.setBarPainter(new StandardXYBarPainter());

    // Create result plot
    XYPlot wakelockStatePlot = new XYPlot(null, null, new NumberAxis(), wakelockStateRenderer);
    wakelockStatePlot.getRangeAxis().setVisible(false);
    return wakelockStatePlot;
}

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

private void jNameLabelMouseMoved(java.awt.event.MouseEvent evt) {
    jNameLabel.setBorder(javax.swing.BorderFactory.createLineBorder(Color.YELLOW));
    jNameLabel.paintImmediately(jNameLabel.getVisibleRect());

    //for (int i=0;i<1000;i++) {      
    //   System.out.println("times: "+i);
    // }/*w w  w .j a  va2  s. c om*/
    try {
        Thread.sleep(500);
    } catch (InterruptedException e) {
    }
    jNameLabel.setBorder(javax.swing.BorderFactory.createLineBorder(Color.BLACK));

}

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

private void jNameLabelMouseMoved(java.awt.event.MouseEvent evt) {
    jNameLabel.setBorder(javax.swing.BorderFactory.createLineBorder(Color.YELLOW));
    jNameLabel.paintImmediately(jNameLabel.getVisibleRect());

    // for (int i=0;i<1000;i++) {
    // System.out.println("times: "+i);
    // }//from  w ww . ja  va2 s.co  m
    try {
        Thread.sleep(500);
    } catch (InterruptedException e) {
    }
    jNameLabel.setBorder(javax.swing.BorderFactory.createLineBorder(Color.BLACK));

}