hades.symbols
Class PortSymbol

java.lang.Object
  extended byjfig.objects.FigBaseobject
      extended byjfig.objects.FigRectangle
          extended byhades.symbols.PortSymbol
All Implemented Interfaces:
FigDrawable, FigObject, java.io.Serializable
Direct Known Subclasses:
BusPortSymbol, TinyPortSymbol

public class PortSymbol
extends FigRectangle
implements java.io.Serializable

PortSymbol: display a standard port on a SimObject symbol.

This class is realized as a subclass of FigRectangle with specific attributes: layer 10, color red, centered around its position, fixed size 40/2400 inch.

See Also:
Serialized Form

Field Summary
protected  java.lang.String name
           
protected  java.awt.Point pos
           
protected static int size
           
 
Fields inherited from class jfig.objects.FigRectangle
pixel_width, radius, renderer, use_rounded_corners
 
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
PortSymbol()
          the default constructor: a PortSymbol located at the origin (0,0)
PortSymbol(int size)
           
 
Method Summary
protected  void build_attribs()
           
 FigObject copy()
          make a copy of this object and return the reference to the copy.
 java.lang.String getName()
           
 java.awt.Point getPosition()
          get object (reference point) position
 int getSize()
           
 boolean initialize(java.lang.String s)
          initialize an PortSymbol from a String.
 void mirrorX(int mirror_x, int mirror_y)
          mirrorX(): implemented as a move( dx, 0 ).
 void mirrorY(int mirror_x, int mirror_y)
          mirrorY(): implemented as a move( 0, dy ).
 void move(int dx, int dy)
          move() this rectangle.
 void setName(java.lang.String name)
           
 void setSize(int _size)
           
 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.FigRectangle
appendPoint, canRotate, createRenderer, deletePoint, getMovePointNeighbors, getNearestPoint, getNeighborPoints, getPoints, insertPoint, isClosed, isRounded, minDistance, minDistanceEuclid, movePoint, paint, paint, paintSave, rebuild, setAttributes, setFillColor, setFillStyle, setLayer, setLineColor, setLineStyle, setLineWidth, setPoints, supportsPointOps, update
 
Methods inherited from class jfig.objects.FigBaseobject
build_sc_bbox, clonePoints, deselect, get_sc_bbox, getAttributes, getBbox, getComment, getLayer, getSyncRedrawFlag, getText, getTimestamp, getTrafo, isSelected, isShowPoints, isVisible, isVisible, keyPressed, manhattan, message, numPoints, reset_debug, rotate, scale, select, set_debug, setComment, setConsole, setObjectPainter, setSyncRedrawFlag, setText, setTrafo, setVisible, showPoints, updateAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

size

protected static int size

name

protected java.lang.String name

pos

protected java.awt.Point pos
Constructor Detail

PortSymbol

public PortSymbol()
the default constructor: a PortSymbol located at the origin (0,0)


PortSymbol

public PortSymbol(int size)
Method Detail

initialize

public boolean initialize(java.lang.String s)
initialize an PortSymbol from a String. The String contains the x and y coordinates of the Port center and a String with the Port's name: x y clock_in

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

getSize

public int getSize()

setSize

public void setSize(int _size)

move

public void move(int dx,
                 int dy)
Description copied from class: FigRectangle
move() this rectangle.

Specified by:
move in interface FigObject
Overrides:
move in class FigRectangle

mirrorX

public void mirrorX(int mirror_x,
                    int mirror_y)
mirrorX(): implemented as a move( dx, 0 ).

Specified by:
mirrorX in interface FigObject
Overrides:
mirrorX in class FigRectangle

mirrorY

public void mirrorY(int mirror_x,
                    int mirror_y)
mirrorY(): implemented as a move( 0, dy ).

Specified by:
mirrorY in interface FigObject
Overrides:
mirrorY in class FigRectangle

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

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

build_attribs

protected void build_attribs()

getPosition

public java.awt.Point getPosition()
Description copied from class: FigBaseobject
get object (reference point) position

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

copy

public FigObject copy()
Description copied from class: FigRectangle
make a copy of this object and return the reference to the copy.

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

toString

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

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