|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.station.screen.window.DisplayerScreenDockWindow bibliothek.gui.dock.station.screen.window.AbstractScreenDockWindow
public abstract class AbstractScreenDockWindow
This abstract implementation of ScreenDockWindow
uses a DockableDisplayer
to show the Dockable
. It can operate with any window. Clients need to
call init(Component, Container, WindowConfiguration, boolean)
to put this object onto some
Container
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class bibliothek.gui.dock.station.screen.window.DisplayerScreenDockWindow |
---|
DisplayerScreenDockWindow.Background |
Constructor Summary | |
---|---|
protected |
AbstractScreenDockWindow(ScreenDockStation station,
WindowConfiguration configuration)
Creates a new window. |
|
AbstractScreenDockWindow(ScreenDockStation station,
WindowConfiguration configuration,
Component window,
Container contentParent)
Creates a new window. |
Method Summary | |
---|---|
void |
checkWindowBounds()
Ensures the correctness of the boundaries of this window. |
void |
checkWindowBoundsAsync()
Adds an event into the EDT that calls checkWindowBounds() at a later time,
the boundaries will only be checked if this window is visible. |
protected void |
convertPointToScreen(Point point,
Component component)
Converts point which is relative to component to a point on the screen. |
protected SecureContainer |
createContent(WindowConfiguration configuration)
Creates the component that will be used as content-pane . |
protected WindowMover |
createTitleMover()
Creates a new WindowMover which is used to move this window if the DockTitle
is dragged by the mouse. |
void |
destroy()
Informs this window that it is no longer used by the station and will never be used again. |
Component |
getComponent()
Gets the root Component of this window. |
DockableDisplayer |
getDisplayer()
Gets the displayer which is shown on this dialog. |
protected Container |
getDisplayerParent()
Gets the container on which the displayer is shown. |
Insets |
getDockableInsets()
Makes a guess how big the insets of the Dockable compared to
the whole dialog are. |
protected Icon |
getTitleIcon()
Gets the icon which should be used in the title. |
protected String |
getTitleText()
Gets the text which should be used in the title. |
Rectangle |
getWindowBounds()
Gets the boundaries of the window. |
protected Component |
getWindowComponent()
Gets the component on which ScreenDockWindow#setWindowBounds(java.awt.Rectangle, boolean)
is applied. |
protected void |
init(Component window,
Container contentParent,
WindowConfiguration configuration,
boolean borderAllowed)
Initializes this window. |
void |
invalidate()
Invalidates the layout of this window. |
boolean |
isVisible()
Tells whether this window is visible or not. |
protected void |
setBackground(BackgroundAlgorithm background)
Sets the algorithm that paints the background of this window. |
void |
setController(DockController controller)
Sets the controller in whose realm this window will be used. |
protected void |
setCursor(Cursor cursor)
Sets the current cursor of this window |
void |
setDockable(Dockable dockable)
Sets the Dockable which should be shown on this window. |
void |
setPaintCombining(CombinerTarget target)
Sets whether this window should paint some additional markings which indicate that a Dockable is about to be dropped onto it.Subclasses should use ScreenDockStation.getPaint() to get
an algorithm that paints. |
void |
setPaintRemoval(boolean removal)
Informs this window that a drag and drop operation is in progress, and that the child of this window may be removed in the near future. |
protected void |
setShape(Window window,
ScreenWindowShape shape)
Sets the algorithm which is responsible for updating the shape of this window. |
void |
setTitleIcon(Icon titleIcon)
Explicitly sets the icon of the title. |
void |
setTitleText(String titleText)
Explicitly sets the text of the title. |
void |
setVisible(boolean visible)
Changes the visibility state of this window. |
void |
setWindowBounds(Rectangle bounds)
Sets the bounds the window is supposed to have. |
void |
setWindowBounds(Rectangle bounds,
ScreenDockWindowBorder.Position position)
Sets the boundaries of this window. |
protected void |
showDisplayer(DockableDisplayer displayer)
Forces the subclass of this window to show displayer . |
protected void |
updateTitleIcon()
Called when the icon of the title should be updated. |
protected void |
updateTitleText()
Called when the text of the title should be updated. |
void |
validate()
Forces this window to update the boundaries of its children. |
Methods inherited from class bibliothek.gui.dock.station.screen.window.DisplayerScreenDockWindow |
---|
addScreenDockWindowListener, contains, discardDisplayer, fireFullscreenChanged, fireShapeChanged, fireVisibilityChanged, fireWindowClosing, getConfiguration, getController, getDockable, getDockableDisplayer, getMinimumWindowSize, getNormalBounds, getOffsetDrop, getOffsetMove, getStation, getTitleCenter, inCombineArea, init, inTitleArea, isFullscreen, isMoveOnTitleGrab, isShowTitle, listeners, removeScreenDockWindowListener, setFullscreen, setFullscreenStrategy, setNormalBounds, setShowTitle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface bibliothek.gui.dock.station.screen.ScreenDockWindow |
---|
setPreventFocusStealing, toFront |
Constructor Detail |
---|
protected AbstractScreenDockWindow(ScreenDockStation station, WindowConfiguration configuration)
init(Component, Container, WindowConfiguration, boolean)
when using this constructor.
station
- the owner of this windowconfiguration
- the configuration to apply during creation of this windowpublic AbstractScreenDockWindow(ScreenDockStation station, WindowConfiguration configuration, Component window, Container contentParent)
station
- the owner of this windowconfiguration
- the configuration to apply during creation of this windowwindow
- the root component of this windowcontentParent
- the container onto which the contents of this window will be putinit(Component, Container, WindowConfiguration, boolean)
Method Detail |
---|
protected void init(Component window, Container contentParent, WindowConfiguration configuration, boolean borderAllowed)
window
- the component which represents the window. This component
will be used when calling methods like #setWindowBounds(Rectangle, boolean)
. It
is the root of this whole window.contentParent
- the container which will be used as parent for the
contents of this window. This method will change the LayoutManager
and add a child to contentParent
. This component can be
the same as window
.borderAllowed
- If true
and if WindowConfiguration.isResizeable()
, then a new border is installed
for the displayer parent
, and some MouseListener
s
are installed. When the mouse is over the border it will change the cursor
and the user can resize or move the window. If false
nothing happens and the resizing system has to be implemented by the
subclass.protected WindowMover createTitleMover()
DisplayerScreenDockWindow
WindowMover
which is used to move this window if the DockTitle
is dragged by the mouse. This method is only called if WindowConfiguration.isMoveOnTitleGrab()
returns true.
createTitleMover
in class DisplayerScreenDockWindow
null
public void setController(DockController controller)
ScreenDockWindow
ScreenDockStation
was set, so AbstractDockStation.getController()
will always
return the same value as controller
. This also implies
that any method of the station called from this method already uses the
new controller.
setController
in interface ScreenDockWindow
setController
in class DisplayerScreenDockWindow
controller
- the new controller, can be null
protected void setShape(Window window, ScreenWindowShape shape)
destroy()
is called.Workarounds.supportsTransparency(Window)
returns false
.
window
- the Window
representing this
, it should be getWindowComponent()
shape
- the algorithm defining the new shapeprotected Component getWindowComponent()
DisplayerScreenDockWindow
ScreenDockWindow#setWindowBounds(java.awt.Rectangle, boolean)
is applied.
getWindowComponent
in class DisplayerScreenDockWindow
protected void setBackground(BackgroundAlgorithm background)
DisplayerScreenDockWindow
setBackground
in class DisplayerScreenDockWindow
background
- the algorithm, may be null
public void setDockable(Dockable dockable)
ScreenDockWindow
Dockable
which should be shown on this window.
setDockable
in interface ScreenDockWindow
setDockable
in class DisplayerScreenDockWindow
dockable
- the new element, can be null
to remove
an old Dockable
protected void showDisplayer(DockableDisplayer displayer)
DisplayerScreenDockWindow
displayer
. Only
one displayer should be shown at any time. A new displayer replaces
an old one.
showDisplayer
in class DisplayerScreenDockWindow
displayer
- the displayer to show or null
to remove
the current displayerpublic void setTitleIcon(Icon titleIcon)
titleIcon
- the new icon or null
to use the
Dockable
s icon.protected Icon getTitleIcon()
protected void updateTitleIcon()
getTitleIcon()
public void setTitleText(String titleText)
titleText
- the new text or null
to use
the Dockable
s title text.protected String getTitleText()
null
protected void updateTitleText()
getTitleText()
public Rectangle getWindowBounds()
ScreenDockWindow
public Component getComponent()
ScreenDockWindow
Component
of this window.
public void setPaintCombining(CombinerTarget target)
ScreenDockWindow
Dockable
is about to be dropped onto it.ScreenDockStation.getPaint()
to get
an algorithm that paints.
target
- if null
then nothing should be painted, otherwise
the method CombinerTarget.paint(java.awt.Graphics, java.awt.Component, bibliothek.gui.dock.station.StationPaint, Rectangle, Rectangle)
should be calledpublic void setPaintRemoval(boolean removal)
ScreenDockWindow
removal
- whether the operation is in progresspublic void setVisible(boolean visible)
ScreenDockWindow
visible
- the new statepublic boolean isVisible()
ScreenDockWindow
public void setWindowBounds(Rectangle bounds, ScreenDockWindowBorder.Position position)
position
gets at the intended position. This is a convenient
method for resizing the window when the mouse is draggint the edge or side at position
.
bounds
- the new boundsposition
- the opposite of the edge or side that is fixedpublic void setWindowBounds(Rectangle bounds)
ScreenDockWindow
ScreenDockStation.getBoundaryRestriction()
to check the validity
of the new bounds.
bounds
- the new location and sizepublic void checkWindowBoundsAsync()
checkWindowBounds()
at a later time,
the boundaries will only be checked if this window is visible.
public void checkWindowBounds()
ScreenDockWindow
ScreenDockStation.getBoundaryRestriction()
to do so.
public void invalidate()
Component.invalidate()
public void validate()
ScreenDockWindow
protected void setCursor(Cursor cursor)
cursor
- the cursorComponent.setCursor(Cursor)
protected void convertPointToScreen(Point point, Component component)
point
which is relative to component
to a point on the screen.
point
- the point to modifycomponent
- specifies the coordinate systemSwingUtilities.convertPointToScreen(Point, Component)
public Insets getDockableInsets()
Dockable
compared to
the whole dialog are.
protected SecureContainer createContent(WindowConfiguration configuration)
content-pane
.
This method is invoked by the constructor.
configuration
- the configuration of this window
protected Container getDisplayerParent()
public DockableDisplayer getDisplayer()
null
showDisplayer(DockableDisplayer)
public void destroy()
ScreenDockWindow
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |