|
||||||||||
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, updateAttributes, 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.
FigParser
public FigObjectList getMembers()
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 void scale(java.awt.Point origin, double factor_x, double factor_y)
scale
in interface FigObject
scale
in class FigBaseobject
public void update(FigAttribs parent_attribs)
update
in interface FigObject
update
in class FigBaseobject
public void rebuild()
rebuild
in interface FigObject
rebuild
in class FigBaseobject
public 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 FigObject
copy
in class FigBaseobject
public void setTrafo(FigTrafo2D trafo)
setTrafo
in interface FigObject
setTrafo
in class FigBaseobject
public void setVisible(boolean visible)
setVisible
in interface FigObject
setVisible
in class FigBaseobject
public void setObjectPainter(ObjectPainter painter)
setObjectPainter
in interface FigObject
setObjectPainter
in class FigBaseobject
public 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 FigObject
paint
in class FigBaseobject
public void paintSave(java.awt.Graphics g, FigTrafo2D trafo)
paintSave
in interface FigObject
paintSave
in class FigBaseobject
public void paintInverse(java.awt.Graphics g)
public boolean canRotate(double angle_in_rad)
canRotate
in interface FigObject
canRotate
in class FigBaseobject
public void rotate(java.awt.Point anchor, double angle_in_rad) throws java.lang.Exception
rotate
in interface FigObject
rotate
in class FigBaseobject
java.lang.Exception
public void paint(java.awt.Graphics g, FigBbox bbox)
public double minDistanceEuclid(java.awt.Point wp)
minDistanceEuclid
in interface FigObject
minDistanceEuclid
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 |