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.LayoutManager2ALayoutManagerthat can be applied to aFieldPanel, allowingComponentsto be placed over a given field location. To apply it, useContainer.setLayout(LayoutManager)to install it. In this case, theContainermust be aFieldPanel. Then, useContainer.add(Component, Object), passing aFieldLocationas 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 voidaddComponent(FieldLocation loc, java.awt.Component comp)Add a component to be position over the given locationvoidaddLayoutComponent(java.awt.Component comp, java.lang.Object constraints)voidaddLayoutComponent(java.lang.String name, java.awt.Component comp)voidaddLayoutListener(FieldPanelOverLayoutListener listener)Add a listener for overlay layout eventsprotected voidfireLayoutListeners(FieldPanelOverLayoutEvent ev)Fire the given overlay layout event to all registered listenersfloatgetLayoutAlignmentX(java.awt.Container target)floatgetLayoutAlignmentY(java.awt.Container target)FieldPanelOverLayoutListener[]getLayoutListeners()Get the list of register overlay layout event listeners<T> T[]getListeners(java.lang.Class<T> listenerType)voidinvalidateLayout(java.awt.Container target)voidlayoutContainer(java.awt.Container parent)java.awt.DimensionmaximumLayoutSize(java.awt.Container target)java.awt.DimensionminimumLayoutSize(java.awt.Container parent)java.awt.DimensionpreferredLayoutSize(java.awt.Container parent)protected booleanremoveComponent(FieldLocation loc)Remove a component by its field locationprotected booleanremoveComponent(java.awt.Component comp)Remove a componentvoidremoveLayoutComponent(java.awt.Component comp)voidremoveLayoutListener(FieldPanelOverLayoutListener listener)Remove a listener for overlay layout eventsprotected voidtrickMapComponents()Tickle the layout manager, so we get a callback to map the components onto the layout.voidunregister()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:
addLayoutComponentin interfacejava.awt.LayoutManager
-
addLayoutComponent
public void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)- Specified by:
addLayoutComponentin interfacejava.awt.LayoutManager2
-
removeLayoutComponent
public void removeLayoutComponent(java.awt.Component comp)
- Specified by:
removeLayoutComponentin interfacejava.awt.LayoutManager
-
preferredLayoutSize
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
- Specified by:
preferredLayoutSizein interfacejava.awt.LayoutManager
-
minimumLayoutSize
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
- Specified by:
minimumLayoutSizein interfacejava.awt.LayoutManager
-
maximumLayoutSize
public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
- Specified by:
maximumLayoutSizein interfacejava.awt.LayoutManager2
-
layoutContainer
public void layoutContainer(java.awt.Container parent)
- Specified by:
layoutContainerin interfacejava.awt.LayoutManager
-
getLayoutAlignmentX
public float getLayoutAlignmentX(java.awt.Container target)
- Specified by:
getLayoutAlignmentXin interfacejava.awt.LayoutManager2
-
getLayoutAlignmentY
public float getLayoutAlignmentY(java.awt.Container target)
- Specified by:
getLayoutAlignmentYin interfacejava.awt.LayoutManager2
-
invalidateLayout
public void invalidateLayout(java.awt.Container target)
- Specified by:
invalidateLayoutin interfacejava.awt.LayoutManager2
-
-