|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.display3d.simple3d.Element
public abstract class Element
Title: Element
Interaction: An Element includes the following targets:
Copyright: Open Source Physics project
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface 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(InteractionListener listener)
Adds the specified interaction listener to receive interaction events to any of its targets from this source. |
protected int |
getAxesMode()
|
DrawingPanel3D |
getDrawingPanel3D()
Returns the DrawingPanel3D in which it (or its final ancestor group) is displayed. |
protected double[] |
getHotSpotBodyCoordinates(InteractionTarget target)
Returns the body coordinates of the specified hotspot |
InteractionTarget |
getInteractionTarget(int target)
Gives access to one of the targets of this source. |
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(InteractionListener listener)
Removes the specified interaction 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 final DrawingPanel3D getDrawingPanel3D()
getDrawingPanel3D in interface Elementprotected int getAxesMode()
public void setName(java.lang.String aName)
Element
setName in interface ElementaName - Stringpublic final java.lang.String getName()
Element
getName in interface Elementpublic void setX(double x)
Element
setX in interface Elementx - doublepublic final double getX()
Element
getX in interface Elementpublic void setY(double y)
Element
setY in interface Elementy - doublepublic final double getY()
Element
getY in interface Elementpublic void setZ(double z)
Element
setZ in interface Elementz - doublepublic final double getZ()
Element
getZ in interface Element
public void setXYZ(double x,
double y,
double z)
Element
setXYZ in interface Elementx - doubley - doublez - doublepublic void setXYZ(double[] pos)
Element
setXYZ in interface Elementpos - double[]public void setSizeX(double sizeX)
Element
setSizeX in interface ElementsizeX - doublepublic final double getSizeX()
Element
getSizeX in interface Elementpublic void setSizeY(double sizeY)
Element
setSizeY in interface ElementsizeY - doublepublic final double getSizeY()
Element
getSizeY in interface Elementpublic void setSizeZ(double sizeZ)
Element
setSizeZ in interface ElementsizeZ - doublepublic final double getSizeZ()
Element
getSizeZ in interface Element
public void setSizeXYZ(double sizeX,
double sizeY,
double sizeZ)
Element
setSizeXYZ in interface ElementsizeX - doublesizeY - doublesizeZ - doublepublic void setSizeXYZ(double[] size)
Element
setSizeXYZ in interface Elementsize - double[]public void setVisible(boolean _visible)
Element
setVisible in interface Element_visible - booleanpublic final boolean isVisible()
Element
isVisible in interface Elementprotected final boolean isReallyVisible()
public final Style getStyle()
Element
getStyle in interface ElementStylepublic Transformation getTransformation()
Element
getTransformation in interface Elementpublic void setTransformation(Transformation transformation)
Element
setTransformation in interface Elementtransformation - the new transformationTransformationpublic double[] toSpaceFrame(double[] vector)
Element
toSpaceFrame in interface Elementvector - double[] The original coordinates in the body frame
public double[] toBodyFrame(double[] vector)
throws java.lang.UnsupportedOperationException
Element
toBodyFrame in interface Elementvector - double[] The original coordinates in the space
java.lang.UnsupportedOperationExceptionpublic InteractionTarget getInteractionTarget(int target)
InteractionSource
getInteractionTarget in interface InteractionSourcetarget - An integer number that identifies the target in the source.
public void addInteractionListener(InteractionListener listener)
InteractionSource
addInteractionListener in interface InteractionSourcelistener - An object that implements the InteractionListener interfaceInteractionListenerpublic void removeInteractionListener(InteractionListener listener)
InteractionSource
removeInteractionListener in interface InteractionSourceInteractionListener
protected InteractionTarget getTargetHit(int x,
int y)
x - inty - int
protected double[] getHotSpotBodyCoordinates(InteractionTarget target)
public void loadUnmutableObjects(XMLControl control)
Element
loadUnmutableObjects in interface Elementcontrol - XMLControl
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||