com.sas.visuals
Class TabButton

com.sas.visuals.TabButton
All Implemented Interfaces:
ActionSource, CompositeInterface, ContainerInterface, com.sas.awt.print.PrintableInterface, VisualInterface, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.ComponentInterface, com.sas.DesignTimeDropTargetInterface, com.sas.lang.StringDataInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, com.sas.PublicClonable, ValidatorInterface, com.sas.ViewInterface, Alignment, MultipleValueEventSourceInterface, ResizeToFitInterface, SelectableInterface, TabButtonInterface, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class TabButton
implements TabButtonInterface

TabButton is a subclass of ToggleButton that implements the TabButtonInterface. This allows it to be used in the TabBar. The TabButtonInterface has an orientation property. On the TabButton, this changes the display of the border. The TabButton uses a special border and buttonModel. The border is the TabBorder and the buttonModel is the TabButtonModel.
Notes:


See Also:
BaseButton, ToggleButton, TabBorder, TabButtonModel, TabButtonInterface, Serialized Form

Field Summary
static int NONE
          NONE orientation value
protected  int orientation
          int value representing orientation of the TabButton
static java.lang.String RB_KEY
           
 
Fields inherited from class com.sas.visuals.ToggleButton
contentShift, label, textBounds
 
Fields inherited from class com.sas.visuals.BaseButton
actionCommand, actionListenerList, borderPainted, BOTTOM, buttonListener, buttonModel, currentInsets, defaultIcon, disabledIcon, displayTransform, focusGap, focusPainted, gap, hasFocus, horizontalAlignment, horizontalTextAlignment, item, itemListenerList, LEFT, pressedIcon, resizeToFit, RIGHT, rolloverIcon, selectedIcon, text, textPosition, TOP, updateItem, updateText, verticalAlignment, verticalTextAlignment
 
Fields inherited from interface com.sas.visuals.Alignment
BEGIN, CENTER, END
 
Constructor Summary
TabButton()
          Default constructor.
TabButton(com.sas.visuals.IconInterface defaultImg)
          Constructor that sets the defaultIcon.
TabButton(java.lang.String txt)
          Constructor that sets the text on the TabButton.
TabButton(java.lang.String txt, com.sas.visuals.IconInterface defaultImg)
          Constructor that sets the text and the defaultIcon of the TabButton.
TabButton(java.lang.String txt, com.sas.visuals.IconInterface defaultImg, boolean selected)
          Constructor that sets the text, the defaultIcon, and the selected state of the TabButton.
 
Method Summary
protected  void buttonModelPressed(ButtonModelInterface btnModel)
          Handles change in buttonModel pressed property.
static int getDefaultHeight()
          Returns the default height in pixels
static int getDefaultWidth()
          Returns the default width in pixels
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
          Returns information used by the com.sas.beans.Introspector to augment the automatically introspected information about this TabButton.
 int getOrientation()
          Get the orientation of the TabButton.
 boolean isFocusTraversable()
          Determines if the TabButton is focusTraversable.
protected  void paintBackground(java.awt.Graphics g)
          Paint the background on the ToggleButton.
static void setDefaultHeight(int newHeight)
          Sets the default height in pixels
static void setDefaultWidth(int newWidth)
          Sets the default widthin pixels
 void setOrientation(int orient)
          Sets the orientation of the TabButton.
 java.lang.String toString()
          Returns the toString representation of the TabButton.
 
Methods inherited from class com.sas.visuals.ToggleButton
buttonModelArmed, buttonModelSelected, clone, contentShift, getContentShift, getMinimumSize, getSelectionGroup, getSource, getTextBounds, paint, paintFocus, setContentShift, setFont, setHorizontalTextAlignment, setSelected, setSelectionGroup, setSource, setText, setVerticalTextAlignment
 
Methods inherited from class com.sas.visuals.BaseButton
actionPerformed, addActionListener, addItemListener, addNotify, buttonModelDisabled, buttonModelRollover, computePreferredSize, detachModel, focusGained, focusLost, getActionCommand, getButtonListener, getButtonModel, getContentSize, getDefaultIcon, getDisabledIcon, getDisplayTransform, getFocusGap, getHorizontalAlignment, getHorizontalTextAlignment, getIconTextGap, getInsets, getItem, getKeyAccelerator, getPressedIcon, getRequiredInterfaces, getRolloverIcon, getSelectedIcon, getSelectedObjects, getText, getTextPosition, getVerticalAlignment, getVerticalTextAlignment, isBorderPainted, isFocusPainted, isResizeToFit, isSelected, itemStateChanged, processActionEvent, processEvent, processItemEvent, propertyChange, refresh, refreshItem, removeActionListener, removeItemListener, resizeToFit, setActionCommand, setBorderPainted, setBounds, setButtonListener, setButtonModel, setDefaultIcon, setDefaultValues, setDisabledIcon, setDisplayTransform, setEnabled, setFocusGap, setFocusPainted, setHorizontalAlignment, setIconTextGap, setInsets, setItem, setKeyAccelerator, setPressedIcon, setResizeToFit, setRolloverIcon, setSelectedIcon, setTextPosition, setVerticalAlignment
 
Methods inherited from class com.sas.awt.ContainerContainerComponent
dragEnter, dragLeave, dragOver, drop, getContainerInterfaceSupportInfo, getErrorHandler, getValidator, isIDEDnDDropBarrier, isIDEDnDDropTarget, isValid, removeNotify, setContainerInterfaceSupportInfo, setErrorHandler, setIDEDnDDropBarrier, setIDEDnDDropTarget, setInsets, setValidator, superAddNotify, superGetInsets, superRemoveNotify, superSetDefaultValues
 
Methods inherited from class com.sas.awt.ContainerVisualComponent
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getBackgroundColor, getBorder, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getFont, getForegroundColor, getHeight, getHorizontalPosition, getLinkInfo, getModelInterface, getPageBounds, getPreferredSize, getPrePainter, getPrintOptionsPanel, getVerticalPosition, getViewInterfaceSupportInfo, getVisualInterfaceSupportInfo, getWidth, initialize, initializeComponent, isDesignTime, isEnabled, isFocus, isLinked, isTransparent, isVisible, pageExists, print, printFinalize, printInitialize, queryLinks, queryLinks, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setBackgroundColor, setBorder, setComponentDescription, setComponentSupportInfo, setFocus, setForegroundColor, setHeight, setHorizontalPosition, setLinkInfo, setModelInterface, setPreferredSize, setPrePainter, setRequiredInterfaces, setTransparent, setVerticalPosition, setViewInterfaceSupportInfo, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, update, validateObject
 
Methods inherited from interface com.sas.visuals.TabButtonInterface
getActionCommand, setActionCommand
 
Methods inherited from interface com.sas.visuals.SelectableInterface
getButtonModel, getDisplayTransform, getItem, getSelectionGroup, setDisplayTransform, setItem, setSelectionGroup
 
Methods inherited from interface com.sas.awt.ActionSource
addActionListener, removeActionListener
 
Methods inherited from interface com.sas.awt.ContainerInterface
getComponents, getLayout, invalidate, setLayout, validate
 
Methods inherited from interface com.sas.awt.VisualInterface
getBackgroundColor, getBorder, getFont, getForegroundColor, getHeight, getHorizontalPosition, getPreferredSize, getPrePainter, getVerticalPosition, getVisualInterfaceSupportInfo, getWidth, isEnabled, isFocus, isTransparent, isVisible, setBackgroundColor, setBorder, setFocus, setForegroundColor, setHeight, setHorizontalPosition, setPreferredSize, setPrePainter, setTransparent, setVerticalPosition, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

NONE

public static final int NONE
NONE orientation value

See Also:
Constant Field Values

orientation

protected int orientation
int value representing orientation of the TabButton

Constructor Detail

TabButton

public TabButton()
Default constructor.


TabButton

public TabButton(java.lang.String txt)
Constructor that sets the text on the TabButton.

Parameters:
txt - the text for the TabButton

TabButton

public TabButton(com.sas.visuals.IconInterface defaultImg)
Constructor that sets the defaultIcon.

Parameters:
defaultImg - the defaultIcon object

TabButton

public TabButton(java.lang.String txt,
                 com.sas.visuals.IconInterface defaultImg)
Constructor that sets the text and the defaultIcon of the TabButton.

Parameters:
txt - the text for the TabButton
defaultImg - the defaultIcon object

TabButton

public TabButton(java.lang.String txt,
                 com.sas.visuals.IconInterface defaultImg,
                 boolean selected)
Constructor that sets the text, the defaultIcon, and the selected state of the TabButton.

Parameters:
txt - the text for the TabButton
defaultImg - the defaultIcon object
selected - the selected state of the TabButton
Method Detail

getDefaultHeight

public static int getDefaultHeight()
Returns the default height in pixels

Returns:
pixel value of the default height
See Also:
setDefaultHeight(int)

getDefaultWidth

public static int getDefaultWidth()
Returns the default width in pixels

Returns:
pixel value of default width
See Also:
setDefaultWidth(int)

setDefaultHeight

public static void setDefaultHeight(int newHeight)
Sets the default height in pixels

Parameters:
newHeight - the desired default height in pixels
See Also:
getDefaultHeight()

setDefaultWidth

public static void setDefaultWidth(int newWidth)
Sets the default widthin pixels

Parameters:
newWidth - the desired default width in pixels
See Also:
setDefaultWidth(int)

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
Returns information used by the com.sas.beans.Introspector to augment the automatically introspected information about this TabButton.

Returns:
the ExtendedBeanInfo for this class

buttonModelPressed

protected void buttonModelPressed(ButtonModelInterface btnModel)
Handles change in buttonModel pressed property. Overridden to do nothing.

Overrides:
buttonModelPressed in class ToggleButton
Parameters:
btnModel - the buttonModel that changed.

isFocusTraversable

public boolean isFocusTraversable()
Determines if the TabButton is focusTraversable.

Overrides:
isFocusTraversable in class BaseButton
Returns:
true if the TabButton selected state is true; false otherwise
See Also:
Component.isFocusTraversable()

getOrientation

public int getOrientation()
Get the orientation of the TabButton.

Specified by:
getOrientation in interface TabButtonInterface
Returns:
an orientation value: TOP, BOTTOM, LEFT, RIGHT, or NONE
See Also:
setOrientation(int)

paintBackground

protected void paintBackground(java.awt.Graphics g)
Paint the background on the ToggleButton.

Overrides:
paintBackground in class ToggleButton
Parameters:
g - the Graphics context

setOrientation

public void setOrientation(int orient)
Sets the orientation of the TabButton. This also sets the orientation on the TabBorder.

Specified by:
setOrientation in interface TabButtonInterface
Parameters:
orient - an orientation value: TOP, BOTTOM, LEFT, RIGHT, or NONE
See Also:
Orientations, getOrientation()

toString

public java.lang.String toString()
Returns the toString representation of the TabButton.

Overrides:
toString in class java.awt.Component
Returns:
the super.toString() and getText()
See Also:
Component.toString()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.