|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.ejs.control.ControlElement org.opensourcephysics.ejs.control.swing.ControlSwingElement
public abstract class ControlSwingElement
ControlSwingElement
is a base class for an object that
displays a visual java.awt.Component.
Component
,
ControlElement
Field Summary | |
---|---|
static int |
ACTION_OFF
|
static int |
ACTION_ON
|
static int |
ACTION_PRESS
|
static int |
BACKGROUND
|
static int |
ENABLED
|
static int |
FONT
|
static int |
FOREGROUND
|
protected java.awt.Component |
myVisual
|
static int |
NAME
|
static int |
PARENT
|
static int |
POSITION
|
static int |
SIZE
|
static int |
TOOLTIP
|
static int |
VISIBLE
|
Fields inherited from class org.opensourcephysics.ejs.control.ControlElement |
---|
ACTION, isUnderEjs, METHOD_FOR_VARIABLE, METHOD_TRIGGER, myGroup, myObject, myPropertiesTable, VARIABLE_CHANGED |
Constructor Summary | |
---|---|
ControlSwingElement(java.lang.Object _visual)
Instantiates an object that wrapps a Swing JComponent of this type. |
Method Summary | |
---|---|
protected abstract java.awt.Component |
createVisual(java.lang.Object _visual)
Creates the visual component of this ControlElement ,
the one you can configure graphically. |
java.awt.Component |
getComponent()
Returns the component of this ControlElement ,
the one that is added to a container. |
protected javax.swing.ImageIcon |
getIcon(java.lang.String _iconFile)
|
java.lang.String |
getPropertyInfo(java.lang.String _property)
Returns information about a given property. |
java.util.ArrayList<java.lang.String> |
getPropertyList()
Returns the list of all properties that can be set for this ControlElement. |
Value |
getValue(int _index)
Gets the value of any internal variable. |
java.awt.Component |
getVisual()
Returns the visual component of this ControlElement ,
the one you can configure graphically. |
Value |
parseConstant(java.lang.String _propertyType,
java.lang.String _value)
Checks if a value can be considered a valid constant value for a property If not, it returns null, meaning the value can be considered to be a GroupVariable or a primitive constant. |
void |
setDefaultValue(int _index)
|
void |
setValue(int _index,
Value _value)
Sets the value of the registered variables. |
Methods inherited from class org.opensourcephysics.ejs.control.ControlElement |
---|
addAction, addAction, addAction, destroy, getGroup, getObject, getProperty, getSimulation, implementsProperty, initialize, invokeActions, invokeActions, isActive, propertyIsTypeOf, propertyType, removeAction, removeAction, reset, setActive, setGroup, setProperties, setProperty, toString, variableChanged, variableChangedDoNotUpdate, variablePropertiesClear, variablesChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NAME
public static final int POSITION
public static final int PARENT
public static final int ENABLED
public static final int VISIBLE
public static final int SIZE
public static final int FOREGROUND
public static final int BACKGROUND
public static final int FONT
public static final int TOOLTIP
public static final int ACTION_PRESS
public static final int ACTION_ON
public static final int ACTION_OFF
protected java.awt.Component myVisual
Constructor Detail |
---|
public ControlSwingElement(java.lang.Object _visual)
_visual
- The javax.swing.JComponent to be wrappedMethod Detail |
---|
protected abstract java.awt.Component createVisual(java.lang.Object _visual)
ControlElement
,
the one you can configure graphically.
If an object of an appropriate class is provided, it is used as
the visual.
_visual
- The javax.swing.JComponent to be wrappedpublic final java.awt.Component getVisual()
ControlElement
,
the one you can configure graphically.
getVisual
in class ControlElement
public java.awt.Component getComponent()
ControlElement
,
the one that is added to a container.
getComponent
in class ControlElement
public java.util.ArrayList<java.lang.String> getPropertyList()
getPropertyList
in class ControlElement
public java.lang.String getPropertyInfo(java.lang.String _property)
getPropertyInfo
in class ControlElement
public Value parseConstant(java.lang.String _propertyType, java.lang.String _value)
parseConstant
in class ControlElement
String
- _property The property nameString
- _value The proposed value for the propertypublic void setValue(int _index, Value _value)
setValue
in class ControlElement
_index
- A keyword index that distinguishes among variables_value
- The object holding the value for the variable.public void setDefaultValue(int _index)
setDefaultValue
in class ControlElement
public Value getValue(int _index)
getValue
in class ControlElement
_index
- A keyword index that distinguishes among variables
protected javax.swing.ImageIcon getIcon(java.lang.String _iconFile)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |