Example usage for java.awt Color darkGray

List of usage examples for java.awt Color darkGray

Introduction

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

Prototype

Color darkGray

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

Click Source Link

Document

The color dark gray.

Usage

From source file:com.t3.client.ui.T3Frame.java

public T3Frame(JMenuBar menuBar) {
    // Set up the frame
    super(AppConstants.APP_NAME);

    this.menuBar = menuBar;

    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    addWindowListener(this);
    setSize(WINDOW_WIDTH, WINDOW_HEIGHT);
    SwingUtil.centerOnScreen(this);
    setFocusTraversalPolicy(new T3FocusTraversalPolicy());

    try {/*  ww  w .  j  av a 2  s  .c  om*/
        setIconImage(ImageUtil.getImage(MINILOGO_IMAGE));
    } catch (IOException ioe) {
        String msg = I18N.getText("msg.error.loadingIconImage");
        log.error(msg, ioe);
        System.err.println(msg);
    }
    // Notify duration
    initializeNotifyDuration();

    // Components
    glassPane = new GlassPane();
    assetPanel = createAssetPanel();
    connectionPanel = createConnectionPanel();
    toolbox = new Toolbox();
    initiativePanel = createInitiativePanel();

    zoneRendererList = new CopyOnWriteArrayList<ZoneRenderer>();
    pointerOverlay = new PointerOverlay();
    colorPicker = new ColorPicker(this);
    textureChooserPanel = new TextureChooserPanel(colorPicker.getPaintChooser(), assetPanel.getModel(),
            "imageExplorerTextureChooser");
    colorPicker.getPaintChooser().addPaintChooser(textureChooserPanel);

    String credits = "";
    String version = "";
    Image logo = null;
    try {
        credits = new String(FileUtil.loadResource(CREDITS_HTML), "UTF-8"); // 2nd param of type Charset is Java6+
        version = TabletopTool.getVersion();
        credits = credits.replace("%VERSION%", version);
        logo = ImageUtil.getImage(T3_LOGO_IMAGE);
    } catch (Exception ioe) {
        log.error(I18N.getText("msg.error.credits"), ioe);
        ioe.printStackTrace();
    }
    aboutDialog = new AboutDialog(this, logo, credits);
    aboutDialog.setSize(354, 400);

    statusPanel = new StatusPanel();
    statusPanel.addPanel(getCoordinateStatusBar());
    statusPanel.addPanel(getZoomStatusBar());
    statusPanel.addPanel(MemoryStatusBar.getInstance());
    // statusPanel.addPanel(progressBar);
    statusPanel.addPanel(connectionStatusPanel);
    statusPanel.addPanel(activityMonitor);
    statusPanel.addPanel(new SpacerStatusBar(25));

    zoneRendererPanel = new JPanel(new PositionalLayout(5));
    zoneRendererPanel.setBackground(Color.black);
    //      zoneRendererPanel.add(zoneMiniMapPanel, PositionalLayout.Position.SE);
    //      zoneRendererPanel.add(getChatTypingLabel(), PositionalLayout.Position.NW);
    zoneRendererPanel.add(getChatTypingPanel(), PositionalLayout.Position.NW);
    zoneRendererPanel.add(getChatActionLabel(), PositionalLayout.Position.SW);

    commandPanel = new CommandPanel();
    TabletopTool.getMessageList().addObserver(commandPanel);

    rendererBorderPanel = new JPanel(new GridLayout());
    rendererBorderPanel.setBorder(BorderFactory.createLineBorder(Color.darkGray));
    rendererBorderPanel.add(zoneRendererPanel);

    // Put it all together
    setJMenuBar(menuBar);
    add(BorderLayout.NORTH, new ToolbarPanel(toolbox));
    add(BorderLayout.SOUTH, statusPanel);

    JLayeredPane glassPaneComposite = new JLayeredPane();
    glassPaneComposite.setLayout(new GridBagLayout());
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridx = 1;
    constraints.gridy = 1;
    constraints.fill = GridBagConstraints.BOTH;
    constraints.weightx = 1;
    constraints.weighty = 1;

    glassPaneComposite.add(glassPane, constraints);
    glassPaneComposite.add(dragImageGlassPane, constraints);

    setGlassPane(glassPane);
    //      setGlassPane(glassPaneComposite);

    glassPaneComposite.setVisible(true);

    if (!TabletopTool.MAC_OS_X)
        removeWindowsF10();
    else
        registerForMacOSXEvents();

    TabletopTool.getEventDispatcher().addListener(this, TabletopTool.ZoneEvent.Activated);

    restorePreferences();
    updateKeyStrokes();

    // This will cause the frame to be set to visible (BAD jide, BAD! No cookie for you!)
    configureDocking();

    new WindowPreferences(AppConstants.APP_NAME, "mainFrame", this);
    chatTyperObserver = new ChatTyperObserver();
    chatTyperTimers = new ChatNotificationTimers();
    chatTyperTimers.addObserver(chatTyperObserver);
    chatTimer = getChatTimer();
    setChatTypingLabelColor(AppPreferences.getChatNotificationColor());
}

From source file:base.BasePlayer.ClusterTable.java

void drawScreen(Graphics g) {
    try {/*w ww .j a  v  a 2s .c  om*/

        buf.setColor(Color.black);
        buf.fillRect(0, 0, this.getWidth(), tablescroll.getViewport().getHeight());
        genemutcount = 0;
        hoverVar = null;
        hoverSample = -1;
        headerHover = -1;
        geneHeaderHover = -1;

        if (!mouseDrag) {
            resizeColumn = -1;
        }
        if (Main.drawCanvas.clusterNodes != null) {
            firstrow = tablescroll.getVerticalScrollBar().getValue() / rowHeight - 1
                    - Main.drawCanvas.clusterNodes.size();

            if (firstrow < 0) {
                firstrow = 0;
            }
            for (int i = 0; i < Main.drawCanvas.clusterNodes.size(); i++) {
                dot = false;

                if ((i + 1 + samplecount + Main.drawCanvas.clusterNodes.size()) * rowHeight < tablescroll
                        .getVerticalScrollBar().getValue()) {
                    continue;
                }

                if (i * rowHeight > tablescroll.getVerticalScrollBar().getValue()
                        + tablescroll.getViewport().getHeight()) {
                    break;
                }

                if (mouseY >= (rowHeight * (i + genemutcount + 1))
                        && mouseY < (rowHeight * (i + genemutcount + 2))) {
                    hoverNode = Main.drawCanvas.clusterNodes.get(i);
                }
                try {
                    buf.setColor(Color.darkGray);
                    buf.drawLine(4,
                            (rowHeight * (i + genemutcount + 1)) - tablescroll.getVerticalScrollBar().getValue()
                                    + 3,
                            this.getWidth(), (rowHeight * (i + genemutcount + 1))
                                    - tablescroll.getVerticalScrollBar().getValue() + 3);

                    buf.setColor(linecolor);
                    cluster = Main.drawCanvas.clusterNodes.get(i);
                    if (cluster.varnodes.get(0).getTranscripts() != null) {
                        if (!chrom.equals(cluster.varnodes.get(0).getTranscripts().get(0).getChrom())) {
                            chrom = cluster.varnodes.get(0).getTranscripts().get(0).getChrom();
                        }
                    } else {
                        if (!chrom.equals(cluster.varnodes.get(0).getExons().get(0).transcript.getChrom())) {
                            chrom = cluster.varnodes.get(0).getExons().get(0).transcript.getChrom();
                        }
                    }

                    for (int c = 0; c < header.size(); c++) {

                        if (Main.drawCanvas.clusterNodes.get(i).equals(hoverNode)
                                || Main.drawCanvas.clusterNodes.get(i).equals(selectedNode)) {

                            buf.setColor(Color.yellow);
                        } else {
                            buf.setColor(Color.white);
                        }

                        if (c == 0) {

                            buf.drawString("" + cluster.ID, (int) header.get(c)[1] + 5,
                                    (rowHeight * (i + 1 + genemutcount))
                                            - tablescroll.getVerticalScrollBar().getValue() + rowHeight);
                        } else if (c == 1) {
                            buf.drawString("" + cluster.nodecount, (int) header.get(c)[1] + 5,
                                    (rowHeight * (i + 1 + genemutcount))
                                            - tablescroll.getVerticalScrollBar().getValue() + rowHeight);
                        } else if (c == 2) {
                            buf.drawString("" + cluster.width, (int) header.get(c)[1] + 5,
                                    (rowHeight * (i + 1 + genemutcount))
                                            - tablescroll.getVerticalScrollBar().getValue() + rowHeight);
                        } else if (c == 3) {
                            buf.drawString(
                                    chrom + ":"
                                            + MethodLibrary.formatNumber(cluster.varnodes.get(0).getPosition()),
                                    (int) header.get(c)[1] + 5, (rowHeight * (i + 1 + genemutcount))
                                            - tablescroll.getVerticalScrollBar().getValue() + rowHeight);
                        } else if (c == 4) {
                            buf.drawString(
                                    "" + MethodLibrary.round((cluster.nodecount / (double) cluster.width), 4),
                                    (int) header.get(c)[1] + 5, (rowHeight * (i + 1 + genemutcount))
                                            - tablescroll.getVerticalScrollBar().getValue() + rowHeight);
                        } else if (c == 5) {
                            if (cluster.varnodes.get(0).getExons() != null) {

                                if (cluster.varnodes.get(0).coding) {
                                    buf.setColor(Color.red);
                                    buf.drawString(
                                            cluster.varnodes.get(0).getExons().get(0).getTranscript()
                                                    .getGenename() + " (Coding)",
                                            (int) header.get(c)[1] + 5,
                                            (rowHeight * (i + 1 + genemutcount))
                                                    - tablescroll.getVerticalScrollBar().getValue()
                                                    + rowHeight);

                                } else {
                                    buf.setColor(Color.lightGray);
                                    buf.drawString(
                                            cluster.varnodes.get(0).getExons().get(0).getTranscript()
                                                    .getGenename() + " (UTR)",
                                            (int) header.get(c)[1] + 5,
                                            (rowHeight * (i + 1 + genemutcount))
                                                    - tablescroll.getVerticalScrollBar().getValue()
                                                    + rowHeight);

                                }
                            } else if (cluster.varnodes.get(0).isInGene()) {
                                buf.setColor(Color.lightGray);
                                buf.drawString(
                                        cluster.varnodes.get(0).getTranscripts().get(0).getGenename()
                                                + " (Intronic)",
                                        (int) header.get(c)[1] + 5, (rowHeight * (i + 1 + genemutcount))
                                                - tablescroll.getVerticalScrollBar().getValue() + rowHeight);

                            } else {
                                buf.setColor(Color.gray);
                                if (!cluster.varnodes.get(0).getTranscripts().get(0)
                                        .equals(cluster.varnodes.get(0).getTranscripts().get(1))) {
                                    buf.drawString(
                                            cluster.varnodes.get(0).getTranscripts().get(0).getGenename()
                                                    + " ... "
                                                    + cluster.varnodes
                                                            .get(0).getTranscripts().get(1).getGenename(),
                                            (int) header.get(c)[1] + 5,
                                            (rowHeight * (i + 1 + genemutcount))
                                                    - tablescroll.getVerticalScrollBar().getValue()
                                                    + rowHeight);

                                } else {
                                    if (cluster.varnodes.get(0).getTranscripts().get(0)
                                            .getEnd() > cluster.varnodes.get(0).getPosition()) {
                                        buf.drawString(
                                                " ... " + cluster.varnodes
                                                        .get(0).getTranscripts().get(0).getGenename(),
                                                (int) header.get(c)[1] + 5,
                                                (rowHeight * (i + 1 + genemutcount))
                                                        - tablescroll.getVerticalScrollBar().getValue()
                                                        + rowHeight);
                                    } else {
                                        buf.drawString(
                                                cluster.varnodes.get(0).getTranscripts().get(0).getGenename()
                                                        + " ... ",
                                                (int) header.get(c)[1] + 5,
                                                (rowHeight * (i + 1 + genemutcount))
                                                        - tablescroll.getVerticalScrollBar().getValue()
                                                        + rowHeight);

                                    }
                                }
                            }
                        } else if (c == 6) {

                            if (cluster.varnodes.get(0).getBedHits() != null) {
                                bedarray = MethodLibrary.makeTrackArray(cluster.varnodes.get(0), null);
                                for (int b = 0; b < bedarray.length; b++) {
                                    buf.setColor(Color.black);
                                    if (b == bedarray.length - 1) {
                                        buf.fillRect((int) header.get(c + b)[1] + 1,
                                                (rowHeight * (i + genemutcount + 1))
                                                        - tablescroll.getVerticalScrollBar().getValue() + 4,
                                                this.getWidth() - (int) header.get(c + b)[1], rowHeight - 1);
                                    } else {
                                        buf.fillRect((int) header.get(c + b)[1] + 1,
                                                (rowHeight * (i + genemutcount + 1))
                                                        - tablescroll.getVerticalScrollBar().getValue() + 4,
                                                (int) header.get(c + b)[2], rowHeight - 1);

                                    }
                                    buf.setColor(Color.white);
                                    if (bedarray[b] != null) {
                                        buf.drawString(bedarray[b].toString(), (int) header.get(c + b)[1] + 5,
                                                (rowHeight * (i + 1 + genemutcount))
                                                        - tablescroll.getVerticalScrollBar().getValue()
                                                        + rowHeight);

                                    }
                                }
                            }
                        }
                        if (c < header.size() - 1 - Main.bedCanvas.bedTrack.size()) {
                            buf.setColor(Color.black);
                            buf.fillRect((int) header.get(c + 1)[1] + 1,
                                    (rowHeight * (i + genemutcount + 1))
                                            - tablescroll.getVerticalScrollBar().getValue() + 4,
                                    (int) header.get(c + 1)[2], rowHeight - 1);

                        }
                    }
                    buf.setColor(Color.darkGray);
                    buf.drawLine(3, rowHeight + 3, 3, (rowHeight * (i + genemutcount + 2))
                            - tablescroll.getVerticalScrollBar().getValue() + 3);

                    for (int r = 0; r < header.size(); r++) {
                        buf.drawLine((int) header.get(r)[1],
                                (rowHeight * (i + genemutcount + 1))
                                        - tablescroll.getVerticalScrollBar().getValue() + 4,
                                (int) header.get(r)[1], (rowHeight * (i + genemutcount + 2))
                                        - tablescroll.getVerticalScrollBar().getValue() + 3);
                    }
                    if (selectedNode != null && selectedNode.equals(cluster)) {

                        hoverSample = -1;
                        genemutcount = aminoarray.size() + 1;
                        listAdd = 1;
                        buf.drawLine(20,
                                (rowHeight * (i + listAdd + 2)) - tablescroll.getVerticalScrollBar().getValue()
                                        + 3,
                                this.getWidth(), (rowHeight * (i + listAdd + 2))
                                        - tablescroll.getVerticalScrollBar().getValue() + 3);
                        drawGeneheader((rowHeight * (i + listAdd + 1))
                                - tablescroll.getVerticalScrollBar().getValue() + 3);

                        for (int s = 0; s < aminoarray.size(); s++) {

                            buf.setColor(Color.darkGray);
                            buf.drawLine(21,
                                    (rowHeight * (i + s + listAdd + 3))
                                            - tablescroll.getVerticalScrollBar().getValue() + 3,
                                    this.getWidth(), (rowHeight * (i + s + listAdd + 3))
                                            - tablescroll.getVerticalScrollBar().getValue() + 3);

                            if (mouseY >= (rowHeight * (i + s + listAdd + 2))
                                    && mouseY < (rowHeight * (i + s + listAdd + 3))) {
                                hoverNode = null;
                                hoverVar = aminoarray.get(s).getNode();
                                hoverString = aminoarray.get(s).getRow();
                                buf.setColor(Color.white);

                                for (int v = 0; v < aminoarray.get(s).getNode().vars.size(); v++) {
                                    if (aminoarray.get(s).getNode().vars.get(v).getKey()
                                            .equals(aminoarray.get(s).getRow()[5])) {
                                        hoverSample = aminoarray.get(s).getNode().vars.get(v).getValue().get(0)
                                                .getSample().getIndex();
                                        break;
                                    }
                                }
                            } else {
                                if (MethodLibrary.aminoEffect(aminoarray.get(s).getRow()[3])
                                        .equals("nonsense")) {
                                    buf.setColor(Color.red);
                                } else if (MethodLibrary.aminoEffect(aminoarray.get(s).getRow()[3])
                                        .equals("missense")) {
                                    buf.setColor(Color.yellow);
                                } else if (MethodLibrary.aminoEffect(aminoarray.get(s).getRow()[3])
                                        .equals("synonymous")) {
                                    buf.setColor(Color.green);
                                } else if (MethodLibrary.aminoEffect(aminoarray.get(s).getRow()[3])
                                        .equals("UTR")) {
                                    buf.setColor(Color.lightGray);
                                } else {
                                    buf.setColor(Color.gray);
                                }
                            }
                            if (!aminoarray.get(s).getRow()[1].equals("1")) {

                                buf.drawString("Multiple", 24, (rowHeight * (i + s + listAdd + 2))
                                        - tablescroll.getVerticalScrollBar().getValue() + rowHeight);
                            } else {
                                for (int v = 0; v < aminoarray.get(s).getNode().vars.size(); v++) {

                                    if (aminoarray.get(s).getNode().vars.get(v).getKey()
                                            .equals(aminoarray.get(s).getRow()[5])) {

                                        buf.drawString(
                                                aminoarray.get(s).getNode().vars.get(v).getValue().get(0)
                                                        .getSample().getName(),
                                                24,
                                                (rowHeight * (i + s + listAdd + 2))
                                                        - tablescroll.getVerticalScrollBar().getValue()
                                                        + rowHeight);
                                        break;
                                    }
                                }

                            }

                            if (hoverVar != null && hoverString.equals(aminoarray.get(s).getRow())) {
                                //TODO
                                textcolor = Color.white;

                            } else {
                                if (MethodLibrary.aminoEffect(aminoarray.get(s).getRow()[3])
                                        .equals("nonsense")) {
                                    textcolor = Color.red;
                                } else if (MethodLibrary.aminoEffect(aminoarray.get(s).getRow()[3])
                                        .equals("missense")) {
                                    textcolor = Color.yellow;
                                } else if (MethodLibrary.aminoEffect(aminoarray.get(s).getRow()[3])
                                        .equals("synonymous")) {
                                    textcolor = Color.green;
                                } else if (aminoarray.get(s).getRow()[3].contains("UTR")) {
                                    textcolor = Color.lightGray;
                                } else {
                                    textcolor = Color.gray;
                                }
                            }
                            for (int h = 1; h < 4; h++) {
                                buf.setColor(Color.black);
                                buf.fillRect((int) geneheader.get(h)[1] + 10,
                                        (rowHeight * (i + s + listAdd + 2))
                                                - tablescroll.getVerticalScrollBar().getValue() + 4,
                                        (int) geneheader.get(h)[2], rowHeight - 1);
                                buf.setColor(textcolor);
                                buf.drawString(aminoarray.get(s).getRow()[h], (int) geneheader.get(h)[1] + 14,
                                        (rowHeight * (i + s + listAdd + 2))
                                                - tablescroll.getVerticalScrollBar().getValue() + rowHeight);

                            }

                            if (aminoarray.get(s).getRow()[1].equals("1")) {
                                buf.setColor(Color.black);
                                buf.fillRect((int) geneheader.get(4)[1] + 10,
                                        (rowHeight * (i + s + listAdd + 2))
                                                - tablescroll.getVerticalScrollBar().getValue() + 4,
                                        this.getWidth(), rowHeight - 1);
                                buf.setColor(textcolor);

                                for (int v = 0; v < aminoarray.get(s).getNode().vars.size(); v++) {
                                    if (aminoarray.get(s).getNode().vars.get(v).getKey()
                                            .equals(aminoarray.get(s).getRow()[5])) {
                                        if (aminoarray.get(s).getNode().vars.get(v).getValue().get(0)
                                                .isHomozygous()) {
                                            buf.drawString(
                                                    "Hom (" + aminoarray.get(s).getNode().vars.get(v).getValue()
                                                            .get(0).getCalls() + "/"
                                                            + aminoarray.get(s).getNode().vars.get(v).getValue()
                                                                    .get(0).getCoverage()
                                                            + ")",
                                                    (int) geneheader.get(4)[1] + 14,
                                                    (rowHeight * (i + s + listAdd + 2))
                                                            - tablescroll.getVerticalScrollBar().getValue()
                                                            + rowHeight);
                                            if (Control.controlData.controlsOn) {
                                                cases = 2;
                                                casefreq = 2 / (double) (Main.varsamples * 2);
                                            }
                                        } else {
                                            buf.drawString(
                                                    "Het (" + aminoarray.get(s).getNode().vars.get(v).getValue()
                                                            .get(0).getCalls() + "/"
                                                            + aminoarray.get(s).getNode().vars.get(v).getValue()
                                                                    .get(0).getCoverage()
                                                            + ")",
                                                    (int) geneheader.get(4)[1] + 14,
                                                    (rowHeight * (i + s + listAdd + 2))
                                                            - tablescroll.getVerticalScrollBar().getValue()
                                                            + rowHeight);
                                            if (Control.controlData.controlsOn) {
                                                cases = 1;
                                                casefreq = 1 / (double) (Main.varsamples * 2);
                                            }

                                        }
                                        buf.setColor(Color.black);
                                        buf.fillRect((int) geneheader.get(5)[1] + 1,
                                                (rowHeight * (i + s + listAdd + 2))
                                                        - tablescroll.getVerticalScrollBar().getValue() + 4,
                                                this.getWidth(), rowHeight - 1);
                                        buf.setColor(textcolor);
                                        buf.drawString(
                                                "" + aminoarray.get(s).getNode().vars
                                                        .get(v).getValue().get(0).getQuality(),
                                                (int) geneheader.get(5)[1] + 14,
                                                (rowHeight * (i + s + listAdd + 2))
                                                        - tablescroll.getVerticalScrollBar().getValue()
                                                        + rowHeight);

                                    }
                                }
                            }

                            if (Control.controlData.controlsOn) {
                                cases = 0;
                                for (int v = 0; v < aminoarray.get(s).getNode().vars.size(); v++) {
                                    if (aminoarray.get(s).getNode().vars.get(v).getKey()
                                            .equals(aminoarray.get(s).getRow()[5])) {
                                        if (aminoarray.get(s).getNode().vars.get(v).getValue().get(0)
                                                .isHomozygous()) {
                                            cases += Integer.parseInt(aminoarray.get(s).getRow()[1]) * 2;
                                        } else {
                                            cases += Integer.parseInt(aminoarray.get(s).getRow()[1]);
                                        }
                                    }
                                }
                                casefreq = cases / (double) (Main.varsamples * 2);
                            }

                            buf.setColor(textcolor);
                            buf.drawString(aminoarray.get(s).getRow()[4], (int) geneheader.get(6)[1] + 14,
                                    (rowHeight * (i + s + listAdd + 2))
                                            - tablescroll.getVerticalScrollBar().getValue() + rowHeight);

                            if (Control.controlData.controlsOn) {
                                buf.setColor(textcolor);

                                for (int v = 0; v < aminoarray.get(s).getNode().vars.size(); v++) {
                                    if (aminoarray.get(s).getNode().vars.get(v).getKey()
                                            .equals(aminoarray.get(s).getRow()[5])) {
                                        vararray = aminoarray.get(s).getNode().vars.get(v).getValue();
                                        controlarray = new SampleNode[Control.controlData.fileArray.size()];
                                        if (vararray.get(vararray.size() - 1).alleles != null) {

                                            for (int e = vararray.size() - 1; e > 0; e--) {

                                                if (vararray.get(e).alleles == null) {
                                                    break;
                                                }
                                                controlarray[vararray.get(e).getControlSample()
                                                        .getIndex()] = vararray.get(e);

                                            }
                                        }
                                        for (int e = 0; e < controlarray.length; e++) {
                                            if (Control.controlData.fileArray.get(e).controlOn) {
                                                if (controlarray[e] == null) {
                                                    buf.setColor(Color.black);
                                                    buf.fillRect(
                                                            (int) geneheader
                                                                    .get(this.geneheaderlength + e * 2)[1] + 11,
                                                            (rowHeight * (i + s + listAdd + 2)) - tablescroll
                                                                    .getVerticalScrollBar().getValue() + 4,
                                                            this.getWidth(), rowHeight - 1);
                                                    buf.setColor(textcolor);
                                                    buf.drawString("0",
                                                            (int) geneheader
                                                                    .get(this.geneheaderlength + e * 2)[1] + 14,
                                                            (rowHeight * (i + s + listAdd + 2)) - tablescroll
                                                                    .getVerticalScrollBar().getValue()
                                                                    + rowHeight);
                                                    buf.setColor(Color.black);
                                                    buf.fillRect(
                                                            (int) geneheader
                                                                    .get(this.geneheaderlength + e * 2 + 1)[1]
                                                                    + 11,
                                                            (rowHeight * (i + s + listAdd + 2)) - tablescroll
                                                                    .getVerticalScrollBar().getValue() + 4,
                                                            this.getWidth(), rowHeight - 1);
                                                    buf.setColor(textcolor);
                                                    buf.drawString("-",
                                                            (int) geneheader
                                                                    .get(this.geneheaderlength + e * 2 + 1)[1]
                                                                    + 14,
                                                            (rowHeight * (i + s + listAdd + 2)) - tablescroll
                                                                    .getVerticalScrollBar().getValue()
                                                                    + rowHeight);

                                                } else {
                                                    buf.setColor(Color.black);
                                                    buf.fillRect(
                                                            (int) geneheader
                                                                    .get(this.geneheaderlength + e * 2)[1] + 11,
                                                            (rowHeight * (i + s + listAdd + 2)) - tablescroll
                                                                    .getVerticalScrollBar().getValue() + 4,
                                                            this.getWidth(), rowHeight - 1);
                                                    buf.setColor(textcolor);
                                                    buf.drawString(
                                                            "" + MethodLibrary.round(controlarray[e].alleles
                                                                    / (double) controlarray[e].allelenumber, 2),
                                                            (int) geneheader
                                                                    .get(this.geneheaderlength + e * 2)[1] + 14,
                                                            (rowHeight * (i + s + listAdd + 2)) - tablescroll
                                                                    .getVerticalScrollBar().getValue()
                                                                    + rowHeight);
                                                    buf.setColor(Color.black);
                                                    buf.fillRect(
                                                            (int) geneheader
                                                                    .get(this.geneheaderlength + e * 2 + 1)[1]
                                                                    + 11,
                                                            (rowHeight * (i + s + listAdd + 2)) - tablescroll
                                                                    .getVerticalScrollBar().getValue() + 4,
                                                            this.getWidth(), rowHeight - 1);
                                                    buf.setColor(textcolor);
                                                    buf.drawString("" + MethodLibrary
                                                            .round(casefreq / (controlarray[e].alleles
                                                                    / (double) controlarray[e].allelenumber), 2)
                                                            + " (p="
                                                            + MethodLibrary.round(
                                                                    VariantHandler.table.fe.getRightTailedP(
                                                                            cases, Main.varsamples * 2 - cases,
                                                                            controlarray[e].alleles,
                                                                            controlarray[e].allelenumber
                                                                                    - controlarray[e].alleles),
                                                                    2)
                                                            + ")",
                                                            (int) geneheader
                                                                    .get(this.geneheaderlength + e * 2 + 1)[1]
                                                                    + 14,
                                                            (rowHeight * (i + s + listAdd + 2)) - tablescroll
                                                                    .getVerticalScrollBar().getValue()
                                                                    + rowHeight);
                                                }
                                            } else {
                                                buf.setColor(Color.black);
                                                buf.fillRect(
                                                        (int) geneheader.get(this.geneheaderlength + e * 2)[1]
                                                                + 11,
                                                        (rowHeight * (i + s + listAdd + 2))
                                                                - tablescroll.getVerticalScrollBar().getValue()
                                                                + 4,
                                                        this.getWidth(), rowHeight - 1);
                                                buf.setColor(Color.darkGray);
                                                buf.drawString("Apply controls",
                                                        (int) geneheader.get(this.geneheaderlength + e * 2)[1]
                                                                + 14,
                                                        (rowHeight * (i + s + listAdd + 2))
                                                                - tablescroll.getVerticalScrollBar().getValue()
                                                                + rowHeight);
                                                buf.setColor(Color.black);
                                                buf.fillRect(
                                                        (int) geneheader
                                                                .get(this.geneheaderlength + e * 2 + 1)[1] + 11,
                                                        (rowHeight * (i + s + listAdd + 2))
                                                                - tablescroll.getVerticalScrollBar().getValue()
                                                                + 4,
                                                        this.getWidth(), rowHeight - 1);
                                                buf.setColor(Color.darkGray);
                                                buf.drawString("-",
                                                        (int) geneheader
                                                                .get(this.geneheaderlength + e * 2 + 1)[1] + 14,
                                                        (rowHeight * (i + s + listAdd + 2))
                                                                - tablescroll.getVerticalScrollBar().getValue()
                                                                + rowHeight);

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

                                for (int e = geneheaderlength; e < geneheader.size(); e++) {
                                    if (geneheader.get(e)[0] instanceof ControlFile) {
                                        buf.drawString("Apply controls", (int) geneheader.get(e)[1] + 14,
                                                (rowHeight * (i + s + listAdd + 2))
                                                        - tablescroll.getVerticalScrollBar().getValue()
                                                        + rowHeight);
                                    }
                                }
                                buf.setColor(Color.lightGray);
                            }
                            vararray = null;
                            if (Main.bedCanvas.bedOn) {
                                for (int a = 0; a < aminoarray.size(); a++) {
                                    bedarray = MethodLibrary.makeTrackArray(aminoarray.get(a).getNode(),
                                            aminoarray.get(a).getRow()[5]);
                                    if (bedarray != null) {
                                        for (int b = 0; b < bedarray.length; b++) {
                                            buf.setColor(Color.black);
                                            if (b == bedarray.length - 1) {
                                                buf.fillRect(
                                                        (int) geneheader.get(geneheaderlength
                                                                + Control.controlData.fileArray.size() * 2
                                                                + b)[1] + 12,
                                                        (rowHeight * (i + a + listAdd + 2))
                                                                - tablescroll.getVerticalScrollBar().getValue()
                                                                + 4,
                                                        this.getWidth() - (int) geneheader.get(geneheaderlength
                                                                + Control.controlData.fileArray.size() * 2
                                                                + b)[1],
                                                        rowHeight - 1);
                                            } else {
                                                buf.fillRect(
                                                        (int) geneheader.get(geneheaderlength
                                                                + Control.controlData.fileArray.size() * 2
                                                                + b)[1] + 12,
                                                        (rowHeight * (i + a + listAdd + 2))
                                                                - tablescroll.getVerticalScrollBar().getValue()
                                                                + 4,
                                                        (int) geneheader.get(geneheaderlength
                                                                + Control.controlData.fileArray.size() * 2
                                                                + b)[2],
                                                        rowHeight - 1);
                                            }
                                            buf.setColor(Color.white);
                                            if (bedarray[b] != null) {
                                                buf.drawString(bedarray[b].toString(),
                                                        (int) geneheader.get(geneheaderlength
                                                                + Control.controlData.fileArray.size() * 2
                                                                + b)[1] + 14,
                                                        (rowHeight * (i + a + listAdd + 2))
                                                                - tablescroll.getVerticalScrollBar().getValue()
                                                                + rowHeight);

                                            }
                                        }
                                    }
                                }
                            }
                            buf.setColor(Color.darkGray);
                            for (int j = 0; j < geneheader.size(); j++) {

                                buf.drawLine((int) geneheader.get(j)[1] + 11,
                                        (rowHeight * (i + s + listAdd + 2))
                                                - tablescroll.getVerticalScrollBar().getValue() + 4,
                                        (int) geneheader.get(j)[1] + 11, (rowHeight * (i + s + listAdd + 3))
                                                - tablescroll.getVerticalScrollBar().getValue() + 3);
                            }
                            if (selectedVar != null && selectedString.equals(aminoarray.get(s).getRow())
                                    && Integer.parseInt(selectedString[1]) > 1) {
                                //hoverSample = -1;
                                pointer = 0;
                                //TODO

                                for (int v = 0; v < aminoarray.get(s).getNode().vars.size(); v++) {
                                    if (aminoarray.get(s).getNode().vars.get(v).getKey()
                                            .equals(selectedString[5])) {

                                        for (int l = 0; l < aminoarray.get(s).getNode().vars.get(v).getValue()
                                                .size(); l++) {
                                            if (aminoarray.get(s).getNode().vars.get(v).getValue()
                                                    .get(l).alleles != null) {
                                                break;
                                            }
                                            if (mouseY > (rowHeight * (i + s + pointer + 4))
                                                    && mouseY < (rowHeight * (i + s + pointer + 5))) {
                                                textcolor = Color.white;

                                                hoverVar = aminoarray.get(s).getNode();
                                                hoverString = aminoarray.get(s).getRow();
                                                hoverSample = aminoarray.get(s).getNode().vars.get(v).getValue()
                                                        .get(l).getSample().getIndex();
                                            } else {
                                                textcolor = Color.lightGray;
                                            }

                                            //   if(aminoarray.get(s).getNode().getSamples().get(l).getVariation().equals(selectedString[5])) {                           
                                            buf.setColor(textcolor);
                                            buf.drawString(
                                                    aminoarray.get(s).getNode().vars.get(v).getValue().get(l)
                                                            .getSample().getName(),
                                                    30,
                                                    (rowHeight * (i + s + pointer + 4))
                                                            - tablescroll.getVerticalScrollBar().getValue()
                                                            + rowHeight);
                                            pointer++;
                                            //   }   

                                            buf.setColor(Color.black);
                                            buf.fillRect((int) geneheader.get(4)[1] + 10,
                                                    (rowHeight * (i + s + pointer + 3))
                                                            - tablescroll.getVerticalScrollBar().getValue() + 4,
                                                    this.getWidth(), rowHeight - 1);
                                            buf.setColor(textcolor);
                                            if (aminoarray.get(s).getNode().vars.get(v).getValue().get(l)
                                                    .isHomozygous()) {
                                                buf.drawString(
                                                        "Hom (" + aminoarray.get(s).getNode().vars.get(v)
                                                                .getValue().get(l).getCalls() + "/"
                                                                + aminoarray.get(s).getNode().vars.get(v)
                                                                        .getValue().get(l).getCoverage()
                                                                + ")",
                                                        (int) geneheader.get(4)[1] + 14,
                                                        (rowHeight * (i + s + pointer + 3))
                                                                - tablescroll.getVerticalScrollBar().getValue()
                                                                + rowHeight);

                                            } else {
                                                buf.drawString(
                                                        "Het (" + aminoarray.get(s).getNode().vars.get(v)
                                                                .getValue().get(l).getCalls() + "/"
                                                                + aminoarray.get(s).getNode().vars.get(v)
                                                                        .getValue().get(l).getCoverage()
                                                                + ")",
                                                        (int) geneheader.get(4)[1] + 14,
                                                        (rowHeight * (i + s + pointer + 3))
                                                                - tablescroll.getVerticalScrollBar().getValue()
                                                                + rowHeight);
                                            }

                                            buf.setColor(Color.black);
                                            buf.fillRect((int) geneheader.get(5)[1] + 10,
                                                    (rowHeight * (i + s + pointer + 3))
                                                            - tablescroll.getVerticalScrollBar().getValue() + 4,
                                                    this.getWidth(), rowHeight - 1);
                                            buf.setColor(textcolor);
                                            buf.drawString(
                                                    "" + aminoarray.get(s).getNode().vars.get(v).getValue()
                                                            .get(l).getQuality(),
                                                    (int) geneheader.get(5)[1] + 14,
                                                    (rowHeight * (i + s + pointer + 3))
                                                            - tablescroll.getVerticalScrollBar().getValue()
                                                            + rowHeight);
                                            buf.setColor(Color.darkGray);
                                            for (int j = 4; j < 7; j++) {

                                                buf.drawLine((int) geneheader.get(j)[1] + 11,
                                                        (rowHeight * (i + s + pointer + 3))
                                                                - tablescroll.getVerticalScrollBar().getValue(),
                                                        (int) geneheader.get(j)[1] + 11,
                                                        (rowHeight * (i + s + pointer + 3))
                                                                - tablescroll.getVerticalScrollBar().getValue()
                                                                + rowHeight + 2);
                                            }

                                        }
                                    }
                                }
                                listAdd = Integer.parseInt(selectedString[1]) + 1;
                                genemutcount = aminoarray.size() + listAdd;
                                buf.setColor(Color.darkGray);
                                buf.drawLine(21,
                                        (rowHeight * (i + s + listAdd + 3))
                                                - tablescroll.getVerticalScrollBar().getValue() + 3,
                                        this.getWidth(), (rowHeight * (i + s + listAdd + 3))
                                                - tablescroll.getVerticalScrollBar().getValue() + 3);

                            }

                        }
                    }

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

            }
            buf.setColor(Color.darkGray);
            buf.drawLine(4,
                    (rowHeight * (Main.drawCanvas.clusterNodes.size() + genemutcount + 1))
                            - tablescroll.getVerticalScrollBar().getValue() + 3,
                    this.getWidth(), (rowHeight * (Main.drawCanvas.clusterNodes.size() + genemutcount + 1))
                            - tablescroll.getVerticalScrollBar().getValue() + 3);

        }
        drawHeader();

        if (headerHover == -1 && geneHeaderHover == -1) {

            setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
        } else {
            if (resizeColumn == -1) {
                setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            } else {
                setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));
            }
        }

        g.drawImage(bufImage, 0, tablescroll.getVerticalScrollBar().getValue(), null);

    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:nu.nethome.tools.protocol_analyzer.RawMessageDistributionWindow.java

private void configurePanelLooks(JFreeChart chart, int selectionSeries) {
    TextTitle title = chart.getTitle(); // fix title
    Font titleFont = title.getFont();
    titleFont = titleFont.deriveFont(Font.PLAIN, (float) 14.0);
    title.setFont(titleFont);//w w w  .  j  av a 2s .c  om
    title.setPaint(Color.darkGray);
    XYPlot plot = chart.getXYPlot();
    plot.setBackgroundPaint(Color.WHITE);
    plot.setDomainGridlinePaint(Color.lightGray);
    plot.setRangeGridlinePaint(Color.lightGray);
    XYLineAndShapeRenderer signalRenderer = (XYLineAndShapeRenderer) chart.getXYPlot().getRenderer();
    signalRenderer.setSeriesStroke(selectionSeries, new BasicStroke(5f));
}

From source file:org.openscience.cdk.applications.taverna.basicutilities.ChartTool.java

/**
 * Creates a XY bar chart.//  ww w  .j  a va  2s  .co m
 * 
 * @param title
 * @param categoryAxisLabel
 * @param valueAxisLabel
 * @param dataset
 * @param includeZero
 * @param shadow
 * @return
 */
public JFreeChart createXYBarChart(String title, String categoryAxisLabel, String valueAxisLabel,
        IntervalXYDataset dataset, boolean includeZero, boolean shadow) {
    JFreeChart chart = ChartFactory.createXYBarChart(title, categoryAxisLabel, false, valueAxisLabel, dataset,
            this.orientation, this.drawLegend, false, false);
    // set the background color for the chart...
    chart.setBackgroundPaint(Color.white);
    chart.setAntiAlias(true);
    XYPlot plot = chart.getXYPlot();
    ValueAxis domainAxis = plot.getDomainAxis();
    domainAxis.setLowerMargin(0.025);
    domainAxis.setUpperMargin(0.025);
    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setAutoRangeIncludesZero(includeZero);
    XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    renderer.setShadowVisible(shadow);
    renderer.setSeriesPaint(0, Color.blue);
    renderer.setSeriesPaint(1, Color.red);
    renderer.setSeriesPaint(2, Color.green);
    renderer.setSeriesPaint(3, Color.darkGray);
    renderer.setSeriesPaint(4, Color.yellow);
    return chart;
}

From source file:net.rptools.maptool.client.ui.MapToolFrame.java

public MapToolFrame(JMenuBar menuBar) {
    // Set up the frame
    super(AppConstants.APP_NAME);

    this.menuBar = menuBar;

    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    addWindowListener(this);
    setSize(WINDOW_WIDTH, WINDOW_HEIGHT);
    SwingUtil.centerOnScreen(this);
    setFocusTraversalPolicy(new MapToolFocusTraversalPolicy());

    try {// ww w.  j  a v  a2  s  . c  o m
        setIconImage(ImageUtil.getImage(MINILOGO_IMAGE));
    } catch (IOException ioe) {
        String msg = I18N.getText("msg.error.loadingIconImage");
        log.error(msg, ioe);
        System.err.println(msg);
    }
    // Notify duration
    initializeNotifyDuration();

    // Components
    glassPane = new GlassPane();
    assetPanel = createAssetPanel();
    connectionPanel = createConnectionPanel();
    toolbox = new Toolbox();
    initiativePanel = createInitiativePanel();

    zoneRendererList = new CopyOnWriteArrayList<ZoneRenderer>();
    pointerOverlay = new PointerOverlay();
    colorPicker = new ColorPicker(this);
    textureChooserPanel = new TextureChooserPanel(colorPicker.getPaintChooser(), assetPanel.getModel(),
            "imageExplorerTextureChooser");
    colorPicker.getPaintChooser().addPaintChooser(textureChooserPanel);

    String credits = "";
    String version = "";
    Image logo = null;
    try {
        credits = new String(FileUtil.loadResource(CREDITS_HTML), "UTF-8"); // 2nd param of type Charset is Java6+
        version = MapTool.getVersion();
        credits = credits.replace("%VERSION%", version);
        logo = ImageUtil.getImage(MAPTOOL_LOGO_IMAGE);
    } catch (Exception ioe) {
        log.error(I18N.getText("msg.error.credits"), ioe);
        ioe.printStackTrace();
    }
    aboutDialog = new AboutDialog(this, logo, credits);
    aboutDialog.setSize(354, 400);

    statusPanel = new StatusPanel();
    statusPanel.addPanel(getCoordinateStatusBar());
    statusPanel.addPanel(getZoomStatusBar());
    statusPanel.addPanel(MemoryStatusBar.getInstance());
    // statusPanel.addPanel(progressBar);
    statusPanel.addPanel(connectionStatusPanel);
    statusPanel.addPanel(activityMonitor);
    statusPanel.addPanel(new SpacerStatusBar(25));

    zoneMiniMapPanel = new ZoneMiniMapPanel();
    zoneMiniMapPanel.setSize(100, 100);

    zoneRendererPanel = new JPanel(new PositionalLayout(5));
    zoneRendererPanel.setBackground(Color.black);
    //      zoneRendererPanel.add(zoneMiniMapPanel, PositionalLayout.Position.SE);
    //      zoneRendererPanel.add(getChatTypingLabel(), PositionalLayout.Position.NW);
    zoneRendererPanel.add(getChatTypingPanel(), PositionalLayout.Position.NW);
    zoneRendererPanel.add(getChatActionLabel(), PositionalLayout.Position.SW);

    commandPanel = new CommandPanel();
    MapTool.getMessageList().addObserver(commandPanel);

    rendererBorderPanel = new JPanel(new GridLayout());
    rendererBorderPanel.setBorder(BorderFactory.createLineBorder(Color.darkGray));
    rendererBorderPanel.add(zoneRendererPanel);

    // Put it all together
    setJMenuBar(menuBar);
    add(BorderLayout.NORTH, new ToolbarPanel(toolbox));
    add(BorderLayout.SOUTH, statusPanel);

    JLayeredPane glassPaneComposite = new JLayeredPane();
    glassPaneComposite.setLayout(new GridBagLayout());
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridx = 1;
    constraints.gridy = 1;
    constraints.fill = GridBagConstraints.BOTH;
    constraints.weightx = 1;
    constraints.weighty = 1;

    glassPaneComposite.add(glassPane, constraints);
    glassPaneComposite.add(dragImageGlassPane, constraints);

    setGlassPane(glassPane);
    //      setGlassPane(glassPaneComposite);

    glassPaneComposite.setVisible(true);

    if (!MapTool.MAC_OS_X)
        removeWindowsF10();
    else
        registerForMacOSXEvents();

    MapTool.getEventDispatcher().addListener(this, MapTool.ZoneEvent.Activated);

    restorePreferences();
    updateKeyStrokes();

    // This will cause the frame to be set to visible (BAD jide, BAD! No cookie for you!)
    configureDocking();

    new WindowPreferences(AppConstants.APP_NAME, "mainFrame", this);
    chatTyperObserver = new ChatTyperObserver();
    chatTyperTimers = new ChatNotificationTimers();
    chatTyperTimers.addObserver(chatTyperObserver);
    chatTimer = getChatTimer();
    setChatTypingLabelColor(AppPreferences.getChatNotificationColor());
}

From source file:ecg.ecgshow.ECGShowUI.java

private void createGuardData() {
    GuardDataPanel = new JPanel();
    GuardDataPanel.setBackground(new Color(0, 150, 255));
    //        GuardDataPanel.setBounds();
    //        BoxLayout layout=new BoxLayout(GuardDataPanel,BoxLayout.Y_AXIS);
    //        GuardDataPanel.setLayout(layout);
    GroupLayout layout = new GroupLayout(GuardDataPanel);
    GuardDataPanel.setLayout(layout);//from   ww  w  .ja v  a  2  s  .c o m
    JPanel temperatureData = new JPanel();
    temperatureData.setLayout(new FlowLayout());
    //        temperatureData.setLayout(null);
    //        temperatureData.setBounds(0,0,(int) (WIDTH * 0.14), (int) (HEIGHT * 0.15));
    temperatureData.setSize((int) (WIDTH * 0.16), (int) (HEIGHT * 0.11));
    temperatureData.setBackground(new Color(0, 150, 255));
    temperatureLabel = new JLabel("--.- ");
    temperatureLabel.setFont(loadFont("LED.tff", (float) (HEIGHT * 0.070)));
    temperatureLabel.setBackground(new Color(0, 150, 255));
    temperatureLabel.setForeground(Color.RED);
    //        temperatureLabel.setBounds(0,0,200,100);
    temperatureLabel.setOpaque(true);
    JLabel temperatureLabelName = new JLabel(" ");
    temperatureLabelName.setFont(new Font("SansSerif", 0, (int) (HEIGHT * 0.020)));
    temperatureLabelName.setBackground(new Color(0, 150, 255));
    temperatureLabelName.setForeground(Color.BLACK);
    temperatureLabelName.setBounds(0, 0, 100, 100);
    temperatureLabelName.setOpaque(true); //??
    temperatureData.add(temperatureLabelName);
    temperatureData.add(temperatureLabel);
    //        JPanel emptyPanel=new JPanel();
    //        emptyPanel.setSize((int)(WIDTH*0.14),(int)(HEIGHT*0.2));
    //        emptyPanel.setBackground(new Color(0,150,255));
    //        GuardDataPanel.add(emptyPanel);

    JPanel lightValueData = new JPanel();
    lightValueData.setLayout(new BorderLayout());
    lightValueData.setBackground(new Color(0, 150, 255));
    //        lightValueData.setBounds(0,(int)(HEIGHT*0.28),(int)(WIDTH*0.14),(int)(HEIGHT*0.30));
    lightValueData.setSize((int) (WIDTH * 0.14), (int) (HEIGHT * 0.22));
    lightValueDataSet = new DefaultValueDataset();
    DialPlot lightValueDialPlot = new DialPlot();
    lightValueDialPlot.setDataset(lightValueDataSet);
    StandardDialFrame dialFrame = new StandardDialFrame();
    dialFrame.setVisible(false);
    lightValueDialPlot.setDialFrame(dialFrame);

    GradientPaint gradientpaint = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(),
            new Color(170, 170, 170));
    DialBackground dialBackground = new DialBackground(gradientpaint);
    dialBackground.setGradientPaintTransformer(
            new StandardGradientPaintTransformer(GradientPaintTransformType.VERTICAL));
    lightValueDialPlot.setBackground(dialBackground);
    // ??
    DialTextAnnotation dialtextannotation = new DialTextAnnotation("");
    dialtextannotation.setFont(new Font("Dialog", 0, (int) (0.016 * HEIGHT)));
    dialtextannotation.setRadius(0.1D);
    lightValueDialPlot.addLayer(dialtextannotation);

    DialValueIndicator dialValueIndicator = new DialValueIndicator(0);
    dialValueIndicator.setFont(new Font("Dialog", Font.PLAIN, (int) (0.011 * HEIGHT)));
    dialValueIndicator.setOutlinePaint(Color.darkGray);
    dialValueIndicator.setRadius(0.4D);
    dialValueIndicator.setAngle(-90.0);
    lightValueDialPlot.addLayer(dialValueIndicator);

    StandardDialScale dialScale = new StandardDialScale();
    dialScale.setLowerBound(0D); // 
    dialScale.setUpperBound(1024); // 
    dialScale.setMajorTickIncrement(100);
    dialScale.setStartAngle(-120D); // 120,?
    dialScale.setExtent(-300D); // 300,?
    dialScale.setTickRadius(0.85D); // ,
    dialScale.setTickLabelOffset(0.1D); // ,0

    bloodDialRange = new StandardDialRange(500D, 750D, Color.red);
    bloodDialRange.setInnerRadius(0.52000000000000002D);
    bloodDialRange.setOuterRadius(0.55000000000000004D);
    lightValueDialPlot.addLayer(bloodDialRange);
    //
    bubbleDialRange = new StandardDialRange(0D, 500D, Color.black);
    bubbleDialRange.setInnerRadius(0.52000000000000002D);
    bubbleDialRange.setOuterRadius(0.55000000000000004D);
    lightValueDialPlot.addLayer(bubbleDialRange);
    //
    normalDialRange = new StandardDialRange(750D, 1024D, Color.green);
    normalDialRange.setInnerRadius(0.52000000000000002D);
    normalDialRange.setOuterRadius(0.55000000000000004D);
    lightValueDialPlot.addLayer(normalDialRange);

    dialScale.setTickLabelFont(new Font("Dialog", 0, (int) (0.011 * HEIGHT))); // 
    lightValueDialPlot.addScale(0, dialScale);

    DialPointer.Pointer pointer = new DialPointer.Pointer();
    lightValueDialPlot.addPointer(pointer);
    lightValueDialPlot.mapDatasetToScale(0, 0);
    DialCap dialCap = new DialCap();
    dialCap.setRadius(0.07D);
    JFreeChart lightValueDialChart = new JFreeChart(lightValueDialPlot);
    lightValueDialChart.setBackgroundPaint(new Color(0, 150, 255));
    lightValueDialChart.setTitle("??");
    lightValueDialChart.getTitle().setFont(new Font("SansSerif", 0, (int) (HEIGHT * 0.020)));
    ChartPanel lightValueDialChartPanel = new ChartPanel(lightValueDialChart, (int) (WIDTH * 0.15),
            (int) (HEIGHT * 0.27), 0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, false, true, false,
            false);
    lightValueData.add(lightValueDialChartPanel, BorderLayout.CENTER);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                            .addComponent(temperatureData, GroupLayout.Alignment.LEADING)
                            .addComponent(lightValueData, GroupLayout.Alignment.LEADING))));
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addGap((int) (HEIGHT * 0.05), (int) (HEIGHT * 0.05), (int) (HEIGHT * 0.05))
                    .addComponent(temperatureData)
                    .addGap((int) (HEIGHT * 0.05), (int) (HEIGHT * 0.05), (int) (HEIGHT * 0.05))
                    .addComponent(lightValueData)
                    .addGap((int) (HEIGHT * 0.05), (int) (HEIGHT * 0.05), (int) (HEIGHT * 0.05))));

    //        JPanel alarmMessage=new JPanel();
    //        alarmMessage.setBackground(new Color(0,150,255));
    //        alarmMessLabel=new JLabel("");
    //        alarmMessLabel.setFont(new Font("SansSerif", 0, (int)(HEIGHT *0.020)));
    //        alarmMessLabel.setBackground(new Color(0,150,255));
    //        alarmMessage.add(alarmMessLabel);
    //        GuardDataPanel.add(alarmMessage);
}

From source file:org.tros.logo.swing.LogoPanel.java

private Color getColorByName(String color) {
    color = color.toLowerCase();/*from   w w  w  .  j  a va2s .  c om*/

    try {
        Field field = Color.class.getField(color);
        return (Color) field.get(null);
    } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException ex) {
    }
    if (null != color) {
        switch (color) {
        case "darkgray":
            return (Color.darkGray);
        case "lightgray":
            return (Color.lightGray);
        default:
            if (!color.startsWith("#") || !color.startsWith(color)) {
                color = "#" + color;
            }
            Color c = java.awt.Color.decode(color);
            return c == null ? Color.black : c;
        }
    }
    return Color.black;
}

From source file:userinterface.DoctorWorkArea.DiagnosePatientJPanel.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor./*from  w ww .  j  ava2 s. com*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jLabel1 = new javax.swing.JLabel();
    jTabbedPane2 = new javax.swing.JTabbedPane();
    jPanel8 = new javax.swing.JPanel();
    jButton6 = new javax.swing.JButton();
    backJButton1 = new javax.swing.JButton();
    jScrollPane5 = new javax.swing.JScrollPane();
    skypeTxt = new javax.swing.JTextArea();
    jLabel22 = new javax.swing.JLabel();
    skypeId = new javax.swing.JTextField();
    jLabel31 = new javax.swing.JLabel();
    jLabel32 = new javax.swing.JLabel();
    patientCombo6 = new javax.swing.JComboBox();
    jPanel7 = new javax.swing.JPanel();
    jLabel7 = new javax.swing.JLabel();
    jScrollPane2 = new javax.swing.JScrollPane();
    labTestRequestJTable = new javax.swing.JTable();
    jLabel9 = new javax.swing.JLabel();
    patientCombo2 = new javax.swing.JComboBox();
    jLabel10 = new javax.swing.JLabel();
    jButton1 = new javax.swing.JButton();
    jLabel11 = new javax.swing.JLabel();
    dateChooser = new com.toedter.calendar.JDateChooser();
    refreshJButton = new javax.swing.JButton();
    backJButton2 = new javax.swing.JButton();
    jPanel5 = new javax.swing.JPanel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    patientCombo = new javax.swing.JComboBox();
    jScrollPane3 = new javax.swing.JScrollPane();
    vitalSignTable = new javax.swing.JTable();
    jLabel12 = new javax.swing.JLabel();
    patientNameTextField = new javax.swing.JTextField();
    jLabel13 = new javax.swing.JLabel();
    respiratoryTextField = new javax.swing.JTextField();
    heartRateTextField = new javax.swing.JTextField();
    jLabel14 = new javax.swing.JLabel();
    patientIdTextField = new javax.swing.JTextField();
    jLabel15 = new javax.swing.JLabel();
    jLabel16 = new javax.swing.JLabel();
    ageTextField = new javax.swing.JTextField();
    jLabel17 = new javax.swing.JLabel();
    bloodPressureTextField = new javax.swing.JTextField();
    weightTextField = new javax.swing.JTextField();
    jLabel18 = new javax.swing.JLabel();
    doctorTextField = new javax.swing.JTextField();
    jLabel19 = new javax.swing.JLabel();
    jLabel21 = new javax.swing.JLabel();
    timestampTextField = new javax.swing.JTextField();
    jButton2 = new javax.swing.JButton();
    backJButton = new javax.swing.JButton();
    barBtn = new javax.swing.JButton();
    jPanel6 = new javax.swing.JPanel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    patientCombo1 = new javax.swing.JComboBox();
    jScrollPane1 = new javax.swing.JScrollPane();
    productTable = new javax.swing.JTable();
    jLabel8 = new javax.swing.JLabel();
    addtoCartButton6 = new javax.swing.JButton();
    jLabel6 = new javax.swing.JLabel();
    quantitySpinner = new javax.swing.JSpinner();
    backJButton3 = new javax.swing.JButton();
    jLabel33 = new javax.swing.JLabel();
    emailTxt = new javax.swing.JTextField();
    jPanel1 = new javax.swing.JPanel();
    jLabel20 = new javax.swing.JLabel();
    patientCombo4 = new javax.swing.JComboBox();
    jLabel23 = new javax.swing.JLabel();
    dateChooser1 = new com.toedter.calendar.JDateChooser();
    jButton3 = new javax.swing.JButton();
    jLabel24 = new javax.swing.JLabel();
    jScrollPane4 = new javax.swing.JScrollPane();
    dietRequestJTable = new javax.swing.JTable();
    refreshJButton1 = new javax.swing.JButton();
    jLabel25 = new javax.swing.JLabel();
    backJButton4 = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    jLabel26 = new javax.swing.JLabel();
    patientCombo5 = new javax.swing.JComboBox();
    jButton4 = new javax.swing.JButton();
    treatedCombo = new javax.swing.JComboBox();
    jLabel27 = new javax.swing.JLabel();
    jLabel28 = new javax.swing.JLabel();
    jLabel29 = new javax.swing.JLabel();
    resumeCombo = new javax.swing.JComboBox();
    jLabel30 = new javax.swing.JLabel();
    operationCombo = new javax.swing.JComboBox();
    jButton7 = new javax.swing.JButton();
    backJButton5 = new javax.swing.JButton();
    jLabel34 = new javax.swing.JLabel();

    setBackground(new java.awt.Color(255, 255, 255));

    jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N
    jLabel1.setText("Diagnose Patient");

    jTabbedPane2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED,
            java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white));
    jTabbedPane2.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N

    jPanel8.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED,
            java.awt.Color.gray, java.awt.Color.gray, java.awt.Color.gray, java.awt.Color.gray));
    jPanel8.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    jButton6.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jButton6.setText("Send Skype Message");
    jButton6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton6ActionPerformed(evt);
        }
    });
    jPanel8.add(jButton6, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 380, 279, 92));

    backJButton1.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N
    backJButton1.setText("<< Back");
    backJButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            backJButton1ActionPerformed(evt);
        }
    });
    jPanel8.add(backJButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 570, -1, -1));

    skypeTxt.setColumns(20);
    skypeTxt.setRows(5);
    jScrollPane5.setViewportView(skypeTxt);

    jPanel8.add(jScrollPane5, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 260, 280, -1));

    jLabel22.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jLabel22.setText("Enter Skype ID");
    jPanel8.add(jLabel22, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 160, -1, -1));

    skypeId.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    skypeId.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            skypeIdActionPerformed(evt);
        }
    });
    jPanel8.add(skypeId, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 160, 160, -1));

    jLabel31.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jLabel31.setText("Enter Message");
    jPanel8.add(jLabel31, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 220, -1, -1));

    jLabel32.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jLabel32.setText("Select Patient");
    jPanel8.add(jLabel32, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 100, -1, 30));

    patientCombo6.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    patientCombo6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            patientCombo6ActionPerformed(evt);
        }
    });
    jPanel8.add(patientCombo6, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 100, 160, -1));

    jTabbedPane2.addTab("Skype Diagnosis", jPanel8);

    jPanel7.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED,
            java.awt.Color.black, java.awt.Color.black, java.awt.Color.black, java.awt.Color.black));
    jPanel7.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    jLabel7.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jLabel7.setText("Check Lab Technician's Request");
    jPanel7.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 360, -1, -1));

    labTestRequestJTable.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    labTestRequestJTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object[][] { { null, null, null, null, null }, { null, null, null, null, null },
                    { null, null, null, null, null }, { null, null, null, null, null } },
            new String[] { "Sender", "Patient Name", "Receiver", "Status", "Result" }) {
        Class[] types = new Class[] { java.lang.Object.class, java.lang.String.class, java.lang.String.class,
                java.lang.String.class, java.lang.String.class };
        boolean[] canEdit = new boolean[] { true, false, false, false, false };

        public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
        }

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
        }
    });
    jScrollPane2.setViewportView(labTestRequestJTable);

    jPanel7.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 400, 730, 160));

    jLabel9.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel9.setText("Select Patient");
    jPanel7.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 160, -1, -1));

    patientCombo2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    patientCombo2.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            patientCombo2MouseClicked(evt);
        }
    });
    patientCombo2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            patientCombo2ActionPerformed(evt);
        }
    });
    jPanel7.add(patientCombo2, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 160, 140, -1));

    jLabel10.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N
    jLabel10.setText("Request Lab Tests");
    jPanel7.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(411, 36, -1, -1));

    jButton1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jButton1.setText("Order Test");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });
    jPanel7.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(229, 287, 137, -1));

    jLabel11.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel11.setText("Request Date");
    jPanel7.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(132, 227, -1, -1));

    dateChooser.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jPanel7.add(dateChooser, new org.netbeans.lib.awtextra.AbsoluteConstraints(312, 221, 140, -1));

    refreshJButton.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    refreshJButton.setText("Refresh");
    refreshJButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            refreshJButtonActionPerformed(evt);
        }
    });
    jPanel7.add(refreshJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(780, 360, -1, -1));

    backJButton2.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N
    backJButton2.setText("<< Back");
    backJButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            backJButton2ActionPerformed(evt);
        }
    });
    jPanel7.add(backJButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 590, -1, -1));

    jTabbedPane2.addTab("Request Tests", jPanel7);

    jPanel5.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED,
            java.awt.Color.lightGray, java.awt.Color.lightGray, java.awt.Color.lightGray,
            java.awt.Color.lightGray));
    jPanel5.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N
    jLabel2.setText("Check Vital Signs");
    jPanel5.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 30, -1, -1));

    jLabel3.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel3.setText("Select Patient");
    jPanel5.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 130, -1, -1));

    patientCombo.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    patientCombo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            patientComboActionPerformed(evt);
        }
    });
    jPanel5.add(patientCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 130, 160, -1));

    vitalSignTable.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    vitalSignTable.setModel(new javax.swing.table.DefaultTableModel(new Object[][] {

    }, new String[] { "TimeStamp", "Vital Sign Status" }));
    jScrollPane3.setViewportView(vitalSignTable);

    jPanel5.add(jScrollPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 170, 730, 170));

    jLabel12.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel12.setText("Patient Name");
    jPanel5.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 100, -1, -1));

    patientNameTextField.setEditable(false);
    patientNameTextField.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            patientNameTextFieldActionPerformed(evt);
        }
    });
    jPanel5.add(patientNameTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 100, 150, -1));

    jLabel13.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel13.setText("Respiratory Rate");
    jPanel5.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 260, -1, -1));

    respiratoryTextField.setEditable(false);
    jPanel5.add(respiratoryTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 260, 150, -1));

    heartRateTextField.setEditable(false);
    jPanel5.add(heartRateTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 300, 150, -1));

    jLabel14.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel14.setText("Heart Rate");
    jPanel5.add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 300, -1, -1));

    patientIdTextField.setEditable(false);
    jPanel5.add(patientIdTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 140, 150, -1));

    jLabel15.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel15.setText("Patient ID");
    jPanel5.add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 140, -1, -1));

    jLabel16.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel16.setText("Age");
    jPanel5.add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 180, -1, -1));

    ageTextField.setEditable(false);
    ageTextField.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            ageTextFieldActionPerformed(evt);
        }
    });
    jPanel5.add(ageTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 180, 150, -1));

    jLabel17.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel17.setText("Blood Pressure");
    jPanel5.add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 340, -1, -1));

    bloodPressureTextField.setEditable(false);
    jPanel5.add(bloodPressureTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 340, 150, -1));

    weightTextField.setEditable(false);
    jPanel5.add(weightTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 380, 150, -1));

    jLabel18.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel18.setText("Weight");
    jPanel5.add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 380, -1, -1));

    doctorTextField.setEditable(false);
    doctorTextField.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            doctorTextFieldActionPerformed(evt);
        }
    });
    jPanel5.add(doctorTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 220, 150, -1));

    jLabel19.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel19.setText("Primary Doctor");
    jPanel5.add(jLabel19, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 220, -1, -1));

    jLabel21.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel21.setText("Timestamp");
    jPanel5.add(jLabel21, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 420, -1, -1));

    timestampTextField.setEditable(false);
    timestampTextField.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            timestampTextFieldActionPerformed(evt);
        }
    });
    jPanel5.add(timestampTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 420, 150, -1));

    jButton2.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N
    jButton2.setText("View Records");
    jButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
        }
    });
    jPanel5.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(980, 120, 150, -1));

    backJButton.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N
    backJButton.setText("<< Back");
    backJButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            backJButtonActionPerformed(evt);
        }
    });
    jPanel5.add(backJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 570, -1, -1));

    barBtn.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    barBtn.setText("Bar Chart");
    barBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            barBtnActionPerformed(evt);
        }
    });
    jPanel5.add(barBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 410, 120, -1));

    jTabbedPane2.addTab("Check Vital Signs", jPanel5);

    jPanel6.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED,
            java.awt.Color.darkGray, java.awt.Color.darkGray, java.awt.Color.darkGray,
            java.awt.Color.darkGray));
    jPanel6.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N
    jLabel4.setText("Prescribe Medicines");
    jPanel6.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 55, -1, -1));

    jLabel5.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel5.setText("Select Patient");
    jPanel6.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(216, 149, -1, -1));

    patientCombo1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    patientCombo1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            patientCombo1ActionPerformed(evt);
        }
    });
    jPanel6.add(patientCombo1, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 140, 200, -1));

    productTable.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    productTable
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Name", "Product Id", "Price", "Avail" }) {
                boolean[] canEdit = new boolean[] { false, false, false, false };

                public boolean isCellEditable(int rowIndex, int columnIndex) {
                    return canEdit[columnIndex];
                }
            });
    jScrollPane1.setViewportView(productTable);

    jPanel6.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 280, 590, 100));

    jLabel8.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jLabel8.setText("Supplier Product Catalog");
    jPanel6.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 250, 240, -1));

    addtoCartButton6.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    addtoCartButton6.setText("Send Mail");
    addtoCartButton6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            addtoCartButton6ActionPerformed(evt);
        }
    });
    jPanel6.add(addtoCartButton6, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 490, 150, -1));

    jLabel6.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel6.setText("Quantity:");
    jPanel6.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 390, 80, 30));

    quantitySpinner.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null,
            Integer.valueOf(1)));
    jPanel6.add(quantitySpinner, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 390, 100, -1));

    backJButton3.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N
    backJButton3.setText("<< Back");
    backJButton3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            backJButton3ActionPerformed(evt);
        }
    });
    jPanel6.add(backJButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 600, -1, -1));

    jLabel33.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel33.setText("Email- ID");
    jPanel6.add(jLabel33, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 200, -1, -1));

    emailTxt.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jPanel6.add(emailTxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 190, 200, -1));

    jTabbedPane2.addTab("Prescribe Medicines", jPanel6);

    jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    jLabel20.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel20.setText("Select Patient");
    jPanel1.add(jLabel20, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 160, -1, -1));

    patientCombo4.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    patientCombo4.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            patientCombo4MouseClicked(evt);
        }
    });
    patientCombo4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            patientCombo4ActionPerformed(evt);
        }
    });
    jPanel1.add(patientCombo4, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 160, 140, -1));

    jLabel23.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel23.setText("Request Date");
    jPanel1.add(jLabel23, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 210, -1, -1));

    dateChooser1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jPanel1.add(dateChooser1, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 210, 140, -1));

    jButton3.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jButton3.setText("Order");
    jButton3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton3ActionPerformed(evt);
        }
    });
    jPanel1.add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 290, 137, -1));

    jLabel24.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jLabel24.setText("Check Dietitian Request Status");
    jPanel1.add(jLabel24, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 360, -1, -1));

    dietRequestJTable.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    dietRequestJTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object[][] { { null, null, null, null, null }, { null, null, null, null, null },
                    { null, null, null, null, null }, { null, null, null, null, null } },
            new String[] { "Sender", "Patient Name", "Receiver", "Status", "Result" }) {
        Class[] types = new Class[] { java.lang.Object.class, java.lang.String.class, java.lang.String.class,
                java.lang.String.class, java.lang.String.class };
        boolean[] canEdit = new boolean[] { true, false, false, false, false };

        public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
        }

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
        }
    });
    jScrollPane4.setViewportView(dietRequestJTable);

    jPanel1.add(jScrollPane4, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 400, 700, 97));

    refreshJButton1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    refreshJButton1.setText("Refresh");
    refreshJButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            refreshJButton1ActionPerformed(evt);
        }
    });
    jPanel1.add(refreshJButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(900, 360, -1, -1));

    jLabel25.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N
    jLabel25.setText("Request Diet Plan from Dietitian");
    jPanel1.add(jLabel25, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 20, -1, -1));

    backJButton4.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    backJButton4.setText("<< Back");
    backJButton4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            backJButton4ActionPerformed(evt);
        }
    });
    jPanel1.add(backJButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 570, -1, -1));

    jTabbedPane2.addTab("Request DietPlan", jPanel1);

    jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    jLabel26.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel26.setText("Select Patient");
    jPanel2.add(jLabel26, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 100, -1, -1));

    patientCombo5.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    patientCombo5.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            patientCombo5MouseClicked(evt);
        }
    });
    patientCombo5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            patientCombo5ActionPerformed(evt);
        }
    });
    jPanel2.add(patientCombo5, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 100, 130, -1));

    jButton4.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N
    jButton4.setText("Generate Medical Report");
    jButton4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton4ActionPerformed(evt);
        }
    });
    jPanel2.add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 440, 240, -1));

    treatedCombo.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    treatedCombo.setModel(
            new javax.swing.DefaultComboBoxModel(new String[] { "Cancer", "Post Operative Complication",
                    "Wound Healing", "Multiple Trauma", "Trauma with Steroids", "Burns", "Bone Fracture" }));
    jPanel2.add(treatedCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 310, 100, 20));

    jLabel27.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel27.setText("Resume Work");
    jPanel2.add(jLabel27, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 230, -1, -1));

    jLabel28.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jLabel28.setText("Update Medical Record");
    jPanel2.add(jLabel28, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 190, -1, -1));

    jLabel29.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel29.setText("Operation Performed");
    jPanel2.add(jLabel29, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 270, -1, -1));

    resumeCombo.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    resumeCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Yes", "No" }));
    jPanel2.add(resumeCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 230, 100, 20));

    jLabel30.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    jLabel30.setText("Treated For");
    jPanel2.add(jLabel30, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 310, -1, -1));

    operationCombo.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    operationCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Yes", "No" }));
    jPanel2.add(operationCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 270, 100, 20));

    jButton7.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jButton7.setText("Update");
    jButton7.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton7ActionPerformed(evt);
        }
    });
    jPanel2.add(jButton7, new org.netbeans.lib.awtextra.AbsoluteConstraints(730, 260, 130, -1));

    backJButton5.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N
    backJButton5.setText("<< Back");
    backJButton5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            backJButton5ActionPerformed(evt);
        }
    });
    jPanel2.add(backJButton5, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 590, -1, -1));

    jLabel34.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N
    jLabel34.setText("Medical Report");
    jPanel2.add(jLabel34, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 20, -1, -1));

    jTabbedPane2.addTab("Generate Medical Report", jPanel2);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane2)
                    .addGroup(layout.createSequentialGroup().addGap(413, 413, 413).addComponent(jLabel1)
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(9, 9, 9).addComponent(jLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jTabbedPane2)));
}

From source file:org.jfree.eastwood.ChartEngine.java

/**
 * Creates a pie chart./*  w ww.  java  2  s. c  o m*/
 *
 * @return A pie chart.
 */
private static JFreeChart createPieChart() {
    JFreeChart chart = ChartFactory.createPieChart(null, null, false, true, false);
    chart.setBackgroundPaint(Color.white);
    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setBackgroundPaint(null);
    plot.setInsets(RectangleInsets.ZERO_INSETS);
    plot.setInteriorGap(0.06);
    plot.setStartAngle(0.0);
    plot.setLabelGenerator(null);
    plot.setBaseSectionOutlinePaint(Color.white);
    plot.setBaseSectionOutlineStroke(new BasicStroke(1.2f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
    plot.setOutlineVisible(false);
    plot.setLabelBackgroundPaint(null);
    plot.setLabelOutlinePaint(null);
    plot.setLabelShadowPaint(null);
    plot.setLabelPadding(RectangleInsets.ZERO_INSETS);
    plot.setLabelFont(new Font("Dialog", Font.PLAIN, 12));
    plot.setLabelPaint(Color.darkGray);
    plot.setToolTipGenerator(new StandardPieToolTipGenerator("{2}"));
    return chart;
}

From source file:org.jfree.eastwood.ChartEngine.java

/**
 * Creates a pie chart with 3D effect./*from   w  w w.  ja  va2 s .  c  o m*/
 *
 * @return A pie chart.
 */
private static JFreeChart createPieChart3D() {
    JFreeChart chart = ChartFactory.createPieChart3D(null, null, false, true, false);
    chart.setBackgroundPaint(Color.white);
    chart.setBorderPaint(Color.white);
    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setInsets(RectangleInsets.ZERO_INSETS);
    plot.setDarkerSides(true);
    plot.setBaseSectionOutlinePaint(new Color(0, 0, 0, 0));
    plot.setStartAngle(0.0);
    plot.setInteriorGap(0.10);
    plot.setLabelGenerator(null);
    plot.setOutlineVisible(false);
    plot.setLabelBackgroundPaint(Color.white);
    plot.setLabelOutlinePaint(null);
    plot.setLabelShadowPaint(null);
    plot.setLabelPadding(RectangleInsets.ZERO_INSETS);
    plot.setLabelFont(new Font("Dialog", Font.PLAIN, 12));
    plot.setLabelPaint(Color.darkGray);
    plot.setToolTipGenerator(new StandardPieToolTipGenerator("{2}"));
    return chart;
}