net.yura.mobile.gui.components
Class List
java.lang.Object
net.yura.mobile.gui.components.Component
net.yura.mobile.gui.components.List
- All Implemented Interfaces:
- ActionListener
- Direct Known Subclasses:
- MenuBar
public class List
- extends Component
- implements ActionListener
if you would like the list to wrap the items then please use GridList
- Author:
- Yura Mamyrin
- See Also:
FileChooser.GridList
,
JList
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 |
Methods inherited from class net.yura.mobile.gui.components.Component |
add, add, add, addFocusListener, addImpl, animate, clip, getBackground, getBorder, getCurrentState, getDesktopPane, getFocusListeners, getForeground, getHeight, getHeightWithBorder, getInsets, getName, getParent, getPreferredHeight, getPreferredWidth, getState, getValue, getWidth, getWidthWithBorder, getWindow, getX, getXOnScreen, getXWithBorder, getY, getYOnScreen, getYWithBorder, insert, insert, isComponentVisible, isFocusable, isFocusOwner, isOpaque, isRectVisible, isShowing, isVisible, makeVisible, paint, paintBorder, processMultitouchEvent, removeFocusListener, removeParent, repaint, requestFocusInWindow, revalidate, scrollRectToVisible, scrollUpDown, setBackground, setBorder, setBounds, setBoundsWithBorder, setFocusable, setForeground, setLocation, setName, setPreferredSize, setState, setToolTipText, setupState, setValue, setVisible, transferFocus, validate, wait, workoutSize |
HORIZONTAL
public static final int HORIZONTAL
- Not supported in Swing
- See Also:
- Constant Field Values
VERTICAL
public static final int VERTICAL
- See Also:
JList.VERTICAL
,
Constant Field Values
List
public List()
- See Also:
JList.JList
List
public List(ListCellRenderer a)
List
public List(Vector a)
- Parameters:
a
- - See Also:
JList.JList
List
public List(Vector a,
ListCellRenderer b,
int h)
actionPerformed
public void actionPerformed(String actionCommand)
- Specified by:
actionPerformed
in interface ActionListener
- Parameters:
actionCommand
- The Command of the action- See Also:
ActionListener.actionPerformed
addActionListener
public void addActionListener(ActionListener l)
addChangeListener
public void addChangeListener(ChangeListener aThis)
addElement
public void addElement(Object a)
- Parameters:
a
- - See Also:
DefaultListModel.addElement
clearSelection
public void clearSelection()
- See Also:
JList.clearSelection
,
ListSelectionModel.clearSelection
consumesMotionEvents
public boolean consumesMotionEvents()
- Overrides:
consumesMotionEvents
in class Component
contentsChanged
public void contentsChanged()
- See Also:
ListDataListener.contentsChanged
ensureIndexIsVisible
public void ensureIndexIsVisible(int i)
- See Also:
JList.ensureIndexIsVisible
fireActionPerformed
public boolean fireActionPerformed()
focusGained
public void focusGained()
- Overrides:
focusGained
in class Component
- See Also:
FocusListener.focusGained
focusLost
public void focusLost()
- Overrides:
focusLost
in class Component
- See Also:
FocusListener.focusLost
getActionCommand
public String getActionCommand()
getActionListener
public ActionListener getActionListener()
getCellRenderer
public ListCellRenderer getCellRenderer()
- Returns:
- the ListCellRenderer
- See Also:
JList.getCellRenderer
getComponentFor
protected Component getComponentFor(int i,
int offset)
getDefaultName
public String getDefaultName()
- Specified by:
getDefaultName
in class Component
getElementAt
public Object getElementAt(int index)
- Parameters:
index
-
- Returns:
- the element
- See Also:
ListModel.getElementAt
getFixedCellHeight
public int getFixedCellHeight()
getItems
public Vector getItems()
- not swing
getLayoutOrientation
public int getLayoutOrientation()
- See Also:
JList.getLayoutOrientation
getRendererComponentFor
public Component getRendererComponentFor(int a)
getSelectedIndex
public int getSelectedIndex()
- Returns:
- the first selected index; returns -1 if there is no selected item
- See Also:
JList.getSelectedIndex
getSelectedValue
public Object getSelectedValue()
- Returns:
- the first selected value, or null if the selection is empty
- See Also:
JList.getSelectedValue
getSelectedValues
public Vector getSelectedValues()
- See Also:
JList.getSelectedValues
getSize
public int getSize()
- Returns:
- the size of the list
- See Also:
ListModel.getSize
getToolTipLocationX
public int getToolTipLocationX()
- Overrides:
getToolTipLocationX
in class Component
- See Also:
JComponent.getToolTipLocation
getToolTipLocationY
public int getToolTipLocationY()
- Overrides:
getToolTipLocationY
in class Component
- See Also:
JComponent.getToolTipLocation
getToolTipText
public String getToolTipText()
- Overrides:
getToolTipText
in class Component
- See Also:
JComponent.getToolTipText
,
JComponent.getToolTipText
indexOf
public int indexOf(Object a)
- See Also:
DefaultListModel.indexOf
insertElementAt
public void insertElementAt(Object object,
int index)
- Parameters:
index
- - See Also:
ListModel.insertElementAt
isSelectedIndex
public boolean isSelectedIndex(int index)
- See Also:
ListSelectionModel.isSelectedIndex
isUseSelectButton
public boolean isUseSelectButton()
paintComponent
public void paintComponent(Graphics2D g)
- Specified by:
paintComponent
in class Component
- See Also:
JComponent.paintComponent
processKeyEvent
public boolean processKeyEvent(KeyEvent keypad)
- Overrides:
processKeyEvent
in class Component
- See Also:
JComponent.processKeyEvent
processMouseEvent
public void processMouseEvent(int type,
int x,
int y,
KeyEvent keys)
- Overrides:
processMouseEvent
in class Component
- See Also:
Component.processMouseEvent
removeActionListener
public void removeActionListener(ActionListener l)
removeAllElements
public void removeAllElements()
- See Also:
DefaultListModel#removeAllElements
removeElement
public boolean removeElement(Object obj)
- Parameters:
obj
- the object to remove- See Also:
DefaultListModel#removeElement
removeElementAt
public void removeElementAt(int i)
- Parameters:
i
- - See Also:
DefaultListModel#removeElementAt
setActionCommand
public void setActionCommand(String ac)
setCellRenderer
public void setCellRenderer(ListCellRenderer cellRenderer)
- Parameters:
cellRenderer
- - See Also:
JList.setCellRenderer
setDoubleClick
public void setDoubleClick(boolean b)
setElementAt
public void setElementAt(Object object,
int index)
- Parameters:
index
- - See Also:
ListModel.setElementAt
setFixedCellHeight
public void setFixedCellHeight(int height)
- Parameters:
height
- - See Also:
JList.setFixedCellHeight
setFixedCellWidth
public void setFixedCellWidth(int width)
- Parameters:
width
- - See Also:
JList.setFixedCellWidth
setLayoutOrientation
public void setLayoutOrientation(int layoutOrientation)
- See Also:
JList.setLayoutOrientation
setListData
public void setListData(Vector a)
- Parameters:
a
- - See Also:
JList.setListData
setLoop
public void setLoop(boolean l)
setPrototypeCellValue
public void setPrototypeCellValue(Object prototypeCellValue)
- maybe should be in list, but is used in a few places
- See Also:
JList.setPrototypeCellValue
setSelectedIndex
public void setSelectedIndex(int a)
- Parameters:
a
- the index of the one cell to select- See Also:
JList.setSelectedIndex
setSelectedIndex
public void setSelectedIndex(int a,
boolean moveScroll)
- Parameters:
a
- the index ofthe one cell to selectmoveScroll
- if true the scroll positon of the list will be
modified to make the newly selected index visible
setSelectedValue
public void setSelectedValue(Object a)
- Parameters:
a
- the object to select- See Also:
JList.setSelectedValue
setSelectedValues
public void setSelectedValues(Vector v)
- See Also:
JList.setSelectedValue
setSize
public void setSize(int w,
int h)
- Overrides:
setSize
in class Component
- See Also:
Component.setSize
setUseSelectButton
public void setUseSelectButton(boolean useSelectButton)
toString
public String toString()
- Overrides:
toString
in class Component
- See Also:
Component.toString
updateUI
public void updateUI()
- Overrides:
updateUI
in class Component
- 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
- Specified by:
workoutMinimumSize
in class Component
- See Also:
JComponent.getMinimumSize