|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.AbstractButton | +--javax.swing.JButton | +--com.smardec.asc.dropdown.JDropDownButton
JDropDownButton
is a Swing component based on JButton
that provides popup menu
with alternate actions.
Field Summary |
Fields inherited from class javax.swing.AbstractButton |
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY |
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 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 | |
JDropDownButton()
Constructs a drop-down button with no actions. |
|
JDropDownButton(boolean toolbarStyle)
Constructs a drop-down button with no actions. |
|
JDropDownButton(java.util.Vector actions)
Constructs a drop-down button with specified actions. |
|
JDropDownButton(java.util.Vector actions,
boolean toolbarStyle)
Constructs a drop-down button with specified actions. |
Method Summary | |
void |
addAction(javax.swing.Action a)
Appends the specified action to the end of this drop-down button. |
void |
addAction(int index,
javax.swing.Action a)
Inserts the specified action at the specified position in this drop-down button. |
int |
getActionsCount()
Returns the number of actions in the drop-down button. |
javax.swing.Action |
getActiveAction()
Returns active action or null if drop-down button has no actions. |
int |
getDropDownAreaWidth()
Retruns the width of drop area in this drop-down button. |
javax.swing.ImageIcon |
getDropDownIcon()
Retruns the drop-down icon in this drop-down button. |
java.awt.Dimension |
getPreferredSize()
Returns preferred size of this drop-down button. |
int |
indexOf(javax.swing.Action a)
Searches for the specified action, testing for equality using the equals method. |
boolean |
isChangeActiveAction()
Indicates whether drop-down button should change active action (action that is displayed on the button). |
boolean |
isShowText()
Indicates whether drop-down button shows its text. |
boolean |
isUseFixedPreferredSize()
Indicates whether drop-down button should use fixed preferred size. |
boolean |
removeAction(javax.swing.Action a)
Removes specified action from the drop-down button. |
javax.swing.Action |
removeAction(int index)
Removes the action at the specified position in the drop-down button. |
void |
setActiveAction(int index)
Specifies the active action index. |
void |
setChangeActiveAction(boolean changeActiveAction)
Specifies whether drop-down button should change active action (action that is displayed on the button). |
void |
setDropDownAreaWidth(int dropDownAreaWidth)
Specifies the width of drop area in this drop-down button. |
void |
setDropDownIcon(javax.swing.ImageIcon dropDownIcon)
Specifies the drop-down icon in this drop-down button. |
void |
setPreferredSize(java.awt.Dimension preferredSize)
Specifies preferred size of this drop-down button. |
void |
setShowText(boolean showText)
Specifies whether drop-down button shows its text. |
void |
setUseFixedPreferredSize(boolean useFixedPreferredSize)
Specifies whether drop-down button should use fixed preferred size. |
Methods inherited from class javax.swing.JButton |
configurePropertiesFromAction, getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable, updateUI |
Methods inherited from class javax.swing.AbstractButton |
addActionListener, addChangeListener, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setEnabled, setFocusPainted, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setMargin, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JDropDownButton()
public JDropDownButton(boolean toolbarStyle)
toolbarStyle
- if true
constructs toolbar style button, false
otherwisepublic JDropDownButton(java.util.Vector actions) throws java.lang.Exception
actions
- alternate actions for JDropDownButton
java.lang.Exception
- actions contains object than is not 'javax.swing.Action'public JDropDownButton(java.util.Vector actions, boolean toolbarStyle) throws java.lang.Exception
actions
- alternate actions for JDropDownButton
toolbarStyle
- if true
constructs toolbar style button, false
otherwise
java.lang.Exception
- actions contains object than is not 'javax.swing.Action'Method Detail |
public void addAction(javax.swing.Action a)
a
- action to be appended to this JAnimatePanel
public void addAction(int index, javax.swing.Action a) throws java.lang.ArrayIndexOutOfBoundsException
index
- index at which the specified action is to be inserteda
- action to be inserted
java.lang.ArrayIndexOutOfBoundsException
- index is out of range (index < 0 || index > getActionsCount()
).public javax.swing.Action removeAction(int index) throws java.lang.ArrayIndexOutOfBoundsException
index
- the index of the tab to be removed
JDropDownButton
.
java.lang.ArrayIndexOutOfBoundsException
public boolean removeAction(javax.swing.Action a)
a
- action to be removed
true
if the JDropDownButton
contained the specified action.public int indexOf(javax.swing.Action a)
a
- action to search for
JDropDownButton
;-1
if the action is not found.public int getActionsCount()
JDropDownButton
.public javax.swing.Action getActiveAction()
null
if drop-down button has no actions.
null
if JDropDownButton
has no actions.public void setActiveAction(int index) throws java.lang.ArrayIndexOutOfBoundsException
index
- the index of action to set active
java.lang.ArrayIndexOutOfBoundsException
public boolean isShowText()
true
.
true
if the JDropDownButton
shows its text, false
otherwise.public void setShowText(boolean showText)
true
.
showText
- true
to show text, false
otherwise.public boolean isChangeActiveAction()
true
.
true
if JDropDownButton
should change active action,
false
otherwise.public void setChangeActiveAction(boolean changeActiveAction)
true
.
changeActiveAction
- if true
JDropDownButton
changes active action,
false
otherwise.public int getDropDownAreaWidth()
JDropDownButton
.public void setDropDownAreaWidth(int dropDownAreaWidth)
dropDownAreaWidth
- width of drop area in this JDropDownButton
.public javax.swing.ImageIcon getDropDownIcon()
JDropDownButton
.public void setDropDownIcon(javax.swing.ImageIcon dropDownIcon)
dropDownIcon
- drop-down icon in this JDropDownButton
.public boolean isUseFixedPreferredSize()
true
getPreferredSize()
returns the preferred size value that is not depend on
which action is active. By default drop-down button queries all actions and returns maximum within all values.
false
getPreferredSize()
returns the preferred size depending on active action.
true
.
true
if JDropDownButton
should use fixed preferred size,
false
otherwise.setUseFixedPreferredSize(boolean)
,
getPreferredSize()
,
setPreferredSize(java.awt.Dimension)
public void setUseFixedPreferredSize(boolean useFixedPreferredSize)
true
getPreferredSize()
returns the preferred size value that is not depend on
which action is active. By default drop-down button queries all actions and returns maximum within all values.
false
getPreferredSize()
returns the preferred size depending on active action.
true
.
useFixedPreferredSize
- true
if JDropDownButton
should use fixed preferred size,
false
otherwiseisUseFixedPreferredSize()
,
getPreferredSize()
,
setPreferredSize(java.awt.Dimension)
public java.awt.Dimension getPreferredSize()
isUseFixedPreferredSize()
is true
this method returns the preferred size value
that is not depend on which action is active. The default value is calculated in the following manner:
drop-down button queries all actions and returns maximum within all values + dropDownAreaWidth.
isUseFixedPreferredSize()
is false
this method returns the preferred size value
depending on active action. The default value is calculated in the following manner:
preferred size calculated on active action + dropDownAreaWidth.
getPreferredSize
in class javax.swing.JComponent
JDropDownButton
.isUseFixedPreferredSize()
,
getDropDownAreaWidth()
public void setPreferredSize(java.awt.Dimension preferredSize)
setPreferredSize
in class javax.swing.JComponent
preferredSize
- preferred size of this JDropDownButton
getPreferredSize()
,
isUseFixedPreferredSize()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |