fr.emn.lite
Class Lite

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byfr.emn.lite.Lite
All Implemented Interfaces:
java.util.Collection, java.util.List
Direct Known Subclasses:
LiteContainer, LiteGhost_old, LiteLabel, LiteLinkHandle, LiteShape, LiteShortcut, LiteSlot

public abstract class Lite
extends java.util.AbstractList


Field Summary
 java.lang.Object model
           
protected  LiteContainer oldParent
           
protected  LiteContainer parent
           
static int PICK_ACTIVEBOUNDS
           
static int PICK_ALL
          All depth strategy for picking.
static int PICK_DEEPEST
          Deepest depth strategy for picking.
static int PICK_FIRST
          First depth strategy for picking.
static int PICK_GRAPHBOUNDS
           
static int PICK_INSIDE
          Inside geometrical strategy for picking.
static int PICK_INTER
          Intersection geometrical strategy for picking.
static int PICK_MANIPULABLE
           
protected  boolean visible
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Lite()
           
 
Method Summary
 void changeTransform(java.awt.geom.AffineTransform t)
           
 void concatenate(java.awt.geom.AffineTransform t)
           
 LiteContext context()
           
protected static double dist(java.awt.geom.Rectangle2D r1, java.awt.geom.Rectangle2D r2)
           
abstract  void doPaint(java.awt.Graphics2D g)
          Include painting code here.
 boolean equals(java.lang.Object l)
           
 java.lang.Object get(int index)
          Don't subclass.
 java.awt.geom.Rectangle2D getActiveBounds()
           
 java.awt.geom.Rectangle2D getActiveBoundsFrom(LiteContainer l)
           
 LiteContainer getAncestor()
           
 LiteContainer getAncestor(java.lang.Class ancestorClass)
           
abstract  java.awt.geom.Rectangle2D getBounds()
          Returns the bounds of the Lite object in its own coordinate system.
 java.awt.geom.Rectangle2D getBoundsFrom(LiteContainer l)
           
protected  java.awt.geom.Rectangle2D getBoundsFromNoCorrect(LiteContainer l)
           
 java.awt.geom.GeneralPath getChildrenGhostPath(int maxDepth)
          Returns the ghost path of all this object's children, transformed in the current coordinates system.
static LiteContainer getCommonAncestor(Lite l1, Lite l2)
          Utility method used to retreive the nearest common ancestor of two lite objects.
 LiteGhost_old getGhost_old()
           
 LiteGhost getGhost(int maxDepth)
           
 java.awt.geom.GeneralPath getGhostPath(int maxDepth)
          This method returns the ghost shape of this object.
 LiteContainer getParent()
           
 java.awt.Shape getShadow()
          Returns this lite's own shadow, WITHOUT its children's shadows.
 java.awt.geom.AffineTransform getTransform()
          Returns a copy of the current transform.
 java.awt.geom.AffineTransform getTransformFrom(LiteContainer l)
           
 java.awt.geom.AffineTransform getTransformNoCopy()
          Returns the current transform.
 boolean isVisible()
           
 void migrateBack()
          Utility method for moving a lite back to its original parent.
 void migrateTo(LiteContainer newParent)
          Utility method for moving temporarily a lite in another parent.
 void paint_old(java.awt.Graphics2D g)
          Called by immediate parent
 void paint(java.awt.Graphics2D g)
          Called by immediate parent
protected  void paintChildren(java.awt.Graphics2D g)
          Useful methods for composite Lite
 void paintShadows(java.awt.Graphics2D g)
          This paints all shadows for lite objects implementing Shadow interface.
 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.
protected  boolean pickChildren(java.awt.Graphics2D g, java.awt.geom.Rectangle2D rect, int strategy, PickedList picked)
          Picks this object's children.
 void preConcatenate(java.awt.geom.AffineTransform t)
           
 void setContext(LiteContext c)
           
protected  void setParent(LiteContainer par)
           
 void setTransform(java.awt.geom.AffineTransform t)
           
 void setVisible(boolean visible)
           
 int size()
          Don't subclass.
 java.lang.String toString()
           
static java.awt.geom.Rectangle2D transformBounds(java.awt.geom.Rectangle2D bounds, java.awt.geom.AffineTransform at)
           
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, 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
 

Field Detail

model

public java.lang.Object model

PICK_INTER

public static final int PICK_INTER
Intersection geometrical strategy for picking.

See Also:
Constant Field Values

PICK_INSIDE

public static final int PICK_INSIDE
Inside geometrical strategy for picking.

See Also:
Constant Field Values

PICK_DEEPEST

public static final int PICK_DEEPEST
Deepest depth strategy for picking.

See Also:
Constant Field Values

PICK_FIRST

public static final int PICK_FIRST
First depth strategy for picking.

See Also:
Constant Field Values

PICK_ALL

public static final int PICK_ALL
All depth strategy for picking.

See Also:
Constant Field Values

PICK_ACTIVEBOUNDS

public static final int PICK_ACTIVEBOUNDS
See Also:
Constant Field Values

PICK_GRAPHBOUNDS

public static final int PICK_GRAPHBOUNDS
See Also:
Constant Field Values

PICK_MANIPULABLE

public static final int PICK_MANIPULABLE
See Also:
Constant Field Values

parent

protected LiteContainer parent

oldParent

protected LiteContainer oldParent

visible

protected boolean visible
Constructor Detail

Lite

public Lite()
Method Detail

changeTransform

public void changeTransform(java.awt.geom.AffineTransform t)

concatenate

public void concatenate(java.awt.geom.AffineTransform t)

context

public LiteContext context()

dist

protected static double dist(java.awt.geom.Rectangle2D r1,
                             java.awt.geom.Rectangle2D r2)

doPaint

public abstract void doPaint(java.awt.Graphics2D g)
Include painting code here.

Call PaintChildren if Lite object is a container.


equals

public boolean equals(java.lang.Object l)

get

public java.lang.Object get(int index)
Don't subclass.

Read-only abstract lists must implement get(int index) and size() methods. set(int, Object) method throws an UnsupportedOperation exception.


getActiveBounds

public java.awt.geom.Rectangle2D getActiveBounds()

getActiveBoundsFrom

public java.awt.geom.Rectangle2D getActiveBoundsFrom(LiteContainer l)

getAncestor

public final LiteContainer getAncestor()

getAncestor

public final LiteContainer getAncestor(java.lang.Class ancestorClass)

getBounds

public abstract java.awt.geom.Rectangle2D getBounds()
Returns the bounds of the Lite object in its own coordinate system. Warning : don't change the Rectangle2D returned. Instead, work on a copy.


getBoundsFrom

public java.awt.geom.Rectangle2D getBoundsFrom(LiteContainer l)

getBoundsFromNoCorrect

protected java.awt.geom.Rectangle2D getBoundsFromNoCorrect(LiteContainer l)

getCommonAncestor

public static LiteContainer getCommonAncestor(Lite l1,
                                              Lite l2)
Utility method used to retreive the nearest common ancestor of two lite objects.


getGhost

public LiteGhost getGhost(int maxDepth)

getGhost_old

public LiteGhost_old getGhost_old()

getGhostPath

public java.awt.geom.GeneralPath getGhostPath(int maxDepth)
This method returns the ghost shape of this object. (implemented here for debug reasons).

By default, this method returns the path iterator of this object's bounds and appends its children's ghost path.

See Also:
#getChildrenGhostPath()

getChildrenGhostPath

public java.awt.geom.GeneralPath getChildrenGhostPath(int maxDepth)
Returns the ghost path of all this object's children, transformed in the current coordinates system.

Used by the default implementation of getGhostPath().


getParent

public LiteContainer getParent()

getShadow

public java.awt.Shape getShadow()
Returns this lite's own shadow, WITHOUT its children's shadows.

By default, this method returns null. If you want your object to cast shadows, subclass it and return your shadow's shape (the most simple is getBounds()). Be careful : your shadow must stay inside lite's bounds.


getTransform

public java.awt.geom.AffineTransform getTransform()
Returns a copy of the current transform.


getTransformNoCopy

public java.awt.geom.AffineTransform getTransformNoCopy()
Returns the current transform.


getTransformFrom

public java.awt.geom.AffineTransform getTransformFrom(LiteContainer l)

isVisible

public boolean isVisible()

migrateBack

public void migrateBack()
Utility method for moving a lite back to its original parent. Creation date: (07/06/00 15:18:20)

See Also:
migrateTo(fr.emn.lite.LiteContainer)

migrateTo

public void migrateTo(LiteContainer newParent)
Utility method for moving temporarily a lite in another parent. Creation date: (07/06/00 15:18:20)

Parameters:
newParent - fr.emn.lite.Lite
See Also:
migrateBack()

paint

public void paint(java.awt.Graphics2D g)
Called by immediate parent


paint_old

public void paint_old(java.awt.Graphics2D g)
Called by immediate parent


paintChildren

protected void paintChildren(java.awt.Graphics2D g)
Useful methods for composite Lite


paintShadows

public void paintShadows(java.awt.Graphics2D g)
This paints all shadows for lite objects implementing Shadow interface.


pick

public 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.

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

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.

pickChildren

protected boolean pickChildren(java.awt.Graphics2D g,
                               java.awt.geom.Rectangle2D rect,
                               int strategy,
                               PickedList picked)
Picks this object's children.

Parameters:
rect - The picking rectangle.
strategy - The picking strategy to be used.
picked - If this argument is not null, picked objects are added to this list.

preConcatenate

public void preConcatenate(java.awt.geom.AffineTransform t)

setContext

public void setContext(LiteContext c)

setParent

protected void setParent(LiteContainer par)

setTransform

public void setTransform(java.awt.geom.AffineTransform t)

setVisible

public void setVisible(boolean visible)

size

public int size()
Don't subclass.

Read-only abstract lists must implement get(int index) and size() methods. set(int, Object) method throws an UnsupportedOperation exception.


toString

public java.lang.String toString()

transformBounds

public static java.awt.geom.Rectangle2D transformBounds(java.awt.geom.Rectangle2D bounds,
                                                        java.awt.geom.AffineTransform at)