com.yospace.yae.yogi
Class YogiTabbedPane

java.lang.Object
  |
  +--com.yospace.yae.yogi.YogiComponent
        |
        +--com.yospace.yae.yogi.YogiTabbedPane
All Implemented Interfaces:
ActionListener, PropertyChangeListener

public class YogiTabbedPane
extends YogiComponent
implements ActionListener, PropertyChangeListener

YogiTabbedPane is the parent container for YogiTabs and their associated TabPanels. YogiTabs are contained within a sliding pane, which automatically scrolls to display the currently focused tab. Activating a tab causes its associated TabPanel to be displayed. TabPanels are contained within a YogiScrollPane, and thus scrollbars are automatically provided if the size of a TabPanel is greater than the space available to it within the YogiTabbedPane.


Field Summary
static int PLACEMENT_TAB_BOTTOM
          Constant denoting tab placement at the bottom of a tabbed pane
static int PLACEMENT_TAB_LEFT
          Constant denoting tab placement at the left of a tabbed pane
static int PLACEMENT_TAB_RIGHT
          Constant denoting tab placement at the right of a tabbed pane
static int PLACEMENT_TAB_TOP
          Constant denoting tab placement at the top of a tabbed pane
static int PROPERTY_TAB_PLACEMENT
          Constant for the tabPlacement property
static int PROPERTY_TAB_SELECTED
          Constant for the selectedIndex property
static int PROPERTY_WINGED
          Constant for the winged property
 
Fields inherited from class com.yospace.yae.yogi.YogiComponent
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, BORDER_DOTTED, BORDER_NONE, BORDER_PLAIN, BORDER_ROUNDED, BORDER_SOLID, COLOR_BACKGROUND, COLOR_BORDER, COLOR_FOREGROUND, FOCUS_DEFAULT, FOCUS_OFF, FOCUS_ON, PROPERTY_ALIGN, PROPERTY_BORDER_STYLE, PROPERTY_BOUNDS, PROPERTY_COLOR, PROPERTY_CONTEXT_ENABLED, PROPERTY_ENABLED, PROPERTY_FOCUS, PROPERTY_FOCUS_INDEX, PROPERTY_FOCUS_TRAVERSABLE, PROPERTY_FONT, PROPERTY_HOTKEY, PROPERTY_LOCATION, PROPERTY_OPAQUE, PROPERTY_SIZE, PROPERTY_VISIBLE, PROPERTY_X_INSET, PROPERTY_Y_INSET
 
Constructor Summary
YogiTabbedPane()
          Default constructor.
 
Method Summary
 void actionPerformed(YogiComponent source)
          Invoked when an action occurs.
 void add(YogiComponent comp)
          Override of the YogiComponent.add(YogiComponent) method to ensure that newly added YogiTabPanels are added to the sliding pane and the content pane, and are initially set to be invisible.
 YogiScrollPane getContentPane()
          Returns the tabbed pane's content pane, which is used to display the tab panels and their contents.
 YogiButton getLeftWing()
          Returns the tabbed pane's left wing.
 YogiButton getRightWing()
          Returns the tabbed pane's right wing.
 int getSelectedIndex()
          Returns the currently selected tab index.
 int getTabPlacement()
          Returns the tab placement of the tabbed pane.
 YogiComponent getTabsSlidingPane()
          Returns the tabbed pane's sliding pane, which is used to display the tabs.
 boolean isWinged()
          Returns the tabbed pane's winged state.
 void propertyChanged(java.lang.Object source, int propertyCode)
          PropertyChangeListener being implemented to make sure that if a tab of the tabbed pane is pressed that the tabbed pane is relayed out and redrawn.
 void remove(YogiComponent comp)
          Override of the YogiComponent.remove(YogiComponent) method to ensure that the component to be removed is removed from the correct section of the YogiTabbedPane, i.e.
 void setSelectedIndex(int index)
          Sets the selected index of the tabbed pane.
 void setTabPlacement(int placement)
          Sets the tab placement of the tabbed pane.
 void setWinged(boolean winged)
          Sets the winged state of the tabbed pane.
 
Methods inherited from class com.yospace.yae.yogi.YogiComponent
_debugPrintComponents, addPropertyChangeListener, bringForwards, bringInFrontOf, bringToFront, contains, containsComponent, ensureVisible, ensureVisible, findComponentAt, findCurrentFocus, findFirstFocus, findFocusDomainRoot, findFocusDomainRootImpl, findHotkeyComponent, findNextFocus, fireActionPerformedEvent, firePropertyChangeEvent, getAlign, getBorderStyle, getBounds, getColor, getColors, getComponent, getComponent, getComponentCount, getComponentIndex, getComponents, getFocusBounds, getFocusIndex, getFont, getGlobalLocation, getHeight, getHotkey, getId, getParent, getParent, getTreeLock, getUI, getWidth, getX, getXInset, getY, getYInset, hasFocus, isActive, isContextEnabled, isEnabled, isFocusDomainRoot, isFocusTraversable, isOpaque, isVisible, keyPressed, keyReleased, keyRepeated, paint, paintBackground, paintBorder, paintForeground, pointerDragged, pointerPressed, pointerReleased, remove, removeAll, removePropertyChangeListener, repaint, repaint, repaintAfterRebounding, requestFocus, requestFocus, sendBackwards, sendBehind, sendToBack, setActionListener, setActive, setAlign, setBorderStyle, setBounds, setColor, setColors, setContextEnabled, setDefaultColor, setEnabled, setFocusDomainRoot, setFocusIndex, setFocusTraversable, setFont, setHotkey, setId, setLocation, setNoFocus, setOpaque, setProperty, setSize, setUI, setVisible, setXInset, setYInset, updateUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_WINGED

public static final int PROPERTY_WINGED
Constant for the winged property

PROPERTY_TAB_SELECTED

public static final int PROPERTY_TAB_SELECTED
Constant for the selectedIndex property

PROPERTY_TAB_PLACEMENT

public static final int PROPERTY_TAB_PLACEMENT
Constant for the tabPlacement property

PLACEMENT_TAB_TOP

public static final int PLACEMENT_TAB_TOP
Constant denoting tab placement at the top of a tabbed pane

PLACEMENT_TAB_BOTTOM

public static final int PLACEMENT_TAB_BOTTOM
Constant denoting tab placement at the bottom of a tabbed pane

PLACEMENT_TAB_LEFT

public static final int PLACEMENT_TAB_LEFT
Constant denoting tab placement at the left of a tabbed pane

PLACEMENT_TAB_RIGHT

public static final int PLACEMENT_TAB_RIGHT
Constant denoting tab placement at the right of a tabbed pane
Constructor Detail

YogiTabbedPane

public YogiTabbedPane()
Default constructor. Constructs a tabbed pane that is not winged, and with tabs at the top.
Method Detail

add

public void add(YogiComponent comp)
Override of the YogiComponent.add(YogiComponent) method to ensure that newly added YogiTabPanels are added to the sliding pane and the content pane, and are initially set to be invisible.
Overrides:
add in class YogiComponent
Parameters:
comp - the YogiComponent to add to the tabbed pane.

remove

public void remove(YogiComponent comp)
Override of the YogiComponent.remove(YogiComponent) method to ensure that the component to be removed is removed from the correct section of the YogiTabbedPane, i.e. the content pane.
Overrides:
remove in class YogiComponent
Parameters:
comp - the YogiComponent to remove from the tabbed pane.

getTabsSlidingPane

public YogiComponent getTabsSlidingPane()
Returns the tabbed pane's sliding pane, which is used to display the tabs.
Returns:
the tab sliding pane.

getContentPane

public YogiScrollPane getContentPane()
Returns the tabbed pane's content pane, which is used to display the tab panels and their contents.
Returns:
the content pane.

getLeftWing

public YogiButton getLeftWing()
Returns the tabbed pane's left wing.
Returns:
the tabbed pane's left wing.

getRightWing

public YogiButton getRightWing()
Returns the tabbed pane's right wing.
Returns:
the tabbed pane's right wing.

setSelectedIndex

public void setSelectedIndex(int index)
Sets the selected index of the tabbed pane.
Parameters:
index - The new selected index.

getSelectedIndex

public int getSelectedIndex()
Returns the currently selected tab index.
Returns:
the currently selected tab index.

setWinged

public void setWinged(boolean winged)
Sets the winged state of the tabbed pane.
Parameters:
winged - new winged state.

isWinged

public boolean isWinged()
Returns the tabbed pane's winged state.
Returns:
the winged state.

setTabPlacement

public void setTabPlacement(int placement)
Sets the tab placement of the tabbed pane.
Parameters:
placement - the placement for the tabs, must be one of PLACEMENT_TAB_TOP, PLACEMENT_TAB_BOTTOM, PLACEMENT_TAB_LEFT, or PLACEMENT_TAB_LEFT.

getTabPlacement

public int getTabPlacement()
Returns the tab placement of the tabbed pane.
Returns:
the tab placement.

actionPerformed

public void actionPerformed(YogiComponent source)
Description copied from interface: ActionListener
Invoked when an action occurs.
Specified by:
actionPerformed in interface ActionListener
Following copied from interface: com.yospace.yae.yogi.ActionListener
Parameters:
source - is the source object that fired the action event.

propertyChanged

public void propertyChanged(java.lang.Object source,
                            int propertyCode)
PropertyChangeListener being implemented to make sure that if a tab of the tabbed pane is pressed that the tabbed pane is relayed out and redrawn.
Specified by:
propertyChanged in interface PropertyChangeListener
Parameters:
source - the object which has had its property value change.
propertyCode - the code of the property that has changed.

Copyright 2002 Yospace Holdings Ltd. All Rights Reserved.