|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jfig.objects.FigBaseobject jfig.objects.FigTrigger
simple active (hyperlink) objects for jfig.
This class provides very simple and basic active objects for the jfig viewer. A FigTrigger objects is realized as a rectangle on the fixed layer 100 (very deep). However, unless explicitly selected, the trigger object will not be displayed. When the user clicks on the inside of this rectangle in the jfig viewer, the viewer will try to load a new FIG file, as specified by the basename/filename attributes of the FigTrigger.
Note that the jfig editor (ModularEditor) is able to create trigger objects, but it will not follow the hyperlinks. You will probably want to create and edit in ModularEditor, and test and debug with the Viewer, both open at the same time.
ModularEditor
,
Viewer
Field Summary | |
(package private) java.lang.String |
basename
|
(package private) java.lang.String |
filename
|
(package private) boolean |
visible
|
(package private) FillWrapper |
wfill
|
(package private) LineWrapper |
wline
|
Fields inherited from class jfig.objects.FigBaseobject |
attribs, bbox, comment, debug, painter, printer, sc_bbox, sc_bbox_timestamp, selected, showPoints, syncRedrawFlag, timestamp, trafo, x, y |
Constructor Summary | |
FigTrigger(FigBbox bbox,
int layer)
Basic constructor from bbox object. |
|
FigTrigger(int x1,
int y1,
int x2,
int y2)
Basic trigger constructor from (x1,y1) to (x2,y2). |
|
FigTrigger(int x1,
int y1,
int x2,
int y2,
FigAttribs attribs,
FigTrafo2D trafo,
java.lang.String basename,
java.lang.String filename)
Advanced constructor with full parameter set. |
Method Summary | |
void |
appendPoint(java.awt.Point wp)
No, we cannot append, insert, or delete a Point in a trigger. |
(package private) void |
build_wfill()
build the FillWrapper object to support efficient wc->sc transformation for filled rectangles. |
(package private) void |
build_wline()
build the LineWrapper object to support efficient wc->sc transformation and 'fat' lines. |
FigObject |
copy()
make a copy of this object and return the reference to the copy. |
java.awt.Point |
deletePoint(java.awt.Point wp)
delete the Point with specified coords from our Point list. |
java.lang.String |
getBasename()
|
java.lang.String |
getFilename()
|
java.lang.String |
getLink()
getLink(): get the current basename+filename |
java.awt.Point[] |
getMovePointNeighbors(java.awt.Point wp)
getMovePointNeighbors( Point wp ): find the nearest Point of the trigger and return an array with the opposite corner, to allow the main editor correct rubberbanding. |
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()
getPoints(): get bbox coordinates for this trigger |
void |
insertPoint(java.awt.Point wp,
java.awt.Point wpnew)
insert a Point wp into our Point list after Point wprev. |
boolean |
isClosed()
return true if this object is 'closed' (polygon vs. |
double |
minDistance(java.awt.Point wp)
return distance (currently Manhattan-distance) of the trigger corners to the reference point wp. |
void |
mirrorX(int mirror_x,
int mirror_y)
mirrorX(): implemented as a move( dx, 0 ). |
void |
mirrorY(int mirror_x,
int mirror_y)
mirrorX(): implemented as a move( 0, dy ). |
void |
move(int dx,
int dy)
move() this trigger. |
void |
movePoint(java.awt.Point wp,
java.awt.Point wpnew)
move a Point from position wp to new position wpnew |
void |
paint(java.awt.Graphics g)
the paint() method |
void |
setLink(java.lang.String basename,
java.lang.String filename)
setLink(): set new basename and filename |
void |
setPoints(java.awt.Point[] wcp)
setPoints(): Set new bbox coordinates for this trigger. |
void |
setTrafo(FigTrafo2D trafo)
set a new transformation for this trigger. |
void |
setVisible(boolean v)
setVisible(): specify whether the FigTrigger object is visible (during editing) or not (during normal usage) |
boolean |
supportsPointOps()
yes, we support the point operations (actually, only movePoint). |
java.lang.String |
toString()
toString() for debug purposes. |
void |
update(FigAttribs new_attribs)
update(): Set the new trigger attributes: lineColor, lineStyle, fillColor, fillStyle, ... |
Methods inherited from class jfig.objects.FigBaseobject |
build_sc_bbox, canRotate, clonePoints, deselect, get_sc_bbox, getAttributes, getBbox, getComment, getLayer, getPosition, getSyncRedrawFlag, getText, getTimestamp, getTrafo, initialize, isSelected, isShowPoints, isVisible, isVisible, keyPressed, manhattan, message, minDistanceEuclid, numPoints, paint, paintSave, rebuild, reset_debug, rotate, scale, select, set_debug, setAttributes, setComment, setConsole, setObjectPainter, setSyncRedrawFlag, setText, showPoints, updateAttributes, writeAsResource |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
LineWrapper wline
FillWrapper wfill
java.lang.String basename
java.lang.String filename
boolean visible
Constructor Detail |
public FigTrigger(int x1, int y1, int x2, int y2)
public FigTrigger(FigBbox bbox, int layer)
public FigTrigger(int x1, int y1, int x2, int y2, FigAttribs attribs, FigTrafo2D trafo, java.lang.String basename, java.lang.String filename)
Method Detail |
public void setVisible(boolean v)
setVisible
in interface FigObject
setVisible
in class FigBaseobject
public void setLink(java.lang.String basename, java.lang.String filename)
public java.lang.String getLink()
public java.lang.String getBasename()
public java.lang.String getFilename()
void build_wline()
void build_wfill()
public void setTrafo(FigTrafo2D trafo)
setTrafo
in interface FigObject
setTrafo
in class FigBaseobject
public java.awt.Point[] getPoints()
getPoints
in interface FigObject
getPoints
in class FigBaseobject
public void paint(java.awt.Graphics g)
paint
in interface FigObject
paint
in class FigBaseobject
public void setPoints(java.awt.Point[] wcp)
setPoints
in interface FigObject
setPoints
in class FigBaseobject
public void update(FigAttribs new_attribs)
update
in interface FigObject
update
in class FigBaseobject
public FigObject copy()
copy
in interface FigObject
copy
in class FigBaseobject
public void move(int dx, int dy)
move
in interface FigObject
move
in class FigBaseobject
public void mirrorX(int mirror_x, int mirror_y)
mirrorX
in interface FigObject
mirrorX
in class FigBaseobject
public void mirrorY(int mirror_x, int mirror_y)
mirrorY
in interface FigObject
mirrorY
in class FigBaseobject
public boolean supportsPointOps()
supportsPointOps
in interface FigObject
supportsPointOps
in class FigBaseobject
public boolean isClosed()
FigObject
isClosed
in interface FigObject
isClosed
in class FigBaseobject
public void appendPoint(java.awt.Point wp)
(To support these operations, we might convert the FigTrigger automatically into a polygon. But currently I don't want this.)
appendPoint
in interface FigObject
appendPoint
in class FigBaseobject
public java.awt.Point deletePoint(java.awt.Point wp)
FigBaseobject
deletePoint
in interface FigObject
deletePoint
in class FigBaseobject
public void insertPoint(java.awt.Point wp, java.awt.Point wpnew)
FigBaseobject
insertPoint
in interface FigObject
insertPoint
in class FigBaseobject
public java.awt.Point[] getMovePointNeighbors(java.awt.Point wp)
getMovePointNeighbors
in interface FigObject
getMovePointNeighbors
in class FigBaseobject
public void movePoint(java.awt.Point wp, java.awt.Point wpnew)
FigBaseobject
movePoint
in interface FigObject
movePoint
in class FigBaseobject
public java.awt.Point getNearestPoint(java.awt.Point wp)
FigBaseobject
getNearestPoint
in interface FigObject
getNearestPoint
in class FigBaseobject
public java.awt.Point[] getNeighborPoints(java.awt.Point wp)
FigBaseobject
getNeighborPoints
in interface FigObject
getNeighborPoints
in class FigBaseobject
public double minDistance(java.awt.Point wp)
minDistance
in interface FigObject
minDistance
in class FigBaseobject
public java.lang.String toString()
toString
in interface FigObject
toString
in class FigBaseobject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |