Example usage for java.awt Color LIGHT_GRAY

List of usage examples for java.awt Color LIGHT_GRAY

Introduction

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

Prototype

Color LIGHT_GRAY

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

Click Source Link

Document

The color light gray.

Usage

From source file:org.nuclos.client.dbtransfer.DBTransferImport.java

private PanelWizardStep newStep3(final MainFrameTab ifrm) {
    final SpringLocaleDelegate localeDelegate = getSpringLocaleDelegate();
    final PanelWizardStep step = new PanelWizardStep(
            localeDelegate.getMessage("dbtransfer.import.step3.1", "System Parameter"),
            localeDelegate.getMessage("dbtransfer.import.step3.2",
                    "Bestimmen Sie die Parameter dieses Systems. Sie k\u00f6nnen w\u00e4hlen zwischen dem aktuellen Zustand und dem aus der Konfigurationsdatei importierten Zustand (default). Sollte keine der beiden Vorgaben stimmen, so k\u00f6nnen Sie auch einen anderen Wert setzen.")) {

        @Override/*from  w ww  . j a  v a 2s . co m*/
        public void prepare() {
            setupParameterPanel(importTransferObject.getParameter());
        }

        @Override
        public void applyState() throws InvalidStateException {
            setSelectedIncomingParameter.clear();
            setSelectedCurrentParameter.clear();
            mapSelectedOtherParameter.clear();

            for (ParameterEditor pe : lstParameterEditors) {
                if (pe.isCurrentValue())
                    setSelectedCurrentParameter.add(pe.getName());
                if (pe.isIncomingValue())
                    setSelectedIncomingParameter.add(pe.getName());
                if (pe.isOtherValue())
                    mapSelectedOtherParameter.put(pe.getName(), pe.getValue());
            }
        }
    };
    step.setComplete(true);

    utils.initJPanel(step, new double[] { TableLayout.FILL },
            new double[] { TableLayout.PREFERRED, TableLayout.FILL, TableLayout.PREFERRED });

    rbCurrentAll.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            resetParameterEditors(true);
        }
    });
    rbIncomingAll.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            resetParameterEditors(false);
        }
    });

    final JScrollPane scroll = new JScrollPane(jpnParameter);
    scroll.setPreferredSize(new Dimension(680, 250));
    scroll.setBorder(new LineBorder(Color.LIGHT_GRAY, 1));
    scroll.getVerticalScrollBar().setUnitIncrement(20);
    scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    scroll.getViewport().addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            Dimension parameterPanelSize = new Dimension(scroll.getViewport().getWidth(),
                    jpnParameter.getPreferredSize().height);
            jpnParameter.setPreferredSize(parameterPanelSize);
        }
    });

    step.add(jpnParameterHeader, "0,0");
    step.add(scroll, "0,1");
    step.add(jpnParameterFooter, "0,2");

    return step;
}

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

private void jExcludeButtonActionPerformed(java.awt.event.ActionEvent evt) {
    if (!panelData.exclude()) {
        panelData.exclude(true);//  www.j a v a  2  s  . c o  m
        jExcludeButton.setText("<html><center><u>Exclude</u>");
        jTree1.setBackground(Color.LIGHT_GRAY);
        jExcludeButton.setToolTipText("Include all items in panel");
        jNameLabel.requestFocus();
    } else {
        panelData.exclude(false);
        jExcludeButton.setText("Exclude");
        jTree1.setBackground(Color.WHITE);
        jExcludeButton.setToolTipText("Exclude all items in panel");
        jNameLabel.requestFocus();
    }
}

From source file:mio_de_pso.MainForm.java

private void viewIndividuals(Individual[] population, XYPlot plot) {

    double annotationSize = (((x1Max - x1Min) * 0.02) + ((x2Max - x2Min) * 0.02)) / 2;

    for (int i = 0; i < population.length; ++i) {
        XYShapeAnnotation annotation = new XYShapeAnnotation(
                new Ellipse2D.Double(population[i].getPosition("x1"), population[i].getPosition("x2"),
                        annotationSize, annotationSize),
                new BasicStroke(1.0f), Color.LIGHT_GRAY, Color.LIGHT_GRAY);

        plot.addAnnotation(annotation);/*from  ww  w  . j  a va2  s  . com*/
    }
}

From source file:net.sf.taverna.t2.activities.spreadsheet.views.SpreadsheetImportConfigView.java

/**
 * Adds a light gray or etched border to the top or bottom of a JComponent.
 *
 * @param component// www . ja va  2s  .  co m
 */
protected void addDivider(JComponent component, final int position, final boolean etched) {
    component.setBorder(new Border() {
        private final Color borderColor = new Color(.6f, .6f, .6f);

        public Insets getBorderInsets(Component c) {
            if (position == SwingConstants.TOP) {
                return new Insets(5, 0, 0, 0);
            } else {
                return new Insets(0, 0, 5, 0);
            }
        }

        public boolean isBorderOpaque() {
            return false;
        }

        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
            if (position == SwingConstants.TOP) {
                if (etched) {
                    g.setColor(borderColor);
                    g.drawLine(x, y, x + width, y);
                    g.setColor(Color.WHITE);
                    g.drawLine(x, y + 1, x + width, y + 1);
                } else {
                    g.setColor(Color.LIGHT_GRAY);
                    g.drawLine(x, y, x + width, y);
                }
            } else {
                if (etched) {
                    g.setColor(borderColor);
                    g.drawLine(x, y + height - 2, x + width, y + height - 2);
                    g.setColor(Color.WHITE);
                    g.drawLine(x, y + height - 1, x + width, y + height - 1);
                } else {
                    g.setColor(Color.LIGHT_GRAY);
                    g.drawLine(x, y + height - 1, x + width, y + height - 1);
                }
            }
        }

    });
}

From source file:net.sf.taverna.t2.activities.spreadsheet.views.SpreadsheetImportConfigView.java

private void enableTable(JTable table, boolean enabled) {
    table.setEnabled(enabled);/*from  ww w. j a  va2 s .  c  om*/
    Component editor = table.getEditorComponent();
    if (editor != null) {
        editor.setEnabled(enabled);
    }
    if (enabled) {
        table.setForeground(Color.BLACK);
        table.getTableHeader().setForeground(Color.BLACK);
    } else {
        table.setForeground(Color.LIGHT_GRAY);
        table.getTableHeader().setForeground(Color.LIGHT_GRAY);
    }
}

From source file:op.tools.SYSCalendar.java

public static Color getFGSHIFT(Byte shift) {
    if (shift == BHPTools.SHIFT_ON_DEMAND) {
        return GUITools.getColor(OPDE.getProps().getProperty("ON_DEMAND_FGSHIFT"));
    }//from www .j  a v a 2 s  .c o  m
    if (shift == BHPTools.SHIFT_OUTCOMES) {
        return Color.LIGHT_GRAY;
    }
    return GUITools.getColor(OPDE.getProps().getProperty(BHPTools.SHIFT_KEY_TEXT[shift] + "_FGSHIFT"));
}

From source file:org.kuali.kfs.module.ar.batch.service.impl.CustomerLoadServiceImpl.java

protected void writeFileNameSectionTitle(Document pdfDoc, String filenameLine) {
    Font font = FontFactory.getFont(FontFactory.COURIER, 10, Font.BOLD);

    Paragraph paragraph = new Paragraph();
    paragraph.setAlignment(Element.ALIGN_LEFT);
    Chunk chunk = new Chunk(filenameLine, font);
    chunk.setBackground(Color.LIGHT_GRAY, 5, 5, 5, 5);
    paragraph.add(chunk);/*from w  ww.  j  av  a2s. co  m*/

    //  blank line
    paragraph.add(new Chunk("", font));

    try {
        pdfDoc.add(paragraph);
    } catch (DocumentException e) {
        LOG.error("iText DocumentException thrown when trying to write content.", e);
        throw new RuntimeException("iText DocumentException thrown when trying to write content.", e);
    }
}

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

public void redraw(QueryConceptTreePanelData data) {
    panelData = data;/*from   w w w.j a  v  a2 s . c o m*/

    String str = "Occurs > " + (data.getOccurrenceTimes() - 1) + "x";
    if (data.getOccurrenceTimes() == 1) {
        setOccurrenceText(str);
    } else if (data.getOccurrenceTimes() > 1) {
        setOccurrenceText("<html><u>" + str + "</u>");
    }

    if (data.exclude()) {
        jExcludeButton.setText("<html><center><u>Exclude</u>");
        jTree1.setBackground(Color.LIGHT_GRAY);
        jExcludeButton.setToolTipText("Include all items in panel");
    } else {
        jExcludeButton.setText("Exclude");
        jTree1.setBackground(Color.WHITE);
        jExcludeButton.setToolTipText("Exclude all items in panel");
    }

    if (data.startDay() != -1 || data.endDay() != -1) {
        setDateConstrainText("<html><u>Dates</u>");
    } else {
        setDateConstrainText("Dates");
    }

    for (int i = 0; i < data.getItems().size(); i++) {
        QueryConceptTreeNodeData node = data.getItems().get(i);
        addNode(node);
    }
}

From source file:org.pentaho.reporting.designer.core.editor.report.AbstractRenderComponent.java

protected void paintComponent(final Graphics g) {
    if (fpsCalculator.isActive()) {
        fpsCalculator.tick();/*from  w  w w  .  ja  v a  2s  .c o m*/
    }

    final Graphics2D g2 = (Graphics2D) g.create();

    g2.setColor(new Color(224, 224, 224));
    g2.fillRect(0, 0, getWidth(), getHeight());

    final int leftBorder = (int) getLeftBorder();
    final int topBorder = (int) getTopBorder();
    final float scaleFactor = getRenderContext().getZoomModel().getZoomAsPercentage();

    // draw the page area ..
    final PageDefinition pageDefinition = getRenderContext().getContextRoot().getPageDefinition();
    final Rectangle2D.Double area = new Rectangle2D.Double(0, 0, pageDefinition.getWidth() * scaleFactor,
            getHeight());
    g2.translate(leftBorder * scaleFactor, topBorder * scaleFactor);
    g2.clip(area);
    g2.setColor(Color.WHITE);
    g2.fill(area);

    // draw the grid (unscaled, but translated)
    final Point2D offset = getOffset();
    if (offset.getX() != 0) {
        // The blackout area is for inline sub-reports and is the area where the subreport is not interested in
        // (so we can clip out).  The blackout area is only visible in the sub-report.
        final Rectangle2D.Double blackoutArea = new Rectangle2D.Double(0, 0, offset.getX() * scaleFactor,
                getHeight());
        g2.setColor(Color.LIGHT_GRAY);
        g2.fill(blackoutArea);
    }
    paintGrid(g2);
    paintElementAlignment(g2);
    g2.dispose();

    final Graphics2D logicalPageAreaG2 = (Graphics2D) g.create();
    // draw the renderable content ...
    logicalPageAreaG2.translate(leftBorder * scaleFactor, topBorder * scaleFactor);
    logicalPageAreaG2.clip(area);
    logicalPageAreaG2.scale(scaleFactor, scaleFactor);

    try {
        final ElementRenderer rendererRoot = getElementRenderer();
        if (rendererRoot != null) {
            if (rendererRoot.draw(logicalPageAreaG2) == false) {
                rendererRoot.handleError(designerContext, renderContext);

                logicalPageAreaG2.scale(1f / scaleFactor, 1f / scaleFactor);
                logicalPageAreaG2.setPaint(Color.WHITE);
                logicalPageAreaG2.fill(area);
            }
        }
    } catch (Exception e) {
        // ignore for now..
        UncaughtExceptionsModel.getInstance().addException(e);
    }

    logicalPageAreaG2.dispose();

    final OverlayRenderer[] renderers = new OverlayRenderer[4];
    renderers[0] = new OverlappingElementOverlayRenderer(getDefaultElement()); // displays the red border for warning
    renderers[1] = new SelectionOverlayRenderer(getDefaultElement());
    renderers[2] = new GuidelineOverlayRenderer(horizontalLinealModel, verticalLinealModel);
    renderers[3] = new SelectionRectangleOverlayRenderer(); // blue box when you shift and drag the region to select multiple
    // elements

    for (int i = 0; i < renderers.length; i++) {
        final OverlayRenderer renderer = renderers[i];
        final Graphics2D selectionG2 = (Graphics2D) g.create();

        renderer.validate(getRenderContext(), scaleFactor, offset);
        renderer.draw(selectionG2,
                new Rectangle2D.Double(getLeftBorder(), getTopBorder(), getWidth(), getHeight()), this);
        selectionG2.dispose();
    }
}

From source file:edu.ucla.stat.SOCR.analyses.gui.NormalPower.java

protected void setSelectPanel() {
    selectPanel.removeAll();/*from  w  w  w.  java 2s.c  o  m*/
    selectPanel.setPreferredSize(new Dimension(400, 400));
    selectPanel.add(subPanel, BorderLayout.EAST);
    selectPanel.add(subPanel, BorderLayout.CENTER);
    selectPanel.add(subPanel, BorderLayout.WEST);

    subPanel.add(parameterPanel, BorderLayout.SOUTH);
    subPanel.add(hypothesisPanel, BorderLayout.CENTER);
    subPanel.add(choicePanel, BorderLayout.NORTH);

    hypothesisPanel.setBackground(Color.LIGHT_GRAY);
    parameterPanel.setBackground(Color.LIGHT_GRAY);
    choicePanel.setBackground(Color.LIGHT_GRAY);
    /*********** Begin Check/Choice Setting ********************/
    //choicePanel.setLayout(new BoxLayout(choicePanel, BoxLayout.Y_AXIS));
    choicePanel.setLayout(new BorderLayout());
    choicePanel.add(checkSampleSizeBox, BorderLayout.NORTH);
    choicePanel.add(checkPowerBox, BorderLayout.CENTER);
    choicePanel.add(criticalValueBox, BorderLayout.SOUTH);

    /*********** End Check/Choice Setting ********************/

    /*********** Begin Hypothesis Setting ********************/

    h0Label = new JLabel("Null: mu      =       mu_0;  ");
    hALabelPrefix = new JLabel("Alternative: mu_A ");
    hALabelSurfix = new JLabel(" mu_0");

    h0Panel.setBackground(Color.LIGHT_GRAY);

    hAPanel.setBackground(Color.LIGHT_GRAY);
    hACheckBoxPanel.setBackground(Color.LIGHT_GRAY);

    hypothesisPanel.add(h0Panel, BorderLayout.CENTER);
    hypothesisPanel.add(hAPanel, BorderLayout.SOUTH);

    h0Panel.add(h0Label, BorderLayout.CENTER);

    hAPanel.add(hALabelPrefix, BorderLayout.WEST);
    hAPanel.add(hACheckBoxPanel, BorderLayout.CENTER);
    hAPanel.add(hALabelSurfix, BorderLayout.EAST);

    hACheckBoxPanel.add(checkNE, BorderLayout.CENTER);
    hACheckBoxPanel.add(checkLT, BorderLayout.EAST);
    hACheckBoxPanel.add(checkGT, BorderLayout.WEST);
    /*********** End Hypothesis Setting ********************/

    /*********** Begin Parameter Setting *******************/
    sampleSizePanel = new JPanel();
    sigmaPanel = new JPanel();
    mu0Panel = new JPanel();
    sigmaZTestPanel = new JPanel();
    mu0ZTestPanel = new JPanel();
    muAPanel = new JPanel();
    alphaPanel = new JPanel();
    powerPanel = new JPanel();
    xValuePanel = new JPanel();

    sampleSizePanel.add(sampleSizeLabel, BorderLayout.WEST);
    sampleSizePanel.add(sampleSizeBar, BorderLayout.CENTER);
    sampleSizePanel.add(sampleSizeText, BorderLayout.EAST);
    sigmaPanel.add(sigmaLabel, BorderLayout.WEST);
    sigmaPanel.add(sigmaText, BorderLayout.EAST);
    sigmaZTestPanel.add(sigmaZTestLabel, BorderLayout.WEST);
    sigmaZTestPanel.add(sigmaZTestText, BorderLayout.EAST);
    mu0Panel.add(mu0Label, BorderLayout.WEST);
    mu0Panel.add(mu0Text, BorderLayout.EAST);
    mu0ZTestPanel.add(mu0ZTestLabel, BorderLayout.WEST);
    mu0ZTestPanel.add(mu0ZTestText, BorderLayout.EAST);
    muAPanel.add(muALabel, BorderLayout.WEST);
    muAPanel.add(muAText, BorderLayout.EAST);
    alphaPanel.add(alphaLabel, BorderLayout.WEST);
    alphaPanel.add(alphaCombo, BorderLayout.EAST);
    powerPanel.add(powerLabel, BorderLayout.WEST);
    powerPanel.add(powerBar, BorderLayout.CENTER);
    powerPanel.add(powerText, BorderLayout.EAST);
    xValuePanel.add(xValueLabel, BorderLayout.WEST);
    xValuePanel.add(xValueText, BorderLayout.EAST);

    parameterPanel.setLayout(new BoxLayout(parameterPanel, BoxLayout.Y_AXIS));

    parameterPanel.add(sampleSizePanel);
    parameterPanel.add(powerPanel);

    parameterPanel.add(xValuePanel);
    parameterPanel.add(sigmaPanel);
    parameterPanel.add(mu0Panel);
    parameterPanel.add(muAPanel);
    parameterPanel.add(alphaPanel);

    parameterPanel.add(sigmaZTestPanel);
    parameterPanel.add(mu0ZTestPanel);

    parameterPanel.add(alphaPanel);
    parameterPanel.add(alphaPanel);

    hypothesisPanel.setVisible(true);
    sampleSizePanel.setVisible(true);
    powerPanel.setVisible(false);
    xValuePanel.setVisible(false);
    sigmaZTestPanel.setVisible(false);
    mu0ZTestPanel.setVisible(false);

}