diva.canvas
Class BasicZList.GSet

java.lang.Object
  extended by diva.canvas.BasicZList.GSet
All Implemented Interfaces:
FigureSet, GeometricSet
Direct Known Subclasses:
BasicZList.EnclosedGSet, BasicZList.IntersectedGSet
Enclosing class:
BasicZList

private abstract class BasicZList.GSet
extends java.lang.Object
implements GeometricSet

The abstract class of Geometric sets on a zlist. Note that if a figure covered by a geometric set is decorated, the set will contain the decorator, not the figure directly.


Field Summary
private  java.util.ArrayList _currentFigures
           
private  java.awt.geom.Rectangle2D _region
           
 
Constructor Summary
BasicZList.GSet(java.awt.geom.Rectangle2D region)
          Create a new set
 
Method Summary
abstract  boolean _contains(Figure f, java.awt.geom.Rectangle2D region)
          Test if the given figure is within this set
protected abstract  void _filter(java.util.ArrayList result, java.util.Iterator i, java.awt.geom.Rectangle2D region)
           
 boolean contains(Figure f)
          Test if the given figure is within the bounds of this region.
 java.util.Iterator figures()
          Return the figures in undefined order.
 java.util.Iterator figuresFromBack()
          Return the figures from highest index to lowest index.
 java.util.Iterator figuresFromFront()
          Return the figures from lowest index to highest index.
 java.awt.Shape getGeometry()
          Get the geometry.
 void setGeometry(java.awt.Shape geometry)
          Set the geometry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_region

private java.awt.geom.Rectangle2D _region

_currentFigures

private java.util.ArrayList _currentFigures
Constructor Detail

BasicZList.GSet

public BasicZList.GSet(java.awt.geom.Rectangle2D region)
Create a new set

Method Detail

contains

public boolean contains(Figure f)
Test if the given figure is within the bounds of this region.

Specified by:
contains in interface FigureSet

figures

public java.util.Iterator figures()
Return the figures in undefined order.

Specified by:
figures in interface FigureSet

figuresFromBack

public java.util.Iterator figuresFromBack()
Return the figures from highest index to lowest index.

Specified by:
figuresFromBack in interface FigureSet

figuresFromFront

public java.util.Iterator figuresFromFront()
Return the figures from lowest index to highest index.

Specified by:
figuresFromFront in interface FigureSet

getGeometry

public java.awt.Shape getGeometry()
Get the geometry.

Specified by:
getGeometry in interface GeometricSet

setGeometry

public void setGeometry(java.awt.Shape geometry)
Set the geometry. All previously-obtained iterators are invalid and must be discarded.

Specified by:
setGeometry in interface GeometricSet

_contains

public abstract boolean _contains(Figure f,
                                  java.awt.geom.Rectangle2D region)
Test if the given figure is within this set


_filter

protected abstract void _filter(java.util.ArrayList result,
                                java.util.Iterator i,
                                java.awt.geom.Rectangle2D region)