當前位置: 首頁>>代碼示例>>Java>>正文


Java ComponentUI類代碼示例

本文整理匯總了Java中javax.swing.plaf.ComponentUI的典型用法代碼示例。如果您正苦於以下問題:Java ComponentUI類的具體用法?Java ComponentUI怎麽用?Java ComponentUI使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ComponentUI類屬於javax.swing.plaf包,在下文中一共展示了ComponentUI類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getIcon

import javax.swing.plaf.ComponentUI; //導入依賴的package包/類
public static Icon getIcon(JComponent c, ComponentUI ui, String key,
        Icon defaultValue) {
    Object iValue = get(c, ui, key);
    if (iValue == null || !(iValue instanceof Icon)) {
        return defaultValue;
    }
    return (Icon)iValue;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:9,代碼來源:DefaultLookup.java

示例2: createUI

import javax.swing.plaf.ComponentUI; //導入依賴的package包/類
/**
 * Returns a multiplexing UI instance if any of the auxiliary
 * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
 * UI object obtained from the default <code>LookAndFeel</code>.
 */
public static ComponentUI createUI(JComponent a) {
    ComponentUI mui = new MultiTableHeaderUI();
    return MultiLookAndFeel.createUIs(mui,
                                      ((MultiTableHeaderUI) mui).uis,
                                      a);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:12,代碼來源:MultiTableHeaderUI.java

示例3: getAccessibleChildrenCount

import javax.swing.plaf.ComponentUI; //導入依賴的package包/類
/**
 * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getAccessibleChildrenCount(JComponent a) {
    int returnValue =
        ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
    }
    return returnValue;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:15,代碼來源:MultiColorChooserUI.java

示例4: contains

import javax.swing.plaf.ComponentUI; //導入依賴的package包/類
/**
 * Invokes the <code>contains</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public boolean contains(JComponent a, int b, int c) {
    boolean returnValue =
        ((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
    }
    return returnValue;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:15,代碼來源:MultiLabelUI.java

示例5: getAccessibleChild

import javax.swing.plaf.ComponentUI; //導入依賴的package包/類
/**
 * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Accessible getAccessibleChild(JComponent a, int b) {
    Accessible returnValue =
        ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
    }
    return returnValue;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:15,代碼來源:MultiButtonUI.java

示例6: getPreferredSize

import javax.swing.plaf.ComponentUI; //導入依賴的package包/類
/**
 * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Dimension getPreferredSize(JComponent a) {
    Dimension returnValue =
        ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
    }
    return returnValue;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:15,代碼來源:MultiSplitPaneUI.java

示例7: getMaximumSize

import javax.swing.plaf.ComponentUI; //導入依賴的package包/類
/**
 * Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Dimension getMaximumSize(JComponent a) {
    Dimension returnValue =
        ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
    }
    return returnValue;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:15,代碼來源:MultiTextUI.java

示例8: createUI

import javax.swing.plaf.ComponentUI; //導入依賴的package包/類
/**
 * Returns an instance of {@code BasicButtonUI}.
 *
 * @param c a component
 * @return an instance of {@code BasicButtonUI}
 */
public static ComponentUI createUI(JComponent c) {
    AppContext appContext = AppContext.getAppContext();
    BasicButtonUI buttonUI =
            (BasicButtonUI) appContext.get(BASIC_BUTTON_UI_KEY);
    if (buttonUI == null) {
        buttonUI = new BasicButtonUI();
        appContext.put(BASIC_BUTTON_UI_KEY, buttonUI);
    }
    return buttonUI;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:17,代碼來源:BasicButtonUI.java

示例9: getMinimumSize

import javax.swing.plaf.ComponentUI; //導入依賴的package包/類
/**
 * Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Dimension getMinimumSize(JComponent a) {
    Dimension returnValue =
        ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
    }
    return returnValue;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:15,代碼來源:MultiTabbedPaneUI.java

示例10: createUI

import javax.swing.plaf.ComponentUI; //導入依賴的package包/類
/**
 * Returns a multiplexing UI instance if any of the auxiliary
 * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
 * UI object obtained from the default <code>LookAndFeel</code>.
 */
public static ComponentUI createUI(JComponent a) {
    ComponentUI mui = new MultiViewportUI();
    return MultiLookAndFeel.createUIs(mui,
                                      ((MultiViewportUI) mui).uis,
                                      a);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:12,代碼來源:MultiViewportUI.java

示例11: getBoolean

import javax.swing.plaf.ComponentUI; //導入依賴的package包/類
public static boolean getBoolean(JComponent c, ComponentUI ui, String key,
                                 boolean defaultValue) {
    Object iValue = get(c, ui, key);

    if (iValue == null || !(iValue instanceof Boolean)) {
        return defaultValue;
    }
    return ((Boolean)iValue).booleanValue();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:10,代碼來源:DefaultLookup.java

示例12: addNotify

import javax.swing.plaf.ComponentUI; //導入依賴的package包/類
public void addNotify() {
    super.addNotify();

    fMenuItem.addComponentListener(this);
    fListener = new ScreenMenuPropertyListener(this);
    fMenuItem.addPropertyChangeListener(fListener);
    addActionListener(this);

    setEnabled(fMenuItem.isEnabled());

    // can't setState or setAccelerator or setIcon till we have a peer
    setAccelerator(fMenuItem.getAccelerator());

    final String label = fMenuItem.getText();
    if (label != null) {
        setLabel(label);
    }

    final Icon icon = fMenuItem.getIcon();
    if (icon != null) {
        this.setIcon(icon);
    }

    final String tooltipText = fMenuItem.getToolTipText();
    if (tooltipText != null) {
        this.setToolTipText(tooltipText);
    }

    if (fMenuItem instanceof JRadioButtonMenuItem) {
        final ComponentUI ui = fMenuItem.getUI();

        if (ui instanceof ScreenMenuItemUI) {
            ((ScreenMenuItemUI)ui).updateListenersForScreenMenuItem();
        }
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:37,代碼來源:ScreenMenuItem.java

示例13: getInsets

import javax.swing.plaf.ComponentUI; //導入依賴的package包/類
public static Insets getInsets(JComponent c, ComponentUI ui, String key,
                               Insets defaultValue) {
    Object iValue = get(c, ui, key);

    if (iValue == null || !(iValue instanceof Insets)) {
        return defaultValue;
    }
    return (Insets)iValue;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:10,代碼來源:DefaultLookup.java


注:本文中的javax.swing.plaf.ComponentUI類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。