HOME

com.ultraswing
Class ToolBarButton

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.AbstractButton
                          |
                          +--javax.swing.JButton
                                |
                                +--com.ultraswing.CButton
                                      |
                                      +--com.ultraswing.FlatButton
                                            |
                                            +--com.ultraswing.ToolBarButton
All Implemented Interfaces:
Accessible, EventListener, ImageObserver, ItemSelectable, MenuContainer, MouseListener, PropertyChangeListener, Serializable, SwingConstants

public class ToolBarButton
extends FlatButton
implements PropertyChangeListener

Tool bar button

See Also:
Serialized Form

Field Summary
static Dimension ICON_ONLY_SIZE
          The size of button with icon only
static int ICON_ONLY_STYLE
          Icon only button
static Dimension TEXT_ICON_HORIZONTAL_SIZE
          The size of horizontal button with text and icon
static int TEXT_ICON_STYLE
          Button with Text and Icon
static Dimension TEXT_ICON_VERTICAL_SIZE
          The size of vertical button with text and icon
static Dimension TEXT_ONLY_SIZE
          The size of button with text only
static int TEXT_ONLY_STYLE
          Text only button
 
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
ToolBarButton()
          Creates a button with no set text or icon.
ToolBarButton(Icon img)
          Creates a button with an icon.
ToolBarButton(String text)
          Creates a button with text.
ToolBarButton(String text, Icon img)
          Creates a button with initial text and an icon.
ToolBarButton(String text, Icon img, boolean isVertical)
          Creates a button with initial text and an icon.
ToolBarButton(String text, Icon img, int style, boolean isVertical)
          Creates a button with initial text and an icon.
 
Method Summary
 Dimension getButtonSize(int style, boolean isVertical)
          Returns the button size
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void propertyChange(PropertyChangeEvent e)
           
 void setButtonSize(int style, boolean isVertical, Dimension size)
          Sets button size
 void setIcon(Icon icon)
          Sets button icon
 void setStyle(int style)
          Sets button style
 void setText(String text)
          Sets button text
 void setVertical(boolean b)
          Makes this button vertical or not depending on the parameter b
 
Methods inherited from class com.ultraswing.FlatButton
mouseClicked, mousePressed, mouseReleased, setBorderChangeable, setFlat, setTransparent, setVisible
 
Methods inherited from class com.ultraswing.CButton
getActionListeners, getVerticalButtonIcon, getVerticalButtonText, isVertical, paintComponent, setAntialias
 
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, 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, setIconTextGap, setLabel, setMargin, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, 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, getPreferredSize, 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, 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, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, 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
 

Field Detail

ICON_ONLY_STYLE

public static final int ICON_ONLY_STYLE
Icon only button

See Also:
Constant Field Values

TEXT_ONLY_STYLE

public static final int TEXT_ONLY_STYLE
Text only button

See Also:
Constant Field Values

TEXT_ICON_STYLE

public static final int TEXT_ICON_STYLE
Button with Text and Icon

See Also:
Constant Field Values

ICON_ONLY_SIZE

public static final Dimension ICON_ONLY_SIZE
The size of button with icon only


TEXT_ONLY_SIZE

public static final Dimension TEXT_ONLY_SIZE
The size of button with text only


TEXT_ICON_VERTICAL_SIZE

public static final Dimension TEXT_ICON_VERTICAL_SIZE
The size of vertical button with text and icon


TEXT_ICON_HORIZONTAL_SIZE

public static final Dimension TEXT_ICON_HORIZONTAL_SIZE
The size of horizontal button with text and icon

Constructor Detail

ToolBarButton

public ToolBarButton()
Creates a button with no set text or icon.


ToolBarButton

public ToolBarButton(String text)
Creates a button with text.

Parameters:
text - the text of the button

ToolBarButton

public ToolBarButton(Icon img)
Creates a button with an icon.

Parameters:
img - the Icon image to display on the button

ToolBarButton

public ToolBarButton(String text,
                     Icon img)
Creates a button with initial text and an icon.

Parameters:
text - the text of the button
img - the Icon image to display on the button

ToolBarButton

public ToolBarButton(String text,
                     Icon img,
                     boolean isVertical)
Creates a button with initial text and an icon.

Parameters:
text - the text of the button
img - the Icon image to display on the button
isVertical - if true, this button is a vertical button

ToolBarButton

public ToolBarButton(String text,
                     Icon img,
                     int style,
                     boolean isVertical)
Creates a button with initial text and an icon.

Parameters:
text - the text of the button
img - the Icon image to display on the button
style - button style, possible values are ToolBarButton.TEXT_ONLY_STYLE, ToolBarButton.ICON_ONLY_STYLE, ToolBarButton.TEXT_ICON_STYLE
isVertical - if true, this button is a vertical button
Method Detail

setStyle

public void setStyle(int style)
Sets button style

Parameters:
style - button style, possible values are ToolBarButton.TEXT_ONLY_STYLE, ToolBarButton.ICON_ONLY_STYLE, ToolBarButton.TEXT_ICON_STYLE

setText

public void setText(String text)
Sets button text

Overrides:
setText in class CButton
Parameters:
text - the buttons text

setIcon

public void setIcon(Icon icon)
Sets button icon

Overrides:
setIcon in class CButton

propertyChange

public void propertyChange(PropertyChangeEvent e)
Specified by:
propertyChange in interface PropertyChangeListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener
Overrides:
mouseEntered in class FlatButton

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener
Overrides:
mouseExited in class FlatButton

setVertical

public void setVertical(boolean b)
Makes this button vertical or not depending on the parameter b

Overrides:
setVertical in class FlatButton
Parameters:
b - if true, show vertical button

setButtonSize

public void setButtonSize(int style,
                          boolean isVertical,
                          Dimension size)
Sets button size


getButtonSize

public Dimension getButtonSize(int style,
                               boolean isVertical)
Returns the button size


HOME

Copyright © 2002 iReasoning Networks. All Rights Reserved.