Example usage for java.awt SystemColor text

List of usage examples for java.awt SystemColor text

Introduction

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

Prototype

SystemColor text

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

Click Source Link

Document

The color rendered for the background of text control objects, such as textfields and comboboxes.

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  w  w .ja  va 2 s  .c  o  m

    }

}

From source file:Main.java

public static void setEnabledWithBackground(Component comp, boolean isEnabled) {
    comp.setEnabled(isEnabled);/*from w w  w  . j av a2  s.c om*/
    if (isEnabled)
        comp.setBackground(SystemColor.text);
    else
        comp.setBackground(SystemColor.control);
}

From source file:de.juwimm.cms.content.panel.PanDocuments.java

private void jbInit() throws Exception {
    mimeType = "";
    btnDelete.setText("Datei lschen");
    panBottom.setLayout(new BorderLayout());
    panDocumentButtons.setLayout(panDocumentsLayout);
    btnAdd.setText("Datei hinzufgen");
    lbLinkDescription.setText(" Linkbeschreibung  ");
    this.setLayout(new BorderLayout());
    panLinkName.setLayout(panLinkNameLayout);
    panDocumentsLayout.setAlignment(FlowLayout.LEFT);
    panDocumentButtons.setBackground(SystemColor.text);
    this.add(panBottom, BorderLayout.SOUTH);
    panBottom.add(panFileAction, BorderLayout.EAST);
    panFileAction.add(btnUpdate, null);/*  ww  w  .java 2s .  c  om*/
    panFileAction.add(btnAdd, null);
    panFileAction.add(btnDelete, null);
    panFileAction.add(btnPreview, null);
    panBottom.add(panLinkName, BorderLayout.NORTH);
    panLinkName.add(lbLinkDescription, new GridBagConstraints(0, 0, 1, 1, 0, 0,
            GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 2, 2));
    panLinkName.add(txtLinkDesc, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.BASELINE_LEADING,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 2, 2));
    if (showDocumentProperties) {
        panLinkName.add(lbDocumentLabel, new GridBagConstraints(0, 1, 1, 1, 0, 0,
                GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 2, 2));
        panLinkName.add(txtDocumentLabel, new GridBagConstraints(1, 1, 1, 1, 1, 0,
                GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 2, 2));
        panLinkName.add(lbDocumentDescription, new GridBagConstraints(0, 2, 1, 1, 0, 0,
                GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 2, 2));
        panLinkName.add(txtDocumentDescription, new GridBagConstraints(1, 2, 1, 1, 1, 0,
                GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 2, 2));
        panLinkName.add(lbAuthor, new GridBagConstraints(0, 3, 1, 1, 0, 0, GridBagConstraints.BASELINE_LEADING,
                GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 2, 2));
        panLinkName.add(txtAuthor, new GridBagConstraints(1, 3, 1, 1, 1, 0, GridBagConstraints.BASELINE_LEADING,
                GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 2, 2));
        panLinkName.add(lbCategory, new GridBagConstraints(0, 4, 1, 1, 0, 0,
                GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 2, 2));
        panLinkName.add(txtCategory, new GridBagConstraints(1, 4, 1, 1, 1, 0,
                GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 2, 2));
        panLinkName.add(ckbDocumentSearchable, new GridBagConstraints(0, 5, 2, 1, 1, 1,
                GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 2, 2));
    }
    panBottom.add(cbxDisplayTypeInline, BorderLayout.WEST);
    this.add(scrollPane, BorderLayout.CENTER);
    if (showRegionCombo) {
        this.add(cboRegion, BorderLayout.NORTH);
    }

    this.add(getViewSelectPan(), BorderLayout.WEST);
    scrollPane.getViewport().add(tblDocuments, null);
    scrollPane.setTransferHandler(new FileTransferHandler(this));
}

From source file:au.org.ala.delta.intkey.Intkey.java

/**
 * Creates and shows the GUI. Called by the swing application framework
 *//*from   w  w  w.j  a  v a 2 s . c om*/
@Override
protected void startup() {
    final JFrame mainFrame = getMainFrame();
    _defaultGlassPane = mainFrame.getGlassPane();
    mainFrame.setTitle("Intkey");
    mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
    mainFrame.setIconImages(IconHelper.getRedIconList());

    _helpController = new HelpController(HELPSET_PATH);

    _taxonformatter = new ItemFormatter(false, CommentStrippingMode.STRIP_ALL, AngleBracketHandlingMode.REMOVE,
            true, false, true);
    _context = new IntkeyContext(new IntkeyUIInterceptor(this), new DirectivePopulatorInterceptor(this));

    _advancedModeOnlyDynamicButtons = new ArrayList<JButton>();
    _normalModeOnlyDynamicButtons = new ArrayList<JButton>();
    _activeOnlyWhenCharactersUsedButtons = new ArrayList<JButton>();
    _dynamicButtonsFullHelp = new HashMap<JButton, String>();

    ActionMap actionMap = getContext().getActionMap();

    _rootPanel = new JPanel();
    _rootPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
    _rootPanel.setBackground(SystemColor.control);
    _rootPanel.setLayout(new BorderLayout(0, 0));

    _globalOptionBar = new JPanel();
    _globalOptionBar.setBorder(new EmptyBorder(0, 5, 0, 5));
    _rootPanel.add(_globalOptionBar, BorderLayout.NORTH);
    _globalOptionBar.setLayout(new BorderLayout(0, 0));

    _pnlDynamicButtons = new JPanel();
    FlowLayout flowLayout_1 = (FlowLayout) _pnlDynamicButtons.getLayout();
    flowLayout_1.setVgap(0);
    flowLayout_1.setHgap(0);
    _globalOptionBar.add(_pnlDynamicButtons, BorderLayout.WEST);

    _btnContextHelp = new JButton();
    _btnContextHelp.setMinimumSize(new Dimension(30, 30));
    _btnContextHelp.setMaximumSize(new Dimension(30, 30));
    _btnContextHelp.setAction(actionMap.get("btnContextHelp"));
    _btnContextHelp.setPreferredSize(new Dimension(30, 30));
    _btnContextHelp.setMargin(new Insets(2, 5, 2, 5));
    _btnContextHelp.addActionListener(actionMap.get("btnContextHelp"));
    _globalOptionBar.add(_btnContextHelp, BorderLayout.EAST);

    _rootSplitPane = new JSplitPane();
    _rootSplitPane.setDividerSize(3);
    _rootSplitPane.setResizeWeight(0.5);
    _rootSplitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
    _rootSplitPane.setContinuousLayout(true);
    _rootPanel.add(_rootSplitPane);

    _innerSplitPaneLeft = new JSplitPane();
    _innerSplitPaneLeft.setMinimumSize(new Dimension(25, 25));
    _innerSplitPaneLeft.setAlignmentX(Component.CENTER_ALIGNMENT);
    _innerSplitPaneLeft.setDividerSize(3);
    _innerSplitPaneLeft.setResizeWeight(0.5);

    _innerSplitPaneLeft.setContinuousLayout(true);
    _innerSplitPaneLeft.setOrientation(JSplitPane.VERTICAL_SPLIT);
    _rootSplitPane.setLeftComponent(_innerSplitPaneLeft);

    _pnlAvailableCharacters = new JPanel();
    _innerSplitPaneLeft.setLeftComponent(_pnlAvailableCharacters);
    _pnlAvailableCharacters.setLayout(new BorderLayout(0, 0));

    _sclPaneAvailableCharacters = new JScrollPane();
    _pnlAvailableCharacters.add(_sclPaneAvailableCharacters, BorderLayout.CENTER);

    _listAvailableCharacters = new JList();
    // _listAvailableCharacters.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    _listAvailableCharacters.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    _listAvailableCharacters.setCellRenderer(_availableCharactersListCellRenderer);
    _listAvailableCharacters.addMouseListener(new MouseInputAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() >= 2) {
                int selectedIndex = _listAvailableCharacters.getSelectedIndex();
                if (selectedIndex >= 0) {
                    try {
                        Character ch = (Character) _availableCharacterListModel.getElementAt(selectedIndex);
                        executeDirective(new UseDirective(), Integer.toString(ch.getCharacterId()));
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                }
            }
        }
    });

    _sclPaneAvailableCharacters.setViewportView(_listAvailableCharacters);

    _pnlAvailableCharactersHeader = new JPanel();
    _pnlAvailableCharacters.add(_pnlAvailableCharactersHeader, BorderLayout.NORTH);
    _pnlAvailableCharactersHeader.setLayout(new BorderLayout(0, 0));

    _lblNumAvailableCharacters = new JLabel();
    _lblNumAvailableCharacters.setBorder(new EmptyBorder(0, 5, 0, 0));
    _lblNumAvailableCharacters.setFont(new Font("Tahoma", Font.PLAIN, 15));
    _lblNumAvailableCharacters.setText(MessageFormat.format(availableCharactersCaption, 0));
    _pnlAvailableCharactersHeader.add(_lblNumAvailableCharacters, BorderLayout.WEST);

    _pnlAvailableCharactersButtons = new JPanel();
    FlowLayout flowLayout = (FlowLayout) _pnlAvailableCharactersButtons.getLayout();
    flowLayout.setVgap(2);
    flowLayout.setHgap(2);
    _pnlAvailableCharactersHeader.add(_pnlAvailableCharactersButtons, BorderLayout.EAST);

    // All toolbar buttons should be disabled until a dataset is loaded.
    _btnRestart = new JButton();
    _btnRestart.setAction(actionMap.get("btnRestart"));
    _btnRestart.setPreferredSize(new Dimension(30, 30));
    _btnRestart.setEnabled(false);
    _pnlAvailableCharactersButtons.add(_btnRestart);

    _btnBestOrder = new JButton();
    _btnBestOrder.setAction(actionMap.get("btnBestOrder"));
    _btnBestOrder.setPreferredSize(new Dimension(30, 30));
    _btnBestOrder.setEnabled(false);
    _pnlAvailableCharactersButtons.add(_btnBestOrder);

    _btnSeparate = new JButton();
    _btnSeparate.setAction(actionMap.get("btnSeparate"));
    _btnSeparate.setVisible(_advancedMode);
    _btnSeparate.setPreferredSize(new Dimension(30, 30));
    _btnSeparate.setEnabled(false);
    _pnlAvailableCharactersButtons.add(_btnSeparate);

    _btnNaturalOrder = new JButton();
    _btnNaturalOrder.setAction(actionMap.get("btnNaturalOrder"));
    _btnNaturalOrder.setPreferredSize(new Dimension(30, 30));
    _btnNaturalOrder.setEnabled(false);
    _pnlAvailableCharactersButtons.add(_btnNaturalOrder);

    _btnDiffSpecimenTaxa = new JButton();
    _btnDiffSpecimenTaxa.setAction(actionMap.get("btnDiffSpecimenTaxa"));
    _btnDiffSpecimenTaxa.setEnabled(false);
    _btnDiffSpecimenTaxa.setPreferredSize(new Dimension(30, 30));
    _pnlAvailableCharactersButtons.add(_btnDiffSpecimenTaxa);

    _btnSetTolerance = new JButton();
    _btnSetTolerance.setAction(actionMap.get("btnSetTolerance"));
    _btnSetTolerance.setPreferredSize(new Dimension(30, 30));
    _btnSetTolerance.setEnabled(false);
    _pnlAvailableCharactersButtons.add(_btnSetTolerance);

    _btnSetMatch = new JButton();
    _btnSetMatch.setAction(actionMap.get("btnSetMatch"));
    _btnSetMatch.setVisible(_advancedMode);
    _btnSetMatch.setPreferredSize(new Dimension(30, 30));
    _btnSetMatch.setEnabled(false);
    _pnlAvailableCharactersButtons.add(_btnSetMatch);

    _btnSubsetCharacters = new JButton();
    _btnSubsetCharacters.setAction(actionMap.get("btnSubsetCharacters"));
    _btnSubsetCharacters.setPreferredSize(new Dimension(30, 30));
    _btnSubsetCharacters.setEnabled(false);
    _pnlAvailableCharactersButtons.add(_btnSubsetCharacters);

    _btnFindCharacter = new JButton();
    _btnFindCharacter.setAction(actionMap.get("btnFindCharacter"));
    _btnFindCharacter.setPreferredSize(new Dimension(30, 30));
    _btnFindCharacter.setEnabled(false);
    _pnlAvailableCharactersButtons.add(_btnFindCharacter);

    _pnlAvailableCharactersButtons.setEnabled(false);

    _pnlUsedCharacters = new JPanel();
    _innerSplitPaneLeft.setRightComponent(_pnlUsedCharacters);
    _pnlUsedCharacters.setLayout(new BorderLayout(0, 0));

    _sclPnUsedCharacters = new JScrollPane();
    _pnlUsedCharacters.add(_sclPnUsedCharacters, BorderLayout.CENTER);

    _listUsedCharacters = new JList();
    _listUsedCharacters.setCellRenderer(_usedCharactersListCellRenderer);
    _listUsedCharacters.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    _listUsedCharacters.addMouseListener(new MouseInputAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() >= 2) {
                int selectedIndex = _listUsedCharacters.getSelectedIndex();
                if (selectedIndex >= 0) {
                    try {
                        Attribute attr = (Attribute) _usedCharacterListModel.getElementAt(selectedIndex);

                        if (_context.charactersFixed() && _context.getFixedCharactersList()
                                .contains(attr.getCharacter().getCharacterId())) {
                            return;
                        }

                        executeDirective(new ChangeDirective(),
                                Integer.toString(attr.getCharacter().getCharacterId()));
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                }
            }
        }
    });

    _sclPnUsedCharacters.setViewportView(_listUsedCharacters);

    _pnlUsedCharactersHeader = new JPanel();
    _pnlUsedCharacters.add(_pnlUsedCharactersHeader, BorderLayout.NORTH);
    _pnlUsedCharactersHeader.setLayout(new BorderLayout(0, 0));

    _lblNumUsedCharacters = new JLabel();
    _lblNumUsedCharacters.setBorder(new EmptyBorder(7, 5, 7, 0));
    _lblNumUsedCharacters.setFont(new Font("Tahoma", Font.PLAIN, 15));
    _lblNumUsedCharacters.setText(MessageFormat.format(usedCharactersCaption, 0));
    _pnlUsedCharactersHeader.add(_lblNumUsedCharacters, BorderLayout.WEST);

    _innerSplitPaneRight = new JSplitPane();
    _innerSplitPaneRight.setMinimumSize(new Dimension(25, 25));
    _innerSplitPaneRight.setDividerSize(3);
    _innerSplitPaneRight.setResizeWeight(0.5);
    _innerSplitPaneRight.setContinuousLayout(true);
    _innerSplitPaneRight.setOrientation(JSplitPane.VERTICAL_SPLIT);
    _rootSplitPane.setRightComponent(_innerSplitPaneRight);

    _pnlRemainingTaxa = new JPanel();
    _innerSplitPaneRight.setLeftComponent(_pnlRemainingTaxa);
    _pnlRemainingTaxa.setLayout(new BorderLayout(0, 0));

    _sclPnRemainingTaxa = new JScrollPane();
    _pnlRemainingTaxa.add(_sclPnRemainingTaxa, BorderLayout.CENTER);

    _listRemainingTaxa = new JList();

    _listRemainingTaxa.addMouseListener(new MouseInputAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() >= 2) {
                displayInfoForSelectedTaxa();
            }
        }
    });

    _sclPnRemainingTaxa.setViewportView(_listRemainingTaxa);

    _pnlRemainingTaxaHeader = new JPanel();
    _pnlRemainingTaxa.add(_pnlRemainingTaxaHeader, BorderLayout.NORTH);
    _pnlRemainingTaxaHeader.setLayout(new BorderLayout(0, 0));

    _lblNumRemainingTaxa = new JLabel();
    _lblNumRemainingTaxa.setBorder(new EmptyBorder(0, 5, 0, 0));
    _lblNumRemainingTaxa.setFont(new Font("Tahoma", Font.PLAIN, 15));
    _lblNumRemainingTaxa.setText(MessageFormat.format(remainingTaxaCaption, 0));
    _pnlRemainingTaxaHeader.add(_lblNumRemainingTaxa, BorderLayout.WEST);

    _pnlRemainingTaxaButtons = new JPanel();
    FlowLayout fl_pnlRemainingTaxaButtons = (FlowLayout) _pnlRemainingTaxaButtons.getLayout();
    fl_pnlRemainingTaxaButtons.setVgap(2);
    fl_pnlRemainingTaxaButtons.setHgap(2);
    _pnlRemainingTaxaHeader.add(_pnlRemainingTaxaButtons, BorderLayout.EAST);

    // All toolbar buttons should be disabled until a dataset is loaded.
    _btnTaxonInfo = new JButton();
    _btnTaxonInfo.setAction(actionMap.get("btnTaxonInfo"));
    _btnTaxonInfo.setPreferredSize(new Dimension(30, 30));
    _btnTaxonInfo.setEnabled(false);
    _pnlRemainingTaxaButtons.add(_btnTaxonInfo);

    _btnDiffTaxa = new JButton();
    _btnDiffTaxa.setAction(actionMap.get("btnDiffTaxa"));
    _btnDiffTaxa.setPreferredSize(new Dimension(30, 30));
    _btnDiffTaxa.setEnabled(false);
    _pnlRemainingTaxaButtons.add(_btnDiffTaxa);

    _btnSubsetTaxa = new JButton();
    _btnSubsetTaxa.setAction(actionMap.get("btnSubsetTaxa"));
    _btnSubsetTaxa.setPreferredSize(new Dimension(30, 30));
    _btnSubsetTaxa.setEnabled(false);
    _pnlRemainingTaxaButtons.add(_btnSubsetTaxa);

    _btnFindTaxon = new JButton();
    _btnFindTaxon.setAction(actionMap.get("btnFindTaxon"));
    _btnFindTaxon.setPreferredSize(new Dimension(30, 30));
    _btnFindTaxon.setEnabled(false);
    _pnlRemainingTaxaButtons.add(_btnFindTaxon);

    _pnlEliminatedTaxa = new JPanel();
    _innerSplitPaneRight.setRightComponent(_pnlEliminatedTaxa);
    _pnlEliminatedTaxa.setLayout(new BorderLayout(0, 0));

    _sclPnEliminatedTaxa = new JScrollPane();
    _pnlEliminatedTaxa.add(_sclPnEliminatedTaxa, BorderLayout.CENTER);

    _listEliminatedTaxa = new JList();

    _listEliminatedTaxa.addMouseListener(new MouseInputAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() >= 2) {
                displayInfoForSelectedTaxa();
            }
        }
    });

    _sclPnEliminatedTaxa.setViewportView(_listEliminatedTaxa);

    _pnlEliminatedTaxaHeader = new JPanel();
    _pnlEliminatedTaxa.add(_pnlEliminatedTaxaHeader, BorderLayout.NORTH);
    _pnlEliminatedTaxaHeader.setLayout(new BorderLayout(0, 0));

    _lblEliminatedTaxa = new JLabel();
    _lblEliminatedTaxa.setBorder(new EmptyBorder(7, 5, 7, 0));
    _lblEliminatedTaxa.setFont(new Font("Tahoma", Font.PLAIN, 15));
    _lblEliminatedTaxa.setText(MessageFormat.format(eliminatedTaxaCaption, 0));
    _pnlEliminatedTaxaHeader.add(_lblEliminatedTaxa, BorderLayout.WEST);

    JMenuBar menuBar = buildMenus(_advancedMode);
    getMainView().setMenuBar(menuBar);

    _txtFldCmdBar = new JTextField();
    _txtFldCmdBar.setCaretColor(Color.WHITE);
    _txtFldCmdBar.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            String cmdStr = _txtFldCmdBar.getText();

            cmdStr = cmdStr.trim();
            if (_cmdMenus.containsKey(cmdStr)) {
                JMenu cmdMenu = _cmdMenus.get(cmdStr);
                cmdMenu.doClick();
            } else {
                _context.parseAndExecuteDirective(cmdStr);
            }
            _txtFldCmdBar.setText(null);
        }
    });

    _txtFldCmdBar.setFont(new Font("Courier New", Font.BOLD, 13));
    _txtFldCmdBar.setForeground(SystemColor.text);
    _txtFldCmdBar.setBackground(Color.BLACK);
    _txtFldCmdBar.setOpaque(true);
    _txtFldCmdBar.setVisible(_advancedMode);
    _rootPanel.add(_txtFldCmdBar, BorderLayout.SOUTH);
    _txtFldCmdBar.setColumns(10);

    _logDialog = new RtfReportDisplayDialog(getMainFrame(), new SimpleRtfEditorKit(null), null, logDialogTitle);

    // Set context-sensitive help keys for toolbar buttons
    _helpController.setHelpKeyForComponent(_btnRestart, HELP_ID_CHARACTERS_TOOLBAR_RESTART);
    _helpController.setHelpKeyForComponent(_btnBestOrder, HELP_ID_CHARACTERS_TOOLBAR_BEST);
    _helpController.setHelpKeyForComponent(_btnSeparate, HELP_ID_CHARACTERS_TOOLBAR_SEPARATE);
    _helpController.setHelpKeyForComponent(_btnNaturalOrder, HELP_ID_CHARACTERS_TOOLBAR_NATURAL);
    _helpController.setHelpKeyForComponent(_btnDiffSpecimenTaxa,
            HELP_ID_CHARACTERS_TOOLBAR_DIFF_SPECIMEN_REMAINING);
    _helpController.setHelpKeyForComponent(_btnSetTolerance, HELP_ID_CHARACTERS_TOOLBAR_TOLERANCE);
    _helpController.setHelpKeyForComponent(_btnSetMatch, HELP_ID_CHARACTERS_TOOLBAR_SET_MATCH);
    _helpController.setHelpKeyForComponent(_btnSubsetCharacters, HELP_ID_CHARACTERS_TOOLBAR_SUBSET_CHARACTERS);
    _helpController.setHelpKeyForComponent(_btnFindCharacter, HELP_ID_CHARACTERS_TOOLBAR_FIND_CHARACTERS);

    _helpController.setHelpKeyForComponent(_btnTaxonInfo, HELP_ID_TAXA_TOOLBAR_INFO);
    _helpController.setHelpKeyForComponent(_btnDiffTaxa, HELP_ID_TAXA_TOOLBAR_DIFF_TAXA);
    _helpController.setHelpKeyForComponent(_btnSubsetTaxa, HELP_ID_TAXA_TOOLBAR_SUBSET_TAXA);
    _helpController.setHelpKeyForComponent(_btnFindTaxon, HELP_ID_TAXA_TOOLBAR_FIND_TAXA);

    // This mouse listener on the default glasspane is to assist with
    // context senstive help. It intercepts the mouse events,
    // determines what component was being clicked on, then takes the
    // appropriate action to provide help for the component
    _defaultGlassPane.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            // Determine what point has been clicked on
            Point glassPanePoint = e.getPoint();
            Point containerPoint = SwingUtilities.convertPoint(getMainFrame().getGlassPane(), glassPanePoint,
                    getMainFrame().getContentPane());
            Component component = SwingUtilities.getDeepestComponentAt(getMainFrame().getContentPane(),
                    containerPoint.x, containerPoint.y);

            // Get the java help ID for this component. If none has been
            // defined, this will be null
            String helpID = _helpController.getHelpKeyForComponent(component);

            // change the cursor back to the normal one and take down the
            // classpane
            mainFrame.setCursor(Cursor.getDefaultCursor());
            mainFrame.getGlassPane().setVisible(false);

            // If a help ID was found, display the related help page in the
            // help viewer
            if (_helpController.getHelpKeyForComponent(component) != null) {
                _helpController.helpAction().actionPerformed(new ActionEvent(component, 0, null));
                _helpController.displayHelpTopic(mainFrame, helpID);
            } else {
                // If a dynamically-defined toolbar button was clicked, show
                // the help for this button in the ToolbarHelpDialog.
                if (component instanceof JButton) {
                    JButton button = (JButton) component;
                    if (_dynamicButtonsFullHelp.containsKey(button)) {
                        String fullHelpText = _dynamicButtonsFullHelp.get(button);
                        if (fullHelpText == null) {
                            fullHelpText = noHelpAvailableCaption;
                        }
                        RTFBuilder builder = new RTFBuilder();
                        builder.startDocument();
                        builder.appendText(fullHelpText);
                        builder.endDocument();
                        ToolbarHelpDialog dlg = new ToolbarHelpDialog(mainFrame, builder.toString(),
                                button.getIcon());
                        show(dlg);
                    }
                }
            }
        }
    });

    show(_rootPanel);
}

From source file:org.esa.snap.ui.tooladapter.model.OperatorParametersTable.java

@Override
public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
    Component component = super.prepareRenderer(renderer, row, column);
    ToolParameterDescriptor descriptor = operator.getToolParameterDescriptors().get(row);
    switch (descriptor.getName()) {
    case ToolAdapterConstants.TOOL_SOURCE_PRODUCT_ID:
    case ToolAdapterConstants.TOOL_SOURCE_PRODUCT_FILE:
    case ToolAdapterConstants.TOOL_TARGET_PRODUCT_ID:
    case ToolAdapterConstants.TOOL_TARGET_PRODUCT_FILE:
        component.setBackground(Color.lightGray);
        break;//from www.jav a  2  s  .  co  m
    default:
        component.setBackground(SystemColor.text);
        break;
    }
    return component;
}

From source file:pcgen.core.SettingsHandler.java

public static Dimension getOptionsFromProperties(final PlayerCharacter aPC) {
    Dimension d = new Dimension(0, 0);

    final String tempBrowserPath = getPCGenOption("browserPath", ""); //$NON-NLS-1$ //$NON-NLS-2$

    if (!"".equals(tempBrowserPath)) //$NON-NLS-1$
    {/*from   w w  w .  j a  va 2 s. c om*/
        setBrowserPath(tempBrowserPath);
    } else {
        setBrowserPath(null);
    }

    setLeftUpperCorner(new Point(getPCGenOption("windowLeftUpperCorner.X", -1.0).intValue(), //$NON-NLS-1$
            getPCGenOption("windowLeftUpperCorner.Y", -1.0).intValue())); //$NON-NLS-1$

    setWindowState(getPCGenOption("windowState", Frame.NORMAL)); //$NON-NLS-1$

    Double dw = getPCGenOption("windowWidth", 0.0); //$NON-NLS-1$
    Double dh = getPCGenOption("windowHeight", 0.0); //$NON-NLS-1$

    if (!CoreUtility.doublesEqual(dw.doubleValue(), 0.0) && !CoreUtility.doublesEqual(dh.doubleValue(), 0.0)) {
        final int width = Integer.parseInt(
                dw.toString().substring(0, Math.min(dw.toString().length(), dw.toString().lastIndexOf('.'))));
        final int height = Integer.parseInt(
                dh.toString().substring(0, Math.min(dh.toString().length(), dh.toString().lastIndexOf('.'))));
        d = new Dimension(width, height);
    }

    setCustomizerLeftUpperCorner(
            new Point(getPCGenOption("customizer.windowLeftUpperCorner.X", -1.0).intValue(), //$NON-NLS-1$
                    getPCGenOption("customizer.windowLeftUpperCorner.Y", -1.0).intValue())); //$NON-NLS-1$
    dw = getPCGenOption("customizer.windowWidth", 0.0); //$NON-NLS-1$
    dh = getPCGenOption("customizer.windowHeight", 0.0); //$NON-NLS-1$

    if (!CoreUtility.doublesEqual(dw.doubleValue(), 0.0) && !CoreUtility.doublesEqual(dh.doubleValue(), 0.0)) {
        setCustomizerDimension(new Dimension(dw.intValue(), dh.intValue()));
    }

    setKitSelectorLeftUpperCorner(
            new Point(getPCGenOption("kitSelector.windowLeftUpperCorner.X", -1.0).intValue(), //$NON-NLS-1$
                    getPCGenOption("kitSelector.windowLeftUpperCorner.Y", -1.0).intValue())); //$NON-NLS-1$
    dw = getPCGenOption("kitSelector.windowWidth", 0.0); //$NON-NLS-1$
    dh = getPCGenOption("kitSelector.windowHeight", 0.0); //$NON-NLS-1$

    if (!CoreUtility.doublesEqual(dw.doubleValue(), 0.0) && !CoreUtility.doublesEqual(dh.doubleValue(), 0.0)) {
        setKitSelectorDimension(new Dimension(dw.intValue(), dh.intValue()));
    }

    //
    // Read in the buy/sell percentages for the gear tab
    // If not in the .ini file and ignoreCost is set, then use 0%
    // Otherwise set buy to 100% and sell to %50
    //
    int buyRate = getPCGenOption("GearTab.buyRate", -1); //$NON-NLS-1$
    int sellRate = getPCGenOption("GearTab.sellRate", -1); //$NON-NLS-1$

    if ((buyRate < 0) || (sellRate < 0)) {
        if (getPCGenOption("GearTab.ignoreCost", false)) //$NON-NLS-1$
        {
            buyRate = 0;
            sellRate = 0;
        } else {
            buyRate = 100;
            sellRate = 50;
        }
    }

    Globals.initCustColumnWidth(CoreUtility.split(getOptions().getProperty("pcgen.options.custColumnWidth", ""), //$NON-NLS-1$//$NON-NLS-2$
            ','));

    loadURLs = getPCGenOption("loadURLs", false); //$NON-NLS-1$

    Globals.setSourceDisplay(
            SourceFormat.values()[getPCGenOption("sourceDisplay", SourceFormat.LONG.ordinal())]); //$NON-NLS-1$

    setAlwaysOverwrite(getPCGenOption("alwaysOverwrite", false)); //$NON-NLS-1$
    setAutoFeatsRefundable(getPCGenOption("autoFeatsRefundable", false)); //$NON-NLS-1$
    setAutogenExoticMaterial(getPCGenOption("autoGenerateExoticMaterial", false)); //$NON-NLS-1$
    setAutogenMagic(getPCGenOption("autoGenerateMagic", false)); //$NON-NLS-1$
    setAutogenMasterwork(getPCGenOption("autoGenerateMasterwork", false)); //$NON-NLS-1$
    setAutogenRacial(getPCGenOption("autoGenerateRacial", false)); //$NON-NLS-1$
    setChaTabPlacement(getOptionTabPlacement("chaTabPlacement", SwingConstants.TOP)); //$NON-NLS-1$
    setCreatePcgBackup(getPCGenOption("createPcgBackup", true));
    setCustomizerSplit1(getPCGenOption("customizer.split1", -1)); //$NON-NLS-1$
    setCustomizerSplit2(getPCGenOption("customizer.split2", -1)); //$NON-NLS-1$
    setDefaultOSType(getPCGenOption("defaultOSType", null)); //$NON-NLS-1$
    setEnforceSpendingBeforeLevelUp(getPCGenOption("enforceSpendingBeforeLevelUp", false)); //$NON-NLS-1$
    setGearTab_AllowDebt(getPCGenOption("GearTab.allowDebt", false)); //$NON-NLS-1$
    setGearTab_AutoResize(getPCGenOption("GearTab.autoResize", false)); //$NON-NLS-1$
    setGearTab_BuyRate(buyRate);
    setGearTab_IgnoreCost(getPCGenOption("GearTab.ignoreCost", false)); //$NON-NLS-1$
    setGearTab_SellRate(sellRate);
    setGrimHPMode(getPCGenOption("grimHPMode", false)); //$NON-NLS-1$
    setGrittyACMode(getPCGenOption("grittyACMode", false)); //$NON-NLS-1$
    setGUIUsesOutputNameEquipment(getPCGenOption("GUIUsesOutputNameEquipment", false)); //$NON-NLS-1$
    setGUIUsesOutputNameSpells(getPCGenOption("GUIUsesOutputNameSpells", false)); //$NON-NLS-1$
    setHideMonsterClasses(getPCGenOption("hideMonsterClasses", false)); //$NON-NLS-1$
    setHPMaxAtFirstLevel(getPCGenOption("hpMaxAtFirstLevel", true)); //$NON-NLS-1$
    setHPMaxAtFirstClassLevel(getPCGenOption("hpMaxAtFirstClassLevel", false)); //$NON-NLS-1$
    setHPMaxAtFirstPCClassLevelOnly(getPCGenOption("hpMaxAtFirstPCClassLevelOnly", false)); //$NON-NLS-1$
    setHPPercent(getPCGenOption("hpPercent", 100)); //$NON-NLS-1$
    setHPRollMethod(getPCGenOption("hpRollMethod", Constants.HP_STANDARD)); //$NON-NLS-1$
    setIgnoreMonsterHDCap(getPCGenOption("ignoreMonsterHDCap", false)); //$NON-NLS-1$
    setInvalidDmgText(getPCGenOption("invalidDmgText", //$NON-NLS-1$
            LanguageBundle.getString("SettingsHandler.114"))); //$NON-NLS-1$
    setInvalidToHitText(getPCGenOption("invalidToHitText", //$NON-NLS-1$
            LanguageBundle.getString("SettingsHandler.114"))); //$NON-NLS-1$
    setLastTipShown(getPCGenOption("lastTipOfTheDayTipShown", -1)); //$NON-NLS-1$
    setLookAndFeel(getPCGenOption("looknFeel", 1)); //$NON-NLS-1$
    setMaxPotionSpellLevel(getPCGenOption("maxPotionSpellLevel", 3)); //$NON-NLS-1$
    setMaxWandSpellLevel(getPCGenOption("maxWandSpellLevel", 4)); //$NON-NLS-1$
    setMetamagicAllowedInEqBuilder(getPCGenOption("allowMetamagicInCustomizer", false)); //$NON-NLS-1$
    setPccFilesLocation(new File(expandRelativePath(getPCGenOption("pccFilesLocation", //$NON-NLS-1$
            System.getProperty("user.dir") + File.separator + "data")))); //$NON-NLS-1$ //$NON-NLS-2$
    setPcgenOutputSheetDir(
            new File(expandRelativePath(getOptions().getProperty("pcgen.files.pcgenOutputSheetDir", //$NON-NLS-1$
                    System.getProperty("user.dir") + File.separator + "outputsheets")))); //$NON-NLS-1$ //$NON-NLS-2$
    setPcgenPreviewDir(new File(expandRelativePath(getOptions().getProperty("pcgen.files.pcgenPreviewDir", //$NON-NLS-1$
            System.getProperty("user.dir") + File.separator + "preview")))); //$NON-NLS-1$ //$NON-NLS-2$
    setGmgenPluginDir(new File(expandRelativePath(getOptions().getProperty("gmgen.files.gmgenPluginDir", //$NON-NLS-1$
            System.getProperty("user.dir") + File.separator + "plugins")))); //$NON-NLS-1$ //$NON-NLS-2$
    setBackupPcgPath(
            new File(expandRelativePath(getOptions().getProperty("pcgen.files.characters.backup", "")))); //$NON-NLS-1$
    setPortraitsPath(new File(expandRelativePath(getOptions().getProperty("pcgen.files.portraits", //$NON-NLS-1$
            Globals.getDefaultPcgPath()))));
    setPostExportCommandStandard(getPCGenOption("postExportCommandStandard", "")); //$NON-NLS-1$ //$NON-NLS-2$
    setPostExportCommandPDF(getPCGenOption("postExportCommandPDF", "")); //$NON-NLS-1$ //$NON-NLS-2$
    setPrereqFailColor(getPCGenOption("prereqFailColor", Color.red.getRGB())); //$NON-NLS-1$
    setPrereqQualifyColor(getPCGenOption("prereqQualifyColor", SystemColor.text.getRGB())); //$NON-NLS-1$
    setPreviewTabShown(getPCGenOption("previewTabShown", true)); //$NON-NLS-1$
    setROG(getPCGenOption("isROG", false)); //$NON-NLS-1$
    setSaveCustomInLst(getPCGenOption("saveCustomInLst", false)); //$NON-NLS-1$
    setSaveOutputSheetWithPC(getPCGenOption("saveOutputSheetWithPC", false)); //$NON-NLS-1$
    setPrintSpellsWithPC(getPCGenOption("printSpellsWithPC", true)); //$NON-NLS-1$
    setSelectedSpellSheet(
            expandRelativePath(getOptions().getProperty("pcgen.files.selectedSpellOutputSheet", ""))); //$NON-NLS-1$ //$NON-NLS-2$
    setSelectedCharacterHTMLOutputSheet(
            expandRelativePath(getOptions().getProperty("pcgen.files.selectedCharacterHTMLOutputSheet", //$NON-NLS-1$
                    "")), //$NON-NLS-1$
            aPC);
    setSelectedCharacterPDFOutputSheet(
            expandRelativePath(getOptions().getProperty("pcgen.files.selectedCharacterPDFOutputSheet", //$NON-NLS-1$
                    "")), //$NON-NLS-1$
            aPC);
    setSelectedEqSetTemplate(
            expandRelativePath(getOptions().getProperty("pcgen.files.selectedEqSetTemplate", ""))); //$NON-NLS-1$ //$NON-NLS-2$
    setSelectedPartyHTMLOutputSheet(
            expandRelativePath(getOptions().getProperty("pcgen.files.selectedPartyHTMLOutputSheet", //$NON-NLS-1$
                    ""))); //$NON-NLS-1$
    setSelectedPartyPDFOutputSheet(
            expandRelativePath(getOptions().getProperty("pcgen.files.selectedPartyPDFOutputSheet", //$NON-NLS-1$
                    ""))); //$NON-NLS-1$
    setShowFeatDialogAtLevelUp(getPCGenOption("showFeatDialogAtLevelUp", true)); //$NON-NLS-1$
    setShowHPDialogAtLevelUp(getPCGenOption("showHPDialogAtLevelUp", true)); //$NON-NLS-1$
    setShowImagePreview(getPCGenOption("showImagePreview", true)); //$NON-NLS-1$
    setShowSingleBoxPerBundle(getPCGenOption("showSingleBoxPerBundle", false)); //$NON-NLS-1$
    setOutputDeprecationMessages(getPCGenOption("outputDeprecationMessages", true));
    setInputUnconstructedMessages(getPCGenOption("inputUnconstructedMessages", false));
    setShowStatDialogAtLevelUp(getPCGenOption("showStatDialogAtLevelUp", true)); //$NON-NLS-1$
    setShowTipOfTheDay(getPCGenOption("showTipOfTheDay", true)); //$NON-NLS-1$
    setShowToolBar(getPCGenOption("showToolBar", true)); //$NON-NLS-1$
    setShowSkillModifier(getPCGenOption("showSkillModifier", true)); //$NON-NLS-1$
    setShowSkillRanks(getPCGenOption("showSkillRanks", true)); //$NON-NLS-1$
    setShowWarningAtFirstLevelUp(getPCGenOption("showWarningAtFirstLevelUp", true)); //$NON-NLS-1$
    setSkinLFThemePack(getPCGenOption("skinLFThemePack", "")); //$NON-NLS-1$ //$NON-NLS-2$
    setSpellMarketPriceAdjusted(getPCGenOption("spellMarketPriceAdjusted", false)); //$NON-NLS-1$
    setTabPlacement(getOptionTabPlacement("tabPlacement", SwingConstants.BOTTOM)); //$NON-NLS-1$
    setUseHigherLevelSlotsDefault(getPCGenOption("useHigherLevelSlotsDefault", false)); //$NON-NLS-1$
    setUseWaitCursor(getPCGenOption("useWaitCursor", true)); //$NON-NLS-1$
    setWantToLoadMasterworkAndMagic(getPCGenOption("loadMasterworkAndMagicFromLst", false)); //$NON-NLS-1$
    setWeaponProfPrintout(getPCGenOption("weaponProfPrintout", Constants.DEFAULT_PRINTOUT_WEAPONPROF));

    // Load up all the RuleCheck stuff from the options.ini file
    // It's stored as:
    //   pcgen.options.rulechecks=aKey:Y|bKey:N|cKey:Y
    parseRuleChecksFromOptions(getPCGenOption("ruleChecks", "")); //$NON-NLS-1$ //$NON-NLS-2$

    return d;
}