net.yura.mobile.gui.components
Class ComboBox

java.lang.Object
  extended by net.yura.mobile.gui.components.Component
      extended by net.yura.mobile.gui.components.Label
          extended by net.yura.mobile.gui.components.Button
              extended by net.yura.mobile.gui.components.ComboBox
All Implemented Interfaces:
ActionListener

public class ComboBox
extends Button
implements ActionListener

Author:
Yura Mamyrin
See Also:
JComboBox

Field Summary
 
Fields inherited from class net.yura.mobile.gui.components.Button
buttonGroup
 
Fields inherited from class net.yura.mobile.gui.components.Label
alignment, extension, font, gap, icon, padding, string, textPosition
 
Fields inherited from class net.yura.mobile.gui.components.Component
background, empty, FOCUS_GAINED, FOCUS_LOST, focusable, foreground, height, parent, posX, posY, preferredHeight, preferredWidth, state, theme, width
 
Constructor Summary
ComboBox()
           
ComboBox(Vector vec)
           
 
Method Summary
 void actionPerformed(String actionCommand)
           
 void addItem(Object obj)
           
 void fireActionPerformed()
           
 String getDefaultName()
           
 int getItemCount()
           
 Vector getItems()
          return the vector, can not be a true representation of the model
 List getList()
           
 Icon getNonSelectedImage()
           
 Icon getSelectedImage()
           
 int getSelectedIndex()
           
 Object getSelectedItem()
           
 Object getValue()
           
 void paintComponent(Graphics2D g)
           
 void setItems(Vector items)
           
 void setLoop(boolean b)
           
 void setModel(List list)
           
 void setNonSelectedImage(Icon nonSelectedImage)
           
 void setScrollMode(int m)
           
 void setSelectedImage(Icon selectedImage)
           
 void setSelectedIndex(int i)
           
 void setSelectedItem(Object selected)
           
 void setText(String a)
          This throws an IllegalArgumentException and you should use the setIndex method instead
 void setValue(Object obj)
           
 void updateUI()
           
 void workoutMinimumSize()
          This sets the width and height of this component to the MINIMUM that is needed for this component
 
Methods inherited from class net.yura.mobile.gui.components.Button
addActionListener, focusGained, focusLost, getActionCommand, getActionListeners, getMnemonic, getState, getXOnScreen, getYOnScreen, isSelected, isUseSelectButton, isVisible, processKeyEvent, processMouseEvent, removeActionListener, setActionCommand, setButtonGroup, setMnemonic, setSelected, setUseSelectButton, toggleSelection
 
Methods inherited from class net.yura.mobile.gui.components.Label
getCombinedHeight, getCombinedHeight, getCombinedWidth, getCombinedWidth, getFont, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getMargin, getMaxWidth, getText, getVerticalAlignment, getVerticalTextPosition, paintIcon, setFont, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setMargin, setVerticalAlignment, setVerticalTextPosition, toString
 
Methods inherited from class net.yura.mobile.gui.components.Component
add, add, add, addFocusListener, addImpl, animate, clip, consumesMotionEvents, getBackground, getBorder, getCurrentState, getDesktopPane, getFocusListeners, getForeground, getHeight, getHeightWithBorder, getInsets, getName, getParent, getPreferredHeight, getPreferredWidth, getToolTipLocationX, getToolTipLocationY, getToolTipText, getWidth, getWidthWithBorder, getWindow, getX, getXWithBorder, getY, getYWithBorder, insert, insert, isComponentVisible, isFocusable, isFocusOwner, isOpaque, isRectVisible, isShowing, makeVisible, paint, paintBorder, processMultitouchEvent, removeFocusListener, removeParent, repaint, requestFocusInWindow, revalidate, scrollRectToVisible, scrollUpDown, setBackground, setBorder, setBounds, setBoundsWithBorder, setFocusable, setForeground, setLocation, setName, setPreferredSize, setSize, setState, setToolTipText, setupState, setVisible, transferFocus, validate, wait, workoutSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComboBox

public ComboBox()
See Also:
JComboBox.JComboBox

ComboBox

public ComboBox(Vector vec)
Parameters:
vec - an vector of objects to insert into the combo box
See Also:
JComboBox.JComboBox
Method Detail

actionPerformed

public void actionPerformed(String actionCommand)
Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class Button
Parameters:
actionCommand - The Command of the action
See Also:
ActionListener.actionPerformed

addItem

public void addItem(Object obj)
See Also:
JComboBox.addItem

fireActionPerformed

public void fireActionPerformed()
Overrides:
fireActionPerformed in class Button
See Also:
AbstractButton.fireActionPerformed

getDefaultName

public String getDefaultName()
Overrides:
getDefaultName in class Button

getItemCount

public int getItemCount()

getItems

public Vector getItems()
return the vector, can not be a true representation of the model


getList

public List getList()
See Also:
ComboPopup.getList

getNonSelectedImage

public Icon getNonSelectedImage()

getSelectedImage

public Icon getSelectedImage()

getSelectedIndex

public int getSelectedIndex()
Returns:
an integer specifying the currently selected list item
See Also:
JComboBox#getSelectedIndex

getSelectedItem

public Object getSelectedItem()
Returns:
the current selected item
See Also:
JComboBox.getSelectedItem

getValue

public Object getValue()
Overrides:
getValue in class Button

paintComponent

public void paintComponent(Graphics2D g)
Overrides:
paintComponent in class Label
See Also:
JComponent.paintComponent

setItems

public void setItems(Vector items)

setLoop

public void setLoop(boolean b)

setModel

public void setModel(List list)
Parameters:
list -
See Also:
JComboBox.setModel

setNonSelectedImage

public void setNonSelectedImage(Icon nonSelectedImage)

setScrollMode

public void setScrollMode(int m)

setSelectedImage

public void setSelectedImage(Icon selectedImage)

setSelectedIndex

public void setSelectedIndex(int i)
Parameters:
i -
See Also:
JComboBox.setSelectedIndex

setSelectedItem

public void setSelectedItem(Object selected)
Parameters:
selected -
See Also:
JComboBox.setSelectedItem

setText

public void setText(String a)
This throws an IllegalArgumentException and you should use the setIndex method instead

Overrides:
setText in class Label
Parameters:
a - The text of the label
See Also:
JLabel.setText

setValue

public void setValue(Object obj)
Overrides:
setValue in class Button

updateUI

public void updateUI()
Overrides:
updateUI in class Button
See Also:
JComponent.updateUI

workoutMinimumSize

public void workoutMinimumSize()
Description copied from class: Component
This sets the width and height of this component to the MINIMUM that is needed for this component

Overrides:
workoutMinimumSize in class Label
See Also:
JComponent.getMinimumSize