Package bibliothek.gui.dock.common
Class CContentArea
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
bibliothek.gui.dock.common.CContentArea
- All Implemented Interfaces:
CStationContainer,ImageObserver,MenuContainer,Serializable,Accessible
A component that is normally set into the center of the
main-
This component contains in the center a
Note: clients should not create
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:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PathThe result ofCStation.getTypeId()for the center stationstatic final PathThe result ofCStation.getTypeId()for the minimize stationsFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the observerlistenerto this container.protected voidaddStations(CStation<?>... stations) voidExchanges all theCDockables on the center panel by the elements ofgrid.Gets the station in the center of thisCContentArea.Gets the station in the center of thisCContentArea.Gets the global identifier for the panel in the center.static StringgetCenterIdentifier(String uniqueCenterId) Creates the global identifier of a panel in the center.Gets theCControlfor which this content area was created.getCornerComponent(CContentArea.Corner corner, boolean horizontal) Gets the component of a corner.CStation<?>Gets the preferred defaultCStationof this container.CStation<?>Gets the preferred defaultCStationof this container for children in modemode.getEast()Gets the station in the east of thisCContentAreaGets the station in the east of thisCContentAreaGets the global identifier for the panel in the east.static StringgetEastIdentifier(String uniqueCenterId) Creates the global identifier of a panel in the east.CStation<?>getMatchingStation(CStationContainer container, CStation<?> station) Assumingcontaineris a type ofCStationContainerthat is known tothis, and assumingstationis a child ofcontainer: this method returns one ofthischildren that has the same relative location in respect tothisasstationhas tocontainer.getNorth()Gets the station in the north of thisCContentAreaGets the station in the north of thisCContentAreaGets the global identifier for the panel in the north.static StringgetNorthIdentifier(String uniqueCenterId) Creates the global identifier of a panel in the north.getSouth()Gets the station in the south of thisCContentAreaGets the station in the south of thisCContentAreaGets the global identifier for the panel in the south.static StringgetSouthIdentifier(String uniqueCenterId) Creates the global identifier of a panel in the south.CStation<?>getStation(int index) Gets the index'th child of this container.intGets the number ofCStations that are currently in this container.CStation<?>[]Gets an independent array of all stations that are used on thisCContentArea.Gets the unique id of this center.getWest()Gets the station in the west of thisCContentAreaGets the station in the west of thisCContentAreaGets the global identifier for the panel in the west.static StringgetWestIdentifier(String uniqueCenterId) Creates the global identifier of a panel in the west.intGets the index ofchild.voidRemoves the observerlistenerfrom this container.voidsetCornerComponent(Component component, CContentArea.Corner corner, boolean horizontal) Putscomponentin one corner of this area.voidsetMinimumAreaSize(Dimension size) Sets the minimum size of the four areas in which minimizedDockables are shown.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, updateMethods 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, transferFocusDownCycle, validate, validateTreeMethods 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
TYPE_ID_CENTER
The result ofCStation.getTypeId()for the center station -
TYPE_ID_MINIMIZE
The result ofCStation.getTypeId()for the minimize stations
-
-
Constructor Details
-
CContentArea
Creates a new content area.- Parameters:
control- the control for which this area will be useduniqueId- a unique identifier of this center
-
-
Method Details
-
addStations
- Parameters:
stations- the additional stations to store
-
getUniqueId
Gets the unique id of this center.- Specified by:
getUniqueIdin interfaceCStationContainer- Returns:
- the unique id
-
getComponent
Description copied from interface:CStationContainer- Specified by:
getComponentin interfaceCStationContainer- Returns:
- the parent of all
CStations, notnull
-
addStationContainerListener
Description copied from interface:CStationContainerAdds the observerlistenerto this container. The listener is to be informed whenever aCStationis added or removed from this container.- Specified by:
addStationContainerListenerin interfaceCStationContainer- Parameters:
listener- the new listener, notnull
-
removeStationContainerListener
Description copied from interface:CStationContainerRemoves the observerlistenerfrom this container.- Specified by:
removeStationContainerListenerin interfaceCStationContainer- Parameters:
listener- the listener to remove
-
getControl
Gets theCControlfor which this content area was created.- Returns:
- the owner of this area
-
getStations
Gets an independent array of all stations that are used on thisCContentArea.- Returns:
- the list of stations
-
getStationCount
public int getStationCount()Description copied from interface:CStationContainerGets the number ofCStations that are currently in this container.- Specified by:
getStationCountin interfaceCStationContainer- Returns:
- the number of stations, at least 0
-
getStation
Description copied from interface:CStationContainerGets the index'th child of this container.- Specified by:
getStationin interfaceCStationContainer- Parameters:
index- the index of the child, between 0 andCStationContainer.getStationCount()- Returns:
- the child, not
null
-
indexOf
Gets the index ofchild.- Parameters:
child- a childCStationof this area.- Returns:
- the index of
childor -1 if not found
-
getDefaultStation
Description copied from interface:CStationContainerGets the preferred defaultCStationof this container. Children with no location are usually made visible on such a default station.- Specified by:
getDefaultStationin interfaceCStationContainer- Returns:
- the default station or
null
-
getDefaultStation
Description copied from interface:CStationContainerGets the preferred defaultCStationof this container for children in modemode.- Specified by:
getDefaultStationin interfaceCStationContainer- Parameters:
mode- the mode for which a station is searched- Returns:
- a child of this
CStationContainerthat can showDockables in modemode, can benull
-
deploy
Exchanges all theCDockables on the center panel by the elements ofgrid.- Parameters:
grid- a grid containing some newDockables
-
setCornerComponent
Putscomponentin one corner of this area.- Parameters:
component- the component, can benullcorner- the corner into which to putcomponenthorizontal- whethercomponentshould be horizontally or vertically.
-
getCornerComponent
Gets the component of a corner.- Parameters:
corner- the corner in which to searchhorizontal- whether the component is horizontally or vertically- Returns:
- the component or
null
-
setMinimumAreaSize
Sets the minimum size of the four areas in which minimizedDockables are shown. Clients could also callget'Side'().setMinimumSize( size ).
There is no methodgetMinimumAreaSizebecause the result might not be the same for all stations.- Parameters:
size- the new minimum size ornullto revert to the default value.- See Also:
-
getCenter
Gets the station in the center of thisCContentArea.- Returns:
- the central station
-
getCenterArea
Gets the station in the center of thisCContentArea.- Returns:
- the central station
-
getNorth
Gets the station in the north of thisCContentArea- Returns:
- the station in the north
-
getNorthArea
Gets the station in the north of thisCContentArea- Returns:
- the station in the north
-
getSouth
Gets the station in the south of thisCContentArea- Returns:
- the station in the south
-
getSouthArea
Gets the station in the south of thisCContentArea- Returns:
- the station in the south
-
getEast
Gets the station in the east of thisCContentArea- Returns:
- the station in the east
-
getEastArea
Gets the station in the east of thisCContentArea- Returns:
- the station in the east
-
getWest
Gets the station in the west of thisCContentArea- Returns:
- the station in the west
-
getWestArea
Gets the station in the west of thisCContentArea- Returns:
- the station in the west
-
getCenterIdentifier
Gets the global identifier for the panel in the center.- Returns:
- the identifier
-
getCenterIdentifier
Creates the global identifier of a panel in the center.- Parameters:
uniqueCenterId- the unique if of the owningCContentArea.- Returns:
- the global identifier
-
getNorthIdentifier
Gets the global identifier for the panel in the north.- Returns:
- the identifier
-
getNorthIdentifier
Creates the global identifier of a panel in the north.- Parameters:
uniqueCenterId- the unique id of the owningCContentArea.- Returns:
- the global identifier
-
getSouthIdentifier
Gets the global identifier for the panel in the south.- Returns:
- the identifier
-
getSouthIdentifier
Creates the global identifier of a panel in the south.- Parameters:
uniqueCenterId- the unique id of the owningCContentArea.- Returns:
- the global identifier
-
getEastIdentifier
Gets the global identifier for the panel in the east.- Returns:
- the identifier
-
getEastIdentifier
Creates the global identifier of a panel in the east.- Parameters:
uniqueCenterId- the unique id of the owningCContentArea.- Returns:
- the global identifier
-
getWestIdentifier
Gets the global identifier for the panel in the west.- Returns:
- the identifier
-
getWestIdentifier
Creates the global identifier of a panel in the west.- Parameters:
uniqueCenterId- the unique id of the owningCContentArea.- Returns:
- the global identifier
-
getMatchingStation
Description copied from interface:CStationContainerAssumingcontaineris a type ofCStationContainerthat is known tothis, and assumingstationis a child ofcontainer: this method returns one ofthischildren that has the same relative location in respect tothisasstationhas tocontainer. For example ifstationis the center area of aCGridArea, andthisis aCGridAreaas well, then this method would return the center area ofthis.- Specified by:
getMatchingStationin interfaceCStationContainer- Parameters:
container- some kind ofCStationContainer, may be a type that is known tothisor not.station- some child ofcontainer- Returns:
- a child of
this, such that the location of the child in relation tothisis equivalent to the location ofstationin relation tocontainer. A value ofnullindicates that this method did not find a suitable child. If possible the result of this method andstationshould be of the same type.
-