Package org.opensourcephysics.controls
Interface Control
- All Known Subinterfaces:
SimControl
,View
,XMLControl
- All Known Implementing Classes:
AnimationControl
,CalculationControl
,ControlFrame
,EjsCalculationControl
,EjsControl
,EjsControlFrame
,EjsSimulationControl
,HiddenControl
,OSPControl
,OSPControlTable
,ParsedEjsControl
,SimulationControl
,XMLControlElement
public interface Control
Graphical User Interfaces implement the Control interface.
- Version:
- 1.0
- Author:
- Joshua Gould, Wolfgang Christian
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
calculationDone
(String message) Notifies the control when a calculation has completed.void
Clears all text from the control's message area.void
Clears all text from the control's data input area.boolean
getBoolean
(String name) Gets a stored boolean from the control.double
Gets a stored double value from the control.int
Gets a stored integer value from the control.Gets the object with the specified property name.Gets the names of all properties stored in this control.Gets the names of all properties stored in this control.Gets a stored string from the control.void
Prints a string in the control's message area.void
println()
Prints a blank line in the control's message area.void
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
Stores a name and a boolean value in the control.void
Stores a name and a double value in the control.default void
void
Stores a name and an integer value in the control.void
Stores a name and a value in the control.
-
Field Details
-
NOT_EDITABLE_BACKGROUND
-
-
Method Details
-
setLockValues
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
Stores a name and a value in the control. GUI controls will usually display the name followed by an equal sign followed by thetoString<\code> representation of the object.
- Parameters:
name
-val
-
-
setValue
-
setValue
Stores a name and a double value in the control. GUI controls will usually display the name followed by an equal sign followed by thetoString<\code> representation of the double.
- Parameters:
name
-val
-
-
setValue
Stores a name and an integer value in the control. GUI controls will usually display the name followed by an equal sign followed by thetoString<\code> representation of the integer.
- Parameters:
name
-val
-
-
setValue
Stores a name and a boolean value in the control. GUI controls will usually display the name followed by an equal sign followed by thetoString<\code> representation of the integer.
- Parameters:
name
-val
-
-
getInt
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
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
Gets the object with the specified property name.- Parameters:
name
- the name- Returns:
- the object
-
getString
Gets a stored string from the control. Srings have usually been initialized with thesetValue (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
Gets a stored boolean from the control. Srings have usually been initialized with thesetValue (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
Collection<String> getPropertyNames()Gets the names of all properties stored in this control.- Returns:
- a clone of the properties List
-
getPropertyNamesRaw
Collection<String> getPropertyNamesRaw()Gets the names of all properties stored in this control.- Returns:
- the actual property list
-
println
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
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. -
clearValues
void clearValues()Clears all text from the control's data input area. -
calculationDone
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
-
-