org.formaria.awt
Class RollupBar

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by org.formaria.awt.Panel
                  extended by org.formaria.awt.RollupBar
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class RollupBar
extends Panel
implements java.awt.event.ActionListener

An outlook style roll-up bar. The methods are modelled on the JTabbedPane

Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.

$Revision: 1.3 $

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.awt.CardLayout cardManager
           
protected  Panel contentPane
           
protected  int selIdx
           
 
Fields inherited from class org.formaria.awt.Panel
BORDER_BEVEL, BORDER_FLAT, BORDER_NONE, currentProject
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
RollupBar()
          Create a new button panel
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Invoked when a mouse button has been pressed on a component.
 java.awt.Component add(java.awt.Component comp)
          Add a new button.
 void addbutton(java.lang.String name, java.awt.Component panel)
          Add a new button.
 java.awt.Color getBackgroundAt(int index)
          Get a button's background color
 Button getButton(int index)
          Get the button component at the specified index, skips over the expanded panel
 int getButtonCount()
          Get the number of buttons
 java.awt.Color getForegroundAt(int index)
          Get a button's foreground color
 int getSelectedIndex()
          Get the index of the selected button
 java.lang.String getTitleAt(int index)
          Get the title of the button at the specified index
 void setBackgroundAt(int index, java.awt.Color clr)
          Set the button background color
 void setForegroundAt(int index, java.awt.Color clr)
          Set the foreground color
 void setSelectedIndex(int index)
          Select a button
 void setTitleAt(int index, java.lang.String str)
          Set a button's title
 
Methods inherited from class org.formaria.awt.Panel
addNotify, getDrawFrame, getPreferredSize, paint, setBorderStyle, setBounds, setDrawBorder
 
Methods inherited from class java.awt.Panel
getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, 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

contentPane

protected Panel contentPane

selIdx

protected int selIdx

cardManager

protected java.awt.CardLayout cardManager
Constructor Detail

RollupBar

public RollupBar()
Create a new button panel

Method Detail

add

public java.awt.Component add(java.awt.Component comp)
Add a new button. The add method could not be overloaded so this method adds does the equivalent.

Overrides:
add in class java.awt.Container
Parameters:
comp - the new button component
Returns:
the new component

addbutton

public void addbutton(java.lang.String name,
                      java.awt.Component panel)
Add a new button. The add method could not be overloaded so this method adds does the equivalent.

Parameters:
name - the name/caption of the button component
panel - the content

getButton

public Button getButton(int index)
Get the button component at the specified index, skips over the expanded panel

Parameters:
index - the button index
Returns:
the button component

getBackgroundAt

public java.awt.Color getBackgroundAt(int index)
Get a button's background color

Parameters:
index - the button index
Returns:
the color

getForegroundAt

public java.awt.Color getForegroundAt(int index)
Get a button's foreground color

Parameters:
index - the button index
Returns:
the color

getButtonCount

public int getButtonCount()
Get the number of buttons

Returns:
the number of buttons

getSelectedIndex

public int getSelectedIndex()
Get the index of the selected button

Returns:
the selection index

getTitleAt

public java.lang.String getTitleAt(int index)
Get the title of the button at the specified index

Parameters:
index - the button index
Returns:
the button text/title

setBackgroundAt

public void setBackgroundAt(int index,
                            java.awt.Color clr)
Set the button background color

Parameters:
index - the button index
clr - the new colr

setForegroundAt

public void setForegroundAt(int index,
                            java.awt.Color clr)
Set the foreground color

Parameters:
index - the button index
clr - the new color

setSelectedIndex

public void setSelectedIndex(int index)
Select a button

Parameters:
index - the button index

setTitleAt

public void setTitleAt(int index,
                       java.lang.String str)
Set a button's title

Parameters:
index - the button index
str - the text for the button

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Invoked when a mouse button has been pressed on a component.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the event