|
||||||||||
| 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.util.ConfiguredBackgroundPanel
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) and/or getComponent(DockTitle)
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 |
|---|
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 |
| 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 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. |
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. |
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 |
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 |
| 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 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 DisplayerContentPane createContentPane()
DisplayerContentPane which will be used to show the contents of this
displayer.
nullprotected void setDecorator(BasicDockableDisplayerDecorator decorator)
decorator - the new decoratorprotected void updateDecorator()
decorator if necessary.
protected void updateDecorator(boolean force)
decorator if necessary.
force - whether to force an updatepublic boolean isSingleTabShowing()
public void setStacked(boolean stacked)
createStackedDecorator() instead of createMinimalDecorator().
stacked - whether this displayer is part of a stack of displayersspublic boolean isStacked()
createStackedDecorator() instead of createMinimalDecorator().
protected BasicDockableDisplayerDecorator createMinimalDecorator()
MinimalDecorator that will be shown on this displayer.
protected BasicDockableDisplayerDecorator createStackedDecorator()
setStacked(boolean)). The default implementation
return createMinimalDecorator(). Subclasses may call createStackedDecorator(PropertyKey)
to easily create a fitting decorator.
createStackedDecorator(PropertyKey)protected BasicDockableDisplayerDecorator createStackedDecorator(PropertyKey<DockActionDistributor> distributor)
MinimalDecorator that uses a restricted set of DockActions.
distributor - the key to the filter for the actions
protected BasicDockableDisplayerDecorator createTabDecorator()
TabDecorator that will be shown on this displayer.
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()
protected void fireMoveableElementChanged()
DockableDisplayerListener.moveableElementChanged(DockableDisplayer) on any
listener that is registered.
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 nullprotected void resetDecorator()
Components from this displayer, then adds them again
in the order that is necessary according to the current settings
public 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 nullpublic DockElementRepresentative getMoveableElement()
DockableDisplayerrepresentation 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:
DockTitleDockElementRepresentativeDockable itselfnull DockableDisplayerListeners.
getMoveableElement in interface DockableDisplayernullprotected Component getComponent(Dockable dockable)
dockable - the current Dockable, never null
dockableprotected 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 Component getComponent()
PaintableComponentComponent which is to be painted.
getComponent in interface DockableDisplayergetComponent in interface PaintableComponentgetComponent in class BackgroundPanelpublic 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 boolean isTabInside()
falsepublic void setTabInside(boolean tabInside)
tabInside - true if the tab is to be shown nearer to the center than the titlepublic void updateUI()
updateUI in class JPanelprotected void updateBorder()
public void setBaseBorder(Border border)
border - the new border, can be nullpublic void setContentBorder(Border border)
border - the new border, can be null
public DisplayerCombinerTarget prepareCombination(CombinerSource source,
Enforcement force)
DockableDisplayerDockable 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.
prepareCombination in interface DockableDisplayersource - 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.
null if this displayer does not
have any specific informationprotected 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 | |||||||||