|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.displayejs.AbstractInteractionSource org.opensourcephysics.displayejs.ElementSet
public class ElementSet
An ElementSet is a simple interactive, drawable3D, measurable3D, that helps create and set some of the values of a large number of InteractiveElements using arrays. It is NOT and InteractiveElement itself, though it is an InteractionSource. When iteracting with it, it returns targets of the InteractionTargetSetElement class. Because of this peculiarity, you should not add listeners to elements of a set directly. This is th eonly restriction that a set imposes on addressing its elements directly.
Constructor Summary | |
---|---|
ElementSet(int _n,
java.lang.Class<?> _aClass)
|
Method Summary | |
---|---|
void |
canBeMeasured(boolean _canBe)
Whether the element should be taken into account for computing the scales. |
void |
draw(DrawingPanel3D _panel,
java.awt.Graphics2D _g2,
int _index)
Draws a given Object3D (indicated by its index). |
void |
draw(DrawingPanel _panel,
java.awt.Graphics _g)
Draws a representation of an object in a drawing panel. |
void |
drawQuickly(DrawingPanel3D _panel,
java.awt.Graphics2D _g2)
Sketches the drawable |
InteractiveElement |
elementAt(int i)
|
Interactive |
findInteractive(DrawingPanel _panel,
int _xpix,
int _ypix)
|
int |
getElementInteracted()
|
int |
getInteractedIndex()
|
java.lang.String |
getName()
|
int |
getNumberOfElements()
|
Object3D[] |
getObjects3D(DrawingPanel3D _panel)
Returns an array of Objects3D to (sort according to its distance and) draw. |
double[] |
getSizeXs()
|
double[] |
getSizeYs()
|
double[] |
getSizeZs()
|
double |
getX()
|
double |
getXMax()
Gets the maximum x needed to draw this object. |
double |
getXMin()
Gets the minimum x needed to draw this object. |
double[] |
getXs()
|
double |
getY()
|
double |
getYMax()
Gets the maximum y needed to draw this object. |
double |
getYMin()
Gets the minimum y needed to draw this object. |
double[] |
getYs()
|
double |
getZMax()
Gets the maximum z needed to draw this object. |
double |
getZMin()
Gets the minimum z needed to draw this object. |
double[] |
getZs()
|
boolean |
isEnabled()
Whether any of the targets of this source is enabled |
boolean |
isEnabled(int _target)
Whether a particular target of this source is enabled |
boolean |
isMeasured()
Determines if information is available to set min/max values. |
boolean |
isVisible()
|
void |
needsToProject(DrawingPanel _panel)
Tells the drawable that it should reproject its points because this panel has changed its projection parameters. |
void |
setEnabled(boolean _enabled)
Enables all the targets of this source |
void |
setEnabled(int _target,
boolean _enabled)
Enables a particular target of this source |
void |
setEnableds(boolean[] _enab)
|
void |
setEnableds(int _target,
boolean[] _enab)
|
void |
setName(java.lang.String _name)
|
void |
setNumberOfElements(int _n)
|
void |
setSizeXs(double[] _x)
|
void |
setSizeXYZs(double[] _x,
double[] _y,
double[] _z)
|
void |
setSizeYs(double[] _y)
|
void |
setSizeZs(double[] _z)
|
void |
setVisible(boolean _visible)
|
void |
setVisibles(boolean[] _vis)
|
void |
setX(double _x)
|
void |
setXs(double[] _x)
|
void |
setXY(double _x,
double _y)
|
void |
setXYZs(double[] _x,
double[] _y,
double[] _z)
|
void |
setY(double _y)
|
void |
setYs(double[] _y)
|
void |
setZs(double[] _z)
|
java.lang.String |
toXML()
|
Methods inherited from class org.opensourcephysics.displayejs.AbstractInteractionSource |
---|
addListener, invokeActions, removeAllListeners, removeListener |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ElementSet(int _n, java.lang.Class<?> _aClass)
Method Detail |
---|
public void setName(java.lang.String _name)
public java.lang.String getName()
public int getNumberOfElements()
public void setNumberOfElements(int _n)
public InteractiveElement elementAt(int i)
public void setXs(double[] _x)
public double[] getXs()
public void setYs(double[] _y)
public double[] getYs()
public void setZs(double[] _z)
public double[] getZs()
public void setXYZs(double[] _x, double[] _y, double[] _z)
public void setSizeXs(double[] _x)
public double[] getSizeXs()
public void setSizeYs(double[] _y)
public double[] getSizeYs()
public void setSizeZs(double[] _z)
public double[] getSizeZs()
public void setSizeXYZs(double[] _x, double[] _y, double[] _z)
public void setVisible(boolean _visible)
public boolean isVisible()
public void setVisibles(boolean[] _vis)
public void setEnabled(boolean _enabled)
InteractionSource
setEnabled
in interface Interactive
setEnabled
in interface InteractionSource
public boolean isEnabled()
InteractionSource
isEnabled
in interface Interactive
isEnabled
in interface InteractionSource
public void setEnabled(int _target, boolean _enabled)
InteractionSource
setEnabled
in interface InteractionSource
public boolean isEnabled(int _target)
InteractionSource
isEnabled
in interface InteractionSource
public void setEnableds(boolean[] _enab)
public void setEnableds(int _target, boolean[] _enab)
public java.lang.String toXML()
public int getElementInteracted()
public int getInteractedIndex()
public Interactive findInteractive(DrawingPanel _panel, int _xpix, int _ypix)
findInteractive
in interface Interactive
public void needsToProject(DrawingPanel _panel)
Drawable3D
needsToProject
in interface Drawable3D
_panel
- the DrawingPanel that has changed or null if the drawable should update
its projection in all possible panelspublic Object3D[] getObjects3D(DrawingPanel3D _panel)
Drawable3D
getObjects3D
in interface Drawable3D
public void draw(DrawingPanel3D _panel, java.awt.Graphics2D _g2, int _index)
Drawable3D
draw
in interface Drawable3D
public void drawQuickly(DrawingPanel3D _panel, java.awt.Graphics2D _g2)
Drawable3D
drawQuickly
in interface Drawable3D
public void draw(DrawingPanel _panel, java.awt.Graphics _g)
Drawable
draw
in interface Drawable
public void canBeMeasured(boolean _canBe)
public final boolean isMeasured()
Measurable
isMeasured
in interface Measurable
public double getXMin()
Measurable
getXMin
in interface Measurable
public double getXMax()
Measurable
getXMax
in interface Measurable
public double getYMin()
Measurable
getYMin
in interface Measurable
public double getYMax()
Measurable
getYMax
in interface Measurable
public double getZMin()
Measurable3D
getZMin
in interface Measurable3D
public double getZMax()
Measurable3D
getZMax
in interface Measurable3D
public void setXY(double _x, double _y)
setXY
in interface Interactive
public void setX(double _x)
setX
in interface Interactive
public void setY(double _y)
setY
in interface Interactive
public double getX()
getX
in interface Interactive
public double getY()
getY
in interface Interactive
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |