|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
bibliothek.gui.dock.util.BackgroundPanel
bibliothek.gui.dock.themes.basic.BasicDockableDisplayer
public class BasicDockableDisplayer
A panel which shows one Dockable and one DockTitle. The location
of the DockTitle is always at one of the four borders (left,
right, top, bottom). The title may be null, in this case only
the Dockable is shown.
Clients using a displayer should try to set the controller
and the station property.
Subclasses may override getComponent(Dockable), addDockable(Dockable, Component),
removeDockable(Dockable, Component), getComponent(DockTitle), addTitle(Component)
and/or removeTitle(Component) if they want to introduce a completely
new layout needing more Containers.
DisplayerCollection,
DisplayerFactory,
Serialized Form| Nested Class Summary | |
|---|---|
protected class |
BasicDockableDisplayer.DisplayerBorder
The border of this displayer. |
protected class |
BasicDockableDisplayer.Hints
This implementation of DockableDisplayerHints forwards
any changes to its BasicDockableDisplayer. |
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| 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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Nested classes/interfaces inherited from interface bibliothek.gui.dock.station.DockableDisplayer |
|---|
DockableDisplayer.Location |
| 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 | |
|---|---|
|
BasicDockableDisplayer(DockStation station)
Creates a new displayer |
protected |
BasicDockableDisplayer(DockStation station,
boolean initialize)
Creates a new displayer but does not set the properties of the displayer. |
|
BasicDockableDisplayer(DockStation station,
Dockable dockable,
DockTitle title)
Creates a new displayer, sets the title and the content. |
|
BasicDockableDisplayer(DockStation station,
Dockable dockable,
DockTitle title,
DockableDisplayer.Location location)
Creates a new displayer, sets the title, its location and the content. |
| Method Summary | |
|---|---|
protected void |
addDockable(Dockable dockable,
java.awt.Component component)
Inserts a component representing the current dockable
into the layout. |
void |
addDockableDisplayerListener(DockableDisplayerListener listener)
Adds listener to this displayer. |
protected void |
addTitle(java.awt.Component component)
Inserts a component representing the current title
into the layout. |
protected void |
doLayout(javax.swing.JPanel content)
|
java.awt.Component |
getComponent()
Gets the Component which is to be painted. |
protected java.awt.Component |
getComponent(Dockable dockable)
Gets the Component which should be used to layout the current Dockable. |
protected java.awt.Component |
getComponent(DockTitle title)
Gets the Component which should be used to layout the current DockTitle. |
javax.swing.JPanel |
getContent()
Gets the content pane of this displayer, the content pane is the parent component of the Dockable and the DockTitle. |
java.awt.Dimension |
getContentMinimumSize()
|
DockController |
getController()
Gets the controller for which this displayer is used. |
protected javax.swing.border.Border |
getDefaultBorder()
Gets the default border for this displayer. |
boolean |
getDefaultBorderHint()
Gets the default value for the show border hint. |
Dockable |
getDockable()
Gets the Dockable which is shown on this displayer. |
java.awt.Insets |
getDockableInsets()
Gets an estimate of the insets around the Dockable of this
displayer compared to the whole size of this displayer. |
protected BasicDockableDisplayer.Hints |
getHints()
Gets the set of hints for displaying this component. |
DockStation |
getStation()
Gets the station on which this displayer might be shown. |
DockTitle |
getTitle()
Gets the title which is shown on this displayer. |
DockableDisplayer.Location |
getTitleLocation()
Gets the location of the title in respect to the Dockable. |
protected void |
init(DockStation station,
Dockable dockable,
DockTitle title,
DockableDisplayer.Location location)
Initialises all properties of this DockableDisplayer. |
boolean |
isRespectBorderHint()
Whether the show border hint is respected by this displayer. |
boolean |
isSingleTabShowInnerBorder()
Tells whether an inner border is shown if a single tab is in use. |
boolean |
isSingleTabShowOuterBorder()
Tells whether an outer border is shown if a single tab is in use. |
protected DockableDisplayerListener[] |
listeners()
Gets a list of all listeners currently registered at this displayer. |
protected DockTitle.Orientation |
orientation(DockableDisplayer.Location location)
Determines the orientation of a DockTitle according to its
location on this displayer. |
protected void |
removeDockable(Dockable dockable,
java.awt.Component component)
Removes the Component which represents the current dockable. |
void |
removeDockableDisplayerListener(DockableDisplayerListener listener)
Removes listener from this displayer. |
protected void |
removeTitle(java.awt.Component component)
Removes the Component which represents the current title. |
void |
setBaseBorder(javax.swing.border.Border border)
Sets the border that wraps around the entire displayer. |
void |
setContentBorder(javax.swing.border.Border border)
Sets the border that wraps around the content component. |
void |
setController(DockController controller)
Sets the controller for which this displayer is used. |
protected void |
setDecorator(BasicDockableDisplayerDecorator decorator)
Exchanges the decorator of this displayer. |
void |
setDefaultBorderHint(boolean defaultBorderHint)
Sets the default value for the show border hint. |
void |
setDockable(Dockable dockable)
Sets the Dockable which should be shown on this displayer. |
void |
setRespectBorderHint(boolean respectBorderHint)
Tells this displayer whether the show border hint of getHints() should be respected or not. |
void |
setSingleTabShowInnerBorder(boolean singleTabShowInnerBorder)
Sets whether an inner border should be shown if a single tab is in use. |
void |
setSingleTabShowOuterBorder(boolean singleTabShowOuterBorder)
Sets whether an outer border should be shown if a single tab is in use. |
void |
setStation(DockStation station)
Sets the station on which this displayer is shown. |
void |
setTitle(DockTitle title)
Sets the title of this displayer. |
void |
setTitleLocation(DockableDisplayer.Location location)
Sets the location of the title in respect to the Dockable. |
boolean |
titleContains(int x,
int y)
Tells whether the point x/y is inside the title of this
displayer or not. |
protected void |
updateBorder()
Called when the hint, whether a border should be shown or not, has changed. |
protected void |
updateDecorator()
|
void |
updateUI()
|
| Methods inherited from class bibliothek.gui.dock.util.BackgroundPanel |
|---|
getBackgroundAlgorithm, isSolid, isTransparent, paint, paintBackground, paintBorder, paintChildren, paintComponent, paintForeground, paintOverlay, setBackground, setSolid, setTransparent |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
| 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, 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 |
|---|
public BasicDockableDisplayer(DockStation station)
station - the station for which this displayer is needed
public BasicDockableDisplayer(DockStation station,
Dockable dockable,
DockTitle title)
station - the station for which this displayer is neededdockable - the content, may be nulltitle - the title, may be null
public BasicDockableDisplayer(DockStation station,
Dockable dockable,
DockTitle title,
DockableDisplayer.Location location)
station - the station for which this displayer is neededdockable - the content, may be nulltitle - the title of dockable, can be nulllocation - the location of the title, can be null
protected BasicDockableDisplayer(DockStation station,
boolean initialize)
init
to initialize all variables of the new displayer.
station - the station for which this displayer is neededinitialize - true if all properties should be set
to default, false if nothing should happen, and
init
will be called.| Method Detail |
|---|
protected void init(DockStation station,
Dockable dockable,
DockTitle title,
DockableDisplayer.Location location)
DockableDisplayer( false ).
station - the station for which this displayer is neededdockable - the content, may be nulltitle - the title of dockable, can be nulllocation - the location of the title, can be nullprotected void setDecorator(BasicDockableDisplayerDecorator decorator)
decorator - the new decoratorprotected void updateDecorator()
public void setController(DockController controller)
DockableDisplayer
setController in interface DockableDisplayercontroller - the controller, can be nullpublic DockController getController()
DockableDisplayer
getController in interface DockableDisplayernullpublic void addDockableDisplayerListener(DockableDisplayerListener listener)
DockableDisplayerlistener to this displayer.
addDockableDisplayerListener in interface DockableDisplayerlistener - the new listener, not nullpublic void removeDockableDisplayerListener(DockableDisplayerListener listener)
DockableDisplayerlistener from this displayer.
removeDockableDisplayerListener in interface DockableDisplayerlistener - the listener to removeprotected DockableDisplayerListener[] listeners()
public void setStation(DockStation station)
DockableDisplayer
setStation in interface DockableDisplayerstation - the station or nullpublic DockStation getStation()
DockableDisplayer
getStation in interface DockableDisplayernullpublic Dockable getDockable()
DockableDisplayer
getDockable in interface DockableDisplayernullpublic void setDockable(Dockable dockable)
DockableDisplayernull means that no Dockable should be visible at all.
setDockable in interface DockableDisplayerdockable - the child, can be nullpublic DockableDisplayer.Location getTitleLocation()
DockableDisplayer
getTitleLocation in interface DockableDisplayerpublic void setTitleLocation(DockableDisplayer.Location location)
DockableDisplayer
setTitleLocation in interface DockableDisplayerlocation - the location, a value of null is transformed
into the default-valueprotected DockTitle.Orientation orientation(DockableDisplayer.Location location)
DockTitle according to its
location on this displayer.
location - the location on this displayer
public DockTitle getTitle()
DockableDisplayer
getTitle in interface DockableDisplayernullpublic void setTitle(DockTitle title)
DockableDisplayernull,
no title is visible. The displayer will change the
orientation
of the title.
setTitle in interface DockableDisplayertitle - the title or null
protected void addDockable(Dockable dockable,
java.awt.Component component)
dockable
into the layout. This method is never called twice unless
removeDockable(Dockable, Component) is called before. Note that
the name "add" is inspired by the method add
of Container.
dockable - the dockable to add, may be nullcomponent - the new Component, may be null
protected void removeDockable(Dockable dockable,
java.awt.Component component)
dockable.
dockable - the element to remove, may be nullcomponent - the component, may be nullprotected java.awt.Component getComponent(Dockable dockable)
dockable - the current Dockable, never null
dockablepublic javax.swing.JPanel getContent()
Dockable and the DockTitle.
protected void addTitle(java.awt.Component component)
title
into the layout. This method is never called twice unless
removeTitle(Component) is called before. Note that
the name "add" is inspired by the method add
of Container.
component - the new Componentprotected void removeTitle(java.awt.Component component)
title.
component - the componentprotected java.awt.Component getComponent(DockTitle title)
title - the current DockTitle, never null
title
public boolean titleContains(int x,
int y)
DockableDisplayerx/y is inside the title of this
displayer or not.
titleContains in interface DockableDisplayerx - the x-coordinate, relatively to this componenty - the y-coordinate, relatively to this component
true if the title contains the pointpublic java.awt.Component getComponent()
PaintableComponentComponent which is to be painted.
getComponent in interface DockableDisplayergetComponent in interface PaintableComponentgetComponent in class BackgroundPanelpublic java.awt.Dimension getContentMinimumSize()
protected void doLayout(javax.swing.JPanel content)
public java.awt.Insets getDockableInsets()
DockableDisplayerDockable of this
displayer compared to the whole size of this displayer.
getDockableInsets in interface DockableDisplayerprotected BasicDockableDisplayer.Hints getHints()
public void setRespectBorderHint(boolean respectBorderHint)
getHints() should be respected or not. The default value
is false.
respectBorderHint - true if the hint should be respected,
false if not.public boolean isRespectBorderHint()
true if the hint is respectedsetRespectBorderHint(boolean)public void setDefaultBorderHint(boolean defaultBorderHint)
defaultBorderHint - the default valuepublic boolean getDefaultBorderHint()
public void setSingleTabShowInnerBorder(boolean singleTabShowInnerBorder)
singleTabShowInnerBorder - whether the inner border should be visiblepublic boolean isSingleTabShowInnerBorder()
public void setSingleTabShowOuterBorder(boolean singleTabShowOuterBorder)
singleTabShowOuterBorder - whether the outer border should be visiblepublic boolean isSingleTabShowOuterBorder()
public void updateUI()
updateUI in class javax.swing.JPanelprotected void updateBorder()
public void setBaseBorder(javax.swing.border.Border border)
border - the new border, can be nullpublic void setContentBorder(javax.swing.border.Border border)
border - the new border, can be nullprotected javax.swing.border.Border getDefaultBorder()
null.
The standard implementation just returns a new instance of of
BevelBorder.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||