Java Code Examples for sun.swing.DefaultLookup#getInt()
The following examples show how to use
sun.swing.DefaultLookup#getInt() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DarkTabbedPaneUIBridge.java From darklaf with MIT License | 6 votes |
/** * Returns the tab label.properties shift y. * * @param tabPlacement the tab placement * @param tabIndex the tab index * @param isSelected selection status * @return the tab label.properties shift y */ protected int getTabLabelShiftY(final int tabPlacement, final int tabIndex, final boolean isSelected) { Rectangle tabRect = rects[tabIndex]; int nudge = (isSelected ? DefaultLookup.getInt(tabPane, this, "TabbedPane.selectedLabelShift", -1) : DefaultLookup.getInt(tabPane, this, "TabbedPane.labelShift", 1)); switch (tabPlacement) { case BOTTOM : return -nudge; case LEFT : case RIGHT : return tabRect.height % 2; case TOP : default : return nudge; } }
Example 2
Source File: BasicSplitPaneDivider.java From JDKSourceCode1.8 with MIT License | 6 votes |
/** * Creates an instance of BasicSplitPaneDivider. Registers this * instance for mouse events and mouse dragged events. */ public BasicSplitPaneDivider(BasicSplitPaneUI ui) { oneTouchSize = DefaultLookup.getInt(ui.getSplitPane(), ui, "SplitPane.oneTouchButtonSize", ONE_TOUCH_SIZE); oneTouchOffset = DefaultLookup.getInt(ui.getSplitPane(), ui, "SplitPane.oneTouchButtonOffset", ONE_TOUCH_OFFSET); centerOneTouchButtons = DefaultLookup.getBoolean(ui.getSplitPane(), ui, "SplitPane.centerOneTouchButtons", true); setLayout(new DividerLayout()); setBasicSplitPaneUI(ui); orientation = splitPane.getOrientation(); setCursor((orientation == JSplitPane.HORIZONTAL_SPLIT) ? Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR) : Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR)); setBackground(UIManager.getColor("SplitPane.background")); }
Example 3
Source File: BasicTabbedPaneUI.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) { Rectangle tabRect = rects[tabIndex]; String propKey = (isSelected ? "selectedLabelShift" : "labelShift"); int nudge = DefaultLookup.getInt( tabPane, this, "TabbedPane." + propKey, 1); switch (tabPlacement) { case LEFT: return nudge; case RIGHT: return -nudge; case BOTTOM: case TOP: default: return tabRect.width % 2; } }
Example 4
Source File: BasicTextUI.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private void installDefaults2() { editor.addMouseListener(dragListener); editor.addMouseMotionListener(dragListener); String prefix = getPropertyPrefix(); Caret caret = editor.getCaret(); if (caret == null || caret instanceof UIResource) { caret = createCaret(); editor.setCaret(caret); int rate = DefaultLookup.getInt(getComponent(), this, prefix + ".caretBlinkRate", 500); caret.setBlinkRate(rate); } Highlighter highlighter = editor.getHighlighter(); if (highlighter == null || highlighter instanceof UIResource) { editor.setHighlighter(createHighlighter()); } TransferHandler th = editor.getTransferHandler(); if (th == null || th instanceof UIResource) { editor.setTransferHandler(getTransferHandler()); } }
Example 5
Source File: BasicTabbedPaneUI.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected) { Rectangle tabRect = rects[tabIndex]; int nudge = (isSelected ? DefaultLookup.getInt(tabPane, this, "TabbedPane.selectedLabelShift", -1) : DefaultLookup.getInt(tabPane, this, "TabbedPane.labelShift", 1)); switch (tabPlacement) { case BOTTOM: return -nudge; case LEFT: case RIGHT: return tabRect.height % 2; case TOP: default: return nudge; } }
Example 6
Source File: BasicTabbedPaneUI.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * Returns the tab label shift x. * @param tabPlacement the tab placement * @param tabIndex the tab index * @param isSelected selection status * @return the tab label shift x */ protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) { Rectangle tabRect = rects[tabIndex]; String propKey = (isSelected ? "selectedLabelShift" : "labelShift"); int nudge = DefaultLookup.getInt( tabPane, this, "TabbedPane." + propKey, 1); switch (tabPlacement) { case LEFT: return nudge; case RIGHT: return -nudge; case BOTTOM: case TOP: default: return tabRect.width % 2; } }
Example 7
Source File: BasicTabbedPaneUI.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected) { Rectangle tabRect = rects[tabIndex]; int nudge = (isSelected ? DefaultLookup.getInt(tabPane, this, "TabbedPane.selectedLabelShift", -1) : DefaultLookup.getInt(tabPane, this, "TabbedPane.labelShift", 1)); switch (tabPlacement) { case BOTTOM: return -nudge; case LEFT: case RIGHT: return tabRect.height % 2; case TOP: default: return nudge; } }
Example 8
Source File: BasicOptionPaneUI.java From Java8CN with Apache License 2.0 | 5 votes |
/** * Messaged from installComponents to create a Container containing the * body of the message. The icon is the created by calling * <code>addIcon</code>. */ protected Container createMessageArea() { JPanel top = new JPanel(); Border topBorder = (Border)DefaultLookup.get(optionPane, this, "OptionPane.messageAreaBorder"); if (topBorder != null) { top.setBorder(topBorder); } top.setLayout(new BorderLayout()); /* Fill the body. */ Container body = new JPanel(new GridBagLayout()); Container realBody = new JPanel(new BorderLayout()); body.setName("OptionPane.body"); realBody.setName("OptionPane.realBody"); if (getIcon() != null) { JPanel sep = new JPanel(); sep.setName("OptionPane.separator"); sep.setPreferredSize(new Dimension(15, 1)); realBody.add(sep, BorderLayout.BEFORE_LINE_BEGINS); } realBody.add(body, BorderLayout.CENTER); GridBagConstraints cons = new GridBagConstraints(); cons.gridx = cons.gridy = 0; cons.gridwidth = GridBagConstraints.REMAINDER; cons.gridheight = 1; cons.anchor = DefaultLookup.getInt(optionPane, this, "OptionPane.messageAnchor", GridBagConstraints.CENTER); cons.insets = new Insets(0,0,3,0); addMessageComponents(body, cons, getMessage(), getMaxCharactersPerLineCount(), false); top.add(realBody, BorderLayout.CENTER); addIcon(top); return top; }
Example 9
Source File: BasicProgressBarUI.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
private int initCycleTime() { cycleTime = DefaultLookup.getInt(progressBar, this, "ProgressBar.cycleTime", 3000); return cycleTime; }
Example 10
Source File: BasicOptionPaneUI.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * Returns the buttons to display from the JOptionPane the receiver is * providing the look and feel for. If the JOptionPane has options * set, they will be provided, otherwise if the optionType is * YES_NO_OPTION, yesNoOptions is returned, if the type is * YES_NO_CANCEL_OPTION yesNoCancelOptions is returned, otherwise * defaultButtons are returned. */ protected Object[] getButtons() { if (optionPane != null) { Object[] suppliedOptions = optionPane.getOptions(); if (suppliedOptions == null) { Object[] defaultOptions; int type = optionPane.getOptionType(); Locale l = optionPane.getLocale(); int minimumWidth = DefaultLookup.getInt(optionPane, this, "OptionPane.buttonMinimumWidth",-1); if (type == JOptionPane.YES_NO_OPTION) { defaultOptions = new ButtonFactory[2]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.yesButtonText", l), getMnemonic("OptionPane.yesButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.yesIcon"), minimumWidth); defaultOptions[1] = new ButtonFactory( UIManager.getString("OptionPane.noButtonText", l), getMnemonic("OptionPane.noButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.noIcon"), minimumWidth); } else if (type == JOptionPane.YES_NO_CANCEL_OPTION) { defaultOptions = new ButtonFactory[3]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.yesButtonText", l), getMnemonic("OptionPane.yesButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.yesIcon"), minimumWidth); defaultOptions[1] = new ButtonFactory( UIManager.getString("OptionPane.noButtonText",l), getMnemonic("OptionPane.noButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.noIcon"), minimumWidth); defaultOptions[2] = new ButtonFactory( UIManager.getString("OptionPane.cancelButtonText",l), getMnemonic("OptionPane.cancelButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.cancelIcon"), minimumWidth); } else if (type == JOptionPane.OK_CANCEL_OPTION) { defaultOptions = new ButtonFactory[2]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.okButtonText",l), getMnemonic("OptionPane.okButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.okIcon"), minimumWidth); defaultOptions[1] = new ButtonFactory( UIManager.getString("OptionPane.cancelButtonText",l), getMnemonic("OptionPane.cancelButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.cancelIcon"), minimumWidth); } else { defaultOptions = new ButtonFactory[1]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.okButtonText",l), getMnemonic("OptionPane.okButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.okIcon"), minimumWidth); } return defaultOptions; } return suppliedOptions; } return null; }
Example 11
Source File: BasicProgressBarUI.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
private int initRepaintInterval() { repaintInterval = DefaultLookup.getInt(progressBar, this, "ProgressBar.repaintInterval", 50); return repaintInterval; }
Example 12
Source File: BasicProgressBarUI.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
private int initCycleTime() { cycleTime = DefaultLookup.getInt(progressBar, this, "ProgressBar.cycleTime", 3000); return cycleTime; }
Example 13
Source File: BasicOptionPaneUI.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * Returns the buttons to display from the JOptionPane the receiver is * providing the look and feel for. If the JOptionPane has options * set, they will be provided, otherwise if the optionType is * YES_NO_OPTION, yesNoOptions is returned, if the type is * YES_NO_CANCEL_OPTION yesNoCancelOptions is returned, otherwise * defaultButtons are returned. */ protected Object[] getButtons() { if (optionPane != null) { Object[] suppliedOptions = optionPane.getOptions(); if (suppliedOptions == null) { Object[] defaultOptions; int type = optionPane.getOptionType(); Locale l = optionPane.getLocale(); int minimumWidth = DefaultLookup.getInt(optionPane, this, "OptionPane.buttonMinimumWidth",-1); if (type == JOptionPane.YES_NO_OPTION) { defaultOptions = new ButtonFactory[2]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.yesButtonText", l), getMnemonic("OptionPane.yesButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.yesIcon"), minimumWidth); defaultOptions[1] = new ButtonFactory( UIManager.getString("OptionPane.noButtonText", l), getMnemonic("OptionPane.noButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.noIcon"), minimumWidth); } else if (type == JOptionPane.YES_NO_CANCEL_OPTION) { defaultOptions = new ButtonFactory[3]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.yesButtonText", l), getMnemonic("OptionPane.yesButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.yesIcon"), minimumWidth); defaultOptions[1] = new ButtonFactory( UIManager.getString("OptionPane.noButtonText",l), getMnemonic("OptionPane.noButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.noIcon"), minimumWidth); defaultOptions[2] = new ButtonFactory( UIManager.getString("OptionPane.cancelButtonText",l), getMnemonic("OptionPane.cancelButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.cancelIcon"), minimumWidth); } else if (type == JOptionPane.OK_CANCEL_OPTION) { defaultOptions = new ButtonFactory[2]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.okButtonText",l), getMnemonic("OptionPane.okButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.okIcon"), minimumWidth); defaultOptions[1] = new ButtonFactory( UIManager.getString("OptionPane.cancelButtonText",l), getMnemonic("OptionPane.cancelButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.cancelIcon"), minimumWidth); } else { defaultOptions = new ButtonFactory[1]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.okButtonText",l), getMnemonic("OptionPane.okButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.okIcon"), minimumWidth); } return defaultOptions; } return suppliedOptions; } return null; }
Example 14
Source File: BasicProgressBarUI.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
private int initRepaintInterval() { repaintInterval = DefaultLookup.getInt(progressBar, this, "ProgressBar.repaintInterval", 50); return repaintInterval; }
Example 15
Source File: SynthSplitPaneDivider.java From jdk1.8-source-analysis with Apache License 2.0 | 4 votes |
private int lookupOneTouchSize() { return DefaultLookup.getInt(splitPaneUI.getSplitPane(), splitPaneUI, "SplitPaneDivider.oneTouchButtonSize", ONE_TOUCH_SIZE); }
Example 16
Source File: BasicOptionPaneUI.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
/** * Returns the buttons to display from the JOptionPane the receiver is * providing the look and feel for. If the JOptionPane has options * set, they will be provided, otherwise if the optionType is * YES_NO_OPTION, yesNoOptions is returned, if the type is * YES_NO_CANCEL_OPTION yesNoCancelOptions is returned, otherwise * defaultButtons are returned. */ protected Object[] getButtons() { if (optionPane != null) { Object[] suppliedOptions = optionPane.getOptions(); if (suppliedOptions == null) { Object[] defaultOptions; int type = optionPane.getOptionType(); Locale l = optionPane.getLocale(); int minimumWidth = DefaultLookup.getInt(optionPane, this, "OptionPane.buttonMinimumWidth",-1); if (type == JOptionPane.YES_NO_OPTION) { defaultOptions = new ButtonFactory[2]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.yesButtonText", l), getMnemonic("OptionPane.yesButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.yesIcon"), minimumWidth); defaultOptions[1] = new ButtonFactory( UIManager.getString("OptionPane.noButtonText", l), getMnemonic("OptionPane.noButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.noIcon"), minimumWidth); } else if (type == JOptionPane.YES_NO_CANCEL_OPTION) { defaultOptions = new ButtonFactory[3]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.yesButtonText", l), getMnemonic("OptionPane.yesButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.yesIcon"), minimumWidth); defaultOptions[1] = new ButtonFactory( UIManager.getString("OptionPane.noButtonText",l), getMnemonic("OptionPane.noButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.noIcon"), minimumWidth); defaultOptions[2] = new ButtonFactory( UIManager.getString("OptionPane.cancelButtonText",l), getMnemonic("OptionPane.cancelButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.cancelIcon"), minimumWidth); } else if (type == JOptionPane.OK_CANCEL_OPTION) { defaultOptions = new ButtonFactory[2]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.okButtonText",l), getMnemonic("OptionPane.okButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.okIcon"), minimumWidth); defaultOptions[1] = new ButtonFactory( UIManager.getString("OptionPane.cancelButtonText",l), getMnemonic("OptionPane.cancelButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.cancelIcon"), minimumWidth); } else { defaultOptions = new ButtonFactory[1]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.okButtonText",l), getMnemonic("OptionPane.okButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.okIcon"), minimumWidth); } return defaultOptions; } return suppliedOptions; } return null; }
Example 17
Source File: BasicOptionPaneUI.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * Returns the buttons to display from the JOptionPane the receiver is * providing the look and feel for. If the JOptionPane has options * set, they will be provided, otherwise if the optionType is * YES_NO_OPTION, yesNoOptions is returned, if the type is * YES_NO_CANCEL_OPTION yesNoCancelOptions is returned, otherwise * defaultButtons are returned. */ protected Object[] getButtons() { if (optionPane != null) { Object[] suppliedOptions = optionPane.getOptions(); if (suppliedOptions == null) { Object[] defaultOptions; int type = optionPane.getOptionType(); Locale l = optionPane.getLocale(); int minimumWidth = DefaultLookup.getInt(optionPane, this, "OptionPane.buttonMinimumWidth",-1); if (type == JOptionPane.YES_NO_OPTION) { defaultOptions = new ButtonFactory[2]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.yesButtonText", l), getMnemonic("OptionPane.yesButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.yesIcon"), minimumWidth); defaultOptions[1] = new ButtonFactory( UIManager.getString("OptionPane.noButtonText", l), getMnemonic("OptionPane.noButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.noIcon"), minimumWidth); } else if (type == JOptionPane.YES_NO_CANCEL_OPTION) { defaultOptions = new ButtonFactory[3]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.yesButtonText", l), getMnemonic("OptionPane.yesButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.yesIcon"), minimumWidth); defaultOptions[1] = new ButtonFactory( UIManager.getString("OptionPane.noButtonText",l), getMnemonic("OptionPane.noButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.noIcon"), minimumWidth); defaultOptions[2] = new ButtonFactory( UIManager.getString("OptionPane.cancelButtonText",l), getMnemonic("OptionPane.cancelButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.cancelIcon"), minimumWidth); } else if (type == JOptionPane.OK_CANCEL_OPTION) { defaultOptions = new ButtonFactory[2]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.okButtonText",l), getMnemonic("OptionPane.okButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.okIcon"), minimumWidth); defaultOptions[1] = new ButtonFactory( UIManager.getString("OptionPane.cancelButtonText",l), getMnemonic("OptionPane.cancelButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.cancelIcon"), minimumWidth); } else { defaultOptions = new ButtonFactory[1]; defaultOptions[0] = new ButtonFactory( UIManager.getString("OptionPane.okButtonText",l), getMnemonic("OptionPane.okButtonMnemonic", l), (Icon)DefaultLookup.get(optionPane, this, "OptionPane.okIcon"), minimumWidth); } return defaultOptions; } return suppliedOptions; } return null; }
Example 18
Source File: SynthSplitPaneDivider.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
private int lookupOneTouchSize() { return DefaultLookup.getInt(splitPaneUI.getSplitPane(), splitPaneUI, "SplitPaneDivider.oneTouchButtonSize", ONE_TOUCH_SIZE); }
Example 19
Source File: BasicProgressBarUI.java From Java8CN with Apache License 2.0 | 4 votes |
private int initRepaintInterval() { repaintInterval = DefaultLookup.getInt(progressBar, this, "ProgressBar.repaintInterval", 50); return repaintInterval; }
Example 20
Source File: SynthSplitPaneDivider.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
private int lookupOneTouchSize() { return DefaultLookup.getInt(splitPaneUI.getSplitPane(), splitPaneUI, "SplitPaneDivider.oneTouchButtonSize", ONE_TOUCH_SIZE); }