|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface InteractiveElement
InteractiveElement
is an interface that extends Drawable3D and Measurable3D, but also Interactive and InteractionSource.
This means already that an interactive element is ready to be drawn in three dimensions, responds to user interaction, and is able to
send interactive events to registered listeners.
This interface also defines methods designed to help you work with elements in a way similar to that you work with physical objects in real life. Using implementing classes, you will find yourself creating and handling (moving, resizing,...) objects in a way similar to what you would do in real life.
This interface provides an API for three-dimensional (interactive, drawable) objects that:
Style
and Resolution
suggestions for their representation on the screen,
Field Summary | |
---|---|
static int |
TARGET_POSITION
|
static int |
TARGET_SIZE
|
Method Summary | |
---|---|
void |
canBeMeasured(boolean _canBe)
Whether the element should be taken into account for computing the scales. |
void |
copyFrom(InteractiveElement _element)
|
Control |
getControl()
|
Group |
getGroup()
Gets the group to which the element belongs. |
Resolution |
getResolution()
Get the resolution suggestions for this element. |
int |
getSensitivity()
|
ElementSet |
getSet()
|
int |
getSetIndex()
|
double |
getSizeX()
Returns the size of the element in the X dimension |
double |
getSizeY()
Returns the size of the element in the Y dimension |
double |
getSizeZ()
Returns the size of the element in the Z dimension |
Style |
getStyle()
The set of style suggestions for this element. |
double |
getX()
Returns the X location of the element |
double |
getY()
Returns the Y location of the element |
double |
getZ()
Returns the Z location of the element |
void |
initializeMemberOfSet()
Special initialization when used as a memeber of a Set |
boolean |
isGroupEnabled()
Whether interaction on any of the targets of this element affects the whole group |
boolean |
isGroupEnabled(int target)
Whether interaction on a given target of this element affects the whole group |
boolean |
isVisible()
Whether the element is visible or not |
void |
setControl(Control control)
|
void |
setGroup(Group group)
Sets whether this element should move and size as part of a group. |
void |
setGroupEnabled(boolean affectsGroup)
Whether interaction on any of the targets of the element should affect the whole group (if the element is in a group). |
void |
setGroupEnabled(int target,
boolean affectsGroup)
Whether interaction on a given target of the element should affect the whole group (if the element is in a group) By default, only TARGET_POSITION targets are group-enabled. |
void |
setResolution(Resolution resolution)
Resolution suggestions for the element. |
void |
setSensitivity(int sensitiviy)
Sets the size of the interaction hot spot (in pixels). |
void |
setSet(ElementSet set,
int index)
|
void |
setSizeX(double x)
Resizes the element in the X dimension |
void |
setSizeXY(double x,
double y)
Resizes the element in the X and Y dimensions |
void |
setSizeXYZ(double x,
double y,
double z)
Resizes the element in the X, Y, and Z dimensions |
void |
setSizeY(double y)
Resizes the element in the Y dimension |
void |
setSizeZ(double z)
Resizes the element in the Z dimension |
void |
setVisible(boolean visible)
Sets the visibility of the element |
void |
setX(double x)
Moves the element to a new X location |
void |
setXY(double x,
double y)
Moves the element to a new X and Y location |
void |
setXYZ(double x,
double y,
double z)
Moves the element to a new X, Y, and Z location |
void |
setY(double y)
Moves the element to a new Y location |
void |
setZ(double z)
Moves the element to a new Z location |
java.lang.String |
toXML()
Get an XML description of this element. |
Methods inherited from interface org.opensourcephysics.displayejs.Drawable3D |
---|
draw, drawQuickly, getObjects3D, needsToProject |
Methods inherited from interface org.opensourcephysics.displayejs.InteractionSource |
---|
addListener, invokeActions, isEnabled, isEnabled, removeAllListeners, removeListener, setEnabled, setEnabled |
Methods inherited from interface org.opensourcephysics.display.Interactive |
---|
findInteractive, isEnabled, setEnabled |
Methods inherited from interface org.opensourcephysics.displayejs.Measurable3D |
---|
getZMax, getZMin |
Methods inherited from interface org.opensourcephysics.display.Measurable |
---|
getXMax, getXMin, getYMax, getYMin, isMeasured |
Methods inherited from interface org.opensourcephysics.display.Drawable |
---|
draw |
Methods inherited from interface org.opensourcephysics.displayejs.HasDataObjectInterface |
---|
getDataObject, setDataObject |
Field Detail |
---|
static final int TARGET_POSITION
static final int TARGET_SIZE
Method Detail |
---|
void setX(double x)
setX
in interface Interactive
x
- the new X location for the elementdouble getX()
getX
in interface Interactive
void setY(double y)
setY
in interface Interactive
y
- the new Y location for the elementdouble getY()
getY
in interface Interactive
void setZ(double z)
z
- the new Z location for the elementdouble getZ()
void setXY(double x, double y)
setXY
in interface Interactive
x
- the new X location for the elementy
- the new Y location for the elementvoid setXYZ(double x, double y, double z)
x
- the new X location for the elementy
- the new Y location for the elementz
- the new Z location for the elementvoid setSizeX(double x)
sizex
- the new X size for the elementdouble getSizeX()
void setSizeY(double y)
sizey
- the new Y size for the elementdouble getSizeY()
void setSizeZ(double z)
sizez
- the new Z size for the elementdouble getSizeZ()
void setSizeXY(double x, double y)
sizex
- the new X size for the elementsizey
- the new Y size for the elementvoid setSizeXYZ(double x, double y, double z)
sizex
- the new X size for the elementsizey
- the new Y size for the elementsizez
- the new Z size for the elementvoid setVisible(boolean visible)
visible
- the desired visibility for the elementboolean isVisible()
void canBeMeasured(boolean _canBe)
Style getStyle()
Style
void setResolution(Resolution resolution)
the
- new resolution for the element.Resolution
Resolution getResolution()
Resolution
void setSensitivity(int sensitiviy)
sensitiviy
- intint getSensitivity()
void setGroup(Group group)
_element
- the group to which the element belongs. null if it doesn't belong to any group.Group
Group getGroup()
Group
void setGroupEnabled(boolean affectsGroup)
affectsGroup
- true if interactions should affect the whole group,
false if they should affect only the element within the group.boolean isGroupEnabled()
void setGroupEnabled(int target, boolean affectsGroup)
target
- An integer that identifies a target of the element.affectsGroup
- true (the default) if interactions on this target should affect the whole group,
false if they should affect only the element within the group.boolean isGroupEnabled(int target)
target
- An integer that identifies a target of the element.
void setSet(ElementSet set, int index)
ElementSet getSet()
int getSetIndex()
void initializeMemberOfSet()
void setControl(Control control)
Control getControl()
java.lang.String toXML()
void copyFrom(InteractiveElement _element)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |