Class builder.Wire
All Packages Class Hierarchy This Package Previous Next Index
Class builder.Wire
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----builder.Moveable
|
+----builder.Wire
- public class Wire
- extends Moveable
Wire that conect Icons of two Nodes.
-
ARROW_RATIO
-
-
ARROW_SIZE
-
-
Wire(Node, Node)
- Main Constructor.
-
drawArrow(Graphics, Point, Point)
- drawArrow
Draws an Arrow at the center of the wire to indicate the direction of
the data flow.
-
getInput()
- getInput
-
getOutput()
- getOutput
-
initialize()
- initialize
Initializes the Wire and returns true if initialization is complete.
-
normalize(double, Point, Point)
- normalize
Normalices the vector defined between the center (c) point and the
p point to a value specified by the size argument.
-
paintWire(Graphics)
- paintWire
Draws the wire in the Map.
-
transmit()
- transmit
Transmits the Action of the Input Node to the Output Node(s).
ARROW_SIZE
public final static int ARROW_SIZE
ARROW_RATIO
public final static double ARROW_RATIO
Wire
public Wire(Node first,
Node second)
- Main Constructor.
- Parameters:
- map - the Map where this wire will be drawn.
initialize
public boolean initialize()
- initialize
Initializes the Wire and returns true if initialization is complete.
- Returns:
- true.
transmit
public boolean transmit()
- transmit
Transmits the Action of the Input Node to the Output Node(s).
- Returns:
- true if the Action is fullfilled by (all) of the Output Nodes.
getInput
public Node getInput()
- getInput
- Returns:
- the Input Node to this Wire.
getOutput
public Node getOutput()
- getOutput
- Returns:
- the Output Node(s) to this Wire.
paintWire
public void paintWire(Graphics g)
- paintWire
Draws the wire in the Map.
- Parameters:
- g - the graphics context.
drawArrow
public void drawArrow(Graphics g,
Point start,
Point end)
- drawArrow
Draws an Arrow at the center of the wire to indicate the direction of
the data flow.
- Parameters:
- g - the graphics context.
- start - the point where the data flows FROM.
- end - the point where the data flows TO.
normalize
public Point normalize(double size,
Point c,
Point p)
- normalize
Normalices the vector defined between the center (c) point and the
p point to a value specified by the size argument.
- Parameters:
- size - length of the resulting line c-p.
- c - the "center" point for the normalization.
- p - the Point to be moved to a "normalized" location.
- Returns:
- the new p Point such that the line c-p(new) is in the same
direction as the line c-p(old) but of length size.
All Packages Class Hierarchy This Package Previous Next Index