org.vectomatic.common.model
Class Shape

java.lang.Object
  extended by org.vectomatic.common.model.Shape
All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
Direct Known Subclasses:
Ellipse, Path, Polyline, Rect, ShapeGroup

public abstract class Shape
extends Object
implements com.google.gwt.user.client.rpc.IsSerializable

Base class for geometric shapes

Author:
Lukas Laag

Field Summary
protected  Map<Attribute,IAttributeValue> _attributes
          A map of attribute, attribute values.
protected  BoundingBox _bbox
           
protected  boolean _dirty
           
protected  int _id
           
protected  TransformMatrix _m
           
protected  DrawingModel _model
           
protected  float _r
           
protected  Point _s
           
protected  Point _t
           
 
Constructor Summary
Shape()
           
Shape(Shape shape)
           
 
Method Summary
abstract  void acceptVisitor(IShapeVisitor visitor)
           
 IAttributeValue clearAttribute(Attribute attr)
           
 void copyAttributes(Shape src)
           
 boolean definesAttribute(Attribute attr)
           
 IAttributeValue getAttribute(Attribute attr)
           
 BoundingBox getBoundingBox()
           
 Set<Attribute> getDefinedAttributes()
           
 DrawingModel getModel()
           
 float getRotation()
           
 Point getScaling(Point s)
           
 TransformMatrix getTransform()
           
 Point getTranslation(Point t)
           
abstract  boolean isSame(Shape shape)
          Returns true if the specified shape has the same geometrical and styling properties as this shape, false otherwise.
 IAttributeValue setAttribute(Attribute attr, IAttributeValue value)
           
 void setModel(DrawingModel model)
           
 void setRotation(float r)
           
 void setScaling(Point s)
           
 void setTransform(TransformMatrix m)
           
 void setTranslation(Point t)
           
protected  void updateTransform()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_model

protected transient DrawingModel _model

_id

protected int _id

_r

protected float _r

_s

protected Point _s

_t

protected Point _t

_dirty

protected transient boolean _dirty

_m

protected transient TransformMatrix _m

_bbox

protected BoundingBox _bbox

_attributes

protected Map<Attribute,IAttributeValue> _attributes
A map of attribute, attribute values.

Constructor Detail

Shape

public Shape()

Shape

public Shape(Shape shape)
Method Detail

getRotation

public float getRotation()

setRotation

public void setRotation(float r)

getScaling

public Point getScaling(Point s)

setScaling

public void setScaling(Point s)

getTranslation

public Point getTranslation(Point t)

setTranslation

public void setTranslation(Point t)

getTransform

public TransformMatrix getTransform()

setTransform

public void setTransform(TransformMatrix m)

updateTransform

protected void updateTransform()

getBoundingBox

public BoundingBox getBoundingBox()

getModel

public DrawingModel getModel()

setModel

public void setModel(DrawingModel model)

getAttribute

public IAttributeValue getAttribute(Attribute attr)

setAttribute

public IAttributeValue setAttribute(Attribute attr,
                                    IAttributeValue value)

clearAttribute

public IAttributeValue clearAttribute(Attribute attr)

getDefinedAttributes

public Set<Attribute> getDefinedAttributes()

definesAttribute

public boolean definesAttribute(Attribute attr)

copyAttributes

public void copyAttributes(Shape src)

acceptVisitor

public abstract void acceptVisitor(IShapeVisitor visitor)

isSame

public abstract boolean isSame(Shape shape)
Returns true if the specified shape has the same geometrical and styling properties as this shape, false otherwise.

Parameters:
shape - A shape
Returns:
True if the specified shape has the same geometrical and styling properties as this shape, false otherwise.


Copyright © 2010. All Rights Reserved.