hades.symbols
Class FigWrapper

java.lang.Object
  extended byjfig.objects.FigBaseobject
      extended byjfig.objects.FigCompound
          extended byhades.symbols.FigWrapper
All Implemented Interfaces:
ConsoleMessage, FigDrawable, FigObject, java.io.Serializable

public class FigWrapper
extends FigCompound
implements java.io.Serializable, ConsoleMessage

FigWrapper: a class to include FIG (3.x) files into HADES symbols. This class is realized as a subclass of FigCompound, with default layer 85 (quite deep, but above the BboxRectangles).

See Also:
Serialized Form

Field Summary
 boolean debug
           
static int FIG_LAYER
           
 
Fields inherited from class jfig.objects.FigCompound
 
Fields inherited from class jfig.objects.FigBaseobject
attribs, bbox, comment, painter, printer, sc_bbox, sc_bbox_timestamp, selected, showPoints, syncRedrawFlag, timestamp, trafo, visible, x, y
 
Constructor Summary
FigWrapper()
          construct an empty FigWrapper.
 
Method Summary
 void consoleMessage(java.lang.String msg)
           
 FigObject copy()
          The copy() method for a compound object.
 boolean initialize(java.lang.String s)
          initialize an FigWrapper from a String.
 void parseFigFile(java.lang.String filename)
           
 void setLayer(int layer)
           
 void setSimObject(SimObject parent)
           
 java.lang.String toString()
          toString() - the usual info method
 void update_bbox()
          calculate a new bounding box for this compound object.
 void writeAsResource(java.io.PrintWriter ps)
          default implementation of 'writeAsResource'.
 
Methods inherited from class jfig.objects.FigCompound
addMember, canRotate, changeLayerRecursively, deleteAllMembers, deleteMember, fastAddMember, getMembers, isMember, minDistanceEuclid, mirrorX, mirrorY, move, paint, paint, paintInverse, paintSave, rebuild, rotate, scale, setObjectPainter, setTrafo, setVisible, update
 
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, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

public boolean debug

FIG_LAYER

public static final int FIG_LAYER
See Also:
Constant Field Values
Constructor Detail

FigWrapper

public FigWrapper()
construct an empty FigWrapper.

Method Detail

setLayer

public void setLayer(int layer)

setSimObject

public void setSimObject(SimObject parent)

initialize

public boolean initialize(java.lang.String s)
initialize an FigWrapper from a String. The String contains the position of the left-top corner of this FigWrapper compound in the Symbol, and the Java resource name of the FIG 3.1 file. This method returns true if all required data could be read.

Specified by:
initialize in interface FigObject
Overrides:
initialize in class FigBaseobject

update_bbox

public void update_bbox()
Description copied from class: FigCompound
calculate a new bounding box for this compound object. It suffices to calculate the union of the bounding boxes of all member objects.

This method is public to allow the FIG3.1 parser efficient parsing of (possibly nested) compound objects.

Overrides:
update_bbox in class FigCompound
See Also:
FigParser

parseFigFile

public void parseFigFile(java.lang.String filename)

writeAsResource

public void writeAsResource(java.io.PrintWriter ps)
Description copied from class: FigBaseobject
default implementation of 'writeAsResource'. This will write a nearly xfig-compatible version of all basic FigObjects.

Specified by:
writeAsResource in interface FigObject
Overrides:
writeAsResource in class FigBaseobject

copy

public FigObject copy()
Description copied from class: FigCompound
The copy() method for a compound object. We first create a new compound object. Then we create copies of all members of this compound and add them to the new one. Finally we return the new compound.

To get the xfig copy behaviour, the editor may combine copy() with a subsequent move().

Specified by:
copy in interface FigObject
Overrides:
copy in class FigCompound

consoleMessage

public void consoleMessage(java.lang.String msg)
Specified by:
consoleMessage in interface ConsoleMessage

toString

public java.lang.String toString()
toString() - the usual info method

Specified by:
toString in interface FigObject
Overrides:
toString in class FigCompound