|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.drawing2d.Element org.opensourcephysics.drawing2d.ElementPolygon
public class ElementPolygon
Title: ElementPolygon
Description: A Polygon 2D
Field Summary |
---|
Fields inherited from class org.opensourcephysics.drawing2d.Element |
---|
TARGET_POSITION, TARGET_SIZE |
Constructor Summary | |
---|---|
ElementPolygon()
|
Method Summary | |
---|---|
void |
draw(DrawingPanel _panel,
java.awt.Graphics _g)
Draws the element on a given Graphics2D. |
Interactive |
findInteractive(DrawingPanel _panel,
int _xpix,
int _ypix)
Gets the target that is under the (x,y) position of the screen. |
java.lang.String[] |
getColumnNames()
The column names to be used in the data display tool |
double[][] |
getData()
Gets a copy of the data of the points for the polygon |
double[][] |
getData2D()
Gets a 2D array of data. |
double[][][] |
getData3D()
Gets a 3D array of data. |
double[][] |
getDataArray()
Gets the actual array with the data of the points for the polygon |
java.util.List<Data> |
getDataList()
Some Data objects (e.g., a Group) do not contain data, but a list of Data objects which do. |
java.util.ArrayList<Dataset> |
getDatasets()
Gets a list of OSP Datasets. |
java.awt.Color[] |
getFillColors()
Fill color to use for this data |
int |
getID()
Returns a unique identifier for this Data |
java.awt.Color[] |
getLineColors()
Line color to use for this data |
boolean |
isClosed()
Gets whether the polygon is closed |
void |
setActionListener(java.awt.event.ActionListener _listener)
Sets an action listener that will be called just before drawing. |
void |
setClosed(boolean closed)
Sets whether the polygon is closed |
void |
setData(double[][] data)
Sets the data for the points of the polygon. |
void |
setData(double[] xArray,
double[] yArray)
Sets the data for the points of the polygon. |
void |
setID(int id)
Sets the ID number of this Data |
void |
updateHotSpot(InteractionTarget target,
double[] point)
This method updates the position or size of the element according to the position of the cursor during the interaction. |
Methods inherited from class org.opensourcephysics.drawing2d.Element |
---|
addInteractionListener, getCanBeMeasured, getDataObject, getInteractionTarget, getName, getPanel, getPosition, getSize, getSizeX, getSizeY, getStyle, getTransformation, getX, getXMax, getXMaxLogscale, getXMin, getXMinLogscale, getY, getYMax, getYMaxLogscale, getYMin, getYMinLogscale, hasChanged, invokeActions, isEnabled, isMeasured, isVisible, removeInteractionListener, setCanBeMeasured, setDataObject, setElementChanged, setEnabled, setName, setNeedToProject, setPanel, setPosition, setSize, setSizeX, setSizeXY, setSizeY, setTransformation, setVisible, setX, setXY, setY, toBodyFrame, toSpaceFrame |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.opensourcephysics.display.Data |
---|
getName |
Constructor Detail |
---|
public ElementPolygon()
Method Detail |
---|
public void setClosed(boolean closed)
closed
- booleanpublic boolean isClosed()
public void setActionListener(java.awt.event.ActionListener _listener)
_listener
- public void setData(double[][] data)
data
- double[][] the double[nPoints][2] array with the datapublic void setData(double[] xArray, double[] yArray)
xArray
- double[] the double[nPoints] array with the X coordinatesyArray
- double[] the double[nPoints] array with the Y coordinatespublic double[][] getData()
public double[][] getDataArray()
public void setID(int id)
Data
setID
in interface Data
id
- the ID numberpublic int getID()
Data
getID
in interface Data
public double[][] getData2D()
Data
getData2D
in interface Data
public double[][][] getData3D()
Data
getData3D
in interface Data
public java.lang.String[] getColumnNames()
Data
getColumnNames
in interface Data
public java.awt.Color[] getLineColors()
Data
getLineColors
in interface Data
public java.awt.Color[] getFillColors()
Data
getFillColors
in interface Data
public java.util.List<Data> getDataList()
Data
getDataList
in interface Data
public java.util.ArrayList<Dataset> getDatasets()
Data
getDatasets
in interface Data
public void draw(DrawingPanel _panel, java.awt.Graphics _g)
Element
draw
in interface Drawable
draw
in class Element
public void updateHotSpot(InteractionTarget target, double[] point)
Element
updateHotSpot
in class Element
target
- InteractionTarget The target interactedpoint
- double[] The position of the cursor during the interactionpublic Interactive findInteractive(DrawingPanel _panel, int _xpix, int _ypix)
Element
findInteractive
in interface Interactive
findInteractive
in class Element
_panel
- org.opensourcephysics.display.DrawingPanel The drawing panel which originated the call_xpix
- int_ypix
- int
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |