Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gui
Class ComputeButtonListener  view ComputeButtonListener download ComputeButtonListener.java

java.lang.Object
  extended bygui.ComputeButtonListener
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class ComputeButtonListener
extends java.lang.Object
implements java.awt.event.ActionListener

This class is listener for "Compute" button

Version:
1.5

Field Summary
(package private)  expression.Expression ex
          expression in a input field
(package private)  java.awt.TextArea inputArea
          location of user input
(package private)  java.applet.Applet logic
          applet wher button "Compute" is located
(package private)  java.awt.TextArea outputArea
          location of program output
(package private)  java.awt.Label statusLabel
          label where program status is shown
(package private)  java.awt.Choice taskChoice
          location of possible tasks
(package private)  java.util.Vector vect
          vector that helps to print the syntax tree of expression and truth table
 
Constructor Summary
ComputeButtonListener(java.applet.Applet applet, java.awt.TextArea input, java.awt.TextArea output, java.awt.Choice task, java.awt.Label status)
          Constructs the Compute button listener
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          What to do when button Compute is pressed
 void drawFullTruthTable(java.lang.String[][] table, java.util.Vector vect)
          This method displays the full truth table of the given expression
 void drawTruthTable(java.lang.String[][] table)
          This method displays the truth coulumn of the given expression.
 void expressionClass(java.lang.String[][] table)
          This method displays the class of the given expression
 java.lang.String wrapLine(java.lang.String text)
          This method wraps too long lines to a output area width
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logic

java.applet.Applet logic
applet wher button "Compute" is located


inputArea

java.awt.TextArea inputArea
location of user input


outputArea

java.awt.TextArea outputArea
location of program output


taskChoice

java.awt.Choice taskChoice
location of possible tasks


ex

expression.Expression ex
expression in a input field


vect

java.util.Vector vect
vector that helps to print the syntax tree of expression and truth table


statusLabel

java.awt.Label statusLabel
label where program status is shown

Constructor Detail

ComputeButtonListener

public ComputeButtonListener(java.applet.Applet applet,
                             java.awt.TextArea input,
                             java.awt.TextArea output,
                             java.awt.Choice task,
                             java.awt.Label status)
Constructs the Compute button listener

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
What to do when button Compute is pressed

Specified by:
actionPerformed in interface java.awt.event.ActionListener

drawTruthTable

public void drawTruthTable(java.lang.String[][] table)
This method displays the truth coulumn of the given expression.


drawFullTruthTable

public void drawFullTruthTable(java.lang.String[][] table,
                               java.util.Vector vect)
This method displays the full truth table of the given expression


expressionClass

public void expressionClass(java.lang.String[][] table)
This method displays the class of the given expression


wrapLine

public java.lang.String wrapLine(java.lang.String text)
This method wraps too long lines to a output area width