|
||||||||||
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.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(Component)
,
removeDockable(Component)
, getComponent(DockTitle)
, addTitle(Component)
and/or removeTitle(Component)
if they want to introduce a completely
new layout needing more Containers
.
DisplayerCollection
,
DisplayerFactory
,
Serialized FormNested Class Summary |
---|
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()
Creates a new displayer |
protected |
BasicDockableDisplayer(boolean initialize)
Creates a new displayer but does not set the properties of the displayer. |
|
BasicDockableDisplayer(Dockable dockable,
DockTitle title)
Creates a new displayer, sets the title and the content. |
|
BasicDockableDisplayer(Dockable dockable,
DockTitle title,
DockableDisplayer.Location location)
Creates a new displayer, sets the title, its location and the content. |
Method Summary | |
---|---|
protected void |
addDockable(Component component)
Inserts a component representing the current dockable
into the layout. |
protected void |
addTitle(Component component)
Inserts a component representing the current title
into the layout. |
void |
doLayout()
|
Component |
getComponent()
Gets the Component which represents this displayer. |
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. |
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. |
Dimension |
getMinimumSize()
|
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(Dockable dockable,
DockTitle title,
DockableDisplayer.Location location)
Initialises all properties of this DockableDisplayer. |
protected DockTitle.Orientation |
orientation(DockableDisplayer.Location location)
Determines the orientation of a DockTitle according to its
location on this displayer. |
protected void |
removeDockable(Component component)
Removes the Component which represents the current dockable . |
protected void |
removeTitle(Component component)
Removes the Component which represents the current title . |
void |
setController(DockController controller)
Sets the controller for which this displayer is used. |
void |
setDockable(Dockable dockable)
Sets the Dockable which should be shown on this displayer. |
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. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BasicDockableDisplayer()
public BasicDockableDisplayer(Dockable dockable, DockTitle title)
dockable
- the content, may be null
title
- the title, may be null
public BasicDockableDisplayer(Dockable dockable, DockTitle title, DockableDisplayer.Location location)
dockable
- the content, may be null
title
- the title of dockable
, can be null
location
- the location of the title, can be null
protected BasicDockableDisplayer(boolean initialize)
init
to initialize all variables of the new displayer.
initialize
- true
if all properties should be set
to default, false
if nothing should happen, and
init
will be called.Method Detail |
---|
protected void init(Dockable dockable, DockTitle title, DockableDisplayer.Location location)
DockableDisplayer( false )
.
dockable
- the content, may be null
title
- the title of dockable
, can be null
location
- the location of the title, can be null
public void setController(DockController controller)
DockableDisplayer
setController
in interface DockableDisplayer
controller
- the controller, can be null
public DockController getController()
DockableDisplayer
getController
in interface DockableDisplayer
null
public void setStation(DockStation station)
DockableDisplayer
setStation
in interface DockableDisplayer
station
- the station or null
public DockStation getStation()
DockableDisplayer
getStation
in interface DockableDisplayer
null
public Dockable getDockable()
DockableDisplayer
getDockable
in interface DockableDisplayer
null
public void setDockable(Dockable dockable)
DockableDisplayer
null
means that no Dockable should be visible at all.
setDockable
in interface DockableDisplayer
dockable
- the child, can be null
public DockableDisplayer.Location getTitleLocation()
DockableDisplayer
getTitleLocation
in interface DockableDisplayer
public void setTitleLocation(DockableDisplayer.Location location)
DockableDisplayer
setTitleLocation
in interface DockableDisplayer
location
- 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 DockableDisplayer
null
public void setTitle(DockTitle title)
DockableDisplayer
null
,
no title is visible. The displayer will change the
orientation
of the title.
setTitle
in interface DockableDisplayer
title
- the title or null
protected void addDockable(Component component)
dockable
into the layout. This method is never called twice unless
removeDockable(Component)
is called before. Note that
the name "add" is inspired by the method add
of Container
.
component
- the new Componentprotected void removeDockable(Component component)
dockable
.
component
- the componentprotected Component getComponent(Dockable dockable)
dockable
- the current Dockable, never null
dockable
protected void addTitle(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(Component component)
title
.
component
- the componentprotected Component getComponent(DockTitle title)
title
- the current DockTitle, never null
title
public boolean titleContains(int x, int y)
DockableDisplayer
x/y
is inside the title of this
displayer or not.
titleContains
in interface DockableDisplayer
x
- the x-coordinate, relatively to this componenty
- the y-coordinate, relatively to this component
true
if the title contains the pointpublic Component getComponent()
DockableDisplayer
getComponent
in interface DockableDisplayer
public Dimension getMinimumSize()
getMinimumSize
in class JComponent
public void doLayout()
doLayout
in class Container
public Insets getDockableInsets()
DockableDisplayer
Dockable
of this
displayer compared to the whole size of this displayer.
getDockableInsets
in interface DockableDisplayer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |