artofillusion.procedural
Class IOPort

java.lang.Object
  extended by artofillusion.procedural.IOPort

public class IOPort
extends java.lang.Object

This is the graphical representation of an input or output port on a module.


Field Summary
static int BOTTOM
           
static int COLOR
           
static int INPUT
           
static int LEFT
           
static int NUMBER
           
static int OUTPUT
           
static int RIGHT
           
static int SIZE
           
static int TOP
           
 
Constructor Summary
IOPort(int valueType, int type, int location, java.lang.String[] description)
           
 
Method Summary
 boolean contains(java.awt.Point p)
          Determine whether a point on the screen is inside this port.
 void draw(java.awt.Graphics g)
          Draw the port.
 java.lang.String[] getDescription()
          Get the description of this port.
 int getIndex()
          Get the index of this port in its Module's list of input or output ports.
 int getLocation()
          Get the location of this port (top, bottom, left, or right).
 Module getModule()
          Get the module this port belongs to.
 java.awt.Point getPosition()
          Get the port's screen position.
 int getType()
          Get the type of port this is (input or output).
 int getValueType()
          Get the type of value for this port.
 void setDescription(java.lang.String[] desc)
          Set the description of this port.
 void setModule(Module mod)
          Set the module this port belongs to.
 void setPosition(int x, int y)
          Set the port's screen position.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INPUT

public static final int INPUT
See Also:
Constant Field Values

OUTPUT

public static final int OUTPUT
See Also:
Constant Field Values

NUMBER

public static final int NUMBER
See Also:
Constant Field Values

COLOR

public static final int COLOR
See Also:
Constant Field Values

TOP

public static final int TOP
See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
See Also:
Constant Field Values

LEFT

public static final int LEFT
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

SIZE

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

IOPort

public IOPort(int valueType,
              int type,
              int location,
              java.lang.String[] description)
Method Detail

getPosition

public java.awt.Point getPosition()
Get the port's screen position.


setPosition

public void setPosition(int x,
                        int y)
Set the port's screen position.


getValueType

public int getValueType()
Get the type of value for this port.


getType

public int getType()
Get the type of port this is (input or output).


getLocation

public int getLocation()
Get the location of this port (top, bottom, left, or right).


getModule

public Module getModule()
Get the module this port belongs to.


setModule

public void setModule(Module mod)
Set the module this port belongs to.


getIndex

public int getIndex()
Get the index of this port in its Module's list of input or output ports.


contains

public boolean contains(java.awt.Point p)
Determine whether a point on the screen is inside this port.


getDescription

public java.lang.String[] getDescription()
Get the description of this port.


setDescription

public void setDescription(java.lang.String[] desc)
Set the description of this port.


draw

public void draw(java.awt.Graphics g)
Draw the port.



Copyright © 1999-2011 by Peter Eastman.