| java.lang.Object org.ofbiz.rules.logikus.LogikusMediator
LogikusMediator | public class LogikusMediator implements ActionListener,Runnable(Code) | | This class supports a LogikusIde object, handling the interaction of the IDE's components.
An object of the IDE (Interactive Development
Environment) has text areas for a Logikus program, a
query against the program, and for the results of a
query.
When a user clicks on the "Next" or "Rest" button, the
mediator parses the program (if it has changed), and
parses the query (if the query has changed). The
mediator then proves the query against the program.
After each proof, the mediator displays the query's
variables in the results text area.
The mediator uses a separate thread to prove the query.
While this thread conducts a proof, the mediator
disables most of the IDE's components, except for the
"Halt" button, which stops the proof thread.
author: Steven J. Metsker version: 1.0 |
Method Summary | |
public void | actionPerformed(ActionEvent event) This method reacts, when the user presses one of the
IDE's buttons. | protected void | conductProof() Parse the program and query (if they have changed)
and proved the query in a separate thread. | protected void | display(String s) Appends the given line to the results text area,
scheduling this event with the event-dispatching thread. | public void | initialize(JButton proveNextButton, JButton proveRestButton, JButton haltButton, JButton clearProgramButton, JButton clearResultsButton, JTextArea programArea, JTextArea resultsArea, JTextArea queryArea) Make the IDE's GUI components available. | protected void | parseProgramAndQuery() Parses the program and query texts. | protected void | proveNext() Proves the query against the program. | protected void | proveRemaining() Proves the query against the program until no proofs
remain. | public void | run() Proves the query against the program. | protected void | setComputing(boolean computing) Sets the state of the IDE to computing or not. |
proveRemaining | protected boolean proveRemaining(Code) | | |
actionPerformed | public void actionPerformed(ActionEvent event)(Code) | | This method reacts, when the user presses one of the
IDE's buttons.
Parameters: ActionEvent - the event |
conductProof | protected void conductProof()(Code) | | Parse the program and query (if they have changed)
and proved the query in a separate thread.
|
display | protected void display(String s)(Code) | | Appends the given line to the results text area,
scheduling this event with the event-dispatching thread.
Parameters: String - the string to append to the resultsarea |
parseProgramAndQuery | protected void parseProgramAndQuery()(Code) | | Parses the program and query texts.
|
proveNext | protected void proveNext()(Code) | | Proves the query against the program.
|
proveRemaining | protected void proveRemaining()(Code) | | Proves the query against the program until no proofs
remain.
|
run | public void run()(Code) | | Proves the query against the program.
|
setComputing | protected void setComputing(boolean computing)(Code) | | Sets the state of the IDE to computing or not. Most of the
IDE's controls are grayed out during computation of a
program.
boolean if true, indicates that a proof threadis finding one or more proofs |
|
|