|
|||||||||
Home >> All >> jpicedt >> graphic >> [ model overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
jpicedt.graphic.model
Interface Element

- All Superinterfaces:
- PicObjectConstants
- All Known Implementing Classes:
- AbstractElement
- public interface Element
- extends PicObjectConstants
An interface for graphic elements that can be added to a Drawing.
A graphic element is basically defined by :
- A set of control-point (sometimes called end-points) that specify their geometry
- An attribute set
- A parent and possibly children once the element has been added to a tree defining a model. This allows us to let the root element only hold state about the tree while still maintaining the ability for a child to retrieve this state at any time through a (possibly recursive) call to getParent.
[todo] add an "apply(Transform t)" method as replacement to "translate()" and "scale()", where Transform may possibly inherit from java.awt.geom.AffineTransform [syd : 5/8/2002]
- Since:
- PicEdt 1.0
Nested Class Summary | |
static interface |
Element.PointIterator
An iterator over PicPoint's. |
Field Summary |
Fields inherited from interface jpicedt.graphic.model.PicObjectConstants |
CROSSHATCH, CROSSHATCH_FILLED, DASH_OPAQUE, DASH_TRANSPARENT, DASH1, DASH2, DASH3, DASHED, DIMEN, DOT_SEP, DOT_SEP1, DOT_SEP2, DOT_SEP3, DOTTED, DOUBLE_COLOR, DOUBLE_LINE, DOUBLE_SEP, FILL_COLOR, FILL_STYLE, HATCH_ANGLE, HATCH_COLOR, HATCH_SEP, HATCH_WIDTH, HLINES, HLINES_FILLED, INNER, LEFT_ARROW, LINE_COLOR, LINE_STYLE, LINE_WIDTH, MaxAttributeNameIndex, MIDDLE, NONE, OUTER, POLYGON_DOTS, POLYGON_SOLID, POLYGON_STYLE, PS_POINT, RIGHT_ARROW, SHADOW, SHADOW_ANGLE, SHADOW_COLOR, SHADOW_SIZE, SOLID, VLINES, VLINES_FILLED |
Method Summary | |
Element.PointIterator |
anchorPointsIterator()
|
java.lang.Object |
clone()
|
java.lang.Object |
getAttribute(PicAttributeName name)
|
PicAttributeSet |
getAttributeSet()
|
java.awt.geom.Rectangle2D |
getBoundingBox(java.awt.geom.Rectangle2D r)
|
Drawing |
getDrawing()
Retrieves the underlying drawing |
int |
getFirstPointIndex()
|
int |
getLastPointIndex()
|
java.lang.String |
getName()
|
BranchElement |
getParent()
Gets the parent of the element. |
jpicedt.graphic.PicPoint |
getPoint(int numPoint,
jpicedt.graphic.PicPoint src)
|
double |
getPointX(int numPoint)
|
double |
getPointY(int numPoint)
|
jpicedt.graphic.view.View |
getView()
|
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(double ptOrgX,
double ptOrgY,
double sx,
double sy)
Scale this object by (sx,sy) using (ptOrgX,ptOrgY) as origin sx and sy can be negative. |
void |
scale(jpicedt.graphic.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,
java.lang.Object value)
set the given attribute name to the given value for this Element |
void |
setAttributeSet(PicAttributeSet attributeSet)
|
void |
setParent(BranchElement p)
Sets the parent of the element. |
void |
setPoint(int numPoint,
jpicedt.graphic.PicPoint pt)
Set the point indexed by "numPoint" to the given value. |
void |
setViewFromFactory(jpicedt.graphic.view.ViewFactory f)
set the view for this Element from the given view factory |
void |
translate(double dx,
double dy)
Translate this object by (dx,dy) |
Method Detail |
getName
public java.lang.String getName()
clone
public java.lang.Object clone()
getDrawing
public Drawing getDrawing()
- Retrieves the underlying drawing
getParent
public BranchElement getParent()
- Gets the parent of the element.
setParent
public void setParent(BranchElement p)
- Sets the parent of the element.
getPoint
public jpicedt.graphic.PicPoint getPoint(int numPoint, jpicedt.graphic.PicPoint src)
- Since:
- PicEdt 1.0
getPointX
public double getPointX(int numPoint)
- Since:
- PicEdt 1.0
getPointY
public double getPointY(int numPoint)
- Since:
- PicEdt 1.0
getFirstPointIndex
public int getFirstPointIndex()
getLastPointIndex
public int getLastPointIndex()
setPoint
public void setPoint(int numPoint, jpicedt.graphic.PicPoint pt)
- Set the point indexed by "numPoint" to the given value.
anchorPointsIterator
public Element.PointIterator anchorPointsIterator()
translate
public void translate(double dx, double dy)
- Translate this object by (dx,dy)
- Since:
- PicEdt 1.0
scale
public void scale(jpicedt.graphic.PicPoint ptOrg, double sx, double sy)
- Scale this object by (sx,sy) using ptOrg as origin
sx and sy can be negative. This can be implemented as a convenience call to
scale(double,double,double,double)
scale
public void scale(double ptOrgX, double ptOrgY, double sx, double sy)
- Scale this object by (sx,sy) using (ptOrgX,ptOrgY) as origin
sx and sy can be negative.
getBoundingBox
public java.awt.geom.Rectangle2D getBoundingBox(java.awt.geom.Rectangle2D r)
- Since:
- PicEdt 1.0
getView
public jpicedt.graphic.view.View getView()
setViewFromFactory
public void setViewFromFactory(jpicedt.graphic.view.ViewFactory f)
- set the view for this Element from the given view factory
removeView
public 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.
getAttributeSet
public PicAttributeSet getAttributeSet()
setAttributeSet
public void setAttributeSet(PicAttributeSet attributeSet)
setAttribute
public void setAttribute(PicAttributeName name, java.lang.Object value)
- set the given attribute name to the given value for this Element
getAttribute
public java.lang.Object getAttribute(PicAttributeName name)
|
|||||||||
Home >> All >> jpicedt >> graphic >> [ model overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |