|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjpicedt.graphic.model.AbstractElement
An abstract class that can serve as the basis class for elements of a Drawing.
This implementation provides some useful behaviour where the integration of Element's in a tree-model is concerned.
Field Summary | |
protected PicAttributeSet |
attributeSet
the attribute set |
protected Element |
parent
the parent of this element |
protected View |
view
the view that render this element |
Constructor Summary | |
AbstractElement()
construct an AbstractElement with no parent and a default PicAttributeSet |
|
AbstractElement(AbstractElement obj)
cloning constructor ; attribute set is deeply copied. |
|
AbstractElement(PicAttributeSet attributeSet)
construct an AbstractElement with no parent and the given PicAttributeSet. |
Method Summary | |
PointIndexIterator |
anchorPointsIterator()
Create an Iterator over points that can serve as anchor points for grid alignment. |
abstract Object |
clone()
Returns a clone of this Element |
protected void |
fireChangedUpdate(DrawingEvent.EventType eventType)
Must be called each time this AbstractElement changes. |
Object |
getAttribute(PicAttributeName name)
Returns the value for the given attribute name |
PicAttributeSet |
getAttributeSet()
Returns the AttributeSet bound to this AbstractElement. |
Drawing |
getDrawing()
Retrieves the underlying drawing |
Element |
getParent()
Gets the parent of the element. |
View |
getView()
Returns the View that's responsible for rendering this AbstractElement |
void |
removeView()
remove the view that render this element ; this may be used to remove any reference to the view, and render it eligible for garbage collection ; if no View, does nothing. |
void |
scale(PicPoint ptOrg,
double sx,
double sy)
Scale this object by (sx,sy) using ptOrg as origin sx and sy can be negative. |
void |
setAttribute(PicAttributeName name,
Object value)
Set the given attribute name to the given value for this AbstractElement |
void |
setAttributeSet(PicAttributeSet attributeSet)
Bind the given attributes set to this Element. |
void |
setParent(Element p)
Sets the parent of this element to be the given element. |
void |
setViewFromFactory(ViewFactory f)
set the view for this AbstractElement from the given view factory or remove the view if f is null. |
String |
toString()
Returns a String representation of the attribute set for this AbstractElement |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jpicedt.graphic.model.Element |
forwardChangedUpdate, getAllowsChildren, getBoundingBox, getFirstPointIndex, getLastPointIndex, getName, getPoint, getPointX, getPointY, rotate, scale, setPoint, setPoint, shear, translate |
Field Detail |
protected Element parent
protected PicAttributeSet attributeSet
protected View view
Constructor Detail |
public AbstractElement()
public AbstractElement(PicAttributeSet attributeSet)
public AbstractElement(AbstractElement obj)
Method Detail |
public abstract Object clone()
clone
in interface Element
public Drawing getDrawing()
getDrawing
in interface Element
public Element getParent()
getParent
in interface Element
public void setParent(Element p)
setParent
in interface Element
protected void fireChangedUpdate(DrawingEvent.EventType eventType)
forwardChangedUpdate(this)
on the Element's parent, if any.
super.fireChangeUpdate
.
public PointIndexIterator anchorPointsIterator()
anchorPointsIterator
in interface Element
public void scale(PicPoint ptOrg, double sx, double sy)
scale(double,double,double,double)
.
scale
in interface Element
public View getView()
getView
in interface Element
public void setViewFromFactory(ViewFactory f)
setViewFromFactory
in interface Element
public void removeView()
removeView
in interface Element
public PicAttributeSet getAttributeSet()
Be careful that modifying attributes using this method does not fire any DrawingEvent's, hence does not keep the view synchronized with the state of the model.
getAttributeSet
in interface Element
public void setAttributeSet(PicAttributeSet attributeSet)
setAttributeSet
in interface Element
attributeSet
- a new AttributeSet for this Element ; this actually make a deep copy of the
given attribute set beforehands.public void setAttribute(PicAttributeName name, Object value)
setAttribute
in interface Element
public Object getAttribute(PicAttributeName name)
getAttribute
in interface Element
public String toString()
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |