Example usage for java.awt SystemColor controlText

List of usage examples for java.awt SystemColor controlText

Introduction

In this page you can find the example usage for java.awt SystemColor controlText.

Prototype

SystemColor controlText

To view the source code for java.awt SystemColor controlText.

Click Source Link

Document

The color rendered for the text of control panels and control objects, such as pushbuttons.

Usage

From source file:Main.java

public static void main(String[] a) {
    Color[] sysColor = new Color[] { SystemColor.activeCaption, SystemColor.activeCaptionBorder,
            SystemColor.activeCaptionText, SystemColor.control, SystemColor.controlDkShadow,
            SystemColor.controlHighlight, SystemColor.controlLtHighlight, SystemColor.controlShadow,
            SystemColor.controlText, SystemColor.desktop, SystemColor.inactiveCaption,
            SystemColor.inactiveCaptionBorder, SystemColor.inactiveCaptionText, SystemColor.info,
            SystemColor.infoText, SystemColor.menu, SystemColor.menuText, SystemColor.scrollbar,
            SystemColor.text, SystemColor.textHighlight, SystemColor.textHighlightText,
            SystemColor.textInactiveText, SystemColor.textText, SystemColor.window, SystemColor.windowBorder,
            SystemColor.windowText };

    for (Color c : sysColor) {
        System.out.println(c);//from  w ww.j av a2s .  co  m

    }

}

From source file:Main.java

/**
 * Setups the given table for usage as row-header. This method setups the background color to
 * the same one than the column headers.
 *
 * {@note In a previous version, we were assigning to the row headers the same cell renderer than
 *        the one created by <cite>Swing</cite> for the column headers. But it produced strange
 *        effects when the L&F uses a vertical grandiant instead than a uniform color.}
 *
 * @param  table The table to setup as row headers.
 * @return The renderer which has been assigned to the table.
 */// w w w  .jav a 2  s.  c o  m
public static TableCellRenderer setupAsRowHeader(final JTable table) {
    final JTableHeader header = table.getTableHeader();
    Color background = header.getBackground();
    Color foreground = header.getForeground();
    if (background == null || background.equals(table.getBackground())) {
        if (!SystemColor.control.equals(background)) {
            background = SystemColor.control;
            foreground = SystemColor.controlText;
        } else {
            final Locale locale = table.getLocale();
            background = UIManager.getColor("Label.background", locale);
            foreground = UIManager.getColor("Label.foreground", locale);
        }
    }
    final DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
    renderer.setBackground(background);
    renderer.setForeground(foreground);
    renderer.setHorizontalAlignment(DefaultTableCellRenderer.RIGHT);
    final TableColumn column = table.getColumnModel().getColumn(0);
    column.setCellRenderer(renderer);
    column.setPreferredWidth(60);
    table.setPreferredScrollableViewportSize(table.getPreferredSize());
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.setCellSelectionEnabled(false);
    return renderer;
}

From source file:TextBox3D.java

public synchronized void paint(Graphics g) {
    FontMetrics fm = g.getFontMetrics();
    Dimension size = getSize();/*from w  ww.j  a  v  a2 s  . c  om*/
    int x = (size.width - fm.stringWidth(text)) / 2;
    int y = (size.height - fm.getHeight()) / 2;
    g.setColor(SystemColor.control);
    g.fillRect(0, 0, size.width, size.height);
    g.setColor(SystemColor.controlShadow);
    g.drawLine(0, 0, 0, size.height - 1);
    g.drawLine(0, 0, size.width - 1, 0);
    g.setColor(SystemColor.controlDkShadow);
    g.drawLine(0, size.height - 1, size.width - 1, size.height - 1);
    g.drawLine(size.width - 1, 0, size.width - 1, size.height - 1);
    g.setColor(SystemColor.controlText);
    g.drawString(text, x, y);
}

From source file:junk.gui.HazardSpectrumApplication.java

private void jbInit() throws Exception {
    border1 = BorderFactory.createLineBorder(SystemColor.controlText, 1);
    border2 = BorderFactory.createLineBorder(SystemColor.controlText, 1);
    border3 = BorderFactory.createEmptyBorder();
    border4 = BorderFactory.createLineBorder(SystemColor.controlText, 1);
    border5 = BorderFactory.createLineBorder(SystemColor.controlText, 1);
    border6 = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.white, Color.white,
            new Color(98, 98, 112), new Color(140, 140, 161));
    border7 = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.white, Color.white,
            new Color(98, 98, 112), new Color(140, 140, 161));
    border8 = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.white, Color.white,
            new Color(98, 98, 112), new Color(140, 140, 161));
    //this.getContentPane().setBackground(Color.white);
    this.setSize(new Dimension(1100, 670));
    this.getContentPane().setLayout(borderLayout1);

    jPanel1.setLayout(gridBagLayout10);/*from w  w  w  .j  ava2 s. c  o  m*/
    //creating the Object the GraphPaenl class
    graphPanel = new GraphPanel(this);

    jPanel1.setBackground(Color.white);
    jPanel1.setBorder(border4);
    jPanel1.setMinimumSize(new Dimension(959, 600));
    jPanel1.setPreferredSize(new Dimension(959, 600));

    //loading the OpenSHA Logo

    topSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    clearButton.setText("Clear Plot");
    clearButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
            clearButton_actionPerformed(e);
        }
    });
    imgLabel.setText("");
    imgLabel.setIcon(new ImageIcon(FileUtils.loadImage(this.POWERED_BY_IMAGE)));
    imgLabel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
            imgLabel_mouseClicked(e);
        }
    });
    //jCheckylog.setBackground(Color.white);
    //jCheckylog.setForeground(new Color(80, 80, 133));
    //buttonPanel.setBackground(Color.white);
    buttonPanel.setMinimumSize(new Dimension(568, 20));
    buttonPanel.setLayout(flowLayout1);
    //progressCheckBox.setBackground(Color.white);
    progressCheckBox.setFont(new java.awt.Font("Dialog", 1, 12));
    //progressCheckBox.setForeground(new Color(80, 80, 133));
    progressCheckBox.setSelected(true);
    progressCheckBox.setText("Show Progress Bar");
    addButton.setText("Compute");
    addButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
            addButton_actionPerformed(e);
        }
    });
    // jCheckxlog.setBackground(Color.white);
    //jCheckxlog.setForeground(new Color(80, 80, 133));
    //controlComboBox.setBackground(new Color(200, 200, 230));
    //controlComboBox.setForeground(new Color(80, 80, 133));
    controlComboBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
            controlComboBox_actionPerformed(e);
        }
    });
    panel.setLayout(gridBagLayout9);
    panel.setBackground(Color.white);
    panel.setBorder(border5);
    panel.setMinimumSize(new Dimension(0, 0));
    imrSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    imrSplitPane.setBottomComponent(imtPanel);
    imrSplitPane.setTopComponent(imrPanel);
    erfSplitPane.setTopComponent(erfPanel);
    sitePanel.setLayout(gridBagLayout13);
    sitePanel.setBackground(Color.white);
    imtPanel.setLayout(gridBagLayout8);
    imtPanel.setBackground(Color.white);
    controlsSplit.setDividerSize(5);
    erfPanel.setLayout(gridBagLayout5);
    erfPanel.setBackground(Color.white);
    erfPanel.setBorder(border2);
    erfPanel.setMaximumSize(new Dimension(2147483647, 10000));
    erfPanel.setMinimumSize(new Dimension(2, 300));
    erfPanel.setPreferredSize(new Dimension(2, 300));
    imrPanel.setLayout(gridBagLayout15);
    imrPanel.setBackground(Color.white);
    chartSplit.setLeftComponent(panel);
    chartSplit.setRightComponent(paramsTabbedPane);
    probDeterSelection.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
            probDeterSelection_actionPerformed(e);
        }
    });
    peelOffButton.setText("Peel Off");
    peelOffButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
            peelOffButton_actionPerformed(e);
        }
    });
    this.getContentPane().add(jPanel1, BorderLayout.CENTER);
    jPanel1.add(topSplitPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(11, 4, 5, 6), 243, 231));
    buttonPanel.add(probDeterSelection, null);
    buttonPanel.add(controlComboBox, null);
    buttonPanel.add(addButton, null);
    buttonPanel.add(clearButton, null);
    buttonPanel.add(peelOffButton, null);
    buttonPanel.add(progressCheckBox, null);
    buttonPanel.add(imgLabel, null);
    topSplitPane.add(chartSplit, JSplitPane.TOP);
    chartSplit.add(panel, JSplitPane.LEFT);
    chartSplit.add(paramsTabbedPane, JSplitPane.RIGHT);
    imrSplitPane.add(imrPanel, JSplitPane.TOP);
    imrSplitPane.add(imtPanel, JSplitPane.BOTTOM);
    controlsSplit.add(imrSplitPane, JSplitPane.LEFT);
    paramsTabbedPane.add(controlsSplit, "IMR, IML/Prob, & Site");
    controlsSplit.add(sitePanel, JSplitPane.RIGHT);
    paramsTabbedPane.add(erfSplitPane, "ERF & Time Span");
    erfSplitPane.add(erfPanel, JSplitPane.LEFT);
    topSplitPane.add(buttonPanel, JSplitPane.BOTTOM);
    topSplitPane.setDividerLocation(600);
    imrSplitPane.setDividerLocation(300);
    erfSplitPane.setDividerLocation(260);
    controlsSplit.setDividerLocation(260);
    erfPanel.validate();
    erfPanel.repaint();
    chartSplit.setDividerLocation(600);

}

From source file:org.springframework.richclient.application.statusbar.support.DefaultStatusBar.java

/**
 * Sets the error message text to be displayed on the status bar.
 * <p>//from   w  w w  .j  a  v a 2 s .  c  o m
 * Error messages are shown over the standard message, and in a red color.
 *
 * @param message
 *            the error message to be set, if <code>null</code>, the error message is cleared, and the standard
 *            message is shown again
 */
public void setErrorMessage(String errorMessage) {
    if (errorMessage == null) {
        logger.debug("Resetting the status bar message color to normal");
        messageLabel.setForeground(SystemColor.controlText);

        this.errorMessage = null;
        setMessage(message);
    } else {
        logger.debug("Setting the status bar messsage color to red");
        messageLabel.setForeground(Color.RED);

        logger.debug("Setting status bar error message to \"" + errorMessage + "\"");
        this.errorMessage = errorMessage;
        messageLabel.setText(this.errorMessage);
    }
}

From source file:put.semantic.fcanew.ui.MainWindow.java

/**
 * Creates new form MainWindow/*from  w  ww.jav a2 s  .c  om*/
 */
public MainWindow() {
    logger.entry();
    logger.trace("INIT");
    try {
        logger.debug("HOST: " + InetAddress.getLocalHost().getCanonicalHostName());
        logger.debug("IP: " + InetAddress.getLocalHost().getHostAddress());
    } catch (UnknownHostException ex) {
    }
    availableCalculatorsModel = new CheckBoxListModel<>(
            Arrays.asList(new RuleCalculator(), new FollowingCalculators(), new ImplicationShapeCalculator(),
                    new EndpointCalculator(), new SatCalculator(), new ConsistencyCalculator()),
            PreferencesProvider.getInstance().getCalculators());
    availableCalculatorsModel.addListDataListener(new ListDataListener() {

        private void save(ListDataEvent e) {
            boolean[] checked = ((CheckBoxListModel<FeatureCalculator>) e.getSource()).getCheckedAsArray();
            PreferencesProvider.getInstance().setCalculators(checked);
        }

        @Override
        public void intervalAdded(ListDataEvent e) {
            save(e);
        }

        @Override
        public void intervalRemoved(ListDataEvent e) {
            save(e);
        }

        @Override
        public void contentsChanged(ListDataEvent e) {
            save(e);
        }
    });
    initComponents();
    normalFont = acceptButton.getFont();
    boldFont = normalFont.deriveFont(Font.BOLD);
    initFiles();
    ((CheckBoxList<FeatureCalculator>) availableCalculators)
            .setTransformer(new CheckBoxList.Transformer<FeatureCalculator>() {

                @Override
                public String transform(FeatureCalculator calc) {
                    return calc.getClass().getSimpleName() + ": " + StringUtils.join(calc.getNames(), ", ");
                }
            });
    classifierConfiguration.getDocument().addDocumentListener(new DocumentListenerHelper() {

        @Override
        protected void update(String text) {
            classifierConfigurationStatus.setText("");
            classifierConfigurationStatus.setForeground(SystemColor.controlText);
            try {
                ((Classifier) classifierToUse.getSelectedItem())
                        .setConfiguration(classifierConfiguration.getText());
                classifierConfigurationStatus.setText("OK");
                classifierConfigurationStatus.setForeground(Color.GREEN);
            } catch (Exception ex) {
                classifierConfigurationStatus.setText(ex.getLocalizedMessage());
                classifierConfigurationStatus.setForeground(Color.RED);
            }
        }
    });
    classifierToUse.setSelectedIndex(PreferencesProvider.getInstance().getClassifier());
    credibilityTreshold.setValue(PreferencesProvider.getInstance().getCredibilityTreshold());
    rejectedWeight.setValue(PreferencesProvider.getInstance().getRejectedWeight());
    CSVExporter.addToAllTables(this);
    if (script != null) {
        runScript();
    }
}