DESY ACOP Beans Home

com.cosylab.gui.components
Class SimpleComboBox.SimpleComboBoxUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ComboBoxUI
          extended by com.cosylab.gui.components.SimpleComboBox.SimpleComboBoxUI
Direct Known Subclasses:
SimpleComboBox.DropComboBoxUI, SimpleComboBox.SwitchComboBoxUI
Enclosing class:
SimpleComboBox

public static class SimpleComboBox.SimpleComboBoxUI
extends javax.swing.plaf.ComboBoxUI

The simplest implementation od ComboBoxUI displays no button in the comboBox. Items are selected from a drop down list activated on mouse click.

Version:
$id$
Author:
Jernej Kamenik

Nested Class Summary
protected  class SimpleComboBox.SimpleComboBoxUI.ComboBoxLayoutManager
           
 
Field Summary
protected  javax.swing.CellRendererPane cellRenderingPane
           
protected  SimpleComboBox comboBox
           
protected  java.awt.event.ItemListener itemListener
           
protected  javax.swing.plaf.basic.BasicComboPopup popup
           
 
Constructor Summary
SimpleComboBox.SimpleComboBoxUI()
          Constructor for SimpleComboBoxUI.
 
Method Summary
protected  void calculateLayout()
           
protected  java.awt.Dimension calculatePreferredSize()
           
protected  java.awt.Rectangle calculateRendererCellRectangle()
           
 java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
          Returns the maximum allowed layout size.
 java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
          Returns the minimum allowed layout size.
 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
          Returns the preferred layout size.
 void installUI(javax.swing.JComponent c)
          Installs this UI to the supplied SimpleComboBox
 boolean isFocusTraversable(javax.swing.JComboBox c)
          Delegates to comboBox implementation.
 boolean isPopupVisible(javax.swing.JComboBox c)
          Delegates to comboBox implementation.
 void paint(java.awt.Graphics g, javax.swing.JComponent jc)
          This method has been overriden to implement correct combo box painting.
 void setPopupVisible(javax.swing.JComboBox c, boolean v)
          Delegates to comboBox implementation.
 void uninstallUI(javax.swing.JComponent c)
          Uninstalls this UI from the supplied SimpleComboBox
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comboBox

protected SimpleComboBox comboBox

popup

protected javax.swing.plaf.basic.BasicComboPopup popup

cellRenderingPane

protected javax.swing.CellRendererPane cellRenderingPane

itemListener

protected java.awt.event.ItemListener itemListener
Constructor Detail

SimpleComboBox.SimpleComboBoxUI

public SimpleComboBox.SimpleComboBoxUI()
Constructor for SimpleComboBoxUI.

Method Detail

isFocusTraversable

public boolean isFocusTraversable(javax.swing.JComboBox c)
Delegates to comboBox implementation.

Specified by:
isFocusTraversable in class javax.swing.plaf.ComboBoxUI
Parameters:
c - JComboBox must be comboBox
Returns:
boolean
See Also:
ComboBoxUI.isFocusTraversable(JComboBox)

isPopupVisible

public boolean isPopupVisible(javax.swing.JComboBox c)
Delegates to comboBox implementation.

Specified by:
isPopupVisible in class javax.swing.plaf.ComboBoxUI
Parameters:
c - JComboBox must be comboBox
Returns:
boolean
See Also:
ComboBoxUI.isPopupVisible(JComboBox)

setPopupVisible

public void setPopupVisible(javax.swing.JComboBox c,
                            boolean v)
Delegates to comboBox implementation.

Specified by:
setPopupVisible in class javax.swing.plaf.ComboBoxUI
Parameters:
c - JComboBox must be comboBox
v - boolean
See Also:
ComboBoxUI.setPopupVisible(JComboBox, boolean)

installUI

public void installUI(javax.swing.JComponent c)
Installs this UI to the supplied SimpleComboBox

Overrides:
installUI in class javax.swing.plaf.ComponentUI
Parameters:
c - JComponent must be an instance of SimpleComboBox
See Also:
ComponentUI.installUI(JComponent)

uninstallUI

public void uninstallUI(javax.swing.JComponent c)
Uninstalls this UI from the supplied SimpleComboBox

Overrides:
uninstallUI in class javax.swing.plaf.ComponentUI
Parameters:
c - JComponent must be comboBox
See Also:
ComponentUI.uninstallUI(JComponent)

getMaximumSize

public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
Returns the maximum allowed layout size.

Overrides:
getMaximumSize in class javax.swing.plaf.ComponentUI
Parameters:
c - JComponent must be comboBox
Returns:
Dimension layout size.
See Also:
ComponentUI.getMaximumSize(JComponent)

getMinimumSize

public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
Returns the minimum allowed layout size.

Overrides:
getMinimumSize in class javax.swing.plaf.ComponentUI
Parameters:
c - JComponent must be comboBox
Returns:
Dimension layout size.
See Also:
ComponentUI.getMinimumSize(JComponent)

getPreferredSize

public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
Returns the preferred layout size.

Overrides:
getPreferredSize in class javax.swing.plaf.ComponentUI
Parameters:
c - JComponent must be comboBox
Returns:
Dimension layout size.
See Also:
ComponentUI.getPreferredSize(JComponent), calculatePreferredSize()

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent jc)
This method has been overriden to implement correct combo box painting.

Overrides:
paint in class javax.swing.plaf.ComponentUI
Parameters:
g - Graphics
jc - JComponent must be comboBox
See Also:
ComponentUI.paint(Graphics, JComponent)

calculateRendererCellRectangle

protected java.awt.Rectangle calculateRendererCellRectangle()

calculateLayout

protected void calculateLayout()

calculatePreferredSize

protected java.awt.Dimension calculatePreferredSize()


Copyright © 2010. All Rights Reserved.