Package docking.widgets.fieldpanel
Class FieldPanelOverLayoutManager
java.lang.Object
docking.widgets.fieldpanel.FieldPanelOverLayoutManager
- All Implemented Interfaces:
LayoutManager
,LayoutManager2
A
LayoutManager
that can be applied to a FieldPanel
, allowing Component
s
to be placed over a given field location.
To apply it, use Container.setLayout(LayoutManager)
to install it. In this case, the
Container
must be a FieldPanel
. Then, use
Container.add(Component, Object)
, passing a FieldLocation
as the constraint.
Currently, you must call layoutContainer(Container)
manually after you add or remove any
components.
When this layout manager is removed from the FieldPanel
, you should call
unregister()
in order to dispose of internal resources.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addComponent
(FieldLocation loc, Component comp) Add a component to be position over the given locationvoid
addLayoutComponent
(Component comp, Object constraints) void
addLayoutComponent
(String name, Component comp) void
Add a listener for overlay layout eventsprotected void
Fire the given overlay layout event to all registered listenersfloat
getLayoutAlignmentX
(Container target) float
getLayoutAlignmentY
(Container target) Get the list of register overlay layout event listeners<T> T[]
getListeners
(Class<T> listenerType) void
invalidateLayout
(Container target) void
layoutContainer
(Container parent) maximumLayoutSize
(Container target) minimumLayoutSize
(Container parent) preferredLayoutSize
(Container parent) protected boolean
Remove a component by its field locationprotected boolean
removeComponent
(Component comp) Remove a componentvoid
void
Remove a listener for overlay layout eventsprotected void
Tickle the layout manager, so we get a callback to map the components onto the layout.void
Remove my callbacks from theFieldPanel
-
Constructor Details
-
FieldPanelOverLayoutManager
-
-
Method Details
-
unregister
public void unregister()Remove my callbacks from theFieldPanel
-
addComponent
Add a component to be position over the given location- Parameters:
loc
- the location of the field to occludecomp
- the component to be placed over the field
-
removeComponent
Remove a component by its field location- Parameters:
loc
- the location of the field- Returns:
- true if there was a component placed at the given location
-
removeComponent
Remove a component- Parameters:
comp
- the component to remove- Returns:
- true if the component existed
-
trickMapComponents
protected void trickMapComponents()Tickle the layout manager, so we get a callback to map the components onto the layout. -
addLayoutListener
Add a listener for overlay layout events- Parameters:
listener
- the listener to add
-
removeLayoutListener
Remove a listener for overlay layout events- Parameters:
listener
- the listener to remove
-
getLayoutListeners
Get the list of register overlay layout event listeners- Returns:
- the array
-
getListeners
-
fireLayoutListeners
Fire the given overlay layout event to all registered listeners- Parameters:
ev
-
-
addLayoutComponent
- Specified by:
addLayoutComponent
in interfaceLayoutManager
-
addLayoutComponent
- Specified by:
addLayoutComponent
in interfaceLayoutManager2
-
removeLayoutComponent
- Specified by:
removeLayoutComponent
in interfaceLayoutManager
-
preferredLayoutSize
- Specified by:
preferredLayoutSize
in interfaceLayoutManager
-
minimumLayoutSize
- Specified by:
minimumLayoutSize
in interfaceLayoutManager
-
maximumLayoutSize
- Specified by:
maximumLayoutSize
in interfaceLayoutManager2
-
layoutContainer
- Specified by:
layoutContainer
in interfaceLayoutManager
-
getLayoutAlignmentX
- Specified by:
getLayoutAlignmentX
in interfaceLayoutManager2
-
getLayoutAlignmentY
- Specified by:
getLayoutAlignmentY
in interfaceLayoutManager2
-
invalidateLayout
- Specified by:
invalidateLayout
in interfaceLayoutManager2
-