|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--com.borland.primetime.actions.ActionButton
The ActionButton is a UI widget that represents a single Action object. ActionButtons represent Action objects by showing their small icon, short text in a tooltip, and mirroring their enabled state. When an ActionButton is clicked, it calls its associated Action's actionPerformed method.
ActionButtons are constructed with a source Object and an Action to represent. The source Object will be passed as the source of the ActionEvent to the assoicated Action's actionPerformed method. This allows an ActionButton to pass a particular source object (not the button itself), so the associated Actions can have direct access to a specific Object. This source is determined by the code that instantiates the ActionButton.
ActionButtons that are associated with UpdateableActions will add themselves to a timer that automatically updates the state of the action at regular intervals.
ActionButtons also have special functionality to represent StateAction objects - they will appear depressed when the StateAction's state property is 'true' and flat when it is 'false'.
Action
,
UpdateableAction
,
StateAction
, Serialized FormInner Class Summary | |
class |
ActionButton.ActionPropertyChangeListener
|
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
protected javax.swing.Action |
action
|
protected java.awt.event.ActionEvent |
ae
|
protected boolean |
center
|
protected java.awt.Image |
dither
|
protected static int |
DOWN
|
protected int |
fixedHeight
|
protected int |
fixedWidth
|
protected static int |
FLAT
|
protected int |
gapSize
|
protected static boolean |
globalMouseDown
|
protected static boolean |
globalPopping
|
protected boolean |
glowStyle
|
protected javax.swing.Icon |
icon
|
protected javax.swing.Icon |
icon_dis
|
protected static javax.swing.Icon |
icon_marker
|
protected javax.swing.Icon |
icon_roll
|
protected java.lang.String |
longText
|
protected boolean |
mouseDown
|
protected java.beans.PropertyChangeListener |
pcl
|
protected boolean |
popping
|
protected int |
popWidth
|
protected boolean |
rollover
|
protected java.lang.String |
shortText
|
protected boolean |
showIcon
|
protected boolean |
showRips
|
protected boolean |
showText
|
protected java.lang.Object |
source
|
protected static int |
UP
|
protected boolean |
useSmallIcon
|
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 |
Constructor Summary | |
ActionButton(java.lang.Object source,
javax.swing.Action action)
Constructs an ActionButton with the specified source and action objects. |
|
ActionButton(java.lang.Object source,
javax.swing.Action action,
java.awt.Dimension fixedSize)
Constructs an ActionButton with the specified source and action objects, using the specified button size. |
|
ActionButton(java.lang.Object source,
javax.swing.Action action,
java.awt.Dimension fixedSize,
boolean useSmallIcon)
Constructs an ActionButton with the specified source and action objects, using the specified button size, and the useSmallIcon setting. |
Method Summary | |
void |
addNotify()
|
protected int |
buttonPopState()
|
void |
clear()
|
javax.swing.JToolTip |
createToolTip()
|
void |
drawBorder(java.awt.Graphics g,
java.awt.Rectangle r,
boolean up)
|
void |
drawPopArrow(java.awt.Graphics g,
java.awt.Rectangle r)
|
protected void |
fire()
|
javax.swing.Action |
getAction()
Returns the Action for this ActionButton. |
int |
getFixedHeight()
|
java.awt.Dimension |
getFixedSize()
Returns the button size. |
int |
getFixedWidth()
|
int |
getGapSize()
|
java.awt.Dimension |
getPreferredSize()
|
java.lang.Object |
getSource()
Returns the object source for this ActionButton. |
protected boolean |
hasPopBar()
|
protected void |
initButton()
|
boolean |
isCentered()
|
boolean |
isFocusTraversable()
|
boolean |
isGlowStyle()
Returns the glowStyle property setting. |
boolean |
isShowIcon()
|
boolean |
isShowRips()
|
boolean |
isShowText()
|
boolean |
isUseSmallIcon()
Returns the useSmallIcon property setting. |
void |
paintChildren(java.awt.Graphics g)
|
void |
paintComponent(java.awt.Graphics g)
|
protected int |
popPopState()
|
protected void |
processMouseEvent(java.awt.event.MouseEvent e)
|
void |
removeNotify()
|
void |
setCentered(boolean center)
|
void |
setFixedHeight(int height)
|
void |
setFixedSize(java.awt.Dimension d)
Sets the button size. |
void |
setFixedWidth(int width)
|
void |
setGapSize(int gap)
|
void |
setGlowStyle(boolean glow)
Sets the glowStyle property. |
void |
setIcon(javax.swing.Icon i)
Sets the icon for the ActionButton. |
protected void |
setLongText(java.lang.String longText)
|
protected void |
setShortText(java.lang.String shortText)
|
void |
setShowIcon(boolean showIcon)
|
void |
setShowRips(boolean rips)
|
void |
setShowText(boolean showText)
|
void |
setToolTipText(java.lang.String text)
|
void |
setUseSmallIcon(boolean useSmall)
Sets the useSmallIcon property. |
protected javax.swing.Icon |
theIcon()
|
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getAccessibleContext,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getUIClassID,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintBorder,
paintImmediately,
paintImmediately,
paramString,
print,
printAll,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setUI,
setVisible,
unregisterKeyboardAction,
update,
updateUI |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
processComponentEvent,
processInputMethodEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected static final int UP
protected static final int FLAT
protected static final int DOWN
protected static boolean globalMouseDown
protected static boolean globalPopping
protected static javax.swing.Icon icon_marker
protected int fixedWidth
protected int fixedHeight
protected int popWidth
protected java.awt.event.ActionEvent ae
protected java.lang.Object source
protected javax.swing.Action action
protected boolean useSmallIcon
protected javax.swing.Icon icon
protected javax.swing.Icon icon_dis
protected javax.swing.Icon icon_roll
protected int gapSize
protected java.lang.String shortText
protected java.lang.String longText
protected boolean rollover
protected boolean mouseDown
protected boolean popping
protected boolean showIcon
protected boolean showText
protected boolean showRips
protected boolean center
protected boolean glowStyle
protected java.awt.Image dither
protected java.beans.PropertyChangeListener pcl
Constructor Detail |
public ActionButton(java.lang.Object source, javax.swing.Action action)
source
- The source objectaction
- The action objectpublic ActionButton(java.lang.Object source, javax.swing.Action action, java.awt.Dimension fixedSize)
public ActionButton(java.lang.Object source, javax.swing.Action action, java.awt.Dimension fixedSize, boolean useSmallIcon)
Method Detail |
public void clear()
public void setFixedSize(java.awt.Dimension d)
d
- The new button sizepublic java.awt.Dimension getFixedSize()
public void setFixedWidth(int width)
public int getFixedWidth()
public void setFixedHeight(int height)
public int getFixedHeight()
public void setGapSize(int gap)
public int getGapSize()
public void setShowIcon(boolean showIcon)
public boolean isShowIcon()
public void setShowText(boolean showText)
public boolean isShowText()
public void setShowRips(boolean rips)
public boolean isShowRips()
public void setCentered(boolean center)
public boolean isCentered()
public void setGlowStyle(boolean glow)
glow
- The glow style stetting for this ActionButtonpublic boolean isGlowStyle()
public void setUseSmallIcon(boolean useSmall)
useSmall
- The useSmallIcon property settingpublic boolean isUseSmallIcon()
public void setIcon(javax.swing.Icon i)
i
- The icon for the ActionButtonpublic java.lang.Object getSource()
public javax.swing.Action getAction()
public java.awt.Dimension getPreferredSize()
public boolean isFocusTraversable()
public void setToolTipText(java.lang.String text)
protected void setLongText(java.lang.String longText)
protected void setShortText(java.lang.String shortText)
public void addNotify()
public void removeNotify()
public javax.swing.JToolTip createToolTip()
protected void initButton()
protected void fire()
protected void processMouseEvent(java.awt.event.MouseEvent e)
protected boolean hasPopBar()
protected int buttonPopState()
protected int popPopState()
protected javax.swing.Icon theIcon()
public void paintComponent(java.awt.Graphics g)
public void drawPopArrow(java.awt.Graphics g, java.awt.Rectangle r)
public void drawBorder(java.awt.Graphics g, java.awt.Rectangle r, boolean up)
public void paintChildren(java.awt.Graphics g)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |