org.opensourcephysics.controls
Interface Control

All Known Subinterfaces:
SimControl, View, XMLControl
All Known Implementing Classes:
ControlFrame, HiddenControl, OSPControlTable, SimulationControl, XMLControlElement

public interface Control

Graphical User Interfaces implement the Control interface.


Method Summary
 void calculationDone(java.lang.String message)
          Notifies the control when a calculation has completed.
 void clearMessages()
          Clears all text from the control's message area.
 void clearValues()
          Clears all text from the control's data input area.
 boolean getBoolean(java.lang.String name)
          Gets a stored boolean from the control.
 double getDouble(java.lang.String name)
          Gets a stored double value from the control.
 int getInt(java.lang.String name)
          Gets a stored integer value from the control.
 java.lang.Object getObject(java.lang.String name)
          Gets the object with the specified property name.
 java.util.Collection getPropertyNames()
          Gets the names of all properties stored in this control.
 java.lang.String getString(java.lang.String name)
          Gets a stored string from the control.
 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 setLockValues(boolean lock)
          Locks the control's interface.
 void setValue(java.lang.String name, boolean val)
          Stores a name and a boolean value in the control.
 void setValue(java.lang.String name, double val)
          Stores a name and a double value in the control.
 void setValue(java.lang.String name, int val)
          Stores a name and an integer value in the control.
 void setValue(java.lang.String name, java.lang.Object val)
          Stores a name and a value in the control.
 

Method Detail

setLockValues

public void setLockValues(boolean lock)
Locks the control's interface. Values sent to the control will not update the display until the control is unlocked.

Parameters:
lock - boolean

setValue

public void setValue(java.lang.String name,
                     java.lang.Object val)
Stores a name and a value in the control. GUI controls will usually display the name followed by an equal sign followed by the toString<\code> representation of the object.

Parameters:
name -
val -

setValue

public void setValue(java.lang.String name,
                     double val)
Stores a name and a double value in the control. GUI controls will usually display the name followed by an equal sign followed by the toString<\code> representation of the double.

Parameters:
name -
val -

setValue

public void setValue(java.lang.String name,
                     int val)
Stores a name and an integer value in the control. GUI controls will usually display the name followed by an equal sign followed by the toString<\code> representation of the integer.

Parameters:
name -
val -

setValue

public void setValue(java.lang.String name,
                     boolean val)
Stores a name and a boolean value in the control. GUI controls will usually display the name followed by an equal sign followed by the toString<\code> representation of the integer.

Parameters:
name -
val -

getInt

public int getInt(java.lang.String name)
Gets a stored integer value from the control. GUI controls will usually allow the user to edit the value of the parameter.

Parameters:
name -
Returns:
the value of the parameter

getDouble

public double getDouble(java.lang.String name)
Gets a stored double value from the control. GUI controls will usually allow the user to edit the value of the parameter.

Parameters:
name -
Returns:
the value of the parameter

getObject

public java.lang.Object getObject(java.lang.String name)
Gets the object with the specified property name.

Parameters:
name - the name
Returns:
the object

getString

public java.lang.String getString(java.lang.String name)
Gets a stored string from the control. Srings have usually been initialized with the setValue (String name, Object val)<\code> method. GUI controls will usually allow the user to edit the value of the parameter.

Parameters:
name -
Returns:
the value of the parameter

getBoolean

public boolean getBoolean(java.lang.String name)
Gets a stored boolean from the control. Srings have usually been initialized with the setValue (String name, Object val)<\code> method. GUI controls will usually allow the user to edit the value of the parameter.

Parameters:
name -
Returns:
the value of the parameter

getPropertyNames

public java.util.Collection getPropertyNames()
Gets the names of all properties stored in this control.

Returns:
List

println

public 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

public 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

public 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

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


clearValues

public void clearValues()
Clears all text from the control's data input area.


calculationDone

public void calculationDone(java.lang.String message)
Notifies the control when a calculation has completed. Some controls, such as the animation control, change their appearance during a calculation. A completed calculation, such as when a predetermined tolerance is reached, can call this method. The message will be displayed in the control's message area.

Parameters:
message -