|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jfig.objects.FigBaseobject
a stub graphics object, suitable for subclassing.
The basic graphics editor object. This implements the full object interface with stub methods and should be subclassed to implement the behaviour for actual objects (polyline, rectangle, text, etc.) version 0.7 13.02.00 added rotate version 0.6 07.04.99 added syncRedrawFlag version 0.5 14.06.97 added isVisible, ObjectPainter for animated objects version 0.4 11.04.96 (added Point functions: insert/append/...) version 0.3 28.03.96 version 0.2 17.03.96
Field Summary | |
protected FigAttribs |
attribs
|
protected FigBbox |
bbox
|
protected java.lang.String |
comment
|
protected boolean |
debug
|
ObjectPainter |
painter
|
protected static ConsoleMessage |
printer
|
protected FigBbox |
sc_bbox
|
protected long |
sc_bbox_timestamp
|
protected boolean |
selected
|
protected boolean |
showPoints
|
protected boolean |
syncRedrawFlag
|
protected long |
timestamp
|
protected FigTrafo2D |
trafo
|
protected boolean |
visible
|
protected int |
x
|
protected int |
y
|
Constructor Summary | |
FigBaseobject()
Basic FigBaseobject constructor. |
|
FigBaseobject(FigTrafo2D trafo)
Basic FigBaseobject constructor. |
Method Summary | |
void |
appendPoint(java.awt.Point wp)
append a Point to our Point list. |
void |
build_sc_bbox()
|
boolean |
canRotate(double angle_in_rad)
|
static java.awt.Point[] |
clonePoints(java.awt.Point[] points)
|
FigObject |
copy()
method stub for the copy() method. |
java.awt.Point |
deletePoint(java.awt.Point wp)
delete the Point with specified coords from our Point list. |
void |
deselect()
mehtod stub for the deselect() mehtod |
FigBbox |
get_sc_bbox()
get object bounding box (in screen coordinates at current transformation) |
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 |
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 two neighbor Points for the specified Point wp from our Point list. |
java.awt.Point[] |
getPoints()
return a list of all Points of this objects. |
java.awt.Point |
getPosition()
get object (reference point) position |
boolean |
getSyncRedrawFlag()
is a sync redraw pending on this object? |
java.lang.String |
getText()
get the object's text: no text in a baseobject |
long |
getTimestamp()
return the timestamp of this object (it's creation/modification time). |
FigTrafo2D |
getTrafo()
get transformation |
boolean |
initialize(java.lang.String s)
a dummy function to initialize a FigObject from a String resource. |
void |
insertPoint(java.awt.Point wp,
java.awt.Point wprev)
insert a Point wp into our Point list after Point wprev. |
boolean |
isClosed()
return true if this object is 'closed' (polygon vs. |
boolean |
isSelected()
get current selection status |
boolean |
isShowPoints()
|
boolean |
isVisible()
check whether this Object is currently visible. |
boolean |
isVisible(FigBbox viewport)
check whether this object is visible inside the given viewport (using world coordinates) |
void |
keyPressed(java.awt.event.KeyEvent e)
basic reaction to keyDown events: none. |
static int |
manhattan(java.awt.Point p,
java.awt.Point q)
|
void |
message(java.lang.String msg)
|
double |
minDistance(java.awt.Point wp)
return the minimum distance of any points (edges,corners) of this object and the Point wp. |
double |
minDistanceEuclid(java.awt.Point wp)
return a high-precision value of the minimum distance between point wp and this object. |
void |
mirrorX(int x,
int y)
method stub for the mirrorX() method |
void |
mirrorY(int x,
int y)
method stub for the 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 a Point from position wp to new position wpnew |
int |
numPoints()
get number of Points in this object |
void |
paint(java.awt.Graphics g)
paint() this object. |
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)
rotate: this contains a reference implementation suitable for most object subclasses. |
void |
scale(java.awt.Point origin,
double factor_x,
double factor_y)
scale the object. |
void |
select()
method stub for the select() method. |
void |
set_debug()
set debug flag |
void |
setAttributes(FigAttribs attribs)
set object attributes |
void |
setComment(java.lang.String s)
set a comment for this object. |
void |
setConsole(ConsoleMessage _printer)
|
void |
setObjectPainter(ObjectPainter canvas)
set the ObjectPainter responsible for drawing this FigBaseobject |
void |
setPoints(java.awt.Point[] wcp)
set PointList (if any), world-coordinates. |
void |
setSyncRedrawFlag(boolean b)
set or reset whether this objects needs a sync redraw |
void |
setText(java.lang.String s)
set the object's text: ignored by a baseobject |
void |
setTrafo(FigTrafo2D trafo)
set transformation |
void |
setVisible(boolean v)
set this Object to be visible or not |
void |
showPoints()
method stub for the showPoints() method. |
boolean |
supportsPointOps()
this object does not provide useful Point list operations. |
java.lang.String |
toString()
debug object information |
void |
update(FigAttribs parent_attribs)
method stub for update() method |
void |
updateAttributes(java.lang.String s)
|
void |
writeAsResource(java.io.PrintWriter ps)
default implementation of 'writeAsResource'. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected FigAttribs attribs
protected FigTrafo2D trafo
protected int x
protected int y
protected FigBbox bbox
protected FigBbox sc_bbox
protected long sc_bbox_timestamp
protected boolean debug
protected boolean selected
protected boolean showPoints
protected boolean syncRedrawFlag
protected long timestamp
protected java.lang.String comment
protected boolean visible
public ObjectPainter painter
protected static ConsoleMessage printer
Constructor Detail |
public FigBaseobject()
public FigBaseobject(FigTrafo2D trafo)
Method Detail |
public boolean initialize(java.lang.String s)
initialize
in interface FigObject
public void setObjectPainter(ObjectPainter canvas)
setObjectPainter
in interface FigObject
public void setVisible(boolean v)
setVisible
in interface FigObject
public boolean isVisible()
isVisible
in interface FigObject
public FigAttribs getAttributes()
getAttributes
in interface FigObject
public void setAttributes(FigAttribs attribs)
setAttributes
in interface FigObject
public void updateAttributes(java.lang.String s)
updateAttributes
in interface FigObject
public void setTrafo(FigTrafo2D trafo)
setTrafo
in interface FigObject
public FigTrafo2D getTrafo()
getTrafo
in interface FigObject
public int getLayer()
getLayer
in interface FigObject
public java.awt.Point getPosition()
getPosition
in interface FigObject
public FigBbox getBbox()
getBbox
in interface FigObject
public void set_debug()
set_debug
in interface FigObject
public void reset_debug()
reset_debug
in interface FigObject
public void move(int dx, int dy)
move
in interface FigObject
public void mirrorX(int x, int y)
mirrorX
in interface FigObject
public void mirrorY(int x, int y)
mirrorY
in interface FigObject
public void scale(java.awt.Point origin, double factor_x, double factor_y)
We also modify the line width, line dash length, and arrow size corresponding to the factor_x value, unless the SetupManager property "jfig.scaleLineWidth" is "false".
scale
in interface FigObject
public void rotate(java.awt.Point anchor, double angle_in_rad) throws java.lang.Exception
rotate
in interface FigObject
java.lang.Exception
public boolean canRotate(double angle_in_rad)
canRotate
in interface FigObject
public void update(FigAttribs parent_attribs)
update
in interface FigObject
parent_attribs
- The current editor FigAttribs object.public void rebuild()
FigObject
rebuild
in interface FigObject
public FigObject copy()
To get the xfig copy behaviour, the editor may combine copy() with a subsequent move().
copy
in interface FigObject
public boolean isSelected()
FigObject
isSelected
in interface FigObject
public void showPoints()
FigObject
showPoints
in interface FigObject
public boolean isShowPoints()
public void select()
FigObject
select
in interface FigObject
public void deselect()
FigObject
deselect
in interface FigObject
public boolean getSyncRedrawFlag()
getSyncRedrawFlag
in interface FigDrawable
public void setSyncRedrawFlag(boolean b)
setSyncRedrawFlag
in interface FigDrawable
public boolean supportsPointOps()
supportsPointOps
in interface FigObject
public int numPoints()
FigObject
numPoints
in interface FigObject
public boolean isClosed()
FigObject
isClosed
in interface FigObject
public java.awt.Point[] getPoints()
getPoints
in interface FigObject
public void setPoints(java.awt.Point[] wcp)
FigObject
setPoints
in interface FigObject
public static java.awt.Point[] clonePoints(java.awt.Point[] points)
public void appendPoint(java.awt.Point wp)
appendPoint
in interface FigObject
public void movePoint(java.awt.Point wp, java.awt.Point wpnew)
movePoint
in interface FigObject
public void insertPoint(java.awt.Point wp, java.awt.Point wprev)
insertPoint
in interface FigObject
public java.awt.Point deletePoint(java.awt.Point wp)
deletePoint
in interface FigObject
public java.awt.Point getNearestPoint(java.awt.Point wp)
getNearestPoint
in interface FigObject
public static int manhattan(java.awt.Point p, java.awt.Point q)
public java.awt.Point[] getNeighborPoints(java.awt.Point wp)
getNeighborPoints
in interface FigObject
public java.awt.Point[] getMovePointNeighbors(java.awt.Point wp)
FigObject
getMovePointNeighbors
in interface FigObject
public double minDistance(java.awt.Point wp)
minDistance
in interface FigObject
public double minDistanceEuclid(java.awt.Point wp)
minDistanceEuclid
in interface FigObject
public java.lang.String getText()
getText
in interface FigObject
public void setText(java.lang.String s)
setText
in interface FigObject
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface FigObject
public long getTimestamp()
public void build_sc_bbox()
public FigBbox get_sc_bbox()
get_sc_bbox
in interface FigObject
public void paint(java.awt.Graphics g)
paint
in interface FigObject
public void paint(java.awt.Graphics g, FigTrafo2D trafo)
FigDrawable
paint
in interface FigObject
public void paintSave(java.awt.Graphics g, FigTrafo2D trafo)
paintSave
in interface FigObject
public boolean isVisible(FigBbox viewport)
isVisible
in interface FigObject
public void message(java.lang.String msg)
public void setConsole(ConsoleMessage _printer)
public void writeAsResource(java.io.PrintWriter ps)
writeAsResource
in interface FigObject
public java.lang.String getComment()
FigObject
getComment
in interface FigObject
public void setComment(java.lang.String s)
FigObject
setComment
in interface FigObject
public java.lang.String toString()
toString
in interface FigObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |