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 Components
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddComponent(FieldLocation loc, Component comp) Add a component to be position over the given locationvoidaddLayoutComponent(Component comp, Object constraints) voidaddLayoutComponent(String name, Component comp) voidAdd a listener for overlay layout eventsprotected voidFire the given overlay layout event to all registered listenersfloatgetLayoutAlignmentX(Container target) floatgetLayoutAlignmentY(Container target) Get the list of register overlay layout event listeners<T> T[]getListeners(Class<T> listenerType) voidinvalidateLayout(Container target) voidlayoutContainer(Container parent) maximumLayoutSize(Container target) minimumLayoutSize(Container parent) preferredLayoutSize(Container parent) protected booleanRemove a component by its field locationprotected booleanremoveComponent(Component comp) Remove a componentvoidvoidRemove a listener for overlay layout eventsprotected voidTickle the layout manager, so we get a callback to map the components onto the layout.voidRemove 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:
addLayoutComponentin interfaceLayoutManager
-
addLayoutComponent
- Specified by:
addLayoutComponentin interfaceLayoutManager2
-
removeLayoutComponent
- Specified by:
removeLayoutComponentin interfaceLayoutManager
-
preferredLayoutSize
- Specified by:
preferredLayoutSizein interfaceLayoutManager
-
minimumLayoutSize
- Specified by:
minimumLayoutSizein interfaceLayoutManager
-
maximumLayoutSize
- Specified by:
maximumLayoutSizein interfaceLayoutManager2
-
layoutContainer
- Specified by:
layoutContainerin interfaceLayoutManager
-
getLayoutAlignmentX
- Specified by:
getLayoutAlignmentXin interfaceLayoutManager2
-
getLayoutAlignmentY
- Specified by:
getLayoutAlignmentYin interfaceLayoutManager2
-
invalidateLayout
- Specified by:
invalidateLayoutin interfaceLayoutManager2
-