public class SimpleButton extends GradientLabel
GradientLabel,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleButton.PanelFlushBorder
A clean border that visually raises the component above its surroundings.
|
ResizableTextLabel.ResizableAdapterjavax.swing.JLabel.AccessibleJLabeljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
static int |
CHAIN_ACTION_MODE
DOCUMENT ME!
|
static int |
DEFAULT_ACTION_MODE
DOCUMENT ME!
|
static int |
FAST_ACTION_MODE
DOCUMENT ME!
|
protected static java.lang.String |
MOUSE_CHAIN |
protected static java.lang.String |
MOUSE_CLICKED |
protected static java.lang.String |
MOUSE_PRESSED |
protected static java.lang.String |
MOUSE_RELEASED |
static int |
NULL_ACTION_MODE
DOCUMENT ME!
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
SimpleButton()
Creates a simple button without text .
|
SimpleButton(javax.swing.Icon icon)
Creates a simple button with Icon.
|
SimpleButton(java.lang.String text)
Creates a simple button with text.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addActionListener(java.awt.event.ActionListener l)
Adds an action listener to the list of registered listeners for this
button.
|
void |
addNotify()
DOCUMENT ME!
|
protected void |
fireActionPerformed(java.awt.event.ActionEvent e)
Fires an action event to all its listeners
|
int |
getActionMode()
Returns the currently set action mode.
|
java.awt.Color |
getBackground()
Overriden for rendering purposes.
|
java.awt.Color |
getBackgroundStart()
Overriden for rendering purposes.
|
javax.swing.border.Border |
getBorder()
Overriden for rendering purposes.
|
int |
getFireRate()
Gets the rate of event firing in the CHAIN_MODE
|
java.awt.Color |
getForeground()
Overriden for rendering purposes.
|
java.awt.Color |
getPressedBackground()
Gets the background color displayed when the button is pressed.
|
java.awt.Color |
getPressedBackgroundStart()
Gets the starting background gradient color displayed when the button
is pressed.
|
javax.swing.border.Border |
getPressedBorder()
Gets the border displayed when the button is pressed.
|
java.awt.Color |
getPressedForeground()
Gets the foreground color displayed when the button is pressed.
|
java.awt.Color |
getRolloverBackground()
Gets the background color displayed when the mouse cursor is over the
button and rollover is enabled.
|
java.awt.Color |
getRolloverBackgroundStart()
Gets the start of background gradient color displayed when the mouse
cursor is over the button and rollover is enabled.
|
javax.swing.border.Border |
getRolloverBorder()
Gets the border displayed when the mouse cursor is over the button and
rollover is enabled.
|
java.awt.Color |
getRolloverForeground()
Gets the foreground color displayed when the mouse cursor is over the
button and rollover is enabled.
|
boolean |
isPressed()
Gets the property specifiing whether the button is being pressed.
|
boolean |
isRollover()
Gets the property specifiing whether the mouse is being moved over the
button.
|
boolean |
isRolloverEnabled()
Returns wether this SimpleButton visually indicates when mouse is over
it.
|
protected void |
paintBorder(java.awt.Graphics g)
This method was overloaded to enable advanced graphical features of the
SimpleButton
|
void |
paintComponent(java.awt.Graphics g)
This method was overloaded to enable advanced graphical features of the
SimpleButton
|
void |
removeActionListener(java.awt.event.ActionListener l)
Removes an action listener from the list of registered listeners for
this button.
|
void |
removeNotify()
DOCUMENT ME!
|
void |
setActionMode(int newMode)
Sets the action mode of the SimpleButton.
|
void |
setBackground(java.awt.Color newColor)
Overriden for rendering purposes.
|
void |
setBackgroundStart(java.awt.Color newColor)
Overriden for rendering purposes.
|
void |
setBorder(javax.swing.border.Border newBorder)
Overriden for rendering purposes.
|
void |
setFireRate(int newRate)
Sets the rate of event firing in the CHAIN_MODE
|
void |
setForeground(java.awt.Color newColor)
Overriden for rendering purposes.
|
protected void |
setPressed(boolean newPressed)
Returns the property specifiing whether the button is being pressed.
|
void |
setPressedBackground(java.awt.Color newColor)
Sets the background color displayed when the button is pressed.
|
void |
setPressedBackgroundStart(java.awt.Color newColor)
Sets the starting background gradient color displayed when the button
is pressed.
|
void |
setPressedBorder(javax.swing.border.Border newBorder)
Sets the border displayed when the button is pressed.
|
void |
setPressedForeground(java.awt.Color newColor)
Sets the foreground color displayed when the button is pressed.
|
protected void |
setRollover(boolean newRollover)
Sets the property specifiing whether the mouse is being moved over the
button.
|
void |
setRolloverBackground(java.awt.Color newColor)
Sets the background color displayed when the mouse cursor is over the
button and rollover is enabled.
|
void |
setRolloverBackgroundStart(java.awt.Color newColor)
Sets the start of background gradient color displayed when the mouse
cursor is over the button and rollover is enabled.
|
void |
setRolloverBorder(javax.swing.border.Border newBorder)
Sets the border displayed when the mouse cursor is over the button and
rollover is enabled.
|
void |
setRolloverEnabled(boolean enabled)
Enables or disables visual indication when mouse is over this
SimpleButton.
|
void |
setRolloverForeground(java.awt.Color newColor)
Sets the foreground color displayed when the mouse cursor is over the
button and rollover is enabled.
|
void |
setVisible(boolean visible)
DOCUMENT ME!
|
isGradientEnabled, setGradientEnabled, setGradientPointsgetColumns, getMinimumSize, getPreferredSize, isEnhanced, isResizable, resize, setColumns, setEnhanced, setMinimumSize, setPreferredSize, setResizable, setTextcheckHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setUI, setVerticalAlignment, setVerticalTextPosition, updateUIaddAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected static final java.lang.String MOUSE_PRESSED
protected static final java.lang.String MOUSE_CLICKED
protected static final java.lang.String MOUSE_RELEASED
protected static final java.lang.String MOUSE_CHAIN
public static final int NULL_ACTION_MODE
public static final int DEFAULT_ACTION_MODE
public static final int CHAIN_ACTION_MODE
public static final int FAST_ACTION_MODE
public SimpleButton(java.lang.String text)
text - java.lang.String to be displayed on the button.public SimpleButton(javax.swing.Icon icon)
icon - javax.swing.Icon to be displayed on the button.public SimpleButton()
public void setActionMode(int newMode)
fireRate. FAST_ACTION_MODE fires ActionEvent when left
mouse button is pressed. NULL_ACTION_MODE fires no ActionEvents on
mouse actions but pressing the ENTER key still triggers ActionEvents.newMode - to be set.java.lang.IllegalArgumentException - if the value entered is not one of
DEFAULT_ACTION_MODE, CHAIN_ACTION_MODE, FAST_ACTION_MODE or
NULL_ACTION_MODE.public int getActionMode()
public void setBackground(java.awt.Color newColor)
setBackground in class GradientLabelnewColor - ColorGradientLabel.setBackground(Color)public java.awt.Color getBackground()
getBackground in class java.awt.ComponentComponent.getBackground()public void setForeground(java.awt.Color newColor)
setForeground in class javax.swing.JComponentnewColor - ColorJComponent.setForeground(Color)public java.awt.Color getForeground()
getForeground in class java.awt.ComponentComponent.getForeground()public java.awt.Color getBackgroundStart()
getBackgroundStart in class GradientLabelGradientLabel.getBackgroundStart()public void setBackgroundStart(java.awt.Color newColor)
setBackgroundStart in class GradientLabelnewColor - ColorGradientLabel.setBackgroundStart(Color)public void setBorder(javax.swing.border.Border newBorder)
setBorder in class javax.swing.JComponentnewBorder - BorderJComponent.setBorder(Border)public javax.swing.border.Border getBorder()
getBorder in class javax.swing.JComponentJComponent.getBorder()public java.awt.Color getPressedBackground()
public void setPressedBackground(java.awt.Color newColor)
newColor - Colorpublic java.awt.Color getPressedForeground()
public void setPressedForeground(java.awt.Color newColor)
newColor - Colorpublic java.awt.Color getPressedBackgroundStart()
public void setPressedBackgroundStart(java.awt.Color newColor)
newColor - Colorpublic javax.swing.border.Border getPressedBorder()
public void setPressedBorder(javax.swing.border.Border newBorder)
newBorder - Borderpublic java.awt.Color getRolloverBackground()
public void setRolloverBackground(java.awt.Color newColor)
newColor - Colorpublic java.awt.Color getRolloverForeground()
public void setRolloverForeground(java.awt.Color newColor)
newColor - Colorpublic java.awt.Color getRolloverBackgroundStart()
public void setRolloverBackgroundStart(java.awt.Color newColor)
newColor - Colorpublic javax.swing.border.Border getRolloverBorder()
public void setRolloverBorder(javax.swing.border.Border newBorder)
newBorder - Borderpublic void setRolloverEnabled(boolean enabled)
enabled - boolean whether this SimpleButton should indicate when
mouse is over it.public boolean isRolloverEnabled()
public void setFireRate(int newRate)
newRate - int time in miliseconds between successive events are
fired.public int getFireRate()
public boolean isPressed()
protected void setPressed(boolean newPressed)
newPressed - booleanpublic boolean isRollover()
protected void setRollover(boolean newRollover)
newRollover - booleanprotected void fireActionPerformed(java.awt.event.ActionEvent e)
e - ActionEventpublic void addActionListener(java.awt.event.ActionListener l)
l - ActionListenerpublic void removeActionListener(java.awt.event.ActionListener l)
l - ActionListenerpublic void paintComponent(java.awt.Graphics g)
paintComponent in class GradientLabelg - GraphicsGradientLabel.paintComponent(Graphics)protected void paintBorder(java.awt.Graphics g)
paintBorder in class javax.swing.JComponentg - GraphicsJComponent.paintBorder(Graphics)public void addNotify()
addNotify in class ResizableTextLabelJComponent.addNotify()public void removeNotify()
removeNotify in class javax.swing.JComponentpublic void setVisible(boolean visible)
setVisible in class javax.swing.JComponentvisible - DOCUMENT ME!