ach.vectorGraphics
Class ShapeList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.Vector
              extended byach.vectorGraphics.ShapeList
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable

public class ShapeList
extends java.util.Vector

ShapeList.java
Copyright (c) 2002-2004 Helge Hackbarth, All Rights Reserved.
A list containg vector graphic objects e.g. used for annotations.

THE AUTHOR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THE AUTHOR SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ShapeList()
          Simple Constructor.
ShapeList(ShapeList sl)
          Constructs a new ShapeList that is a copy of the specified ShapeList object.
 
Method Summary
 void applyBounds(java.awt.Rectangle bounds)
          Set a new rectangular affine transformation for all objects in the shapelist.
 void applyQuadrantRotation(int rotationIndex)
          Apply quadrant rotation (1=90 degree, 2=180 degree, 3=270 degree).
 void drawAll(java.awt.Graphics g, boolean XORallowed)
          Draw all objects in the shapelist do a given Graphics.
 void drawAllXORmode(java.awt.Graphics g)
          Draw all objects in the shapelist do a given Graphics with forced XOR mode
 ach.vectorGraphics.Shape findContainingShape(java.awt.Point p)
          Find the topmost shape that contains the given point (the point with these coordinates is painted by the shape).
 ach.vectorGraphics.AffineTransform getAffineTransform()
          Get a copy of the current affine transformation applied to all shapes.
 java.awt.Rectangle getBounds()
          Get the Rectangle that was used to create the current affine transformation matrix
 ach.vectorGraphics.AffineTransform getOrientationTransform()
          Get a copy of the affine transformation representing the current view orientation.
 ShapeList getTaggedShapes()
          Get a ShapeList containing all elements currently tagged
 void incModCount()
          change modified state by virtually incrementing a modificcation counter
 boolean isModified()
          Return modified state
 void moveRelAll(int dx, int dy)
          Move all elements relative a given number of units using coordinates of the target system.
 void removeTaggedShapes()
          Remove all shapes which are currently tagged
 void resetModifiedState()
          Reset modified state to unmodified
 void setAffineTransformAll(ach.vectorGraphics.AffineTransform at)
          Set a new affine transformation for all objects in the shapelist.
 void setOrientationTransform(ach.vectorGraphics.AffineTransform at)
          Set a new affine transformation representing the current view orientation.
 void setTaggedAll(boolean tagged, java.awt.Graphics g)
          Set all objects of the shapelist "tagged" (marked) or "untagged"
 int taggedCount()
          Return the number of tagged elements
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

ShapeList

public ShapeList()
Simple Constructor.


ShapeList

public ShapeList(ShapeList sl)
Constructs a new ShapeList that is a copy of the specified ShapeList object. Only the list control structure is copied. The list elements (shapes) are still referenced to the original elements.

Method Detail

getOrientationTransform

public ach.vectorGraphics.AffineTransform getOrientationTransform()
Get a copy of the affine transformation representing the current view orientation.

Returns:
the affine transformation representing the current view orientation

setOrientationTransform

public void setOrientationTransform(ach.vectorGraphics.AffineTransform at)
Set a new affine transformation representing the current view orientation.

Parameters:
at - is the affine transformation representing the current view orientation

getAffineTransform

public ach.vectorGraphics.AffineTransform getAffineTransform()
Get a copy of the current affine transformation applied to all shapes.

Returns:
a copy of the current affine transformation applied to all shapes

setAffineTransformAll

public void setAffineTransformAll(ach.vectorGraphics.AffineTransform at)
Set a new affine transformation for all objects in the shapelist.

Parameters:
at - is an affine transformation

applyBounds

public void applyBounds(java.awt.Rectangle bounds)
Set a new rectangular affine transformation for all objects in the shapelist.

Parameters:
bounds - is a Rectangle used to create a new affine transformation matrix

applyQuadrantRotation

public void applyQuadrantRotation(int rotationIndex)
Apply quadrant rotation (1=90 degree, 2=180 degree, 3=270 degree).


getBounds

public java.awt.Rectangle getBounds()
Get the Rectangle that was used to create the current affine transformation matrix

Returns:
Rectangle that was used to create the current affine transformation matrix

drawAll

public void drawAll(java.awt.Graphics g,
                    boolean XORallowed)
Draw all objects in the shapelist do a given Graphics. The XOR mode setting of each object can be overridden by the parameter XORallowed (set false if used for printing)

Parameters:
g - is the Graphics context to be used for drawing
XORallowed - set false to override the individual drawing modes (e.g. if printing does not support XOR mode) to paint mode

drawAllXORmode

public void drawAllXORmode(java.awt.Graphics g)
Draw all objects in the shapelist do a given Graphics with forced XOR mode

Parameters:
g - is the Graphics context to be used for drawing

findContainingShape

public ach.vectorGraphics.Shape findContainingShape(java.awt.Point p)
Find the topmost shape that contains the given point (the point with these coordinates is painted by the shape).

Parameters:
p - Point to be checked which shape contains it
Returns:
Shape that was marked or null if no containing shape was found

setTaggedAll

public void setTaggedAll(boolean tagged,
                         java.awt.Graphics g)
Set all objects of the shapelist "tagged" (marked) or "untagged"

Parameters:
tagged - boolean controlling the tag state (true for tagged, false for untagged)
g - is the Graphics context to be used for drawing

taggedCount

public int taggedCount()
Return the number of tagged elements

Returns:
Number of tagged elements

getTaggedShapes

public ShapeList getTaggedShapes()
Get a ShapeList containing all elements currently tagged

Returns:
ShapeList containing all elements which are currently tagged

moveRelAll

public void moveRelAll(int dx,
                       int dy)
Move all elements relative a given number of units using coordinates of the target system.

Parameters:
dx - number of units (coordinates of the target system) to move horizontally
dy - number of units (coordinates of the target system) to move vertically

removeTaggedShapes

public void removeTaggedShapes()
Remove all shapes which are currently tagged


isModified

public boolean isModified()
Return modified state


resetModifiedState

public void resetModifiedState()
Reset modified state to unmodified


incModCount

public void incModCount()
change modified state by virtually incrementing a modificcation counter