Package docking.widgets.fieldpanel
Class FieldPanelOverLayoutManager
- java.lang.Object
-
- docking.widgets.fieldpanel.FieldPanelOverLayoutManager
-
- All Implemented Interfaces:
java.awt.LayoutManager
,java.awt.LayoutManager2
public class FieldPanelOverLayoutManager extends java.lang.Object implements java.awt.LayoutManager2
ALayoutManager
that can be applied to aFieldPanel
, allowingComponent
s to be placed over a given field location. To apply it, useContainer.setLayout(LayoutManager)
to install it. In this case, theContainer
must be aFieldPanel
. Then, useContainer.add(Component, Object)
, passing aFieldLocation
as the constraint. Currently, you must calllayoutContainer(Container)
manually after you add or remove any components. When this layout manager is removed from theFieldPanel
, you should callunregister()
in order to dispose of internal resources.
-
-
Constructor Summary
Constructors Constructor Description FieldPanelOverLayoutManager(FieldPanel fieldpane)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addComponent(FieldLocation loc, java.awt.Component comp)
Add a component to be position over the given locationvoid
addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
void
addLayoutComponent(java.lang.String name, java.awt.Component comp)
void
addLayoutListener(FieldPanelOverLayoutListener listener)
Add a listener for overlay layout eventsprotected void
fireLayoutListeners(FieldPanelOverLayoutEvent ev)
Fire the given overlay layout event to all registered listenersfloat
getLayoutAlignmentX(java.awt.Container target)
float
getLayoutAlignmentY(java.awt.Container target)
FieldPanelOverLayoutListener[]
getLayoutListeners()
Get the list of register overlay layout event listeners<T> T[]
getListeners(java.lang.Class<T> listenerType)
void
invalidateLayout(java.awt.Container target)
void
layoutContainer(java.awt.Container parent)
java.awt.Dimension
maximumLayoutSize(java.awt.Container target)
java.awt.Dimension
minimumLayoutSize(java.awt.Container parent)
java.awt.Dimension
preferredLayoutSize(java.awt.Container parent)
protected boolean
removeComponent(FieldLocation loc)
Remove a component by its field locationprotected boolean
removeComponent(java.awt.Component comp)
Remove a componentvoid
removeLayoutComponent(java.awt.Component comp)
void
removeLayoutListener(FieldPanelOverLayoutListener listener)
Remove a listener for overlay layout eventsprotected void
trickMapComponents()
Tickle the layout manager, so we get a callback to map the components onto the layout.void
unregister()
Remove my callbacks from theFieldPanel
-
-
-
Constructor Detail
-
FieldPanelOverLayoutManager
public FieldPanelOverLayoutManager(FieldPanel fieldpane)
-
-
Method Detail
-
unregister
public void unregister()
Remove my callbacks from theFieldPanel
-
addComponent
protected void addComponent(FieldLocation loc, java.awt.Component comp)
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
protected boolean removeComponent(FieldLocation loc)
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
protected boolean removeComponent(java.awt.Component comp)
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
public void addLayoutListener(FieldPanelOverLayoutListener listener)
Add a listener for overlay layout events- Parameters:
listener
- the listener to add
-
removeLayoutListener
public void removeLayoutListener(FieldPanelOverLayoutListener listener)
Remove a listener for overlay layout events- Parameters:
listener
- the listener to remove
-
getLayoutListeners
public FieldPanelOverLayoutListener[] getLayoutListeners()
Get the list of register overlay layout event listeners- Returns:
- the array
-
getListeners
public <T> T[] getListeners(java.lang.Class<T> listenerType)
-
fireLayoutListeners
protected void fireLayoutListeners(FieldPanelOverLayoutEvent ev)
Fire the given overlay layout event to all registered listeners- Parameters:
ev
-
-
addLayoutComponent
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
- Specified by:
addLayoutComponent
in interfacejava.awt.LayoutManager
-
addLayoutComponent
public void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
- Specified by:
addLayoutComponent
in interfacejava.awt.LayoutManager2
-
removeLayoutComponent
public void removeLayoutComponent(java.awt.Component comp)
- Specified by:
removeLayoutComponent
in interfacejava.awt.LayoutManager
-
preferredLayoutSize
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
- Specified by:
preferredLayoutSize
in interfacejava.awt.LayoutManager
-
minimumLayoutSize
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
- Specified by:
minimumLayoutSize
in interfacejava.awt.LayoutManager
-
maximumLayoutSize
public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
- Specified by:
maximumLayoutSize
in interfacejava.awt.LayoutManager2
-
layoutContainer
public void layoutContainer(java.awt.Container parent)
- Specified by:
layoutContainer
in interfacejava.awt.LayoutManager
-
getLayoutAlignmentX
public float getLayoutAlignmentX(java.awt.Container target)
- Specified by:
getLayoutAlignmentX
in interfacejava.awt.LayoutManager2
-
getLayoutAlignmentY
public float getLayoutAlignmentY(java.awt.Container target)
- Specified by:
getLayoutAlignmentY
in interfacejava.awt.LayoutManager2
-
invalidateLayout
public void invalidateLayout(java.awt.Container target)
- Specified by:
invalidateLayout
in interfacejava.awt.LayoutManager2
-
-