|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.event.ComponentAdapter
de.uni_paderborn.fujaba.fsa.swing.GrabManager
The GrabManager associates a number of Grabs to a target JComponent, manages events of the target and calls the GrabLayouter to relayout the Grabs when necessary.
The association to the JComponent is implemented using the clientProperty-Methods of the JComponent. This means that the association to the JComponent is implemented with the traditional access methods, but the backward association is implemented as the client property with name
GrabManager.TARGET_PROPERTYof the target component. It is accessible via:
(GrabManager)targetComponent.getClientProperty(GrabManager.TARGET_PROPERTY)
0..1 N GrabManager ----------------------------- JGrab manager grabs 0..1 N GrabManager ---------------------------------------- JComponent getClientProperty target
JComponent.getClientProperty(java.lang.Object)
,
JComponent.putClientProperty(java.lang.Object, java.lang.Object)
,
JGrab
,
GrabLayouter
Field Summary | |
private java.awt.Container |
commonAncestorOfGrabs
No comment provided by developer, please add a comment to improve documentation. |
private de.upb.tools.fca.FHashSet |
grabs
0..1 N GrabManager ----------------------------- JGrab manager grabs |
private static java.util.HashSet |
postPonedManagers
No comment provided by developer, please add a comment to improve documentation. |
private static boolean |
postPoneing
No comment provided by developer, please add a comment to improve documentation. |
private static int |
recursionDepth
No comment provided by developer, please add a comment to improve documentation. |
private boolean |
revalidating
No comment provided by developer, please add a comment to improve documentation. |
private javax.swing.JComponent |
target
0..1 N GrabManager ---------------------------------------- JComponent getClientProperty target (GrabManager.TARGET_PROPERTY) |
static java.lang.String |
TARGET_PROPERTY
No comment provided by developer, please add a comment to improve documentation. |
Constructor Summary | |
GrabManager()
Constructor for class GrabManager |
|
GrabManager(javax.swing.JComponent target)
Constructor for class GrabManager |
Method Summary | |
boolean |
addToGrabs(JGrab value)
Add a Grab to the list of Grabs that are managed by this Object. |
void |
ancestorMoved(java.awt.event.HierarchyEvent e)
Listen for changes to ancestors of the target. |
void |
ancestorResized(java.awt.event.HierarchyEvent e)
No comment provided by developer, please add a comment to improve documentation. |
void |
componentMoved(java.awt.event.ComponentEvent e)
|
void |
componentResized(java.awt.event.ComponentEvent e)
|
static void |
doPostPonedGrabLayout()
No comment provided by developer, please add a comment to improve documentation. |
javax.swing.JComponent |
getTarget()
|
boolean |
hasInGrabs(JGrab value)
|
void |
hierarchyChanged(java.awt.event.HierarchyEvent e)
|
java.util.Iterator |
iteratorOfGrabs()
No comment provided by developer, please add a comment to improve documentation. |
static void |
postPoneGrabLayout()
No comment provided by developer, please add a comment to improve documentation. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Listens for changes to Position or size of the target to revalidate the grabs and for changes to the parents of the Grabs to update the common ancestor |
private void |
registerGrab(JGrab grab)
No comment provided by developer, please add a comment to improve documentation. |
private void |
registerGrabs()
No comment provided by developer, please add a comment to improve documentation. |
private void |
registerTarget()
No comment provided by developer, please add a comment to improve documentation. |
void |
removeAllFromGrabs()
No comment provided by developer, please add a comment to improve documentation. |
boolean |
removeFromGrabs(JGrab value)
Removes the Grab value from the list of Grabs and updates the common ancestor of all grabs |
void |
revalidate()
Checks the Target if a specific GrabLayouter is set as client property with name GrabLayouter.TARGET_PROPERTY. |
void |
revalidate(int depthIncrease)
Checks the Target if a specific GrabLayouter is set as client property with name GrabLayouter.TARGET_PROPERTY. |
boolean |
setTarget(javax.swing.JComponent value)
Set the target of this Manager (and all of its Grabs) to value. |
int |
sizeOfGrabs()
No comment provided by developer, please add a comment to improve documentation. |
private void |
unregisterGrab(JGrab grab)
No comment provided by developer, please add a comment to improve documentation. |
private void |
unregisterGrabs()
No comment provided by developer, please add a comment to improve documentation. |
private void |
unregisterTarget()
No comment provided by developer, please add a comment to improve documentation. |
private void |
updateCommonAncestorOfGrabs(java.awt.Container hint)
recalculate common ancestor from scratch by iterating over all grabs |
private void |
updateCommonAncestorOfGrabs(java.awt.Container parent,
boolean removed)
Update the common ancestor of all grabs by checking the parent value and comparing it to the current value. |
Methods inherited from class java.awt.event.ComponentAdapter |
componentHidden, componentShown |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String TARGET_PROPERTY
private static int recursionDepth
private static boolean postPoneing
private static java.util.HashSet postPonedManagers
private javax.swing.JComponent target
0..1 N GrabManager ---------------------------------------- JComponent getClientProperty target (GrabManager.TARGET_PROPERTY)
private de.upb.tools.fca.FHashSet grabs
0..1 N GrabManager ----------------------------- JGrab manager grabs
private java.awt.Container commonAncestorOfGrabs
private boolean revalidating
Constructor Detail |
public GrabManager()
public GrabManager(javax.swing.JComponent target)
target
- No description providedMethod Detail |
public static void postPoneGrabLayout()
public static void doPostPonedGrabLayout()
public boolean setTarget(javax.swing.JComponent value)
Reverse Link is
(GrabManager)value.getClientProperty(GrabManager.TARGET_PROPERTY)
value
- The new target
getTarget()
private void unregisterTarget()
private void registerTarget()
private void registerGrabs()
private void unregisterGrabs()
private void registerGrab(JGrab grab)
grab
- No description providedprivate void unregisterGrab(JGrab grab)
grab
- No description providedpublic javax.swing.JComponent getTarget()
public boolean addToGrabs(JGrab value)
value
- the Grab to add
updateCommonAncestorOfGrabs(java.awt.Container, boolean)
public boolean hasInGrabs(JGrab value)
value
-
public java.util.Iterator iteratorOfGrabs()
public int sizeOfGrabs()
public boolean removeFromGrabs(JGrab value)
value
- the grab in question
updateCommonAncestorOfGrabs(java.awt.Container, boolean)
public void removeAllFromGrabs()
private void updateCommonAncestorOfGrabs(java.awt.Container hint)
hint
- No description providedupdateCommonAncestorOfGrabs(java.awt.Container, boolean)
private void updateCommonAncestorOfGrabs(java.awt.Container parent, boolean removed)
The commonAncestorOfGrabs is needed to decrease the work that is to be done when an AncestorEvent occurs on the JComponent. If the ancestor in question is an ancestor of commonAncestorOfGrabs nothing is to be done. Otherwise a revalidate() is necessary
parent
- removed
- updateCommonAncestorOfGrabs(Container)
public void revalidate()
Then the layout-Method of the Layouter is called to reposition the grabs around the target JComponent
GrabLayouter
,
GrabLayouter.getDefaultLayouter()
,
GrabLayouter.layout(de.uni_paderborn.fujaba.fsa.swing.GrabManager)
public void revalidate(int depthIncrease)
Then the layout-Method of the Layouter is called to reposition the grabs around the target JComponent
depthIncrease
- recursion is limitted to 2.GrabLayouter
,
GrabLayouter.getDefaultLayouter()
,
GrabLayouter.layout(de.uni_paderborn.fujaba.fsa.swing.GrabManager)
public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange
in interface java.beans.PropertyChangeListener
e
- the eventrevalidate()
,
updateCommonAncestorOfGrabs(java.awt.Container, boolean)
public void componentMoved(java.awt.event.ComponentEvent e)
componentMoved
in interface java.awt.event.ComponentListener
e
- the eventpublic void componentResized(java.awt.event.ComponentEvent e)
componentResized
in interface java.awt.event.ComponentListener
e
- the eventpublic void hierarchyChanged(java.awt.event.HierarchyEvent e)
hierarchyChanged
in interface java.awt.event.HierarchyListener
e
- the eventpublic void ancestorMoved(java.awt.event.HierarchyEvent e)
If a parent of the common ancestor of grabs is changed there is nothing to do, because the changes affect the grabs, too. Otherwise the grabs have to be relayouted
ancestorMoved
in interface java.awt.event.HierarchyBoundsListener
e
- The eventrevalidate()
,
updateCommonAncestorOfGrabs(Container)
public void ancestorResized(java.awt.event.HierarchyEvent e)
ancestorResized
in interface java.awt.event.HierarchyBoundsListener
e
- No description provided
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |