All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javaParse.Transition

java.lang.Object
   |
   +----javaParse.Transition

public class Transition
extends Object
This class implements the transition function of a machine. It is designed to be used with the current machine types: FSA, PDA, TM1, TM2.


Variable Index

 o distance
 o fieldCounter
 o from
 o label
 o off
 o offr
 o selectedSublabel
 o separator
 o st
 o sublabel
 o to

Constructor Index

 o Transition(State, State, int, String[])
Creates a transition with the given from and to states.
 o Transition(State, State, String, int, String[])
Creates a transition with the given from and to states and with the given label.
 o Transition(State, String, State)

Method Index

 o computeArrow(Point, int[], int[])
Computes the points of the little triangle which shows the direction of the transition.
 o move(int, int)
 o paintLabel(Graphics, Transition, Point)
Paints the label of a transition.
 o paintLine(Graphics, Transition)
Paints the line of a transition.
 o processKey(int, KeyEvent)
processes a KeyEvent that occured in this transition for the Desktop.
 o setLabel(Vector)
 o slope()
Returns the slope of the line between the from and to states.
 o tokenizeLabel()
Tokenizes the given label.
 o tokenizeOrList()
returns a Vector of Strings corresponding to the list of ORed transitions represented by this Transition works only for FSA's

Variables

 o from
 public State from
 o to
 public State to
 o label
 public String label
 o sublabel
 public String sublabel[]
 o distance
 public int distance
 o st
 public int st
 o fieldCounter
 public int fieldCounter
 o separator
 public String separator[]
 o selectedSublabel
 public int selectedSublabel
 o off
 public static final int off
 o offr
 public static final int offr

Constructors

 o Transition
 public Transition(State from,
                   State to,
                   String symbol,
                   int fields,
                   String seps[])
Creates a transition with the given from and to states and with the given label.

 o Transition
 public Transition(State from,
                   State to,
                   int fields,
                   String seps[])
Creates a transition with the given from and to states.

 o Transition
 public Transition(State ifrom,
                   String ilabel,
                   State ito)

Methods

 o move
 public void move(int x,
                  int y)
 o slope
 public double slope()
Returns the slope of the line between the from and to states.

 o paintLabel
 public void paintLabel(Graphics g,
                        Transition selectedTransition,
                        Point pl)
Paints the label of a transition.

 o paintLine
 public void paintLine(Graphics g,
                       Transition selectedTransition)
Paints the line of a transition.

 o computeArrow
 public void computeArrow(Point pl,
                          int xPoints[],
                          int yPoints[])
Computes the points of the little triangle which shows the direction of the transition.

Parameters:
pl - the upper left corner of the transition's label.
xpoints - the x coordinates of the points representing the arrow.
ypoints - the y coordinates of the points representing the arrow.
 o processKey
 public boolean processKey(int key,
                           KeyEvent e)
processes a KeyEvent that occured in this transition for the Desktop.

 o tokenizeLabel
 public void tokenizeLabel()
Tokenizes the given label. The result is stored in the sublabel array.

 o tokenizeOrList
 public Vector tokenizeOrList()
returns a Vector of Strings corresponding to the list of ORed transitions represented by this Transition works only for FSA's

 o setLabel
 public void setLabel(Vector aVector)

All Packages  Class Hierarchy  This Package  Previous  Next  Index