dog.gui
Class DFolder

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--dog.gui.DContainer
                    |
                    +--dog.gui.DFolder
All Implemented Interfaces:
java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, Referential, java.io.Serializable

public class DFolder
extends DContainer
implements java.beans.PropertyChangeListener

A tabbed folder panel.

See Also:
Serialized Form

Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
protected  DItem current
          The current tab.
protected static java.awt.Dimension MINSMALLICONSIZE
          The minimum size for small icons (16x16).
protected  java.util.Hashtable pages
          The tab to component mapping.
protected  java.util.Vector tabs
          The tabs.
 
Fields inherited from class dog.gui.DContainer
cancelButton, CENTER, defaultButton, EAST, NORTH, NORTHEAST, NORTHWEST, reference, SOUTH, SOUTHEAST, SOUTHWEST, tooltip, WEST
 
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
DFolder()
          Constructs a folder.
 
Method Summary
 java.awt.Component add(java.awt.Component component)
          Adds a component to the end of the folder with a tab labelled "New tab".
 java.awt.Component add(java.awt.Component component, int index)
          Adds a component to the folder at the specified index with a tab labelled "New tab".
 void add(java.awt.Component component, java.lang.Object constraints)
          Adds a component to the end of the folder with the specified constraints with a tab labelled "New tab".
 void add(java.awt.Component component, java.lang.Object constraints, int index)
          Adds a component to the end of the folder at the specified index with the specified constraints with a tab labelled "New tab".
 java.awt.Component add(DItem tab, java.awt.Component component)
          Adds a component to the end of the folder with the specified tab.
 java.awt.Component add(DItem tab, java.awt.Component component, int index)
          Adds a component to the folder with the specified tab at the specified index.
 void add(DItem tab, java.awt.Component component, java.lang.Object constraints)
          Adds a component to the end of the folder with the specified tab and constraints.
 void add(DItem tab, java.awt.Component component, java.lang.Object constraints, int index)
          Adds a component to the end of the folder at the specified index with the specified tab and constraints.
 void addActionListener(java.awt.event.ActionListener listener)
          Adds the specified action listener to receive action events from this folder.
protected  void addImpl(DItem tab, java.awt.Component component, java.lang.Object constraints, int index)
          Adds a component to the folder associated with the specified tab.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds the specified property change listener to receive property change events from this component.
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Adds the specified vetoable change listener to receive vetoable change events from this component.
 void doLayout()
          Lays out the folder.
 DItem getCurrent()
          Returns the tab of the currently displayed page.
 java.awt.Dimension getMinimumSize()
           
 java.awt.Component getPage()
          Returns the currently displayed page.
 java.awt.Component getPage(DItem tab)
          Returns the page with the specified tab.
 java.awt.Dimension getPreferredSize()
           
 DItem[] getTabs()
          Returns the tabs in this folder.
 void paint(java.awt.Graphics g)
          Paints the folder.
protected  void processActionEvent(java.awt.event.ActionEvent event)
          Processes action events on this choice by dispatching them to any registered ActionListeners.
protected  void processEvent(java.awt.AWTEvent event)
          Processes events on this choice.
protected  void processFocusEvent(java.awt.event.FocusEvent event)
          Process focus events.
protected  void processMouseEvent(java.awt.event.MouseEvent event)
          Process mouse events.
 void propertyChange(java.beans.PropertyChangeEvent event)
          A tab may have changed state.
 void remove(java.awt.Component component)
          Removes a component from the folder.
 void remove(DItem tab)
          Removes the component associated with the specified tab from the folder.
 void remove(int index)
          Removes the component at the specified index from the folder.
 void removeActionListener(java.awt.event.ActionListener listener)
          Removes the specified action listener so that it no longer receives action events from this folder.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes the specified property change listener so it no longer receives property change events from this component.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Removes the specified vetoable change listener so it no longer receives vetoable change events from this component.
 void setCurrent(DItem tab)
          Sets the page to be displayed by its tab.
 
Methods inherited from class dog.gui.DContainer
addImpl, alignParamString, drawActiveButtonBorder, drawActiveOptionBorder, drawArrow, drawBorder, drawButtonBorder, drawCheckbox, drawDarkBorder, drawDefaultButtonBorder, drawDisabledBorder, drawDisabledCheckbox, drawDisabledOption, drawExpander, drawFocusBorder, drawImage, drawLabel, drawOption, drawOptionBorder, drawPressedBorder, getCancelButton, getComponent, getDefaultButton, getDefaultToolkit, getImage, getImage, getImage, getReference, getRootPane, getTooltip, isPreloadImages, paramString, processCancelAction, processDefaultAction, processMouseMotionEvent, setCancelButton, setDefaultButton, setEnabled, setPreloadImages, setReference, setTooltip, toString
 
Methods inherited from class java.awt.Container
add, addContainerListener, addNotify, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MINSMALLICONSIZE

protected static final java.awt.Dimension MINSMALLICONSIZE
The minimum size for small icons (16x16).

current

protected DItem current
The current tab.

tabs

protected java.util.Vector tabs
The tabs.

pages

protected java.util.Hashtable pages
The tab to component mapping.
Constructor Detail

DFolder

public DFolder()
Constructs a folder.
Method Detail

add

public java.awt.Component add(java.awt.Component component)
Adds a component to the end of the folder with a tab labelled "New tab".
Overrides:
add in class java.awt.Container
Parameters:
component - the component

add

public java.awt.Component add(DItem tab,
                              java.awt.Component component)
Adds a component to the end of the folder with the specified tab.
Parameters:
tab - the item used for the folder tab for this component
component - the component

add

public java.awt.Component add(java.awt.Component component,
                              int index)
Adds a component to the folder at the specified index with a tab labelled "New tab".
Overrides:
add in class java.awt.Container
Parameters:
component - the component
index - the index of the tab and component

add

public java.awt.Component add(DItem tab,
                              java.awt.Component component,
                              int index)
Adds a component to the folder with the specified tab at the specified index.
Parameters:
tab - the item used for the folder tab for this component
component - the component
index - the index of the tab and component

add

public void add(java.awt.Component component,
                java.lang.Object constraints)
Adds a component to the end of the folder with the specified constraints with a tab labelled "New tab".
Overrides:
add in class java.awt.Container
Parameters:
component - the component
constraints - an Insets object defining the offsets from the inside of the folder area.

add

public void add(DItem tab,
                java.awt.Component component,
                java.lang.Object constraints)
Adds a component to the end of the folder with the specified tab and constraints.
Parameters:
tab - the item used for the folder tab for this component
component - the component
constraints - an Insets object defining the offsets from the inside of the folder area.

add

public void add(java.awt.Component component,
                java.lang.Object constraints,
                int index)
Adds a component to the end of the folder at the specified index with the specified constraints with a tab labelled "New tab".
Overrides:
add in class java.awt.Container
Parameters:
component - the component
constraints - an Insets object defining the offsets from the inside of the folder area.
index - the index of the tab and component

add

public void add(DItem tab,
                java.awt.Component component,
                java.lang.Object constraints,
                int index)
Adds a component to the end of the folder at the specified index with the specified tab and constraints.
Parameters:
tab - the item used for the folder tab for this component
component - the component
constraints - an Insets object defining the offsets from the inside of the folder area.
index - the index of the tab and component

addImpl

protected void addImpl(DItem tab,
                       java.awt.Component component,
                       java.lang.Object constraints,
                       int index)
Adds a component to the folder associated with the specified tab.

remove

public void remove(java.awt.Component component)
Removes a component from the folder.
Overrides:
remove in class java.awt.Container
Parameters:
component - the component to remove.

remove

public void remove(DItem tab)
Removes the component associated with the specified tab from the folder.
Parameters:
tab - the tab of the component to remove.

remove

public void remove(int index)
Removes the component at the specified index from the folder.
Overrides:
remove in class java.awt.Container
Parameters:
index - the index of the component to remove.

getCurrent

public DItem getCurrent()
Returns the tab of the currently displayed page.
See Also:
setCurrent(dog.gui.DItem)

setCurrent

public void setCurrent(DItem tab)
                throws java.beans.PropertyVetoException
Sets the page to be displayed by its tab.
Parameters:
tab - the tab of the page to be displayed
Throws:
java.beans.PropertyVetoException - if the page could not be changed
See Also:
getCurrent()

getPage

public java.awt.Component getPage()
Returns the currently displayed page.

getPage

public java.awt.Component getPage(DItem tab)
Returns the page with the specified tab.
Parameters:
tab - the tab of the page required

getTabs

public DItem[] getTabs()
Returns the tabs in this folder.

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class java.awt.Container

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class java.awt.Container

doLayout

public void doLayout()
Lays out the folder.
Overrides:
doLayout in class java.awt.Container

paint

public void paint(java.awt.Graphics g)
Paints the folder.
Overrides:
paint in class java.awt.Container

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Adds the specified action listener to receive action events from this folder.
Parameters:
listener - the action listener

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Removes the specified action listener so that it no longer receives action events from this folder.
Parameters:
listener - the action listener

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds the specified property change listener to receive property change events from this component.
Overrides:
addPropertyChangeListener in class DContainer
Parameters:
listener - the property change listener

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the specified property change listener so it no longer receives property change events from this component.
Overrides:
removePropertyChangeListener in class DContainer
Parameters:
listener - the property change listener

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds the specified vetoable change listener to receive vetoable change events from this component.
Parameters:
listener - the vetoable change listener

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes the specified vetoable change listener so it no longer receives vetoable change events from this component.
Parameters:
listener - the vetoable change listener

processEvent

protected void processEvent(java.awt.AWTEvent event)
Processes events on this choice. If the event is an ActionEvent, it invokes the processActionEvent method.
Overrides:
processEvent in class DContainer
Parameters:
event - the event

processActionEvent

protected void processActionEvent(java.awt.event.ActionEvent event)
Processes action events on this choice by dispatching them to any registered ActionListeners.
Parameters:
event - the action event

processFocusEvent

protected void processFocusEvent(java.awt.event.FocusEvent event)
Process focus events.
Overrides:
processFocusEvent in class java.awt.Component

processMouseEvent

protected void processMouseEvent(java.awt.event.MouseEvent event)
Process mouse events.
Overrides:
processMouseEvent in class DContainer

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
A tab may have changed state.
Specified by:
propertyChange in interface java.beans.PropertyChangeListener