|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjfig.objects.FigBaseobject
jfig.objects.FigCompound
hades.symbols.Symbol
Symbol: the graphical abstraction for a Hades simulation model.
This class is realized as a subclass of FigCompound, default layer is 50.
Field Summary |
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 | |
Symbol()
construct an empty Symbol. |
Method Summary | |
void |
addMember(FigObject obj)
Add a new member to this Symbol and update the bounding box information. |
FigObject |
copy()
The copy() method for a compound object. |
java.util.Enumeration |
elements()
elements(): return an Enumeration of all FigObjects in this Symbol |
void |
fastAddMember(FigObject obj)
add a new member object to this Symbol, but don't update the bounding box information (to save time). |
java.lang.String |
getOrientationString()
|
SimObject |
getParent()
return a reference to the parent of this Symbol |
java.lang.String[] |
getPortNames()
return an array with the names of all Ports defined in this Symbol |
java.awt.Point |
getPortPosition(Port port)
|
java.awt.Point |
getPortPosition(java.lang.String name)
return the position (in world-coordinates) of Port 'name' on this Symbol. |
PortSymbol |
getPortSymbol(java.lang.String name)
return a reference to a Port called 'name' on this Symbol, if any. |
java.awt.Point |
getPos()
get the current position of this symbol |
void |
initializeFromFile(java.lang.String filename)
find and read a Symbol 'schematic' from a file. |
void |
initializeFromResource(SimObject parent)
find and read a Symbol 'schematic' from a Java 1.1 "resource" for parent's class. |
void |
message(java.lang.String msg)
|
void |
mirrorX(int x,
int y)
mirrorX: we just call mirrorX() for each object in this compound and finally update our bounding-box. |
void |
mirrorY(int x,
int y)
mirrorY: we just call mirrorY() for each object in this compound and finally update our bounding-box. |
void |
move(int dx,
int dy)
move this symbol. |
void |
printDebugInfo()
|
void |
setDebug(boolean _debug)
set debug on/off |
void |
setInstanceLabel(java.lang.String name)
find the first InstanceLabel in the current symbol objects and set a new text 'name' for it. |
void |
setLayer(int layer)
|
void |
setOrientation(java.lang.String s)
set a Symbol's orientation from a String with the following encoding: |
void |
setParent(SimObject parent)
|
void |
setVisibility(LayerTable lt)
setVisibility(): set the visibility of all elements in this Symbol |
java.lang.String |
toString()
toString() - the usual info method |
void |
writeAsResource(java.io.PrintWriter ps)
default implementation of 'writeAsResource'. |
Methods inherited from class jfig.objects.FigCompound |
canRotate, changeLayerRecursively, deleteAllMembers, deleteMember, getMembers, isMember, minDistanceEuclid, paint, paint, paintInverse, paintSave, rebuild, rotate, scale, setObjectPainter, setTrafo, setVisible, update_bbox, 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, initialize, insertPoint, isClosed, isSelected, isShowPoints, isVisible, isVisible, keyPressed, manhattan, 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 |
Constructor Detail |
public Symbol()
Method Detail |
public void setParent(SimObject parent)
public void setLayer(int layer)
public java.awt.Point getPos()
public void move(int dx, int dy)
move
in interface FigObject
move
in class FigCompound
public SimObject getParent()
public void setInstanceLabel(java.lang.String name)
The implementation of this method should be improved.
public PortSymbol getPortSymbol(java.lang.String name)
public java.awt.Point getPortPosition(java.lang.String name)
public java.awt.Point getPortPosition(Port port)
public java.lang.String[] getPortNames()
public java.util.Enumeration elements()
public void setVisibility(LayerTable lt)
public java.lang.String getOrientationString()
public void setOrientation(java.lang.String s)
'@' : start of the orientation encoding. 'N' : normal orientation 'X' : mirror along x axis 'Y' : mirror along y axis 'Rnumber' : rotate 'number' degrees
Examples: @N, @XR90, @XYR135.6
public void initializeFromResource(SimObject parent)
public void initializeFromFile(java.lang.String filename)
public void writeAsResource(java.io.PrintWriter ps)
FigBaseobject
writeAsResource
in interface FigObject
writeAsResource
in class FigBaseobject
public FigObject copy()
FigCompound
To get the xfig copy behaviour, the editor may combine copy() with a subsequent move().
copy
in interface FigObject
copy
in class FigCompound
public void addMember(FigObject obj)
we need to override addMember() from FigCompound, in order to handle late adding of members to a mirrored Symbol: If the Symbol is mirrored, we have to mirror the objects as well (best before adding them).
addMember
in class FigCompound
obj
- The editor object to add to this compound.public void fastAddMember(FigObject obj)
fastAddMember
in class FigCompound
addMember
public void mirrorX(int x, int y)
FigCompound
mirrorX
in interface FigObject
mirrorX
in class FigCompound
public void mirrorY(int x, int y)
FigCompound
mirrorY
in interface FigObject
mirrorY
in class FigCompound
public void printDebugInfo()
public void message(java.lang.String msg)
message
in class FigBaseobject
public void setDebug(boolean _debug)
public java.lang.String toString()
toString
in interface FigObject
toString
in class FigCompound
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |