|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensourcephysics.display3d.simple3d.Element
Title: Element
Interaction: An Element includes the following targets:
Copyright: Open Source Physics project
Nested Class Summary |
Nested classes inherited from class org.opensourcephysics.display3d.core.Element |
Element.Loader |
Field Summary | |
protected InteractionTarget |
targetPosition
|
protected InteractionTarget |
targetSize
|
Fields inherited from interface org.opensourcephysics.display3d.core.Element |
TARGET_POSITION, TARGET_SIZE |
Constructor Summary | |
Element()
|
Method Summary | |
void |
addInteractionListener(org.opensourcephysics.display3d.core.interaction.InteractionListener listener)
|
protected double[] |
getHotSpotBodyCoordinates(InteractionTarget target)
Returns the body coordinates of the specified hotspot |
org.opensourcephysics.display3d.core.interaction.InteractionTarget |
getInteractionTarget(int target)
|
java.lang.String |
getName()
Gets the name of the element |
double |
getSizeX()
Get the size along the X axis |
double |
getSizeY()
Get the size along the Y axis |
double |
getSizeZ()
Get the size along the Z axis |
Style |
getStyle()
Gets the style of the element |
protected InteractionTarget |
getTargetHit(int x,
int y)
Gets the target that is under the (x,y) position of the screen |
Transformation |
getTransformation()
Returns a clone of the element transformation |
double |
getX()
Get the X coordinate of the element |
double |
getY()
Get the Y coordinate of the element |
double |
getZ()
Get the Z coordinate of the element |
protected boolean |
isReallyVisible()
Returns the real visibility status of the element, which will be false if it belongs to an invisible group |
boolean |
isVisible()
Whether the element is visible |
void |
loadUnmutableObjects(XMLControl control)
Loads unmutable objects of the Element, such as the style, as well as perform any extra implementation-specific initialization. |
void |
removeInteractionListener(org.opensourcephysics.display3d.core.interaction.InteractionListener listener)
|
void |
setName(java.lang.String aName)
Gives a name to the element. |
void |
setSizeX(double sizeX)
Set the size along the X axis |
void |
setSizeXYZ(double[] size)
Sets the size of the element. |
void |
setSizeXYZ(double sizeX,
double sizeY,
double sizeZ)
Set the size along the X, Y and Z axes |
void |
setSizeY(double sizeY)
Set the size along the Y axis |
void |
setSizeZ(double sizeZ)
Set the size along the Z axis |
void |
setTransformation(Transformation transformation)
Sets the internal transformation of the element, that is, the transformation that converts the standard XYZ axes to the body's internal reference axes. |
void |
setVisible(boolean _visible)
Sets the visibility of the element |
void |
setX(double x)
Set the X coordinate of the element |
void |
setXYZ(double[] pos)
Sets the coordinates of the element. |
void |
setXYZ(double x,
double y,
double z)
Set the X, Y, and Z coordinates of the element |
void |
setY(double y)
Set the Y coordinate of the element |
void |
setZ(double z)
Set the Z coordinate of the element |
double[] |
toBodyFrame(double[] vector)
This method converts a double[3] vector from the space's frame to the body's frame. |
double[] |
toSpaceFrame(double[] vector)
This method transforms a double[3] vector from the body's frame to the space's frame. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final InteractionTarget targetPosition
protected final InteractionTarget targetSize
Constructor Detail |
public Element()
Method Detail |
public void setName(java.lang.String aName)
Element
setName
in interface Element
aName
- Stringpublic final java.lang.String getName()
Element
getName
in interface Element
public void setX(double x)
Element
setX
in interface Element
x
- doublepublic final double getX()
Element
getX
in interface Element
public void setY(double y)
Element
setY
in interface Element
y
- doublepublic final double getY()
Element
getY
in interface Element
public void setZ(double z)
Element
setZ
in interface Element
z
- doublepublic final double getZ()
Element
getZ
in interface Element
public void setXYZ(double x, double y, double z)
Element
setXYZ
in interface Element
x
- doubley
- doublez
- doublepublic void setXYZ(double[] pos)
Element
setXYZ
in interface Element
pos
- double[]public void setSizeX(double sizeX)
Element
setSizeX
in interface Element
sizeX
- doublepublic final double getSizeX()
Element
getSizeX
in interface Element
public void setSizeY(double sizeY)
Element
setSizeY
in interface Element
sizeY
- doublepublic final double getSizeY()
Element
getSizeY
in interface Element
public void setSizeZ(double sizeZ)
Element
setSizeZ
in interface Element
sizeZ
- doublepublic final double getSizeZ()
Element
getSizeZ
in interface Element
public void setSizeXYZ(double sizeX, double sizeY, double sizeZ)
Element
setSizeXYZ
in interface Element
sizeX
- doublesizeY
- doublesizeZ
- doublepublic void setSizeXYZ(double[] size)
Element
setSizeXYZ
in interface Element
size
- double[]public void setVisible(boolean _visible)
Element
setVisible
in interface Element
_visible
- booleanpublic final boolean isVisible()
Element
isVisible
in interface Element
protected final boolean isReallyVisible()
public final Style getStyle()
Element
getStyle
in interface Element
Style
public Transformation getTransformation()
Element
getTransformation
in interface Element
public void setTransformation(Transformation transformation)
Element
setTransformation
in interface Element
transformation
- the new transformationTransformation
public double[] toSpaceFrame(double[] vector)
Element
toSpaceFrame
in interface Element
vector
- double[] The original coordinates in the body frame
public double[] toBodyFrame(double[] vector) throws java.lang.UnsupportedOperationException
Element
toBodyFrame
in interface Element
vector
- double[] The original coordinates in the space
java.lang.UnsupportedOperationException
public org.opensourcephysics.display3d.core.interaction.InteractionTarget getInteractionTarget(int target)
getInteractionTarget
in interface org.opensourcephysics.display3d.core.interaction.InteractionSource
public void addInteractionListener(org.opensourcephysics.display3d.core.interaction.InteractionListener listener)
addInteractionListener
in interface org.opensourcephysics.display3d.core.interaction.InteractionSource
public void removeInteractionListener(org.opensourcephysics.display3d.core.interaction.InteractionListener listener)
removeInteractionListener
in interface org.opensourcephysics.display3d.core.interaction.InteractionSource
protected InteractionTarget getTargetHit(int x, int y)
x
- inty
- int
protected double[] getHotSpotBodyCoordinates(InteractionTarget target)
public void loadUnmutableObjects(XMLControl control)
Element
loadUnmutableObjects
in interface Element
control
- XMLControl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |