|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JTextField
com.sibvisions.rad.ui.swing.ext.JVxChoice
public class JVxChoice
A Choice editor can display and switch several values as Image. This is more flexible than JRadioButton or JCheckBox, because it can be configured which items should be returned and which images should be displayed instead.
Nested Class Summary | |
---|---|
static class |
JVxChoice.NullCaret
Null Caret is a invisible non functional Caret to prevent null pointer exceptions in swing. |
static class |
JVxChoice.NullDocumentFilter
Null Document Filter. |
Nested classes/interfaces inherited from class javax.swing.JTextField |
---|
JTextField.AccessibleJTextField |
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
---|
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JTextField |
---|
notifyAction |
Fields inherited from class javax.swing.text.JTextComponent |
---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface com.sibvisions.rad.ui.swing.ext.JVxConstants |
---|
STRETCH |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JVxChoice()
Constructs a new JVxChoice component. |
|
JVxChoice(Object[] pAllowedValues,
Image[] pImages)
Constructs a new JVxChoice with the given allowed values and image names. |
Method Summary | |
---|---|
void |
addActionListener(ActionListener pActionListener)
Adds an ActionListener . |
void |
addItemListener(ItemListener pItemListener)
|
protected void |
fireActionEvent()
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireItemStateChanged(ItemEvent pItemEvent)
Notifies all listeners that have registered interest for notification on this event type. |
String |
getActionCommand()
Returns the action command that is included in the event sent to action listeners. |
ActionListener[] |
getActionListeners()
Returns an array of all the ActionListener s added
to this JComboBox with addActionListener(). |
Object[] |
getAllowedValues()
Gets all allowed values. |
Color |
getBackground()
|
Rectangle |
getBounds()
|
Image |
getDefaultImage()
Gets the default image that is shown if selectedIndex is -1. |
int |
getHeight()
|
int |
getHorizontalAlignment()
Gets the horizontal alignment of the icon. |
Image[] |
getImages()
Gets the images that are used for displaying the values. |
Dimension |
getImageSize()
Returns the image size. |
Color |
getInnerBackground()
Gets the inner background. |
Border |
getInnerBorder()
Gets the inner border. |
Rectangle |
getInnerBounds()
Returns the inner bounds of the choice component. |
Insets |
getInnerInsets()
Returns the inner insets. |
ItemListener[] |
getItemListeners()
Returns an array of all the ItemListener s added
to this JVxChoice with addItemListener(). |
Dimension |
getPreferredSize()
Gets the preferred size of the icon dependent of the configured alignments. |
int |
getSelectedIndex()
Gets the selected index, or -1 if no value is selected. |
Object |
getSelectedItem()
Gets the current selected value, or null, if no one is selected. |
Object[] |
getSelectedObjects()
|
Dimension |
getSize()
|
int |
getVerticalAlignment()
Gets the vertical alignment of the icon. |
int |
getWidth()
|
boolean |
isImageBorderVisible()
Gets the visibility of the image border. |
void |
paintComponent(Graphics pGraphics)
|
protected void |
processKeyEvent(KeyEvent pKeyEvent)
|
protected void |
processMouseEvent(MouseEvent pMouseEvent)
|
void |
removeActionListener(ActionListener pActionListener)
Removes an ActionListener . |
void |
removeItemListener(ItemListener pItemListener)
|
void |
selectNextIndex()
Selects the next index. |
void |
setActionCommand(String pActionCommand)
Sets the action command that should be included in the event sent to action listeners. |
void |
setAllowedValues(Object[] pAllowedValues)
Sets all allowed values. |
void |
setCursor(Cursor pCursor)
|
void |
setDefaultImage(Image pDefaultImage)
Sets the default image that is shown if selectedIndex is -1. |
void |
setEditable(boolean pEditable)
|
void |
setHorizontalAlignment(int pHorizontalAlignment)
Sets the horizontal alignment of the icon. |
void |
setImageBorderVisible(boolean pImageBorderVisible)
sets the visibility of the image border. |
void |
setImages(Image[] pImages)
Sets the images that are used for displaying the values. |
void |
setImageSize(Dimension pImageSize)
Returns the image size. |
void |
setInnerBackground(Color pInnerBackground)
sets the inner background. |
void |
setInnerBorder(Border pInnerBorder)
sets the inner border. |
void |
setSelectedIndex(int pSelectedIndex)
Sets the selected index. |
void |
setSelectedItem(Object pSelectedItem)
Sets the value that should be selected. |
void |
setUI(TextUI pTextUI)
|
void |
setVerticalAlignment(int pVerticalAlignment)
Sets the vertical alignment of the icon. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JVxChoice()
public JVxChoice(Object[] pAllowedValues, Image[] pImages)
pAllowedValues
- the allowed values.pImages
- the images.Method Detail |
---|
public void setUI(TextUI pTextUI)
setUI
in class JTextComponent
public void setCursor(Cursor pCursor)
setCursor
in class Component
public void setEditable(boolean pEditable)
setEditable
in class JTextComponent
public Color getBackground()
getBackground
in class Component
public int getWidth()
getWidth
in class JComponent
public int getHeight()
getHeight
in class JComponent
public Dimension getSize()
getSize
in class Component
public Rectangle getBounds()
getBounds
in class Component
public void paintComponent(Graphics pGraphics)
paintComponent
in class JComponent
public Dimension getPreferredSize()
JVxConstants.STRETCH
then the
size of the component will be used. Otherwise the size
of the image will be used.
getPreferredSize
in class JTextField
public int getHorizontalAlignment()
getHorizontalAlignment
in class JTextField
JVxConstants
public void setHorizontalAlignment(int pHorizontalAlignment)
setHorizontalAlignment
in class JTextField
pHorizontalAlignment
- the alignmentJVxConstants
protected void processMouseEvent(MouseEvent pMouseEvent)
processMouseEvent
in class JComponent
protected void processKeyEvent(KeyEvent pKeyEvent)
processKeyEvent
in class JComponent
public Object[] getSelectedObjects()
getSelectedObjects
in interface ItemSelectable
public void addItemListener(ItemListener pItemListener)
addItemListener
in interface ItemSelectable
public void removeItemListener(ItemListener pItemListener)
removeItemListener
in interface ItemSelectable
public Color getInnerBackground()
public void setInnerBackground(Color pInnerBackground)
pInnerBackground
- the inner background.public Border getInnerBorder()
public void setInnerBorder(Border pInnerBorder)
pInnerBorder
- the inner border.public boolean isImageBorderVisible()
public void setImageBorderVisible(boolean pImageBorderVisible)
pImageBorderVisible
- the visibility of the image border.public Object[] getAllowedValues()
public void setAllowedValues(Object[] pAllowedValues)
pAllowedValues
- all allowed values.public Image[] getImages()
public void setImages(Image[] pImages)
pImages
- the images.public Dimension getImageSize()
public void setImageSize(Dimension pImageSize)
pImageSize
- the size the images should have.public Insets getInnerInsets()
public Rectangle getInnerBounds()
public Image getDefaultImage()
public void setDefaultImage(Image pDefaultImage)
pDefaultImage
- the default image.public int getVerticalAlignment()
JVxConstants
public void setVerticalAlignment(int pVerticalAlignment)
pVerticalAlignment
- the alignmentJVxConstants
public int getSelectedIndex()
public void setSelectedIndex(int pSelectedIndex)
pSelectedIndex
- the index to select.public void selectNextIndex()
public Object getSelectedItem()
public void setSelectedItem(Object pSelectedItem)
pSelectedItem
- the value to select.public String getActionCommand()
public void setActionCommand(String pActionCommand)
setActionCommand
in class JTextField
pActionCommand
- a string containing the "command" that is sent
to action listeners; the same listener can then
do different things depending on the command it
receivespublic ItemListener[] getItemListeners()
ItemListener
s added
to this JVxChoice with addItemListener().
ItemListener
s added or an empty
array if no listeners have been addedpublic void addActionListener(ActionListener pActionListener)
ActionListener
.
The ActionListener
will receive an ActionEvent
when a selection has been made.
addActionListener
in class JTextField
pActionListener
- the ActionListener
that is to be notifiedsetSelectedItem(java.lang.Object)
public void removeActionListener(ActionListener pActionListener)
ActionListener
.
removeActionListener
in class JTextField
pActionListener
- the ActionListener
to removepublic ActionListener[] getActionListeners()
ActionListener
s added
to this JComboBox with addActionListener().
getActionListeners
in class JTextField
ActionListener
s added or an empty
array if no listeners have been addedprotected void fireItemStateChanged(ItemEvent pItemEvent)
pItemEvent
- the event of interestItemListener
protected void fireActionEvent()
ActionListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |