com.davisor.graphics
Class IndirectAnnotatedShape

java.lang.Object
  extended bycom.davisor.core.Wrapper
      extended bycom.davisor.graphics.IndirectAnnotatedShape
All Implemented Interfaces:
com.davisor.core.Annotated, AnnotatedShape, com.davisor.core.Dupable, java.io.Serializable, java.awt.Shape
Direct Known Subclasses:
IndirectAnnotatedSerializableShape

public class IndirectAnnotatedShape
extends com.davisor.core.Wrapper
implements AnnotatedShape

IndirectAnnotatedShape implements a simple wrapper that associates annotation information to a Shape.

Since:
JDK1.3
See Also:
getProperties(), Serialized Form

Field Summary
protected  int M_channelIndex
          Annotation channel index assosiated with the wrapped paint.
protected  short M_contextIndex
          Annotation context index assosiated with the wrapped paint.
protected  long M_elementIndex
          Annotation element index assosiated with the wrapped paint.
protected  java.lang.String M_id
          Annotation description assosiated with the wrapped paint.
protected  java.util.Properties M_properties
          Annotation attributes associated with the wrapped paint.
 
Fields inherited from class com.davisor.core.Wrapper
M_object
 
Constructor Summary
IndirectAnnotatedShape(IndirectAnnotatedShape ias)
          Deep copy constructor.
IndirectAnnotatedShape(java.awt.Shape shape, com.davisor.core.Annotated annotation)
          Creates a new annotated shape.
IndirectAnnotatedShape(java.awt.Shape shape, java.util.Properties properties, long elementIndex, int channelIndex, short contextIndex)
          Creates a new annotated shape.
IndirectAnnotatedShape(java.awt.Shape shape, java.util.Properties properties, long elementIndex, int channelIndex, short contextIndex, java.lang.String id)
          Deprecated. explicit identity strings are obsolete
 
Method Summary
 boolean contains(double x, double y)
           
 boolean contains(double x, double y, double w, double h)
           
 boolean contains(java.awt.geom.Point2D p)
           
 boolean contains(java.awt.geom.Rectangle2D r)
           
 com.davisor.core.Dupable dup()
          Makes a deep copy of this object.
 boolean equals(java.lang.Object o)
          Tests if this object is equal with another.
 java.lang.String getAddress()
          Deprecated. Use getProperty(java.lang.String) instead (with arg "href")
 java.awt.Rectangle getBounds()
           
 java.awt.geom.Rectangle2D getBounds2D()
           
 int getChannelIndex()
          Returns the channel index of this shape.
 short getContextIndex()
          Returns the context index of this shape.
 java.lang.String getDescription()
          Deprecated. Use getProperty(java.lang.String) instead (with arg "alt")
 long getElementIndex()
          Returns the element index of this shape.
 java.lang.String getID()
          Returns the identity of this shape.
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
           
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at, double flatness)
           
 java.util.Properties getProperties()
          Returns annotation attributes as property set.
 java.lang.String getProperty(java.lang.String name)
          Returns the value of the asked property or null
 java.awt.Shape getShape()
          Gets a reference to underlying shape object.
 java.lang.String getTarget()
          Deprecated. Use getProperty(java.lang.String) instead (with arg "target")
 int hashCode()
          Computes hash code for this object.
 boolean intersects(double x, double y, double w, double h)
           
 boolean intersects(java.awt.geom.Rectangle2D r)
           
 java.lang.String toString()
          Gets the string representation of this object.
 
Methods inherited from class com.davisor.core.Wrapper
getObject, isNull
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

M_channelIndex

protected int M_channelIndex
Annotation channel index assosiated with the wrapped paint.


M_contextIndex

protected short M_contextIndex
Annotation context index assosiated with the wrapped paint.


M_elementIndex

protected long M_elementIndex
Annotation element index assosiated with the wrapped paint.


M_id

protected java.lang.String M_id
Annotation description assosiated with the wrapped paint.


M_properties

protected java.util.Properties M_properties
Annotation attributes associated with the wrapped paint.

Constructor Detail

IndirectAnnotatedShape

public IndirectAnnotatedShape(IndirectAnnotatedShape ias)
Deep copy constructor.

Parameters:
ias - indirect annotated shape to be copied
See Also:
dup(), Dupable

IndirectAnnotatedShape

public IndirectAnnotatedShape(java.awt.Shape shape,
                              com.davisor.core.Annotated annotation)
Creates a new annotated shape.

Parameters:
shape - shape to be annotated
annotation - annotation information the shape is to be annotated with

IndirectAnnotatedShape

public IndirectAnnotatedShape(java.awt.Shape shape,
                              java.util.Properties properties,
                              long elementIndex,
                              int channelIndex,
                              short contextIndex)
Creates a new annotated shape.

Parameters:
shape - shape to be annotated
properties - annotation attributes (may be null)
elementIndex - annotation element index
channelIndex - annotation channel index
contextIndex - annotation context index

IndirectAnnotatedShape

public IndirectAnnotatedShape(java.awt.Shape shape,
                              java.util.Properties properties,
                              long elementIndex,
                              int channelIndex,
                              short contextIndex,
                              java.lang.String id)
Deprecated. explicit identity strings are obsolete

Creates a new annotated shape.

Parameters:
shape - shape to be annotated
properties - annotation attributes (may be null)
elementIndex - annotation element index
channelIndex - annotation channel index
contextIndex - annotation context index
id - shapeidentity (may be null)
Method Detail

getAddress

public java.lang.String getAddress()
Deprecated. Use getProperty(java.lang.String) instead (with arg "href")

Gets the annotation address assosiated to this object.

Specified by:
getAddress in interface com.davisor.core.Annotated

getDescription

public java.lang.String getDescription()
Deprecated. Use getProperty(java.lang.String) instead (with arg "alt")

Gets the annotation description assosiated to this object.

Specified by:
getDescription in interface com.davisor.core.Annotated

getChannelIndex

public int getChannelIndex()
Returns the channel index of this shape.

Specified by:
getChannelIndex in interface com.davisor.core.Annotated

getContextIndex

public short getContextIndex()
Returns the context index of this shape.

Specified by:
getContextIndex in interface com.davisor.core.Annotated

getElementIndex

public long getElementIndex()
Returns the element index of this shape.

Specified by:
getElementIndex in interface com.davisor.core.Annotated

getID

public java.lang.String getID()
Returns the identity of this shape.

Specified by:
getID in interface com.davisor.core.Annotated

getProperties

public java.util.Properties getProperties()
Returns annotation attributes as property set.

Specified by:
getProperties in interface com.davisor.core.Annotated

getProperty

public java.lang.String getProperty(java.lang.String name)
Returns the value of the asked property or null

Specified by:
getProperty in interface com.davisor.core.Annotated

getTarget

public java.lang.String getTarget()
Deprecated. Use getProperty(java.lang.String) instead (with arg "target")

Gets the annotation target frame assosiated to this object.

Specified by:
getTarget in interface com.davisor.core.Annotated

dup

public com.davisor.core.Dupable dup()
                             throws com.davisor.core.DupNotSupportedError
Makes a deep copy of this object.

Specified by:
dup in interface com.davisor.core.Dupable
Throws:
com.davisor.core.DupNotSupportedError - if the object can not be deep-copied.

equals

public boolean equals(java.lang.Object o)
Tests if this object is equal with another. Annoated shapes are equal if their super-classes are, and both share the same annotation information.

See Also:
Compare.equals(Object,Object)

hashCode

public int hashCode()
Computes hash code for this object.

See Also:
Compare.hashCode(Object)

toString

public java.lang.String toString()
Gets the string representation of this object.


getShape

public java.awt.Shape getShape()
Gets a reference to underlying shape object.

See Also:
Wrapper.getObject()

contains

public boolean contains(double x,
                        double y)
Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(java.awt.geom.Point2D p)
Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(java.awt.geom.Rectangle2D r)
Specified by:
contains in interface java.awt.Shape

getBounds

public java.awt.Rectangle getBounds()
Specified by:
getBounds in interface java.awt.Shape

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D()
Specified by:
getBounds2D in interface java.awt.Shape

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
Specified by:
getPathIterator in interface java.awt.Shape

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at,
                                                  double flatness)
Specified by:
getPathIterator in interface java.awt.Shape

intersects

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Specified by:
intersects in interface java.awt.Shape

intersects

public boolean intersects(java.awt.geom.Rectangle2D r)
Specified by:
intersects in interface java.awt.Shape


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.