org.colos.ejs.library
Interface View


public interface View

A base interface for the graphical user interface of a simulation


Method Summary
 void blockVariable(java.lang.String variable)
          Protects a view variable from being updated
 void clearMessages()
          Clears all text from the control's message area.
 void collectData()
          Accept data sent but do not graphic work
 void finalUpdate()
          Does the final update which makes the drawing complete.
 java.awt.Component getComponent(java.lang.String _name)
          Get a graphical object
 ControlElement getElement(java.lang.String _name)
          Get a ControlElement by name
 java.util.Vector<ControlElement> getElements()
          Get the Vector elementList of the simualtion controls
 void initialize()
          A softer reset.
 void onExit()
          Clean-up when you exit
 void print(java.lang.String s)
          Prints a string in the control's message area.
 void println()
          Prints a blank line in the control's message area.
 void println(java.lang.String s)
          Prints a string in the control's message area followed by a CR and LF.
 void read()
          Read current data
 void read(java.lang.String _variable)
          Read a single variable
 void reset()
          Clearing any previous data
 void setUpdateSimulation(boolean _value)
          Whether the view must inform any simulation to update whenever it changes because of user interaction
 void update()
          Accept data sent and display it
 

Method Detail

reset

void reset()
Clearing any previous data


initialize

void initialize()
A softer reset. Calling reset makes initialize unnecessary


read

void read()
Read current data


read

void read(java.lang.String _variable)
Read a single variable


update

void update()
Accept data sent and display it


finalUpdate

void finalUpdate()
Does the final update which makes the drawing complete. Typically used by drawing panels for rendering


collectData

void collectData()
Accept data sent but do not graphic work


onExit

void onExit()
Clean-up when you exit


setUpdateSimulation

void setUpdateSimulation(boolean _value)
Whether the view must inform any simulation to update whenever it changes because of user interaction

Parameters:
_value - boolean

getComponent

java.awt.Component getComponent(java.lang.String _name)
Get a graphical object

Parameters:
_name - A keyword that identifies the graphical object that must be retrieved. Typically its name.
Returns:
The graphical component

getElement

ControlElement getElement(java.lang.String _name)
Get a ControlElement by name

Parameters:
_name - A keyword that identifies the control element that must be retrieved. Typically its name.
Returns:
The ControlElement

blockVariable

void blockVariable(java.lang.String variable)
Protects a view variable from being updated

Parameters:
variable -

println

void println(java.lang.String s)
Prints a string in the control's message area followed by a CR and LF. GUI controls will usually display messages in a non-editable text area.

Parameters:
s -

println

void println()
Prints a blank line in the control's message area. GUI controls will usually display messages in a non-editable text area.


print

void print(java.lang.String s)
Prints a string in the control's message area. GUI controls will usually display messages in a non-editable text area.

Parameters:
s -

clearMessages

void clearMessages()
Clears all text from the control's message area.


getElements

java.util.Vector<ControlElement> getElements()
Get the Vector elementList of the simualtion controls