com.sas.visuals
Class TabBar

com.sas.visuals.TabBar
All Implemented Interfaces:
ActionSource, CompositeInterface, ContainerInterface, com.sas.awt.print.PrintableInterface, VisualInterface, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.collection.ContentsChangedListener, com.sas.ComponentInterface, com.sas.DesignTimeDropTargetInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, ValidatorInterface, com.sas.ViewInterface, Alignment, Direction, Justification, MultipleValueEventSourceInterface, Sizing, TabBarInterface, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class TabBar
implements TabBarInterface, java.awt.event.AdjustmentListener, com.sas.collection.ContentsChangedListener

The TabBar is a sub-class of CompositePanel that implements the TabBarInterface to contain TabButtonInterface components. It supports creating and adding the TabButtonInterface objects, as well as laying out the tabButtons in a multi-row or a single row style. Other layout options include orientation and justification of the tabButtons. The tabButtons can also be enabled or hidden using the TabBarInterface.

Notes:


See Also:
TabbedView, TabBarInterface, TabButtonInterface, Serialized Form

Field Summary
protected  BorderInterface border
           
protected  int orientation
           
static java.lang.String RB_KEY
           
protected  SpinButton spinBtn
           
protected  java.awt.Dimension spinBtnSize
           
protected  int style
           
 
Fields inherited from interface com.sas.visuals.TabBarInterface
BOTTOM, LEFT, MULTIGROUP, NONE, RIGHT, SCROLLABLE, TOP
 
Fields inherited from interface com.sas.visuals.Justification
FULL
 
Fields inherited from interface com.sas.visuals.Alignment
BEGIN, CENTER, END
 
Fields inherited from interface com.sas.visuals.Direction
BOTTOM_TO_TOP, COLUMN_MAJOR, LEFT_TO_RIGHT, RIGHT_TO_LEFT, ROW_MAJOR, TOP_TO_BOTTOM
 
Fields inherited from interface com.sas.visuals.Sizing
PROPORTIONAL, UNIFORM
 
Constructor Summary
TabBar()
          Default Constructor
TabBar(int orientation)
          Constructor to set the orientation of the TabBar.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener listener)
          Add the specified action listener to receive action events from this TabBar when a tab is selected.
protected  void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)
          Overriden to only add TabButtonInterface objects to the TabBar.
 java.awt.Component addItem(java.lang.Object tabItem)
          Construct and add a TabButtonInterface component to the container with the specified item in the first group.
 java.awt.Component addItem(java.lang.Object tabItem, int index)
          Construct and add a TabButtonInterface component to the container with the specified item in the specified group.
 java.awt.Component addItem(java.lang.Object tabItem, java.lang.Integer grpIndex)
          Construct and add a TabButtonInterface component to the container with the specified item in the specified group.
 java.awt.Component addItem(java.lang.Object item, java.lang.Integer grpIndex, int index)
          Construct and add a TabButtonInterface component to the container with the specified item in the specified group.
 void addItemListener(java.awt.event.ItemListener listener)
          Add the specified item listener to receive item events from this TabBar when a tab is selected.
protected  java.awt.Component addModelItem(java.lang.Object tabItem, java.lang.Integer grpIndex, int index)
          Construct and add a TabButtonInterface component to the container with the item from the model in the specified group.
 void adjustmentValueChanged(java.awt.event.AdjustmentEvent evt)
          Handle AdjustmentEvents from the spinButton when the style is SCROLLABLE.
 void contentsChanged(com.sas.collection.ContentsChangedEvent evt)
          Handle a change in the contents of the model.
 void detachModel(com.sas.ModelInterface model)
          Detach the specified model from the TabBar.
 void doLayout()
          Layout the component based on the style and orientation of the TabBar.
 int dragOver(java.awt.Point point, int representation, int keyState, java.util.Vector data)
          Used to support Drag and Drop in webAF at design time.
 int getBottomMargin()
          Get the amount of the bottom margin on the layout.
static int getDefaultHeight()
           
static int getDefaultWidth()
           
 com.sas.util.transforms.TransformInterface getDisplayTransform()
          Get the transform used by the TabButtonInterface to display the item object.
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
           
 int getFillFrom()
          Get the direction to fill the row of tabs from.
 int getGroupCount()
          Get the number of groups in this TabBar.
 int getIndex(TabButtonInterface tab)
          Get the index of the specified tab.
 java.lang.String[] getInitialItems()
          Get the item values in the defaultModel.
 com.sas.util.transforms.TransformInterface getInputTransform()
          Get the transform used by any methods that use the TabButtonInterface item property as an input parameter.
 int getJustification()
          Get the justification of the tabs on the tab row.
 int getLeftMargin()
          Get the amount of the left margin.
 int getOrientation()
          Get the orientation of the tabs
 com.sas.util.transforms.TransformInterface getOutputTransform()
          Get the transform used by any methods that use the TabButtonInterface item property as an return value.
 java.util.Vector getRequiredInterfaces()
          Returns the required interfaces Vector for this component.
 int getRightMargin()
          Get the amount of the right margin.
 BorderInterface getRowBorder()
          Get the Border used to draw the rows.
 int getRowSpacing()
          Get the pixel amount of spacing between rows.
 int getSelectedGroupIndex()
          Get the group index of the selected tab.
 int getSelectedIndex()
          Get the index of the selected tab.
 java.lang.Object getSelectedItem()
          Get the item property of the selected tab.
 java.lang.Object[] getSelectedObjects()
          Get the selected item or null if no item is selected.
 SelectionGroupInterface getSelectionGroup()
          Get the SelectionGroupInterface that the tabs belong to.
 int getSizing()
          Get the type of sizing done on the tabs.
 int getSpinButtonAlignment()
          Get the alignment of the SpinButton
 int getSpinButtonGap()
          Get the minium pixel gap between the SpinButton and the tabs.
 int getSpinButtonOrientation()
          Get the orientation of the SpinButton.
 int getStartIndex()
          Get the index of the starting tab.
 int getStyle()
          Get the style of the RowLayout.
 java.lang.Class getTabButtonClass()
          Get the class of the default tabs created when an addItem() method is called.
 int getTabGroupIndex(TabButtonInterface tab)
          Get the item property of the selected TabButtonInterface object.
 java.awt.Dimension getTabSize()
          Get the tabSize used when the sizing is set to UNIFORM tabs.
 int getTabSpacing()
          Get the pixel space between the tab components.
 int getTopMargin()
          Get the amount of the topMargin.
 void initialize()
          The initialize() method was designed to be a synchronization point after the constructor for the object has completed and a number of methods have been called on the component.
 void itemStateChanged(java.awt.event.ItemEvent e)
          Invoked when the selectionGroup's state has been changed.
 void paint(java.awt.Graphics g)
          Paint the tab children into an offscreen buffer, then blast entire image at once.
protected  void paintRowBorder(java.awt.Graphics g)
          Paint the row Border for the tabs.
protected  void processActionEvent(java.awt.event.ActionEvent e)
          Processes action events occurring on the tabs.
protected  void processEvent(java.awt.AWTEvent e)
          Processes events occurring on the tabs.
protected  void processItemEvent(java.awt.event.ItemEvent e)
          Processes item events occurring on the tabs.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Handle the changes in property.
 void refresh(com.sas.ModelInterface model)
          Refresh the TabBar with the model information.
 void remove(java.awt.Component comp)
          Remove the specified tab component from the TabBar
 void remove(int index)
          Remove the tab at the specified index.
 void removeActionListener(java.awt.event.ActionListener listener)
          Removes the specified action listener so it no longer receives action events from this TabBar.
 void removeAll()
          Remove all tabs from this TabBar
 void removeItem(java.lang.Object item)
          Remove the tab with the specified item property
 void removeItemListener(java.awt.event.ItemListener listener)
          Removes the specified item listener so it no longer receives item events from this TabBar.
protected  void reorderComponents()
          Reorder all components because of change to layout.
 void setBackground(java.awt.Color c)
          Set the background color of the TabBar.
 void setBottomMargin(int margin)
          Set the bottomMargin of the TabBar.
static void setDefaultHeight(int newHeight)
           
 void setDefaultValues()
          Set all default values for the TabBar.
static void setDefaultWidth(int newWidth)
           
 void setDisplayTransform(com.sas.util.transforms.TransformInterface transform)
          Set the displayTransform for the TabBarInterface.
 void setEnabled(boolean enabled)
          Set the entire TabBar enabled or disabled.
 void setFillFrom(int direction)
          Set the direction to fill the row of tabs from.
 void setForeground(java.awt.Color c)
          Set the foreground color of the TabBar.
 void setInitialItems(java.lang.String[] items)
          Set the item values in the defaultModel.
 void setInputTransform(com.sas.util.transforms.TransformInterface transform)
          Set the transform used by any methods that use the TabButtonInterface item property as an input parameter.
 void setJustification(int justify)
          Set the justification of the tabs on the container.
 void setLeftMargin(int margin)
          Set the leftMargin of the container.
 void setOrientation(int orient)
          Set the orientation of the tabs on this container.
 void setOutputTransform(com.sas.util.transforms.TransformInterface transform)
          Set the transform used by any methods that use the TabButtonInterface item property as an return value.
 void setRightMargin(int margin)
          Set the rightMargin of the container.
 void setRowBorder(BorderInterface border)
          Set the row border of the TabBarInterface
 void setRowSpacing(int spacing)
          Set the pixel space between the rows of tab components.
 void setSelectedIndex(int index)
          Select the tab at the specified index.
 void setSelectedItem(java.lang.Object item)
          Select the tab with specified item property.
 void setSelectionGroup(SelectionGroupInterface selectionGrp)
          Set the Selection Group for all tabs to belong to.
 void setSizing(int sizing)
          Set the type of sizing of the tabs.
 void setSpinButtonAlignment(int align)
          Set the SpinButton justification.
 void setSpinButtonGap(int gap)
          Set the pixel gap between the spinButton and the tabs.
protected  void setSpinButtonOrientation(int orient)
          Set the SpinButtonOrienation to the specified orientation.
 void setStartIndex(int start)
          Get the index of the starting tab.
 void setStyle(int newStyle)
          Set the style of the RowLayout.
 void setTabButtonClass(java.lang.Class tClass)
          Set the class of the default tabs created when an addItem() method is called.
 void setTabEnabled(boolean enabled, int index)
          Set the enabled state of the tab at the specified index.
 void setTabEnabled(boolean enabled, java.lang.Object item)
          Set the enabled state of the tab with the specified item.
 void setTabSize(java.awt.Dimension size)
          Get the tabSize used when the sizing is set to UNIFORM tabs.
 void setTabSpacing(int spacing)
          Set the pixel space between the tab components.
 void setTabVisible(boolean visible, int index)
          Set the visisble state of the tab at the specified index.
 void setTabVisible(boolean visible, java.lang.Object item)
          Set the visible state of the tab with the specified item.
 void setTopMargin(int margin)
          Set the topMargin of the container.
 void update(java.awt.Graphics g)
          override update to *not* erase the background before painting
 void validateObject()
           
 
Methods inherited from class com.sas.awt.PanelContainerComponent
addNotify, clone, dragEnter, dragLeave, drop, getContainerInterfaceSupportInfo, getErrorHandler, getInsets, getValidator, isIDEDnDDropBarrier, isIDEDnDDropTarget, isValid, removeNotify, setContainerInterfaceSupportInfo, setErrorHandler, setIDEDnDDropBarrier, setIDEDnDDropTarget, setInsets, setInsets, setValidator, superAddNotify, superGetInsets, superRemoveNotify, superSetDefaultValues
 
Methods inherited from class com.sas.awt.PanelVisualComponent
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, computePreferredSize, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getBackgroundColor, getBorder, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getFont, getForegroundColor, getHeight, getHorizontalPosition, getLinkInfo, getMinimumSize, getModelInterface, getPageBounds, getPreferredSize, getPrePainter, getPrintOptionsPanel, getVerticalPosition, getViewInterfaceSupportInfo, getVisualInterfaceSupportInfo, getWidth, initializeComponent, isDesignTime, isEnabled, isFocus, isLinked, isTransparent, isVisible, pageExists, print, printFinalize, printInitialize, queryLinks, queryLinks, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setBackgroundColor, setBorder, setBounds, setComponentDescription, setComponentSupportInfo, setFocus, setFont, 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
 
Methods inherited from interface com.sas.visuals.TabBarInterface
add, getLayout
 
Methods inherited from interface com.sas.awt.ContainerInterface
getComponents, getLayout, invalidate, setLayout, validate
 
Methods inherited from interface com.sas.awt.VisualInterface
computePreferredSize, getBackgroundColor, getBorder, getFont, getForegroundColor, getHeight, getHorizontalPosition, getMinimumSize, getPreferredSize, getPrePainter, getVerticalPosition, getVisualInterfaceSupportInfo, getWidth, isEnabled, isFocus, isTransparent, isVisible, setBackgroundColor, setBorder, setBounds, setFocus, setFont, 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

spinBtn

protected SpinButton spinBtn

spinBtnSize

protected java.awt.Dimension spinBtnSize

style

protected int style

orientation

protected int orientation

border

protected BorderInterface border
Constructor Detail

TabBar

public TabBar()
Default Constructor


TabBar

public TabBar(int orientation)
Constructor to set the orientation of the TabBar.

Parameters:
orientation - the orientation of the buttons in the TabBar
Method Detail

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()

getDefaultHeight

public static int getDefaultHeight()

getDefaultWidth

public static int getDefaultWidth()

setDefaultHeight

public static void setDefaultHeight(int newHeight)

setDefaultWidth

public static void setDefaultWidth(int newWidth)

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Add the specified action listener to receive action events from this TabBar when a tab is selected.

Specified by:
addActionListener in interface ActionSource
Parameters:
listener - the ActionEvent listener
See Also:
removeActionListener(java.awt.event.ActionListener)

addImpl

protected void addImpl(java.awt.Component comp,
                       java.lang.Object constraints,
                       int index)
Overriden to only add TabButtonInterface objects to the TabBar. The constraint object should be the Integer of the group the TabButton will be placed in.

Overrides:
addImpl in class java.awt.Container
Parameters:
comp - the component to add to the TabBar
constraints - the group to add the component to
index - the index to add the tab at

addItemListener

public void addItemListener(java.awt.event.ItemListener listener)
Add the specified item listener to receive item events from this TabBar when a tab is selected.

Specified by:
addItemListener in interface java.awt.ItemSelectable
Parameters:
listener - the ItemEvent listener
See Also:
removeItemListener(java.awt.event.ItemListener)

addItem

public java.awt.Component addItem(java.lang.Object tabItem)
Construct and add a TabButtonInterface component to the container with the specified item in the first group.

Parameters:
tabItem - the item to set on the TabButtonInterface.
Returns:
the component added to the TabBar

addItem

public java.awt.Component addItem(java.lang.Object tabItem,
                                  int index)
Construct and add a TabButtonInterface component to the container with the specified item in the specified group.

Parameters:
tabItem - the item to set on the TabButtonInterface.
index - the position at which to insert the component. -1 means insert at the end.
Returns:
the component added to the TabBarInterface

addItem

public java.awt.Component addItem(java.lang.Object tabItem,
                                  java.lang.Integer grpIndex)
Construct and add a TabButtonInterface component to the container with the specified item in the specified group.

Parameters:
tabItem - the item to set on the TabButtonInterface.
grpIndex - the index of the group to add the tab to.
Returns:
the component added to the TabBarInterface

addItem

public java.awt.Component addItem(java.lang.Object item,
                                  java.lang.Integer grpIndex,
                                  int index)
Construct and add a TabButtonInterface component to the container with the specified item in the specified group.

Specified by:
addItem in interface TabBarInterface
Parameters:
tabItem - the item to set on the TabButtonInterface.
grpIndex - the index of the group to add the tab to.
index - the position at which to insert the component. -1 means insert at the end.
Returns:
the component added to the TabBarInterface

addModelItem

protected java.awt.Component addModelItem(java.lang.Object tabItem,
                                          java.lang.Integer grpIndex,
                                          int index)
Construct and add a TabButtonInterface component to the container with the item from the model in the specified group.

Parameters:
tabItem - the item to set on the TabButtonInterface.
grpIndex - the index of the group to add the tab to.
index - the position at which to insert the component. -1 means insert at the end.
Returns:
the component added to the TabBarInterface

adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent evt)
Handle AdjustmentEvents from the spinButton when the style is SCROLLABLE.

Specified by:
adjustmentValueChanged in interface java.awt.event.AdjustmentListener
Parameters:
evt - the AdjustmentEvent changing the start tab when the style is SCROLLABLE
See Also:
AdjustmentListener

contentsChanged

public void contentsChanged(com.sas.collection.ContentsChangedEvent evt)
Handle a change in the contents of the model.

Specified by:
contentsChanged in interface com.sas.collection.ContentsChangedListener
Parameters:
evt - the ContentsChangedEvent from the model that changed.
See Also:
ContentsChangedListener

detachModel

public void detachModel(com.sas.ModelInterface model)
Detach the specified model from the TabBar. If the modelInterface is set to null, the model is set to the defaultModel

Specified by:
detachModel in interface com.sas.ViewInterface
Overrides:
detachModel in class PanelVisualComponent
Parameters:
model - the model to detach
See Also:
ViewInterface.detachModel(com.sas.ModelInterface)

doLayout

public void doLayout()
Layout the component based on the style and orientation of the TabBar.

Overrides:
doLayout in class java.awt.Container

dragOver

public int dragOver(java.awt.Point point,
                    int representation,
                    int keyState,
                    java.util.Vector data)
Used to support Drag and Drop in webAF at design time.

Specified by:
dragOver in interface ContainerInterface
Specified by:
dragOver in interface com.sas.DesignTimeDropTargetInterface
Overrides:
dragOver in class PanelContainerComponent
Parameters:
point - The x/y coordinates of the mouse cursor inside the component.
representation - One of com.sas.DesignTimeDropResult.{representationComponent,representationModel,representationAttribute,representationViewer}
keyState - Unused.
data - A Vector containing information about the drag.
Returns:
One of com.sas.DesignTimeDropResult.{dragIndeterminate,dragMove,dragCopy,dragLink,dragNone}
See Also:
DesignTimeDropTargetInterface.dragOver(java.awt.Point, int, int, java.util.Vector)

getBottomMargin

public int getBottomMargin()
Get the amount of the bottom margin on the layout.

Returns:
the bottom margin of the TabBar

getIndex

public int getIndex(TabButtonInterface tab)
Get the index of the specified tab.

Parameters:
tab - the tab to get the index of
Returns:
the index of the specified tab

getDisplayTransform

public com.sas.util.transforms.TransformInterface getDisplayTransform()
Get the transform used by the TabButtonInterface to display the item object.

Returns:
display Transform
See Also:
setDisplayTransform(com.sas.util.transforms.TransformInterface)

getFillFrom

public int getFillFrom()
Get the direction to fill the row of tabs from. If RIGHT_TO_LEFT, then the rightmost tab is the last one added.

Returns:
a com.sas.visuals.Direction value

getGroupCount

public int getGroupCount()
Get the number of groups in this TabBar.

Specified by:
getGroupCount in interface TabBarInterface
Returns:
the number of groups in the TabBar

getInputTransform

public com.sas.util.transforms.TransformInterface getInputTransform()
Get the transform used by any methods that use the TabButtonInterface item property as an input parameter.

Returns:
the inputTransform
See Also:
setInputTransform(com.sas.util.transforms.TransformInterface)

getInitialItems

public java.lang.String[] getInitialItems()
Get the item values in the defaultModel.

Returns:
an array of strings containing the items in the defaultModel
See Also:
setInitialItems(java.lang.String[])

setInitialItems

public void setInitialItems(java.lang.String[] items)
Set the item values in the defaultModel.

Parameters:
items - an array of strings containing the items to be set on the defaultModel
See Also:
getInitialItems()

getJustification

public int getJustification()
Get the justification of the tabs on the tab row.

Returns:
a justification value: BEGIN(LEFT), CENTER, END(RIGHT), FULL
See Also:
Justification, setJustification(int)

getLeftMargin

public int getLeftMargin()
Get the amount of the left margin.

Returns:
the leftMargin
See Also:
setLeftMargin(int)

getOrientation

public int getOrientation()
Get the orientation of the tabs

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

getOutputTransform

public com.sas.util.transforms.TransformInterface getOutputTransform()
Get the transform used by any methods that use the TabButtonInterface item property as an return value.

Returns:
the outputTransform
See Also:
setOutputTransform(com.sas.util.transforms.TransformInterface)

getRequiredInterfaces

public java.util.Vector getRequiredInterfaces()
Returns the required interfaces Vector for this component.

Specified by:
getRequiredInterfaces in interface com.sas.ViewInterface
Overrides:
getRequiredInterfaces in class PanelVisualComponent
Returns:
the required interfaces Vector for this component.
See Also:
ViewInterface.getRequiredInterfaces()

getRightMargin

public int getRightMargin()
Get the amount of the right margin.

Returns:
the leftMargin
See Also:
setLeftMargin(int)

getRowBorder

public BorderInterface getRowBorder()
Get the Border used to draw the rows.

Specified by:
getRowBorder in interface TabBarInterface
Returns:
the border used to draw the rows of the TabBarInterface.
See Also:
setRowBorder(com.sas.visuals.BorderInterface)

getRowSpacing

public int getRowSpacing()
Get the pixel amount of spacing between rows.

Returns:
the pixel spacing between tab rows
See Also:
setRowSpacing(int)

getStyle

public int getStyle()
Get the style of the RowLayout. The SCROLLABLE style draws the tabs on one row with a SpinButton to access tabs that are not visible. The MULTIGROUP style draws the tabs in multiple rows so that all tabs are visible at the same time.

Specified by:
getStyle in interface TabBarInterface
Returns:
a style value: SCROLLABLE or MULTIGROUP
See Also:
setStyle(int)

getSelectionGroup

public SelectionGroupInterface getSelectionGroup()
Get the SelectionGroupInterface that the tabs belong to.

Specified by:
getSelectionGroup in interface TabBarInterface
Returns:
the SelectionGroupInterface handling the selection behavior of the tabs.
See Also:
setSelectionGroup(com.sas.visuals.SelectionGroupInterface)

getSelectedGroupIndex

public int getSelectedGroupIndex()
Get the group index of the selected tab.

Returns:
the index of the group of the selected tab

getSelectedObjects

public java.lang.Object[] getSelectedObjects()
Get the selected item or null if no item is selected.

Specified by:
getSelectedObjects in interface java.awt.ItemSelectable
Returns:
the selected item from the selected tab
See Also:
ItemSelectable

getSizing

public int getSizing()
Get the type of sizing done on the tabs.

Returns:
a sizing value: PROPORTIONAL or UNIFORM

getTabSpacing

public int getTabSpacing()
Get the pixel space between the tab components.

Returns:
the pixel space between the tabs
See Also:
setTabSpacing(int)

getTabButtonClass

public java.lang.Class getTabButtonClass()
Get the class of the default tabs created when an addItem() method is called.

Returns:
the class of the tab to create by default
See Also:
setTabButtonClass(java.lang.Class)

getSpinButtonAlignment

public int getSpinButtonAlignment()
Get the alignment of the SpinButton

Returns:
an alignment value of: BEGIN(LEFT) or END(RIGHT)
See Also:
setSpinButtonAlignment(int)

getSpinButtonOrientation

public int getSpinButtonOrientation()
Get the orientation of the SpinButton.

Returns:
the orientation value: TOP, BOTTOM, LEFT, or RIGHT
See Also:
setSpinButtonOrientation(int)

getSpinButtonGap

public int getSpinButtonGap()
Get the minium pixel gap between the SpinButton and the tabs.

Returns:
the pixel gap between the SpinButton and the tabs
See Also:
setSpinButtonGap(int)

getStartIndex

public int getStartIndex()
Get the index of the starting tab.

Returns:
the index of the starting tab
See Also:
setStartIndex(int)

getSelectedIndex

public int getSelectedIndex()
Get the index of the selected tab.

Specified by:
getSelectedIndex in interface TabBarInterface
Returns:
the index of the selected tab.
See Also:
setSelectedIndex(int)

getSelectedItem

public java.lang.Object getSelectedItem()
Get the item property of the selected tab.

Specified by:
getSelectedItem in interface TabBarInterface
Returns:
the item property of the selected tab
See Also:
setSelectedItem(java.lang.Object)

getTabGroupIndex

public int getTabGroupIndex(TabButtonInterface tab)
Get the item property of the selected TabButtonInterface object.

Specified by:
getTabGroupIndex in interface TabBarInterface
Parameters:
tab - the tab to determine which group it is in
Returns:
the item property of the selected TabButtonInterface object
See Also:
setSelectedItem(java.lang.Object)

getTabSize

public java.awt.Dimension getTabSize()
Get the tabSize used when the sizing is set to UNIFORM tabs.

Returns:
the size of the tabs
See Also:
setTabSize(java.awt.Dimension)

getTopMargin

public int getTopMargin()
Get the amount of the topMargin.

Returns:
the topMargin

initialize

public void initialize()
Description copied from interface: ComponentInterface
The initialize() method was designed to be a synchronization point after the constructor for the object has completed and a number of methods have been called on the component. This allows components with "expensive" set method calls to delay processing until all the sets have occurred.

initialize() should be called on a component after is it constructed :

     ListBox listBox = new ListBox();
     listBox.initialize();
     container.add( listBox );
 

Overriding initialize is now discouraged since it is generally better to override setDefaultValues and readObject to perform initialization.

By default (in the ComponentInterface implementation), initialize() does nothing. However, various components override initialize() to perform operations, and it should be called.

Although use of initialize() is now discouraged, initialize() is also called by the validateObject method after a component is deserialized. This allows components which need processing during creation and deserialization to have a common place to perform operations. Adding event handlers to subcomponents is a typical use of the initialize method.

Specified by:
initialize in interface com.sas.ComponentInterface
Overrides:
initialize in class PanelVisualComponent
See Also:
ComponentInterface.initialize()

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Invoked when the selectionGroup's state has been changed.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener

paint

public void paint(java.awt.Graphics g)
Paint the tab children into an offscreen buffer, then blast entire image at once.

Overrides:
paint in class PanelVisualComponent
See Also:
VisualInterfaceSupport.paint(com.sas.ComponentInterface, com.sas.awt.VisualInterface, java.awt.Component, java.awt.Graphics)

paintRowBorder

protected void paintRowBorder(java.awt.Graphics g)
Paint the row Border for the tabs.

Parameters:
g - the Graphics contents

processEvent

protected void processEvent(java.awt.AWTEvent e)
Processes events occurring on the tabs.

Overrides:
processEvent in class java.awt.Container

processActionEvent

protected void processActionEvent(java.awt.event.ActionEvent e)
Processes action events occurring on the tabs.


processItemEvent

protected void processItemEvent(java.awt.event.ItemEvent e)
Processes item events occurring on the tabs.


propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Handle the changes in property.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Overrides:
propertyChange in class PanelVisualComponent
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

validateObject

public void validateObject()
Specified by:
validateObject in interface java.io.ObjectInputValidation
Overrides:
validateObject in class PanelVisualComponent
See Also:
ComponentInterfaceSupport.validateObject(com.sas.ComponentInterface)

refresh

public void refresh(com.sas.ModelInterface model)
Refresh the TabBar with the model information.

Specified by:
refresh in interface com.sas.ViewInterface
Overrides:
refresh in class PanelVisualComponent
Parameters:
model - Model that has just been updated
See Also:
ViewInterface.refresh(com.sas.ModelInterface)

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Removes the specified action listener so it no longer receives action events from this TabBar.

Specified by:
removeActionListener in interface ActionSource
Parameters:
listener - the ActionEvent listener
See Also:
addActionListener(java.awt.event.ActionListener)

removeItemListener

public void removeItemListener(java.awt.event.ItemListener listener)
Removes the specified item listener so it no longer receives item events from this TabBar.

Specified by:
removeItemListener in interface java.awt.ItemSelectable
Parameters:
listener - the itemEvent listener
See Also:
addItemListener(java.awt.event.ItemListener)

remove

public void remove(java.awt.Component comp)
Remove the specified tab component from the TabBar

Specified by:
remove in interface TabBarInterface
Overrides:
remove in class Panel
Parameters:
comp - the component to remove from the TabBar

remove

public void remove(int index)
Remove the tab at the specified index.

Overrides:
remove in class Panel
Parameters:
index - index of the tab to remove

removeItem

public void removeItem(java.lang.Object item)
Remove the tab with the specified item property

Specified by:
removeItem in interface TabBarInterface
Parameters:
item - the item property of the TabButtonInterface object to remove

removeAll

public void removeAll()
Remove all tabs from this TabBar

Specified by:
removeAll in interface TabBarInterface
Overrides:
removeAll in class Panel

reorderComponents

protected void reorderComponents()
Reorder all components because of change to layout. This is done to keep the correct Z-order for the components.


setBackground

public void setBackground(java.awt.Color c)
Set the background color of the TabBar. The background color of each of the tabs is also set.

Overrides:
setBackground in class java.awt.Component
Parameters:
c - the new background color

setForeground

public void setForeground(java.awt.Color c)
Set the foreground color of the TabBar. The foreground color of each of the tabs is also set.

Overrides:
setForeground in class java.awt.Component
Parameters:
c - the new foreground color

setBottomMargin

public void setBottomMargin(int margin)
Set the bottomMargin of the TabBar.

Parameters:
margin - the new bottomMargin
See Also:
getBottomMargin()

setDefaultValues

public void setDefaultValues()
Set all default values for the TabBar.

Specified by:
setDefaultValues in interface ContainerInterface
Specified by:
setDefaultValues in interface VisualInterface
Specified by:
setDefaultValues in interface com.sas.ComponentInterface
Overrides:
setDefaultValues in class CompositePanel
See Also:
ContainerInterface.setDefaultValues()

setDisplayTransform

public void setDisplayTransform(com.sas.util.transforms.TransformInterface transform)
Set the displayTransform for the TabBarInterface. Transforms all item properties into display form. Default null does an IdentityTransform.

Parameters:
transform - the displayTransform
See Also:
getDisplayTransform()

setFillFrom

public void setFillFrom(int direction)
Set the direction to fill the row of tabs from. If RIGHT_TO_LEFT, then the rightmost tab is the last one added.

Parameters:
direction - a com.sas.visuals.Direction value
See Also:
Direction

setInputTransform

public void setInputTransform(com.sas.util.transforms.TransformInterface transform)
Set the transform used by any methods that use the TabButtonInterface item property as an input parameter. Default null does an IdentityTransform.

Parameters:
transform - the inputTransform
See Also:
getInputTransform()

setJustification

public void setJustification(int justify)
Set the justification of the tabs on the container.

Parameters:
justify - a justification value of: BEGIN, CENTER, END, or FULL.
See Also:
getJustification(), Justification

setLeftMargin

public void setLeftMargin(int margin)
Set the leftMargin of the container.

Parameters:
margin - the leftMargin
See Also:
getLeftMargin()

setOrientation

public void setOrientation(int orient)
Set the orientation of the tabs on this container.

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

setOutputTransform

public void setOutputTransform(com.sas.util.transforms.TransformInterface transform)
Set the transform used by any methods that use the TabButtonInterface item property as an return value. Default null does an IdentityTransform.

Parameters:
transform - the outputTransform
See Also:
getOutputTransform()

setRightMargin

public void setRightMargin(int margin)
Set the rightMargin of the container.

Parameters:
margin - the rightMargin
See Also:
getRightMargin()

setRowBorder

public void setRowBorder(BorderInterface border)
Set the row border of the TabBarInterface

Specified by:
setRowBorder in interface TabBarInterface
Parameters:
border - the border drawn for each row
See Also:
getRowBorder()

setRowSpacing

public void setRowSpacing(int spacing)
Set the pixel space between the rows of tab components.

Parameters:
spacing - the pixel space between the rows of tabs
See Also:
getRowSpacing()

setSelectedIndex

public void setSelectedIndex(int index)
Select the tab at the specified index.

Specified by:
setSelectedIndex in interface TabBarInterface
Parameters:
index - the index of the tab to select
See Also:
getSelectedIndex()

setSelectedItem

public void setSelectedItem(java.lang.Object item)
Select the tab with specified item property.

Specified by:
setSelectedItem in interface TabBarInterface
Parameters:
item - the item property of the tab to select
See Also:
getSelectedItem()

setSelectionGroup

public void setSelectionGroup(SelectionGroupInterface selectionGrp)
Set the Selection Group for all tabs to belong to. This group controls the selection/deselection of tabs.

Parameters:
selectionGrp - the selectionGrp for all tabs to belong to
See Also:
getSelectionGroup()

setSizing

public void setSizing(int sizing)
Set the type of sizing of the tabs.

Parameters:
sizing - a com.sas.visuals.Sizing value: PROPORTIONAL or UNIFORM
See Also:
Sizing

setTabSpacing

public void setTabSpacing(int spacing)
Set the pixel space between the tab components. The value can be negative to cause overlapping of tabs.

Parameters:
spacing - the pixel space between the tabs
See Also:
getTabSpacing()

setSpinButtonGap

public void setSpinButtonGap(int gap)
Set the pixel gap between the spinButton and the tabs.

Parameters:
gap - the pixel gap between the spinButton and the tabs
See Also:
getSpinButtonGap()

setSpinButtonAlignment

public void setSpinButtonAlignment(int align)
Set the SpinButton justification.

Parameters:
align - an alignment value of: TOP, LEFT, BOTTOM, or TOP
See Also:
getSpinButtonAlignment()

setSpinButtonOrientation

protected void setSpinButtonOrientation(int orient)
Set the SpinButtonOrienation to the specified orientation.

Parameters:
orient - the orientation of the spinButton when SCROLLABLE style is used.
See Also:
getSpinButtonOrientation()

setStartIndex

public void setStartIndex(int start)
Get the index of the starting tab.

Parameters:
start - the index of the starting tab
See Also:
getStartIndex()

setStyle

public void setStyle(int newStyle)
Set the style of the RowLayout. The SCROLLABLE style draws the tabs on one row with a SpinButton to access tabs that are not visible. The MULTIGROUP style draws the tabs in multiple rows so that all tabs are visible at the same time.

Specified by:
setStyle in interface TabBarInterface
Parameters:
newStyle - a style value: SCROLLABLE or MULTIGROUP
See Also:
getStyle()

setTabButtonClass

public void setTabButtonClass(java.lang.Class tClass)
Set the class of the default tabs created when an addItem() method is called.

Specified by:
setTabButtonClass in interface TabBarInterface
Parameters:
tClass - the class of the tab to create by default

setEnabled

public void setEnabled(boolean enabled)
Set the entire TabBar enabled or disabled.

Specified by:
setEnabled in interface VisualInterface
Overrides:
setEnabled in class PanelVisualComponent
Parameters:
enabled - if true the TabBar is enabled; otherwise it is disabled
See Also:
VisualInterface.setEnabled(boolean)

setTabEnabled

public void setTabEnabled(boolean enabled,
                          java.lang.Object item)
Set the enabled state of the tab with the specified item.

Specified by:
setTabEnabled in interface TabBarInterface
Parameters:
enabled - the enabled state of the tab
item - the item property of the tab to set the enabled property of.

setTabEnabled

public void setTabEnabled(boolean enabled,
                          int index)
Set the enabled state of the tab at the specified index.

Specified by:
setTabEnabled in interface TabBarInterface
Parameters:
enabled - the enabled state of the tab
index - the index of the tab to set the enabled property of.

setTabSize

public void setTabSize(java.awt.Dimension size)
Get the tabSize used when the sizing is set to UNIFORM tabs.

Parameters:
size - the size of the tabs
See Also:
getTabSize()

setTabVisible

public void setTabVisible(boolean visible,
                          java.lang.Object item)
Set the visible state of the tab with the specified item.

Specified by:
setTabVisible in interface TabBarInterface
Parameters:
visible - the visible state of the tab
item - the item property of the tab to set the visible property of.

setTabVisible

public void setTabVisible(boolean visible,
                          int index)
Set the visisble state of the tab at the specified index.

Specified by:
setTabVisible in interface TabBarInterface
Parameters:
visisble - the visisble state of the tab
index - the index of the tab to set the visisble property of.

setTopMargin

public void setTopMargin(int margin)
Set the topMargin of the container.

Parameters:
margin - the topMargin

update

public void update(java.awt.Graphics g)
override update to *not* erase the background before painting

Overrides:
update in class PanelVisualComponent
See Also:
VisualInterfaceSupport.update(com.sas.ComponentInterface, com.sas.awt.VisualInterface, java.awt.Component, java.awt.Graphics)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.