|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjpicedt.graphic.model.AbstractElement
public abstract class 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 String |
name
the name of this element, if set by the user |
protected BranchElement |
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 AbstractElement |
clone()
Returns a clone of this Element |
|
ArrayList<PEAction> |
createActions(ActionDispatcher actionDispatcher,
ActionLocalizer localizer,
HitInfo hi)
Creates an array of Action's related to this object |
|
Shape |
createShape()
Creates a Shape that reflects the geometry of this model. |
|
protected void |
fireChangedUpdate(DrawingEvent.EventType eventType)
Must be called each time this AbstractElement changes. |
|
|
getAttribute(PicAttributeName<T> name)
Returns the value for the given attribute name |
|
PicAttributeSet |
getAttributeSet()
Returns the AttributeSet bound to this AbstractElement. |
|
CtrlPtSubset |
getCtrlPtSubset(ConvexZoneGroup csg,
BitSet czExtension)
Renvoie un la partie des points de contrôle qui satisfont à l'un des deux critères suivants: ceux compris dans l'ensemble de zones convexes csg, et
ceux en relation avec les points de contrôle satisfaisant au première critère selon une relation
définies par czExtension
|
|
protected abstract String |
getDefaultName()
|
|
Drawing |
getDrawing()
Retrieves the underlying drawing |
|
String |
getName()
Return a non-localised string representing this element's name. |
|
BranchElement |
getParent()
Gets the parent of the element. |
|
View |
getView()
Returns the View that's responsible for rendering this AbstractElement |
|
boolean |
pullOutOfGroup()
If this element's parent is a PicGroup, pull it out this PicGroup, and add it
to its grand-parent as a sibling of this PicGroup. |
|
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 |
replaceBy(Element by,
boolean replaceInSelection)
Une implantation de Element.replaceBy(Element by, boolean replaceInSelection). |
|
void |
scale(double ptOrgX,
double ptOrgY,
double sx,
double sy)
Dilate cet élément par (sx,sy) en utilisant (ptOrgX, ptOrgY) comme
origine ; sx ou sy peuvent être négatifs. |
|
void |
scale(PicPoint ptOrg,
double sx,
double sy)
Dilate cet élément par (sx,sy) en utilisant ptOrg comme origine ;
sx ou sy peuvent être négatifs. |
|
void |
scale(PicPoint ptOrg,
double sx,
double sy,
UserConfirmationCache ucc)
Dilate cet élément par (sx,sy) en utilisant ptOrg comme origine ;
sx ou sy peuvent être négatifs. |
|
|
setAttribute(PicAttributeName<T> name,
T 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 |
setCtrlPt(int index,
PicPoint pt)
convenience call to setCtrlPt(int, PicPoint, null) |
|
void |
setName(String name)
Sets the name of this object. |
|
void |
setParent(BranchElement 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. |
|
void |
shear(PicPoint ptOrg,
double shx,
double shy)
Cisaille cet élément par (shx,shy) en utilisant ptOrg comme origine. |
|
void |
syncArrowGeometry(ArrowView v,
ArrowView.Direction d)
Helper for the associated View. |
|
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 |
|---|
getBoundingBox, getCtrlPt, getFirstPointIndex, getLastPointIndex, mirror, rotate, scale, setCtrlPt, shear, translate |
| Field Detail |
|---|
protected String name
protected BranchElement parent
protected PicAttributeSet attributeSet
protected View view
| Constructor Detail |
|---|
public AbstractElement()
AbstractElement with no parent and a default PicAttributeSet
public AbstractElement(PicAttributeSet attributeSet)
AbstractElement with no parent and the given PicAttributeSet.
public AbstractElement(AbstractElement obj)
| Method Detail |
|---|
public abstract AbstractElement clone()
clone in interface Elementclone in class Objectpublic String getName()
Element
getName in interface Elementpublic void setName(String name)
name - if null, reverts to the default name.protected abstract String getDefaultName()
public Drawing getDrawing()
getDrawing in interface ElementAbstractElement doesn't belong to any drawing yet.public BranchElement getParent()
getParent in interface Element
public void replaceBy(Element by,
boolean replaceInSelection)
Element.replaceBy(Element by, boolean replaceInSelection).
replaceBy in interface Elementby - l'Element servant de remplacement.replaceInSelection - indique que this est également à remplacer dans la selection.public void setParent(BranchElement p)
setParent in interface Elementp - The parent to be set for this element.public boolean pullOutOfGroup()
PicGroup, pull it out this PicGroup, and add it
to its grand-parent as a sibling of this PicGroup.
protected void fireChangedUpdate(DrawingEvent.EventType eventType)
AbstractElement changes. This default implementation
updates the associated View if any, then propagates upward along the tree by calling
forwardChangedUpdate(this) on the Element's parent, if any.
super.fireChangeUpdate.
eventType - the event type
public void setCtrlPt(int index,
PicPoint pt)
setCtrlPt(int, PicPoint, null)
setCtrlPt in interface Elementpublic PointIndexIterator anchorPointsIterator()
DefaultPointIndexIterator which simply iterates through all user-controlled
points in ascending order.
anchorPointsIterator in interface Element
public void scale(PicPoint ptOrg,
double sx,
double sy,
UserConfirmationCache ucc)
(sx,sy) en utilisant ptOrg comme origine ;
sx ou sy peuvent être négatifs. Ceci est une commodité d'appel de
scale(ptOrg.x, ptOrg.y, sx, sy,ucc).
scale in interface Element
public void scale(PicPoint ptOrg,
double sx,
double sy)
(sx,sy) en utilisant ptOrg comme origine ;
sx ou sy peuvent être négatifs. Ceci est une commodité d'appel de
scale(ptOrg.x, ptOrg.y, sx, sy,UserConfirmationCache.DEFAULT).
scale in interface Element
public void scale(double ptOrgX,
double ptOrgY,
double sx,
double sy)
(sx,sy) en utilisant (ptOrgX, ptOrgY) comme
origine ; sx ou sy peuvent être négatifs. Ceci est une commodité d'appel
de scale(ptOrgX, ptOrgY, sx, sy,UserConfirmationCache.DEFAULT).
scale in interface Element
public void shear(PicPoint ptOrg,
double shx,
double shy)
(shx,shy) en utilisant ptOrg comme origine.
Ceci est une commodité d'appel de
shear(ptOrg, shx, shy,UserConfirmationCache.DEFAULT).
shear in interface Elementpublic View getView()
AbstractElement
getView in interface Elementpublic void setViewFromFactory(ViewFactory f)
AbstractElement from the given view factory
or remove the view if f is null.
setViewFromFactory in interface Elementpublic void removeView()
removeView in interface Elementpublic Shape createShape()
createShape in interface Element
public void syncArrowGeometry(ArrowView v,
ArrowView.Direction d)
View. This implementation does nothing by default.
syncArrowGeometry in interface Elementpublic PicAttributeSet getAttributeSet()
AttributeSet bound to this AbstractElement.
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 Elementpublic void setAttributeSet(PicAttributeSet attributeSet)
Element. This implementation actually makes a deep
copy of the given set beforehands.
setAttributeSet in interface Element
public <T> void setAttribute(PicAttributeName<T> name,
T value)
setAttribute in interface Elementpublic <T> T getAttribute(PicAttributeName<T> name)
getAttribute in interface Elementpublic String toString()
String representation of the attribute set for this AbstractElement
toString in class Object
public CtrlPtSubset getCtrlPtSubset(ConvexZoneGroup csg,
BitSet czExtension)
Elementcsg, et
czExtension
getCtrlPtSubset in interface Elementcsg - un ensemble de zones convexesczExtension - un BitSet permettant d'étendre l'ensemble des points de contrôle
compris dans l'ensemble de zones convexes csg. La signification des bit est selon
l'énuméré CtrlPtSubset.CZExtension.
nulljpicedt.graphic.model
public ArrayList<PEAction> createActions(ActionDispatcher actionDispatcher,
ActionLocalizer localizer,
HitInfo hi)
Action's related to this object
createActions in interface ActionFactoryactionDispatcher - répartiteur utilisé pour créer unePEActionlocalizer - utilisé pour localiser les paramètre des actionshi - une HitInfo contenant les informations relatives à l'évènement-souris qui a
déclencher le menu contextuel.
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||