|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
base FIG object interface.
The basic graphics editor object interface.
A simple stub implementation that may be subclassed for actual objects can be found in jfig.objects.FigBaseobject.java
Method Summary | |
void |
appendPoint(java.awt.Point wp)
append the new Point wp (in world coords) at the end of the Point list. |
boolean |
canRotate(double angle_in_rad)
|
FigObject |
copy()
method stub for the copy() method |
java.awt.Point |
deletePoint(java.awt.Point wp)
delete the selected Point (world-coordinates) if possible. |
void |
deselect()
mehtod stub for the deselect() mehtod |
FigBbox |
get_sc_bbox()
get bounding box (in screen coordinates) |
FigAttribs |
getAttributes()
get object attributes |
FigBbox |
getBbox()
get bounding box (in world coordinates) |
java.lang.String |
getComment()
get the comment for this object (may be null). |
int |
getLayer()
get layer (depth) |
java.awt.Point[] |
getMovePointNeighbors(java.awt.Point wp)
get the neighbor Points for a move point operation |
java.awt.Point |
getNearestPoint(java.awt.Point wp)
return the point of this object nearest to Point wp, if any. |
java.awt.Point[] |
getNeighborPoints(java.awt.Point wp)
get the neighbor Points for the given Point wp (in world-coords). |
java.awt.Point[] |
getPoints()
get PointList (if any), world-coordinates |
java.awt.Point |
getPosition()
get object position (usually the top-left corner) |
java.lang.String |
getText()
get the object's text, if any |
FigTrafo2D |
getTrafo()
get transformation |
boolean |
initialize(java.lang.String s)
|
void |
insertPoint(java.awt.Point wp,
java.awt.Point prev)
insert the new Point wp (in world-coords) after Point prev into the Point list. |
boolean |
isClosed()
return true if this object is 'closed' (polygon vs. |
boolean |
isSelected()
get current selection status |
boolean |
isVisible()
|
boolean |
isVisible(FigBbox bbox)
is this object visible within the given FigBbox? |
void |
keyPressed(java.awt.event.KeyEvent e)
react to a key event (e.g. |
double |
minDistance(java.awt.Point wp)
return the minimum distance of reference point wp and this object (use fast and xfig compatible measure, like manhattan distance). |
double |
minDistanceEuclid(java.awt.Point wp)
return the minimum distance of reference point wp and this object, using an accurate (and possibly computationally expensive) norm, like the length of the norm vector to a polygon segment. |
void |
mirrorX(int x,
int y)
method stub for mirrorX() method |
void |
mirrorY(int x,
int y)
method stub for mirrorY() method |
void |
move(int dx,
int dy)
method stub for the move() method |
void |
movePoint(java.awt.Point wp,
java.awt.Point wpnew)
move the Point at position wp (in world coords) to new Position wpnew. |
int |
numPoints()
get number of Points in this object |
void |
paint(java.awt.Graphics g)
paint this object using a default transformation and Graphics g |
void |
paint(java.awt.Graphics g,
FigTrafo2D trafo)
paint this object using the specified transformation and Graphics g |
void |
paintSave(java.awt.Graphics g,
FigTrafo2D trafo)
|
void |
rebuild()
rebuild (=re-initialize) this object given its current points, attributes, transformation, and the global Java2D enable status. |
void |
reset_debug()
reset debug flag |
void |
rotate(java.awt.Point anchor,
double angle_in_rad)
method stub for rotate() - allow for Exceptions if the object doesn't support the specified angle. |
void |
scale(java.awt.Point origin,
double factor_x,
double factor_y)
method stub for the scale() method |
void |
select()
method stub for the select() method. |
void |
set_debug()
set debug flag |
void |
setAttributes(FigAttribs attribs)
|
void |
setComment(java.lang.String s)
set a comment for this object. |
void |
setObjectPainter(ObjectPainter canvas)
|
void |
setPoints(java.awt.Point[] wcp)
set PointList (if any), world-coordinates. |
void |
setText(java.lang.String s)
set the object's text |
void |
setTrafo(FigTrafo2D trafo)
set transformation |
void |
setVisible(boolean v)
|
void |
showPoints()
method stub for the showPoints() method. |
boolean |
supportsPointOps()
return true if this object supports the polyline add/insert/ append/cut/move single Point functions. |
java.lang.String |
toString()
debug object information |
void |
update(FigAttribs parent_attribs)
method stub for update() method. |
void |
updateAttributes(java.lang.String stringWithAttributes)
|
void |
writeAsResource(java.io.PrintWriter ps)
write a complete text representation of this object |
Methods inherited from interface jfig.canvas.FigDrawable |
getSyncRedrawFlag, setSyncRedrawFlag |
Method Detail |
public void paint(java.awt.Graphics g)
FigDrawable
paint
in interface FigDrawable
public void paint(java.awt.Graphics g, FigTrafo2D trafo)
FigDrawable
paint
in interface FigDrawable
public void paintSave(java.awt.Graphics g, FigTrafo2D trafo)
public boolean isVisible(FigBbox bbox)
FigDrawable
isVisible
in interface FigDrawable
public boolean initialize(java.lang.String s)
public void setObjectPainter(ObjectPainter canvas)
public void setVisible(boolean v)
public boolean isVisible()
public void setTrafo(FigTrafo2D trafo)
setTrafo
in interface FigDrawable
public FigTrafo2D getTrafo()
public int getLayer()
public FigBbox getBbox()
getBbox
in interface FigDrawable
public FigBbox get_sc_bbox()
get_sc_bbox
in interface FigDrawable
public java.awt.Point getPosition()
public FigAttribs getAttributes()
public void setAttributes(FigAttribs attribs)
public void updateAttributes(java.lang.String stringWithAttributes)
public void set_debug()
public void reset_debug()
public void move(int dx, int dy)
public FigObject copy()
public void mirrorX(int x, int y)
public void mirrorY(int x, int y)
public void scale(java.awt.Point origin, double factor_x, double factor_y)
public void rotate(java.awt.Point anchor, double angle_in_rad) throws java.lang.Exception
java.lang.Exception
public boolean canRotate(double angle_in_rad)
public void update(FigAttribs parent_attribs)
parent_attribs
- The current editor FigAttribs object.public void rebuild()
public void showPoints()
public void select()
public void deselect()
public boolean isSelected()
public boolean supportsPointOps()
public int numPoints()
public boolean isClosed()
public java.awt.Point[] getPoints()
public void setPoints(java.awt.Point[] wcp)
public java.awt.Point deletePoint(java.awt.Point wp)
public java.awt.Point getNearestPoint(java.awt.Point wp)
public java.awt.Point[] getNeighborPoints(java.awt.Point wp)
public java.awt.Point[] getMovePointNeighbors(java.awt.Point wp)
public void appendPoint(java.awt.Point wp)
public void insertPoint(java.awt.Point wp, java.awt.Point prev)
public void movePoint(java.awt.Point wp, java.awt.Point wpnew)
public java.lang.String getText()
public void setText(java.lang.String s)
public double minDistance(java.awt.Point wp)
public double minDistanceEuclid(java.awt.Point wp)
public void keyPressed(java.awt.event.KeyEvent e)
public void writeAsResource(java.io.PrintWriter ps)
public java.lang.String toString()
public java.lang.String getComment()
public void setComment(java.lang.String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |