fr.emn.lite
Class LiteUnion

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byfr.emn.lite.Lite
              extended byfr.emn.lite.LiteContainer
                  extended byfr.emn.lite.LiteUnion
All Implemented Interfaces:
java.util.Collection, java.util.List
Direct Known Subclasses:
LiteLinkUnion, LiteNodeUnion

public class LiteUnion
extends LiteContainer

This class describes a Union of lite objects.

A LiteUnion is a temporar container which is used to perform operations on a set of lite objects. It is well suited to describe group selections.

The shape of a LiteUnion is the union of the shapes of its lite children (it may contains holes). As a result, it can be picked only where its children reside (! changing the lite bounds after moving it in the union has no effect on the union's shape !).

Lite objects can be moved in and out a Union. When moved in, lite objects temporarily leave their parent and become direct children of the LiteUnion, until they are moved out and return to their original parent. During these operations, the affine transform of the lite is updated so that its screen appearance never changes.

Every set of lite can form a Union, even if they have not originally the same parent. Subclass LiteUnion to describe particular unions of objects.

WARNING : Always add the LiteUnion to the hierarchy before filling it.


Field Summary
 
Fields inherited from class fr.emn.lite.LiteContainer
children
 
Fields inherited from class fr.emn.lite.Lite
model, oldParent, parent, PICK_ACTIVEBOUNDS, PICK_ALL, PICK_DEEPEST, PICK_FIRST, PICK_GRAPHBOUNDS, PICK_INSIDE, PICK_INTER, PICK_MANIPULABLE, visible
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
LiteUnion()
          LiteGroup constructor comment.
 
Method Summary
 void createIn(Lite l, LiteContainer realParent)
          Moves a newly created lite object (i.e. without original parent) in this Union without changing its transformation (*), and returns it to the specified parent when moveOut() is called.
 void delete()
          Destroy this group by calling moveAllOut() and removing this object from its parent.
 void doPaint(java.awt.Graphics2D g)
          paint children.
 java.awt.geom.Rectangle2D getBounds()
          getBounds2D method comment.
 java.awt.geom.GeneralPath getGhostPath(int maxDepth)
          This object has no ghost path on its own, but returns the ghost path of its children.
 void moveAllOut()
          Moves all elements to their original parent.
 void moveAllOut(LiteContainer newParent)
          Moves all elements to a new common parent.
 void moveIn(Lite l)
          Moves the lite object in this Union while keeping its global transformation (*), and returns it to its original parent when moveOut() is called.
 void moveIn(java.util.Vector objects)
          Insert the method's description here.
 void moveOut(Lite l)
          Returns l to its original parent.
 void moveOut(Lite l, LiteContainer newParent)
          Moves element to a new parent.
 boolean pick(java.awt.Graphics2D g, java.awt.geom.Rectangle2D rect, int strategy, PickedList picked)
          Picks this object with the specified strategy, and adds the results to the picked list.
 void updateObjects(java.util.Vector objects)
          Update this group with a new vector of objects (optimized).
 
Methods inherited from class fr.emn.lite.LiteContainer
add, add, get, getChildrenBounds, remove, remove, set, set, size
 
Methods inherited from class fr.emn.lite.Lite
changeTransform, concatenate, context, dist, equals, getActiveBounds, getActiveBoundsFrom, getAncestor, getAncestor, getBoundsFrom, getBoundsFromNoCorrect, getChildrenGhostPath, getCommonAncestor, getGhost_old, getGhost, getParent, getShadow, getTransform, getTransformFrom, getTransformNoCopy, isVisible, migrateBack, migrateTo, paint_old, paint, paintChildren, paintShadows, pickChildren, preConcatenate, setContext, setParent, setTransform, setVisible, toString, transformBounds
 
Methods inherited from class java.util.AbstractList
add, addAll, clear, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

LiteUnion

public LiteUnion()
LiteGroup constructor comment.

Method Detail

createIn

public void createIn(Lite l,
                     LiteContainer realParent)
Moves a newly created lite object (i.e. without original parent) in this Union without changing its transformation (*), and returns it to the specified parent when moveOut() is called.

This is useful when creating unions of new objects (e.g. when cloning unions).

*: Set the lite's transform BEFORE moving it to the union.


delete

public void delete()
Destroy this group by calling moveAllOut() and removing this object from its parent.


doPaint

public void doPaint(java.awt.Graphics2D g)
paint children.

Specified by:
doPaint in class Lite

getBounds

public java.awt.geom.Rectangle2D getBounds()
getBounds2D method comment.

Specified by:
getBounds in class Lite

getGhostPath

public java.awt.geom.GeneralPath getGhostPath(int maxDepth)
This object has no ghost path on its own, but returns the ghost path of its children.

Overrides:
getGhostPath in class Lite
See Also:
#getChildrenGhostPath()

moveAllOut

public void moveAllOut()
Moves all elements to their original parent.


moveAllOut

public void moveAllOut(LiteContainer newParent)
Moves all elements to a new common parent.


moveIn

public void moveIn(Lite l)
Moves the lite object in this Union while keeping its global transformation (*), and returns it to its original parent when moveOut() is called.

*: The Union's parent must be an ancestor of the lite object.


moveIn

public void moveIn(java.util.Vector objects)
Insert the method's description here. Creation date: (07/06/00 14:54:29)

Parameters:
objects - java.util.Vector

moveOut

public void moveOut(Lite l)
Returns l to its original parent.


moveOut

public void moveOut(Lite l,
                    LiteContainer newParent)
Moves element to a new parent. If newParent == null, returns to its original parent.


pick

public boolean pick(java.awt.Graphics2D g,
                    java.awt.geom.Rectangle2D rect,
                    int strategy,
                    PickedList picked)
Description copied from class: Lite
Picks this object with the specified strategy, and adds the results to the picked list.

A picking strategy is a combination of a depth strategy and a geometrical strategy.

* Depth filters:

PICK_DEEPEST strategy : Deepest pickable children of this object (or the object itself if none) are added to the picked list. This is the default value.

PICK_FIRST strategy : First pickable children (or the object itself if pickable) are added to the picked list.

PICK_ALL strategy : All pickable objects are added to the list.

* Geometrical filters:

PICK_INTER strategy : Objects have to intersect the picking rectangle to be picked. This is the default value.

PICK_INSIDE strategy : Objects must be inside the picking rectangle to be picked. PICK_ACTIVEBOUNDS strategy PICK_GRAPHBOUNDS strategy * Semantic filters: PICK_MANIPULABLE strategy

Overrides:
pick in class Lite
Parameters:
rect - The picking rectangle
strategy - The picking strategy to be used, i.e. a combination of a depth strategy and a geometrical strategy. Default value (0) is PICK_DEEPEST | PICK_INTER.
picked - if this argument is not null, picked objects are added to the pick list.

updateObjects

public void updateObjects(java.util.Vector objects)
Update this group with a new vector of objects (optimized). Creation date: (07/06/00 14:43:00)

Parameters:
objects - java.util.Vector