Class operator

java.lang.Object
  |
  +--operator
Direct Known Subclasses:
operator1DInt, operator2DDouble, operator2DInt, operatorBinary

public abstract class operator
extends java.lang.Object

All operators extend this class (in reality all operators extend one of several classes for example operator1DInt that extend this class).


Field Summary
protected  operatorBox box
          The graphical representation of this operator on the UI.
protected  java.lang.String name
          The unique name of the operator (for example convolution)
protected  javax.swing.JPanel panel
          The panel that the operatorBox (representing the operator graphically on the UI) is placed on (this is the panel that is on the big scrollpane taking up most of the UI).
protected  javax.swing.JFrame parameters
          The frame that contains the parameter window for this operator (made visible by clicking on the operator name in the operatorBox on th UI).
protected  java.lang.String type
          The type of operator (for example convolution).
 
Constructor Summary
operator()
           
 
Method Summary
protected  operatorBox getBox()
          Returns the graphical representation of the operator.
 java.lang.String getName()
          Returns the name of the operator.
 javax.swing.JFrame getParameters()
          Returns the parameters frame for this operator.
 java.lang.String getType()
          Returns the type of this operator (for example convolution).
abstract  void go()
          Runs the operator and then propagates the outputs to all operators that this operator links to.
abstract  void link1To1(operator linkOp)
          Adds a link between this operator and another operator (output1 to input1).
abstract  void link1To2(operator linkOp)
          Adds a link between this operator and another operator (output1 to input2).
abstract  void link2To1(operator linkOp)
          Adds a link between this operator and another operator (output2 to input1).
abstract  void link2To2(operator linkOp)
          Adds a link between this operator and another operator (output2 to input2).
abstract  void loadParameters(java.io.StreamTokenizer tokenizer)
           
 void propagate()
          Runs all the operators that this operator passes stuff to (all operators that are input linked to one of this operator's outputs).
 void propagateSingleLink(singleLink link)
          Passes data from one of this operator's output to one of another operator's input (converting the image representation if necessary) and runs the next operator.
 java.lang.String saveOperator()
          Returns a String representing the operator, containing all the information required to reconstruct this operator at a later date.
abstract  java.lang.String saveParameters()
          Returns a String representing all the parameters for this operator for the purpose of saving the system setup (and being able to load it again at a future date).
protected  void setBox(javax.swing.JPanel panel, linkData links, int inputs, int outputs)
          Creates the box for the operator which is the graphical representation of the operator on the UI.
abstract  void setInput1(image x)
          Sets input1 to the specified image.
abstract  void setInput2(image x)
          Sets input2 to the specified image.
 void setName(java.lang.String name)
          Sets the name of this operator.
 void setType(java.lang.String type)
           
 void showParameters()
          Makes the parameters window visible and deiconifies it if necessary.
protected  void updateParameters()
          Lays out the parameters frame correctly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

panel

protected javax.swing.JPanel panel
The panel that the operatorBox (representing the operator graphically on the UI) is placed on (this is the panel that is on the big scrollpane taking up most of the UI).

parameters

protected javax.swing.JFrame parameters
The frame that contains the parameter window for this operator (made visible by clicking on the operator name in the operatorBox on th UI).

type

protected java.lang.String type
The type of operator (for example convolution).

name

protected java.lang.String name
The unique name of the operator (for example convolution)

box

protected operatorBox box
The graphical representation of this operator on the UI.
Constructor Detail

operator

public operator()
Method Detail

saveOperator

public java.lang.String saveOperator()
Returns a String representing the operator, containing all the information required to reconstruct this operator at a later date.
Returns:
the String containing all necessary information

setBox

protected void setBox(javax.swing.JPanel panel,
                      linkData links,
                      int inputs,
                      int outputs)
Creates the box for the operator which is the graphical representation of the operator on the UI.
Parameters:
panel - the panel that the box is to added to
links - the representation of the links between the operators
inputs - the number of inputs to the operator (1 or 2)
outputs - the number of outputs from the operator (1 or 2)

getBox

protected operatorBox getBox()
Returns the graphical representation of the operator.
Returns:
the operatorBox representing the operator

getParameters

public javax.swing.JFrame getParameters()
Returns the parameters frame for this operator.
Parameters:
the - parameters frame for this operator

updateParameters

protected void updateParameters()
Lays out the parameters frame correctly.

setName

public void setName(java.lang.String name)
Sets the name of this operator.
Parameters:
name - of the operator to be used

getName

public java.lang.String getName()
Returns the name of the operator.
Returns:
the operator name

showParameters

public void showParameters()
Makes the parameters window visible and deiconifies it if necessary.

setType

public void setType(java.lang.String type)

getType

public java.lang.String getType()
Returns the type of this operator (for example convolution).
Returns:
the type of the operator

propagate

public void propagate()
Runs all the operators that this operator passes stuff to (all operators that are input linked to one of this operator's outputs).

propagateSingleLink

public void propagateSingleLink(singleLink link)
Passes data from one of this operator's output to one of another operator's input (converting the image representation if necessary) and runs the next operator.
Parameters:
link - the link that is to be used

setInput1

public abstract void setInput1(image x)
Sets input1 to the specified image.
Parameters:
x - the image to be used

setInput2

public abstract void setInput2(image x)
Sets input2 to the specified image.
Parameters:
x - the image to be used

link1To1

public abstract void link1To1(operator linkOp)
Adds a link between this operator and another operator (output1 to input1).
Parameters:
linkOp - the operator to be linked to

link1To2

public abstract void link1To2(operator linkOp)
Adds a link between this operator and another operator (output1 to input2).
Parameters:
linkOp - the operator to be linked to

link2To1

public abstract void link2To1(operator linkOp)
Adds a link between this operator and another operator (output2 to input1).
Parameters:
linkOp - the operator to be linked to

link2To2

public abstract void link2To2(operator linkOp)
Adds a link between this operator and another operator (output2 to input2).
Parameters:
linkOp - the operator to be linked to

saveParameters

public abstract java.lang.String saveParameters()
Returns a String representing all the parameters for this operator for the purpose of saving the system setup (and being able to load it again at a future date).
Returns:
String representing the operator

loadParameters

public abstract void loadParameters(java.io.StreamTokenizer tokenizer)
                             throws java.io.IOException

go

public abstract void go()
Runs the operator and then propagates the outputs to all operators that this operator links to.