bibliothek.gui.dock.themes.basic
Class BasicDockableDisplayer

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.util.BackgroundPanel
                      extended by bibliothek.gui.dock.util.ConfiguredBackgroundPanel
                          extended by bibliothek.gui.dock.themes.basic.BasicDockableDisplayer
All Implemented Interfaces:
DockComponentRoot, DockableDisplayer, PaintableComponent, ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
BubbleDisplayer, EclipseBasicDockableDisplayer, EclipseDockableDisplayer, FlatDockableDisplayer, NoTitleBarDisplayer

public class BasicDockableDisplayer
extends ConfiguredBackgroundPanel
implements DockableDisplayer

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) and/or getComponent(DockTitle) if they want to introduce a completely new layout needing more Containers.

Author:
Benjamin Sigg
See Also:
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
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.BaselineResizeBehavior, Component.BltBufferStrategy, 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
 void addDockableDisplayerListener(DockableDisplayerListener listener)
          Adds listener to this displayer.
protected  DisplayerContentPane createContentPane()
          Creates a new DisplayerContentPane which will be used to show the contents of this displayer.
protected  BasicDockableDisplayerDecorator createMinimalDecorator()
          Creates a new MinimalDecorator that will be shown on this displayer.
protected  DockComponentRootHandler createRootHandler()
          Creates the DockComponentRootHandler for this displayer.
protected  BasicDockableDisplayerDecorator createStackedDecorator()
          Creates a new decorator that will be shown in this displayer if the displayer is shown alongside a tab (@see setStacked(boolean)).
protected  BasicDockableDisplayerDecorator createStackedDecorator(PropertyKey<DockActionDistributor> distributor)
          Creates a new MinimalDecorator that uses a restricted set of DockActions.
protected  BasicDockableDisplayerDecorator createTabDecorator()
          Creates a new TabDecorator that will be shown on this displayer.
protected  void fireMoveableElementChanged()
          Calls DockableDisplayerListener.moveableElementChanged(DockableDisplayer) on any listener that is registered.
 Component getComponent()
          Gets the Component which is to be painted.
protected  Component getComponent(Dockable dockable)
          Gets the Component which should be used to layout the current Dockable.
protected  Component getComponent(DockTitle title)
          Gets the Component which should be used to layout the current DockTitle.
 DockComponentConfiguration getComponentConfiguration()
          Gets the currently applied configuration.
 DockController getController()
          Gets the controller for which this displayer is used.
protected  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.
 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.
 DockElementRepresentative getMoveableElement()
          Gets a representation of the Dockable that can be used for grabbing and moving around the displayer.
 DockStation getStation()
          Gets the station on which this displayer might be shown.
 DockTitle getTitle()
          Gets the title which is shown on this displayer.
 Point getTitleCenter()
          Gets the center point of the title or any Component that behaves as if it would be the title.
 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 isSingleTabShowing()
          Tells whether this displayer currently is showing a single tab.
 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.
 boolean isStacked()
          Tells this displayer that it is used inside a tabbed environment.
 boolean isTabInside()
          Tells whether the tab is shown below the title, if there is a tab and a title.
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.
 DisplayerCombinerTarget prepareCombination(CombinerSource source, Enforcement force)
          This method tells how this displayer would like to combine itself with a Dockable that is dropped over it.
 void removeDockableDisplayerListener(DockableDisplayerListener listener)
          Removes listener from this displayer.
protected  void resetDecorator()
          Resets the decorator, this method removes all Components from this displayer, then adds them again in the order that is necessary according to the current settings
 void setBaseBorder(Border border)
          Sets the border that wraps around the entire displayer.
 void setComponentConfiguration(DockComponentConfiguration configuration)
          Sets a configuration which is to be applied to all Components (and maybe their children) of this DockComponentRoot.
 void setContentBorder(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 setStacked(boolean stacked)
          Tells this displayer that it is used inside a tabbed environment.
 void setStation(DockStation station)
          Sets the station on which this displayer is shown.
 void setTabInside(boolean tabInside)
          Sets the location of the tab (if present) in respect to the title (if present).
 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()
          Replaces the current decorator if necessary.
protected  void updateDecorator(boolean force)
          Replaces the current decorator if necessary.
 void updateUI()
           
 
Methods inherited from class bibliothek.gui.dock.util.ConfiguredBackgroundPanel
configure, setupRenderingHints
 
Methods inherited from class bibliothek.gui.dock.util.BackgroundPanel
getBackgroundAlgorithm, getTransparency, paint, paintBackground, paintBorder, paintChildren, paintComponent, paintForeground, paintOverlay, setBackground, setTransparency
 
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, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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

BasicDockableDisplayer

public BasicDockableDisplayer(DockStation station)
Creates a new displayer

Parameters:
station - the station for which this displayer is needed

BasicDockableDisplayer

public BasicDockableDisplayer(DockStation station,
                              Dockable dockable,
                              DockTitle title)
Creates a new displayer, sets the title and the content.

Parameters:
station - the station for which this displayer is needed
dockable - the content, may be null
title - the title, may be null

BasicDockableDisplayer

public BasicDockableDisplayer(DockStation station,
                              Dockable dockable,
                              DockTitle title,
                              DockableDisplayer.Location location)
Creates a new displayer, sets the title, its location and the content.

Parameters:
station - the station for which this displayer is needed
dockable - the content, may be null
title - the title of dockable, can be null
location - the location of the title, can be null

BasicDockableDisplayer

protected BasicDockableDisplayer(DockStation station,
                                 boolean initialize)
Creates a new displayer but does not set the properties of the displayer. Subclasses may call init to initialize all variables of the new displayer.

Parameters:
station - the station for which this displayer is needed
initialize - true if all properties should be set to default, false if nothing should happen, and init will be called.
Method Detail

init

protected void init(DockStation station,
                    Dockable dockable,
                    DockTitle title,
                    DockableDisplayer.Location location)
Initialises all properties of this DockableDisplayer. This method should only be called once, by a constructor of a subclass which invoked DockableDisplayer( false ).

Parameters:
station - the station for which this displayer is needed
dockable - the content, may be null
title - the title of dockable, can be null
location - the location of the title, can be null

createRootHandler

protected DockComponentRootHandler createRootHandler()
Creates the DockComponentRootHandler for this displayer. The root handler is required to inform the client about all the Components that are related to this displayer.

Returns:
the new root handler

createContentPane

protected DisplayerContentPane createContentPane()
Creates a new DisplayerContentPane which will be used to show the contents of this displayer.

Returns:
the new content pane, not null

setDecorator

protected void setDecorator(BasicDockableDisplayerDecorator decorator)
Exchanges the decorator of this displayer.

Parameters:
decorator - the new decorator

updateDecorator

protected void updateDecorator()
Replaces the current decorator if necessary.


updateDecorator

protected void updateDecorator(boolean force)
Replaces the current decorator if necessary.

Parameters:
force - whether to force an update

isSingleTabShowing

public boolean isSingleTabShowing()
Tells whether this displayer currently is showing a single tab.

Returns:
whether a tab is shown

setStacked

public void setStacked(boolean stacked)
Tells this displayer that it is used inside a tabbed environment. This displayer will call createStackedDecorator() instead of createMinimalDecorator().

Parameters:
stacked - whether this displayer is part of a stack of displayerss

isStacked

public boolean isStacked()
Tells this displayer that it is used inside a tabbed environment. This displayer will call createStackedDecorator() instead of createMinimalDecorator().

Returns:
whether this displayer is part of a stack of displayerss

createMinimalDecorator

protected BasicDockableDisplayerDecorator createMinimalDecorator()
Creates a new MinimalDecorator that will be shown on this displayer.

Returns:
the new decorator

createStackedDecorator

protected BasicDockableDisplayerDecorator createStackedDecorator()
Creates a new decorator that will be shown in this displayer if the displayer is shown alongside a tab (@see setStacked(boolean)). The default implementation return createMinimalDecorator(). Subclasses may call createStackedDecorator(PropertyKey) to easily create a fitting decorator.

Returns:
the new decorator
See Also:
createStackedDecorator(PropertyKey)

createStackedDecorator

protected BasicDockableDisplayerDecorator createStackedDecorator(PropertyKey<DockActionDistributor> distributor)
Creates a new MinimalDecorator that uses a restricted set of DockActions.

Parameters:
distributor - the key to the filter for the actions
Returns:
the new decorator

createTabDecorator

protected BasicDockableDisplayerDecorator createTabDecorator()
Creates a new TabDecorator that will be shown on this displayer.

Returns:
the new decorator

setController

public void setController(DockController controller)
Description copied from interface: DockableDisplayer
Sets the controller for which this displayer is used. That property must be set by the client. Note that there is no guarantee, that a client sets this property.

Specified by:
setController in interface DockableDisplayer
Parameters:
controller - the controller, can be null

getController

public DockController getController()
Description copied from interface: DockableDisplayer
Gets the controller for which this displayer is used. Note that there is no guarantee, that this property is set.

Specified by:
getController in interface DockableDisplayer
Returns:
the controller or null

setComponentConfiguration

public void setComponentConfiguration(DockComponentConfiguration configuration)
Description copied from interface: DockComponentRoot
Sets a configuration which is to be applied to all Components (and maybe their children) of this DockComponentRoot.

Specified by:
setComponentConfiguration in interface DockComponentRoot
Parameters:
configuration - the new configuration or null.

getComponentConfiguration

public DockComponentConfiguration getComponentConfiguration()
Description copied from interface: DockComponentRoot
Gets the currently applied configuration.

Specified by:
getComponentConfiguration in interface DockComponentRoot
Returns:
the current configuration, may be null

addDockableDisplayerListener

public void addDockableDisplayerListener(DockableDisplayerListener listener)
Description copied from interface: DockableDisplayer
Adds listener to this displayer.

Specified by:
addDockableDisplayerListener in interface DockableDisplayer
Parameters:
listener - the new listener, not null

removeDockableDisplayerListener

public void removeDockableDisplayerListener(DockableDisplayerListener listener)
Description copied from interface: DockableDisplayer
Removes listener from this displayer.

Specified by:
removeDockableDisplayerListener in interface DockableDisplayer
Parameters:
listener - the listener to remove

listeners

protected DockableDisplayerListener[] listeners()
Gets a list of all listeners currently registered at this displayer.

Returns:
the list of listeners

fireMoveableElementChanged

protected void fireMoveableElementChanged()
Calls DockableDisplayerListener.moveableElementChanged(DockableDisplayer) on any listener that is registered.


setStation

public void setStation(DockStation station)
Description copied from interface: DockableDisplayer
Sets the station on which this displayer is shown. That property must be set by the station itself. Note that there is no guarantee, that a station sets this property.

Specified by:
setStation in interface DockableDisplayer
Parameters:
station - the station or null

getStation

public DockStation getStation()
Description copied from interface: DockableDisplayer
Gets the station on which this displayer might be shown. Note that there is no guarantee, that a parent-station sets this property.

Specified by:
getStation in interface DockableDisplayer
Returns:
the station or null

getDockable

public Dockable getDockable()
Description copied from interface: DockableDisplayer
Gets the Dockable which is shown on this displayer.

Specified by:
getDockable in interface DockableDisplayer
Returns:
the child, can be null

setDockable

public void setDockable(Dockable dockable)
Description copied from interface: DockableDisplayer
Sets the Dockable which should be shown on this displayer. A value of null means that no Dockable should be visible at all.

Specified by:
setDockable in interface DockableDisplayer
Parameters:
dockable - the child, can be null

resetDecorator

protected void resetDecorator()
Resets the decorator, this method removes all Components from this displayer, then adds them again in the order that is necessary according to the current settings


getTitleLocation

public DockableDisplayer.Location getTitleLocation()
Description copied from interface: DockableDisplayer
Gets the location of the title in respect to the Dockable.

Specified by:
getTitleLocation in interface DockableDisplayer
Returns:
the location

setTitleLocation

public void setTitleLocation(DockableDisplayer.Location location)
Description copied from interface: DockableDisplayer
Sets the location of the title in respect to the Dockable.

Specified by:
setTitleLocation in interface DockableDisplayer
Parameters:
location - the location, a value of null is transformed into the default-value

orientation

protected DockTitle.Orientation orientation(DockableDisplayer.Location location)
Determines the orientation of a DockTitle according to its location on this displayer.

Parameters:
location - the location on this displayer
Returns:
the orientation

getTitle

public DockTitle getTitle()
Description copied from interface: DockableDisplayer
Gets the title which is shown on this displayer.

Specified by:
getTitle in interface DockableDisplayer
Returns:
the title, can be null

setTitle

public void setTitle(DockTitle title)
Description copied from interface: DockableDisplayer
Sets the title of this displayer. If the title is set to null, no title is visible. The displayer will change the orientation of the title.

Specified by:
setTitle in interface DockableDisplayer
Parameters:
title - the title or null

getMoveableElement

public DockElementRepresentative getMoveableElement()
Description copied from interface: DockableDisplayer
Gets a representation of the Dockable that can be used for grabbing and moving around the displayer. The result of this method should be the first match of this list:
  1. A DockTitle
  2. Any kind of DockElementRepresentative
  3. The Dockable itself
  4. null
Changes of the result of this method should be communicated through the DockableDisplayerListeners.

Specified by:
getMoveableElement in interface DockableDisplayer
Returns:
an element for moving around this displayer, can be null

getTitleCenter

public Point getTitleCenter()
Description copied from interface: DockableDisplayer
Gets the center point of the title or any Component that behaves as if it would be the title. Some DockStations may use this information to make sure, that the user can always grab and move around the Dockable.

Specified by:
getTitleCenter in interface DockableDisplayer
Returns:
the center point, may be null

getComponent

protected Component getComponent(Dockable dockable)
Gets the Component which should be used to layout the current Dockable.

Parameters:
dockable - the current Dockable, never null
Returns:
the component representing dockable

getComponent

protected Component getComponent(DockTitle title)
Gets the Component which should be used to layout the current DockTitle.

Parameters:
title - the current DockTitle, never null
Returns:
the component representing title

titleContains

public boolean titleContains(int x,
                             int y)
Description copied from interface: DockableDisplayer
Tells whether the point x/y is inside the title of this displayer or not.

Specified by:
titleContains in interface DockableDisplayer
Parameters:
x - the x-coordinate, relatively to this component
y - the y-coordinate, relatively to this component
Returns:
true if the title contains the point

getComponent

public Component getComponent()
Description copied from interface: PaintableComponent
Gets the Component which is to be painted.

Specified by:
getComponent in interface DockableDisplayer
Specified by:
getComponent in interface PaintableComponent
Overrides:
getComponent in class BackgroundPanel
Returns:
the item to paint

getDockableInsets

public Insets getDockableInsets()
Description copied from interface: DockableDisplayer
Gets an estimate of the insets around the Dockable of this displayer compared to the whole size of this displayer.

Specified by:
getDockableInsets in interface DockableDisplayer
Returns:
the estimate of the insets

getHints

protected BasicDockableDisplayer.Hints getHints()
Gets the set of hints for displaying this component.

Returns:
the set of hints

setRespectBorderHint

public void setRespectBorderHint(boolean respectBorderHint)
Tells this displayer whether the show border hint of getHints() should be respected or not. The default value is false.

Parameters:
respectBorderHint - true if the hint should be respected, false if not.

isRespectBorderHint

public boolean isRespectBorderHint()
Whether the show border hint is respected by this displayer.

Returns:
true if the hint is respected
See Also:
setRespectBorderHint(boolean)

setDefaultBorderHint

public void setDefaultBorderHint(boolean defaultBorderHint)
Sets the default value for the show border hint.

Parameters:
defaultBorderHint - the default value

getDefaultBorderHint

public boolean getDefaultBorderHint()
Gets the default value for the show border hint.

Returns:
the default value

setSingleTabShowInnerBorder

public void setSingleTabShowInnerBorder(boolean singleTabShowInnerBorder)
Sets whether an inner border should be shown if a single tab is in use.

Parameters:
singleTabShowInnerBorder - whether the inner border should be visible

isSingleTabShowInnerBorder

public boolean isSingleTabShowInnerBorder()
Tells whether an inner border is shown if a single tab is in use.

Returns:
whether the border is shown

setSingleTabShowOuterBorder

public void setSingleTabShowOuterBorder(boolean singleTabShowOuterBorder)
Sets whether an outer border should be shown if a single tab is in use.

Parameters:
singleTabShowOuterBorder - whether the outer border should be visible

isSingleTabShowOuterBorder

public boolean isSingleTabShowOuterBorder()
Tells whether an outer border is shown if a single tab is in use.

Returns:
whether the border is shown

isTabInside

public boolean isTabInside()
Tells whether the tab is shown below the title, if there is a tab and a title.

Returns:
the location of the tab in respect to the title, the default value is false

setTabInside

public void setTabInside(boolean tabInside)
Sets the location of the tab (if present) in respect to the title (if present).

Parameters:
tabInside - true if the tab is to be shown nearer to the center than the title

updateUI

public void updateUI()
Overrides:
updateUI in class JPanel

updateBorder

protected void updateBorder()
Called when the hint, whether a border should be shown or not, has changed.


setBaseBorder

public void setBaseBorder(Border border)
Sets the border that wraps around the entire displayer.

Parameters:
border - the new border, can be null

setContentBorder

public void setContentBorder(Border border)
Sets the border that wraps around the content component.

Parameters:
border - the new border, can be null

prepareCombination

public DisplayerCombinerTarget prepareCombination(CombinerSource source,
                                                  Enforcement force)
Description copied from interface: DockableDisplayer
This method tells how this displayer would like to combine itself with a Dockable that is dropped over it. This method is usually called by a Combiner or by a DockStation, but other modules may call this method as well.

Specified by:
prepareCombination in interface DockableDisplayer
Parameters:
source - information about the dockable that is dropped, the location of the mouse, etc...
force - tells how much the caller would like the result not to be null, if the force property is high, then the result should more likely not be null. Note that a result of null is always a valid result, even if the caller does not like it.
Returns:
the operation that could be performed or null if this displayer does not have any specific information

getDefaultBorder

protected Border getDefaultBorder()
Gets the default border for this displayer. That can either be a new object or an old border. It should not be null. The standard implementation just returns a new instance of of BevelBorder.

Returns:
the default border to be used on this displayer