|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjfig.objects.FigBaseobject
jfig.objects.FigCompound
FIG compound (group) object.
The graphics editor 'compound' object, kind of a group object. A compound object contains references to other objects, it's members. Typical editor manipulations like move() are passed to all the compound's members in turn.
To break a compound, the editor should call getMembers() to retrieve the array with the compound object's member objects, insert these objects into its own (the editors) object-list, and finally delete the compound. There is no obvious way to do this with a member function of FigCompound, unless we make all data structures of the editor transparent (but we won't want this).
| Field Summary | |
(package private) FigObjectList |
members
|
| Fields inherited from class jfig.objects.FigBaseobject |
attribs, bbox, comment, debug, painter, printer, sc_bbox, sc_bbox_timestamp, selected, showPoints, syncRedrawFlag, timestamp, trafo, visible, x, y |
| Constructor Summary | |
FigCompound()
Basic FigCompound constructor. |
|
| Method Summary | |
void |
addMember(FigObject obj)
add an object to this compound. |
boolean |
canRotate(double angle_in_rad)
|
void |
changeLayerRecursively(FigAttribs new_attribs)
|
FigObject |
copy()
The copy() method for a compound object. |
boolean |
deleteAllMembers()
|
boolean |
deleteMember(FigObject obj)
Try to delete an object from this compound. |
void |
fastAddMember(FigObject obj)
add an object to this compound, but don't update the bounding box. |
FigObjectList |
getMembers()
return the list with all member objects of this compound. |
boolean |
isMember(FigObject testobj)
check whether the given object is a member of this compound. |
double |
minDistanceEuclid(java.awt.Point wp)
return a distance measure (in world coords units) between point wp and this compound which is useful for object selection. |
void |
mirrorX(int mirror_x,
int mirror_y)
mirrorX: we just call mirrorX() for each object in this compound and finally update our bounding-box. |
void |
mirrorY(int mirror_x,
int mirror_y)
mirrorY: we just call mirrorY() for each object in this compound and finally update our bounding-box. |
void |
move(int dx,
int dy)
The move() method calls the move() method for each member. |
void |
paint(java.awt.Graphics g)
paint(): Again, we just call paint() for each member of this component. |
void |
paint(java.awt.Graphics g,
FigBbox bbox)
paint( Graphics g, FigBbox bbox ): Check all members of this compound whether they are visible or not. |
void |
paintInverse(java.awt.Graphics g)
|
void |
paintSave(java.awt.Graphics g,
FigTrafo2D trafo)
|
void |
rebuild()
rebuild this compound: call rebuild() recursively on all member objects |
void |
rotate(java.awt.Point anchor,
double angle_in_rad)
rotate this compound: we simple call rotate to all compound member objects in turn, and finally update the compound bbox data. |
void |
scale(java.awt.Point origin,
double factor_x,
double factor_y)
scale(): scale all our members in turn, the recalculate the bounding box |
void |
setObjectPainter(ObjectPainter painter)
set a new ObjectPainter for all objects in this compound |
void |
setTrafo(FigTrafo2D trafo)
set a new transformation for this compound. |
void |
setVisible(boolean visible)
set the visible attribute for all members of this FigCompound |
java.lang.String |
toString()
debug object information |
void |
update_bbox()
calculate a new bounding box for this compound object. |
void |
update(FigAttribs parent_attribs)
update(): Call update() for all members of this compound and update its layer. |
| Methods inherited from class jfig.objects.FigBaseobject |
appendPoint, build_sc_bbox, clonePoints, deletePoint, deselect, get_sc_bbox, getAttributes, getBbox, getComment, getLayer, getMovePointNeighbors, getNearestPoint, getNeighborPoints, getPoints, getPosition, getSyncRedrawFlag, getText, getTimestamp, getTrafo, initialize, insertPoint, isClosed, isSelected, isShowPoints, isVisible, isVisible, keyPressed, manhattan, message, minDistance, movePoint, numPoints, paint, reset_debug, select, set_debug, setAttributes, setComment, setConsole, setPoints, setSyncRedrawFlag, setText, showPoints, supportsPointOps, writeAsResource |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
FigObjectList members
| Constructor Detail |
public FigCompound()
| Method Detail |
public void addMember(FigObject obj)
The editor that calls addMember(obj) should probably delete obj from its own objectList.
obj - The editor object to add to this compound.public void fastAddMember(FigObject obj)
public boolean deleteMember(FigObject obj)
public boolean deleteAllMembers()
public boolean isMember(FigObject testobj)
public void update_bbox()
This method is public to allow the FIG3.1 parser efficient parsing of (possibly nested) compound objects.
FigParserpublic FigObjectList getMembers()
public void move(int dx,
int dy)
move in interface FigObjectmove in class FigBaseobject
public void mirrorX(int mirror_x,
int mirror_y)
mirrorX in interface FigObjectmirrorX in class FigBaseobject
public void mirrorY(int mirror_x,
int mirror_y)
mirrorY in interface FigObjectmirrorY in class FigBaseobject
public void scale(java.awt.Point origin,
double factor_x,
double factor_y)
scale in interface FigObjectscale in class FigBaseobjectpublic void update(FigAttribs parent_attribs)
update in interface FigObjectupdate in class FigBaseobjectpublic void rebuild()
rebuild in interface FigObjectrebuild in class FigBaseobjectpublic void changeLayerRecursively(FigAttribs new_attribs)
public FigObject copy()
To get the xfig copy behaviour, the editor may combine copy() with a subsequent move().
copy in interface FigObjectcopy in class FigBaseobjectpublic void setTrafo(FigTrafo2D trafo)
setTrafo in interface FigObjectsetTrafo in class FigBaseobjectpublic void setVisible(boolean visible)
setVisible in interface FigObjectsetVisible in class FigBaseobjectpublic void setObjectPainter(ObjectPainter painter)
setObjectPainter in interface FigObjectsetObjectPainter in class FigBaseobjectpublic void paint(java.awt.Graphics g)
Note that this method() may be very inefficient, because all members of the component are paint()ed, whether they are visible or not. Typically you should call the improved variant paint( Graphics, FigBbox bbox ) below.
paint in interface FigObjectpaint in class FigBaseobject
public void paintSave(java.awt.Graphics g,
FigTrafo2D trafo)
paintSave in interface FigObjectpaintSave in class FigBaseobjectpublic void paintInverse(java.awt.Graphics g)
public boolean canRotate(double angle_in_rad)
canRotate in interface FigObjectcanRotate in class FigBaseobject
public void rotate(java.awt.Point anchor,
double angle_in_rad)
throws java.lang.Exception
rotate in interface FigObjectrotate in class FigBaseobjectjava.lang.Exception
public void paint(java.awt.Graphics g,
FigBbox bbox)
public double minDistanceEuclid(java.awt.Point wp)
minDistanceEuclid in interface FigObjectminDistanceEuclid in class FigBaseobjectpublic java.lang.String toString()
toString in interface FigObjecttoString in class FigBaseobject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||