当前位置: 首页>>代码示例>>Java>>正文


Java DefaultLookup.getInt方法代码示例

本文整理汇总了Java中sun.swing.DefaultLookup.getInt方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultLookup.getInt方法的具体用法?Java DefaultLookup.getInt怎么用?Java DefaultLookup.getInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.swing.DefaultLookup的用法示例。


在下文中一共展示了DefaultLookup.getInt方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTabLabelShiftX

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
 * 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;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:BasicTabbedPaneUI.java

示例2: getTabLabelShiftX

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
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;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:BasicTabbedPaneUI.java

示例3: installDefaults2

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
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());
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:26,代码来源:BasicTextUI.java

示例4: BasicSplitPaneDivider

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
 * 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"));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:BasicSplitPaneDivider.java

示例5: BasicSplitPaneDivider

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
 * Creates an instance of {@code BasicSplitPaneDivider}. Registers this
 * instance for mouse events and mouse dragged events.
 *
 * @param ui an instance of {@code BasicSplitPaneUI}
 */
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"));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:BasicSplitPaneDivider.java

示例6: createMessageArea

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:45,代码来源:BasicOptionPaneUI.java

示例7: createMessageArea

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
 * Messaged from {@code installComponents} to create a {@code Container}
 * containing the body of the message. The icon is the created
 * by calling {@code addIcon}.
 *
 * @return a instance of {@code Container}
 */
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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:47,代码来源:BasicOptionPaneUI.java

示例8: initCycleTime

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
private int initCycleTime() {
    cycleTime = DefaultLookup.getInt(progressBar, this,
            "ProgressBar.cycleTime", 3000);
    return cycleTime;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:BasicProgressBarUI.java

示例9: initRepaintInterval

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
private int initRepaintInterval() {
    repaintInterval = DefaultLookup.getInt(progressBar,
            this, "ProgressBar.repaintInterval", 50);
    return repaintInterval;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:BasicProgressBarUI.java

示例10: getButtons

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
 * Returns the buttons to display from the {@code JOptionPane} the receiver is
 * providing the look and feel for. If the {@code JOptionPane} has options
 * set, they will be provided, otherwise if the optionType is
 * {@code YES_NO_OPTION}, {@code yesNoOptions} is returned, if the type is
 * {@code YES_NO_CANCEL_OPTION} {@code yesNoCancelOptions} is returned, otherwise
 * {@code defaultButtons} are returned.
 *
 * @return the buttons to display from the JOptionPane
 */
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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:78,代码来源:BasicOptionPaneUI.java

示例11: getButtons

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:76,代码来源:BasicOptionPaneUI.java

示例12: lookupOneTouchSize

import sun.swing.DefaultLookup; //导入方法依赖的package包/类
private int lookupOneTouchSize() {
    return DefaultLookup.getInt(splitPaneUI.getSplitPane(), splitPaneUI,
          "SplitPaneDivider.oneTouchButtonSize", ONE_TOUCH_SIZE);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:SynthSplitPaneDivider.java


注:本文中的sun.swing.DefaultLookup.getInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。