|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjpicedt.graphic.model.AbstractElement
jpicedt.graphic.model.BranchElement
jpicedt.graphic.model.Drawing.RootElement
public class Drawing.RootElement
The Element that is the root of the tree of Element's in this
Drawing. Children can be directly added to this RootElement (i.e. instead of
using the Drawing API), since changed-update are always forwarded to the hosting drawing.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jpicedt.graphic.model.BranchElement |
|---|
BranchElement.CompoundMode |
| Field Summary |
|---|
| Fields inherited from class jpicedt.graphic.model.BranchElement |
|---|
changeLock, children, compoundMode, DEFAULT_LIFTPEN, isPathClosed, liftPen, ptsX, ptsY, shape |
| Fields inherited from class jpicedt.graphic.model.AbstractElement |
|---|
attributeSet, name, parent, view |
| Constructor Summary | |
|---|---|
Drawing.RootElement()
Construct a new empty RootElement |
|
Drawing.RootElement(BranchElement e)
construct a new RootElement whose content is initialized from the content of the given
BranchElement Children are cloned beforehands, so it's perfectly safe to use this constructor when
one doesn't want to modify the initial content of the given BranchElement. |
|
Drawing.RootElement(Collection<Element> c)
Create a new BranchElement from the content of the given Collection of
Element's. |
|
| Method Summary | |
|---|---|
Drawing.RootElement |
clone()
Returns a clone of this Element |
protected void |
fireChangedUpdate(DrawingEvent.EventType eventType)
Called each time the content of this RootElement has changed. |
void |
forwardChangedUpdate(Element child,
DrawingEvent.EventType eventType)
Called by a child to inform of some change that occured to it or one of its children. |
Drawing.BoundingBox |
getBoundingBox()
|
PicPoint |
getCtrlPt(int numPoint,
PicPoint src)
return null |
String |
getDefaultName()
|
Drawing |
getDrawing()
Retrieves the underlying drawing Overriden to return this. |
int |
getFirstPointIndex()
Return 0 |
int |
getLastPointIndex()
Return 0 |
String |
getName()
Return a non-localised string representing this element's name. |
BranchElement |
getParent()
Gets the parent of the element. |
void |
setCtrlPt(int numPoint,
PicPoint src,
EditPointConstraint c)
does nothing |
void |
setParent(BranchElement p)
Sets the parent of the element. |
void |
setViewFromFactory(ViewFactory f)
set the view for this Element from the given view factory, then set the view for children. |
| Methods inherited from class jpicedt.graphic.model.BranchElement |
|---|
add, add, addAll, addAll, bringBackward, bringForward, bringToBack, bringToFront, clear, closePath, contains, containsAll, containsClass, createFilteredCollection, createShape, equals, get, getBoundingBox, getCompoundMode, getCtrlPtSubset, getCtrlPtX, getCtrlPtY, getLiftPen, hashCode, indexOf, isEmpty, isPathClosed, isToBack, isToFront, iterator, lastIndexOf, listIterator, listIterator, mirror, openPath, remove, remove, removeAll, removeView, replace, retainAll, rotate, scale, set, setAttribute, setAttributeSet, setCompoundMode, setCtrlPt, setLiftPen, shear, shear, size, subList, syncArrowGeometry, toArray, toArray, toggleCompoundMode, togglePathClosure, toString, translate, updateBoundingBox |
| Methods inherited from class jpicedt.graphic.model.AbstractElement |
|---|
anchorPointsIterator, createActions, getAttribute, getAttributeSet, getView, pullOutOfGroup, replaceBy, scale, scale, scale, setName |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Drawing.RootElement()
public Drawing.RootElement(BranchElement e)
RootElement whose content is initialized from the content of the given
BranchElement Children are cloned beforehands, so it's perfectly safe to use this constructor when
one doesn't want to modify the initial content of the given BranchElement.
e - The Drawing object to clonepublic Drawing.RootElement(Collection<Element> c)
BranchElement from the content of the given Collection of
Element's. Children are cloned as well (i.e. this is a deep copy).
| Method Detail |
|---|
public Drawing.BoundingBox getBoundingBox()
public String getDefaultName()
getDefaultName in class BranchElementpublic String getName()
Element
getName in interface ElementgetName in class AbstractElementpublic Drawing.RootElement clone()
AbstractElement
clone in interface Elementclone in class BranchElementpublic Drawing getDrawing()
getDrawing in interface ElementgetDrawing in class AbstractElementAbstractElement doesn't belong to any drawing yet.public BranchElement getParent()
getParent in interface ElementgetParent in class AbstractElementpublic void setParent(BranchElement p)
setParent in interface ElementsetParent in class AbstractElementp - The parent to be set for this element.protected void fireChangedUpdate(DrawingEvent.EventType eventType)
fireChangedUpdate in class AbstractElementeventType - the event type
public void forwardChangedUpdate(Element child,
DrawingEvent.EventType eventType)
child as the element that changed.
This mainly occurs when the geometry of an element is modified.
forwardChangedUpdate in class BranchElementeventType - the event type
public PicPoint getCtrlPt(int numPoint,
PicPoint src)
getCtrlPt in interface ElementgetCtrlPt in class BranchElementnumPoint - the point index, should be greater or equal to the value returned by
getFirstPointIndex, and lower or equal to getLastPointIndex.
numPoint ;
if src is null, allocates a new PicPoint and return it,
otherwise directly modifies src and returns it as well for convenience.
public void setCtrlPt(int numPoint,
PicPoint src,
EditPointConstraint c)
setCtrlPt in interface ElementsetCtrlPt in class BranchElementc - a geometry constraint, or null if no particular constraint is being imposed (aka default).public int getFirstPointIndex()
getFirstPointIndex in interface ElementgetFirstPointIndex in class BranchElementgetCtrlPt.
This returns PT_ANCHOR.public int getLastPointIndex()
getLastPointIndex in interface ElementgetLastPointIndex in class BranchElementpublic void setViewFromFactory(ViewFactory f)
setViewFromFactory in interface ElementsetViewFromFactory in class BranchElement
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||