Java Code Examples for javax.swing.plaf.ComboBoxUI

The following examples show how to use javax.swing.plaf.ComboBoxUI. These examples are extracted from open source projects. 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 Project: jdk1.8-source-analysis   Source File: SynthComboPopup.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 2
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 3
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 4
Source Project: jdk8u60   Source File: SynthComboPopup.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 5
Source Project: JDKSourceCode1.8   Source File: SynthComboPopup.java    License: MIT License 6 votes vote down vote up
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 6
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 7
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 8
Source Project: Bytecoder   Source File: SynthComboPopup.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 9
Source Project: openjdk-jdk9   Source File: SynthComboPopup.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 10
Source Project: jdk8u-jdk   Source File: SynthComboPopup.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 11
Source Project: Java8CN   Source File: SynthComboPopup.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 12
Source Project: hottub   Source File: SynthComboPopup.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 13
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 14
Source Project: openjdk-8   Source File: SynthComboPopup.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 15
Source Project: jdk8u_jdk   Source File: SynthComboPopup.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 16
Source Project: jdk8u-jdk   Source File: SynthComboPopup.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 17
/**
 * @inheritDoc
 *
 * Overridden to take into account any popup insets specified in
 * SynthComboBoxUI
 */
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
    ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof SynthComboBoxUI) {
        SynthComboBoxUI sui = (SynthComboBoxUI) ui;
        if (sui.popupInsets != null) {
            Insets i = sui.popupInsets;
            return super.computePopupBounds(
                    px + i.left,
                    py + i.top,
                    pw - i.left - i.right,
                    ph - i.top - i.bottom);
        }
    }
    return super.computePopupBounds(px, py, pw, ph);
}
 
Example 18
Source Project: jdk1.8-source-analysis   Source File: MultiComboBoxUI.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>isFocusTraversable</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 isFocusTraversable(JComboBox a) {
    boolean returnValue =
        ((ComboBoxUI) (uis.elementAt(0))).isFocusTraversable(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComboBoxUI) (uis.elementAt(i))).isFocusTraversable(a);
    }
    return returnValue;
}
 
Example 19
Source Project: jdk1.8-source-analysis   Source File: MultiComboBoxUI.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>isPopupVisible</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 isPopupVisible(JComboBox a) {
    boolean returnValue =
        ((ComboBoxUI) (uis.elementAt(0))).isPopupVisible(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComboBoxUI) (uis.elementAt(i))).isPopupVisible(a);
    }
    return returnValue;
}
 
Example 20
/**
 * Invokes the <code>isFocusTraversable</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 isFocusTraversable(JComboBox a) {
    boolean returnValue =
        ((ComboBoxUI) (uis.elementAt(0))).isFocusTraversable(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComboBoxUI) (uis.elementAt(i))).isFocusTraversable(a);
    }
    return returnValue;
}
 
Example 21
/**
 * Invokes the <code>isPopupVisible</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 isPopupVisible(JComboBox a) {
    boolean returnValue =
        ((ComboBoxUI) (uis.elementAt(0))).isPopupVisible(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComboBoxUI) (uis.elementAt(i))).isPopupVisible(a);
    }
    return returnValue;
}
 
Example 22
/**
 * Invokes the <code>isFocusTraversable</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 isFocusTraversable(JComboBox a) {
    boolean returnValue =
        ((ComboBoxUI) (uis.elementAt(0))).isFocusTraversable(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComboBoxUI) (uis.elementAt(i))).isFocusTraversable(a);
    }
    return returnValue;
}
 
Example 23
/**
 * Invokes the <code>isPopupVisible</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 isPopupVisible(JComboBox a) {
    boolean returnValue =
        ((ComboBoxUI) (uis.elementAt(0))).isPopupVisible(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComboBoxUI) (uis.elementAt(i))).isPopupVisible(a);
    }
    return returnValue;
}
 
Example 24
Source Project: jdk8u60   Source File: MultiComboBoxUI.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>isFocusTraversable</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 isFocusTraversable(JComboBox a) {
    boolean returnValue =
        ((ComboBoxUI) (uis.elementAt(0))).isFocusTraversable(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComboBoxUI) (uis.elementAt(i))).isFocusTraversable(a);
    }
    return returnValue;
}
 
Example 25
Source Project: jdk8u60   Source File: MultiComboBoxUI.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>isPopupVisible</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 isPopupVisible(JComboBox a) {
    boolean returnValue =
        ((ComboBoxUI) (uis.elementAt(0))).isPopupVisible(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComboBoxUI) (uis.elementAt(i))).isPopupVisible(a);
    }
    return returnValue;
}
 
Example 26
Source Project: JDKSourceCode1.8   Source File: MultiComboBoxUI.java    License: MIT License 5 votes vote down vote up
/**
 * Invokes the <code>isFocusTraversable</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 isFocusTraversable(JComboBox a) {
    boolean returnValue =
        ((ComboBoxUI) (uis.elementAt(0))).isFocusTraversable(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComboBoxUI) (uis.elementAt(i))).isFocusTraversable(a);
    }
    return returnValue;
}
 
Example 27
Source Project: JDKSourceCode1.8   Source File: MultiComboBoxUI.java    License: MIT License 5 votes vote down vote up
/**
 * Invokes the <code>isPopupVisible</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 isPopupVisible(JComboBox a) {
    boolean returnValue =
        ((ComboBoxUI) (uis.elementAt(0))).isPopupVisible(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComboBoxUI) (uis.elementAt(i))).isPopupVisible(a);
    }
    return returnValue;
}
 
Example 28
/**
 * Invokes the <code>isFocusTraversable</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 isFocusTraversable(JComboBox a) {
    boolean returnValue =
        ((ComboBoxUI) (uis.elementAt(0))).isFocusTraversable(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComboBoxUI) (uis.elementAt(i))).isFocusTraversable(a);
    }
    return returnValue;
}
 
Example 29
/**
 * Invokes the <code>isPopupVisible</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 isPopupVisible(JComboBox a) {
    boolean returnValue =
        ((ComboBoxUI) (uis.elementAt(0))).isPopupVisible(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComboBoxUI) (uis.elementAt(i))).isPopupVisible(a);
    }
    return returnValue;
}
 
Example 30
Source Project: netbeans   Source File: ComboInplaceEditor.java    License: Apache License 2.0 5 votes vote down vote up
/** Overridden to set a flag used to block the UI from adding a focus
 * listener, and to use an alternate renderer class on GTK look and feel
 * to work around a painting bug in SynthComboUI (colors not set correctly)*/
@Override
public void setUI(ComboBoxUI ui) {
    inSetUI = true;

    try {
        super.setUI(ui);
    } finally {
        inSetUI = false;
    }
}