bibliothek.gui.dock.common
Class CContentArea

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by bibliothek.gui.dock.common.CContentArea
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

@Todo(priority=MINOR,
      compatibility=COMPATIBLE,
      target=VERSION_1_1_0,
      description="Introduce some interface \'MultiCStation\' or similar: a set of CStations, CContentArea would implement this interface")
public class CContentArea
extends JPanel

A component that is normally set into the center of the main- JFrame. This component can display and manage some CDockables.
This component contains in the center a SplitDockStation allowing to show several CDockables at the same time. At each border a FlapDockStation allows to show "minimized" CDockables.
Note: clients should not create CContentAreas directly, they should use CControl.getContentArea() to get the default content area, or CControl.createContentArea(String) to create a new content area.

Author:
Benjamin Sigg
See Also:
Serialized Form

Nested Class Summary
static class CContentArea.Corner
          References a corner of a panel.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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
CContentArea(CControl control, String uniqueId)
          Creates a new content area.
 
Method Summary
 void deploy(CGrid grid)
          Exchanges all the CDockables on the center panel by the elements of grid.
 SplitDockStation getCenter()
          Gets the station in the center of this CContentArea.
 String getCenterIdentifier()
          Gets the global identifier for the panel in the center.
static String getCenterIdentifier(String uniqueCenterId)
          Creates the global identifier of a panel in the center.
 CControl getControl()
          Gets the CControl for which this content area was created.
 Component getCornerComponent(CContentArea.Corner corner, boolean horizontal)
          Gets the component of a corner.
 FlapDockStation getEast()
          Gets the station in the east of this CContentArea
 String getEastIdentifier()
          Gets the global identifier for the panel in the east.
static String getEastIdentifier(String uniqueCenterId)
          Creates the global identifier of a panel in the east.
 FlapDockStation getNorth()
          Gets the station in the north of this CContentArea
 String getNorthIdentifier()
          Gets the global identifier for the panel in the north.
static String getNorthIdentifier(String uniqueCenterId)
          Creates the global identifier of a panel in the north.
 FlapDockStation getSouth()
          Gets the station in the south of this CContentArea
 String getSouthIdentifier()
          Gets the global identifier for the panel in the south.
static String getSouthIdentifier(String uniqueCenterId)
          Creates the global identifier of a panel in the south.
 CStation<?>[] getStations()
          Gets an independant array of all stations that are used on this CContentArea.
 String getUniqueId()
          Gets the unique id of this center.
 FlapDockStation getWest()
          Gets the station in the west of this CContentArea
 String getWestIdentifier()
          Gets the global identifier for the panel in the west.
static String getWestIdentifier(String uniqueCenterId)
          Creates the global identifier of a panel in the west.
 void setCornerComponent(Component component, CContentArea.Corner corner, boolean horizontal)
          Puts component in one corner of this area.
 void setMinimumAreaSize(Dimension size)
          Sets the minimum size of the four areas in which minimized Dockables are shown.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CContentArea

public CContentArea(CControl control,
                    String uniqueId)
Creates a new content area.

Parameters:
control - the control for which this area will be used
uniqueId - a unique identifier of this center
Method Detail

getUniqueId

public String getUniqueId()
Gets the unique id of this center.

Returns:
the unique id

getControl

public CControl getControl()
Gets the CControl for which this content area was created.

Returns:
the owner of this area

getStations

public CStation<?>[] getStations()
Gets an independant array of all stations that are used on this CContentArea.

Returns:
the list of stations

deploy

public void deploy(CGrid grid)
Exchanges all the CDockables on the center panel by the elements of grid.

Parameters:
grid - a grid containing some new Dockables

setCornerComponent

public void setCornerComponent(Component component,
                               CContentArea.Corner corner,
                               boolean horizontal)
Puts component in one corner of this area.

Parameters:
component - the component, can be null
corner - the corner into which to put component
horizontal - whether component should be horizontally or vertically.

getCornerComponent

public Component getCornerComponent(CContentArea.Corner corner,
                                    boolean horizontal)
Gets the component of a corner.

Parameters:
corner - the corner in which to search
horizontal - whether the component is horizontally or vertically
Returns:
the component or null

setMinimumAreaSize

public void setMinimumAreaSize(Dimension size)
Sets the minimum size of the four areas in which minimized Dockables are shown. Clients could also call get'Side'().setMinimumSize( size ).
There is no method getMinimumAreaSize because the result might not be the same for all stations.

Parameters:
size - the new minimum size or null to revert to the default value.
See Also:
FlapDockStation.setMinimumSize(Dimension), FlapDockStation.MINIMUM_SIZE

getCenter

public SplitDockStation getCenter()
Gets the station in the center of this CContentArea.

Returns:
the central station

getNorth

public FlapDockStation getNorth()
Gets the station in the north of this CContentArea

Returns:
the station in the north

getSouth

public FlapDockStation getSouth()
Gets the station in the south of this CContentArea

Returns:
the station in the south

getEast

public FlapDockStation getEast()
Gets the station in the east of this CContentArea

Returns:
the station in the east

getWest

public FlapDockStation getWest()
Gets the station in the west of this CContentArea

Returns:
the station in the west

getCenterIdentifier

public String getCenterIdentifier()
Gets the global identifier for the panel in the center.

Returns:
the identifier

getCenterIdentifier

public static String getCenterIdentifier(String uniqueCenterId)
Creates the global identifier of a panel in the center.

Parameters:
uniqueCenterId - the unique if of the owning CContentArea.
Returns:
the global identifier

getNorthIdentifier

public String getNorthIdentifier()
Gets the global identifier for the panel in the north.

Returns:
the identifier

getNorthIdentifier

public static String getNorthIdentifier(String uniqueCenterId)
Creates the global identifier of a panel in the north.

Parameters:
uniqueCenterId - the unique id of the owning CContentArea.
Returns:
the global identifier

getSouthIdentifier

public String getSouthIdentifier()
Gets the global identifier for the panel in the south.

Returns:
the identifier

getSouthIdentifier

public static String getSouthIdentifier(String uniqueCenterId)
Creates the global identifier of a panel in the south.

Parameters:
uniqueCenterId - the unique id of the owning CContentArea.
Returns:
the global identifier

getEastIdentifier

public String getEastIdentifier()
Gets the global identifier for the panel in the east.

Returns:
the identifier

getEastIdentifier

public static String getEastIdentifier(String uniqueCenterId)
Creates the global identifier of a panel in the east.

Parameters:
uniqueCenterId - the unique id of the owning CContentArea.
Returns:
the global identifier

getWestIdentifier

public String getWestIdentifier()
Gets the global identifier for the panel in the west.

Returns:
the identifier

getWestIdentifier

public static String getWestIdentifier(String uniqueCenterId)
Creates the global identifier of a panel in the west.

Parameters:
uniqueCenterId - the unique id of the owning CContentArea.
Returns:
the global identifier