Java 类javax.swing.plaf.ComboBoxUI 实例源码

项目:OpenJSharp    文件:SynthComboPopup.java   
/**
 * @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);
}
项目:jdk8u-jdk    文件:SynthComboPopup.java   
/**
 * @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);
}
项目:openjdk-jdk10    文件:SynthComboPopup.java   
/**
 * @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);
}
项目:openjdk9    文件:SynthComboPopup.java   
/**
 * @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);
}
项目:Java8CN    文件:SynthComboPopup.java   
/**
 * @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);
}
项目:jdk8u_jdk    文件:SynthComboPopup.java   
/**
 * @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);
}
项目:lookaside_java-1.8.0-openjdk    文件:SynthComboPopup.java   
/**
 * @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);
}
项目:infobip-open-jdk-8    文件:SynthComboPopup.java   
/**
 * @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);
}
项目:jdk8u-dev-jdk    文件:SynthComboPopup.java   
/**
 * @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);
}
项目:OLD-OpenJDK8    文件:SynthComboPopup.java   
/**
 * @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);
}
项目:openjdk-jdk7u-jdk    文件:SynthComboPopup.java   
/**
 * @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);
}
项目:openjdk-icedtea7    文件:SynthComboPopup.java   
/**
 * @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);
}
项目:incubator-netbeans    文件:ComboInplaceEditor.java   
/** 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;
    }
}
项目:OpenJSharp    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:OpenJSharp    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:jdk8u-jdk    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:jdk8u-jdk    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:openjdk-jdk10    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:openjdk-jdk10    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:openjdk-jdk10    文件:JComboBoxOperator.java   
/**
 * Maps {@code JComboBox.getUI()} through queue
 */
public ComboBoxUI getUI() {
    return (runMapping(new MapAction<ComboBoxUI>("getUI") {
        @Override
        public ComboBoxUI map() {
            return ((JComboBox) getSource()).getUI();
        }
    }));
}
项目:openjdk-jdk10    文件:JComboBoxOperator.java   
/**
 * Maps {@code JComboBox.setUI(ComboBoxUI)} through queue
 */
public void setUI(final ComboBoxUI comboBoxUI) {
    runMapping(new MapVoidAction("setUI") {
        @Override
        public void map() {
            ((JComboBox) getSource()).setUI(comboBoxUI);
        }
    });
}
项目:sbc-qsystem    文件:JTreeComboBox.java   
@Override
public void updateUI() {
    ComboBoxUI cui = (ComboBoxUI) UIManager.getUI(this);
    if (cui instanceof MetalComboBoxUI) {
        cui = new MetalTreeComboBoxUI();
    } else if (cui instanceof MotifComboBoxUI) {
        cui = new MotifTreeComboBoxUI();
    } else if (cui instanceof WindowsComboBoxUI) {
        cui = new WindowsTreeComboBoxUI();
    }
    setUI(cui);
}
项目:openjdk9    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:openjdk9    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:openjdk9    文件:JComboBoxOperator.java   
/**
 * Maps {@code JComboBox.getUI()} through queue
 */
public ComboBoxUI getUI() {
    return (runMapping(new MapAction<ComboBoxUI>("getUI") {
        @Override
        public ComboBoxUI map() {
            return ((JComboBox) getSource()).getUI();
        }
    }));
}
项目:openjdk9    文件:JComboBoxOperator.java   
/**
 * Maps {@code JComboBox.setUI(ComboBoxUI)} through queue
 */
public void setUI(final ComboBoxUI comboBoxUI) {
    runMapping(new MapVoidAction("setUI") {
        @Override
        public void map() {
            ((JComboBox) getSource()).setUI(comboBoxUI);
        }
    });
}
项目:Java8CN    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:Java8CN    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:jdk8u_jdk    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:jdk8u_jdk    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:lookaside_java-1.8.0-openjdk    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:lookaside_java-1.8.0-openjdk    文件:MultiComboBoxUI.java   
/**
 * 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;
}
项目:javify    文件:MultiComboBoxUI.java   
/**
 * Calls the {@link ComboBoxUI#setPopupVisible(JComboBox, boolean)} method
 * for all the UI delegates managed by this <code>MultiComboBoxUI</code>.
 *
 * @param c  the component.
 * @param visible  the visible state.
 */
public void setPopupVisible(JComboBox c, boolean visible)
{
  Iterator iterator = uis.iterator();
  while (iterator.hasNext())
  {
    ComboBoxUI ui = (ComboBoxUI) iterator.next();
    ui.setPopupVisible(c, visible);
  }
}
项目:intellij-ce-playground    文件:FixedComboBoxEditor.java   
@Nullable
private static ComboPopup getComboboxPopup(final JComboBox comboBox) {
  final ComboBoxUI ui = comboBox.getUI();
  ComboPopup popup = null;
  if (ui instanceof BasicComboBoxUI) {
    popup = ReflectionUtil.getField(BasicComboBoxUI.class, ui, ComboPopup.class, "popup");
  }

  return popup;
}
项目:intellij-ce-playground    文件:UIUtil.java   
@Nullable
public static ComboPopup getComboBoxPopup(@NotNull JComboBox comboBox) {
  final ComboBoxUI ui = comboBox.getUI();
  if (ui instanceof BasicComboBoxUI) {
    return ReflectionUtil.getField(BasicComboBoxUI.class, ui, ComboPopup.class, "popup");
  }

  return null;
}
项目:SE2    文件:MyComboBox.java   
@Override
public void setUI(ComboBoxUI ui) {
    if (ui instanceof CustomComboBoxUI) {
        super.setUI(ui);
    } else {
        super.setUI(new CustomComboBoxUI());
    }
}
项目:jvm-stm    文件:MultiComboBoxUI.java   
/**
 * Calls the {@link ComboBoxUI#setPopupVisible(JComboBox, boolean)} method 
 * for all the UI delegates managed by this <code>MultiComboBoxUI</code>.
 * 
 * @param c  the component.
 * @param visible  the visible state.
 */
public void setPopupVisible(JComboBox c, boolean visible) 
{
  Iterator iterator = uis.iterator();
  while (iterator.hasNext())
  {
    ComboBoxUI ui = (ComboBoxUI) iterator.next();
    ui.setPopupVisible(c, visible);
  }
}
项目:metasfresh    文件:AdempiereComboBoxUI.java   
public static final ComboPopup getComboPopup(final JComboBox<?> comboBox)
{
    final ComboBoxUI comboBoxUI = comboBox.getUI();
    if (comboBoxUI instanceof AdempiereComboBoxUI)
    {
        return ((AdempiereComboBoxUI)comboBoxUI).getComboPopup();
    }

    //
    // Fallback:
    // Back door our way to finding the inner JList.
    //
    // it is unknown whether this functionality will work outside of Sun's
    // implementation, but the code is safe and will "fail gracefully" on
    // other systems
    //
    // see javax.swing.plaf.basic.BasicComboBoxUI.getAccessibleChild(JComponent, int)
    final Accessible a = comboBoxUI.getAccessibleChild(comboBox, 0);
    if (a instanceof ComboPopup)
    {
        return (ComboPopup)a;
    }
    else
    {
        return null;
    }
}
项目:metasfresh    文件:CComboBox.java   
private final JButton getArrowButton()
{
    final ComboBoxUI ui = getUI();
    if (ui instanceof org.adempiere.plaf.AdempiereComboBoxUI)
    {
        final JButton b = ((org.adempiere.plaf.AdempiereComboBoxUI)ui).getArrowButton();
        return b;
    }

    return null;
}
项目:infobip-open-jdk-8    文件:MultiComboBoxUI.java   
/**
 * 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;
}