|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
org.opensourcephysics.display.DatasetManager
DatasetManager maintains a list of datasets. Datasets are added
automatically to this DatasetCollection by calling a method in this
DatasetManager with a dataset index greater than the maximum value for
the dataset index that has been used previously. For example the statements:
DatasetManager datasetManager = new DatasetManager();
datasetManager.append(0,3,4);
datasetManager.append(1,5,6); appends the point (3,4) to the 0th
dataset (and creates this dataset automatically) and appends the point (5,6)
to the 1-st dataset (and also creates this dataset automatically).
Modified June 27, 2002 by W. Christian.
| Field Summary |
| Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
| Constructor Summary | |
DatasetManager()
DatasetManager constructor. |
|
DatasetManager(boolean linked)
DatasetManager constructor. |
|
DatasetManager(boolean _connected,
boolean _sorted)
DatasetManager constructor specifying whether points are connected and sorted. |
|
DatasetManager(boolean _connected,
boolean _sorted,
boolean _linked,
int _markerShape)
DatasetManager constructor specifying whether points are connected, sorted, and the marker shape. |
|
| Method Summary | |
void |
append(int datasetIndex,
double[] xpoints,
double[] ypoints)
Appends (x,y) arrays to the Dataset. |
void |
append(int datasetIndex,
double[] xpoints,
double[] ypoints,
double[] delx,
double[] dely)
Appends arrays of data points and uncertainties to the Dataset. |
void |
append(int datasetIndex,
double x,
double y)
Appends an (x,y) datum to the Dataset with the given index. |
void |
append(int datasetIndex,
double x,
double y,
double delx,
double dely)
Appends a data point and its uncertainty to the Dataset. |
protected void |
checkDatasetIndex(int datasetIndex)
Ensures capacity |
void |
clear()
Clears all data from all Datasets. |
void |
clear(int datasetIndex)
Clears all data from Dataset with the given datasetIndex. |
void |
draw(DrawingPanel drawingPanel,
java.awt.Graphics g)
Draws this Dataset in the drawing panel. |
java.lang.Class |
getColumnClass(int columnIndex)
Gets the type of object for JTable entry. |
int |
getColumnCount()
Gets the number of columns for rendering in a JTable. |
java.lang.String |
getColumnName(int tableColumnIndex)
Gets the name of the colummn for rendering in a JTable |
Dataset |
getDataset(int datasetIndex)
Gets a dataset with the given index. |
java.util.ArrayList |
getDatasets()
Gets a shallow clone of the dataset list. |
static java.awt.Color |
getLineColor(int index)
Gets a line color that matches the index |
static XML.ObjectLoader |
getLoader()
Returns the XML.ObjectLoader for this class. |
int |
getRowCount()
Gets the number of rows for rendering in a JTable. |
java.lang.Object |
getValueAt(int rowIndex,
int tableColumnIndex)
Gets an x or y value for rendering in a JTable. |
double |
getXMax()
Gets the x world coordinate for the right hand side of the panel. |
double |
getXMin()
Gets the x world coordinate for the left hand side of the panel. |
double[] |
getXPoints(int datasetIndex)
Gets a copy of the xpoints array. |
double |
getYMax()
Gets y world coordinate for the top of the panel. |
double |
getYMin()
Gets y world coordinate for the bottom of the panel. |
double[] |
getYPoints(int datasetIndex)
Gets a copy of the ypoints array. |
boolean |
isConnected(int datasetIndex)
Gets the data connected flag. |
boolean |
isMeasured()
Gets the valid measure flag. |
boolean |
isSorted(int datasetIndex)
Gets the sorted flag. |
void |
removeDatasets()
Removes all Datasets from the manager. |
void |
setConnected(boolean _connected)
Sets the connected flag for all datasets. |
void |
setConnected(int datasetIndex,
boolean _connected)
Sets the data connected flag. |
void |
setCustomMarker(int datasetIndex,
java.awt.Shape marker)
Sets a custom marker shape. |
void |
setLineColor(int datasetIndex,
java.awt.Color _lineColor)
Sets the color of the lines connecting data points. |
void |
setMarkerColor(int datasetIndex,
java.awt.Color _markerColor)
Sets the data point marker color. |
void |
setMarkerColor(int datasetIndex,
java.awt.Color fillColor,
java.awt.Color edgeColor)
Sets the data point marker's fill and edge color. |
void |
setMarkerShape(int datasetIndex,
int _markerShape)
Sets the data point marker shape. |
void |
setMarkerSize(int datasetIndex,
int _markerSize)
Sets the half-width of the data point marker. |
void |
setSorted(boolean _sorted)
Sets the sorted flag for all datasets. |
void |
setSorted(int datasetIndex,
boolean _sorted)
Sets the sorted flag. |
void |
setStride(int _stride)
|
void |
setStride(int datasetIndex,
int stride)
Sets the stride for the given dataset. |
void |
setXColumnVisible(int datasetIndex,
boolean visible)
Sets the visibility of the x column in a table view. |
void |
setXPointsLinked(boolean _linked)
Sets the linked flag. |
void |
setXYColumnNames(int datasetIndex,
java.lang.String xColumnName,
java.lang.String yColumnName)
Sets the column names when rendering this dataset in a JTable. |
void |
setXYColumnNames(int datasetIndex,
java.lang.String xColumnName,
java.lang.String yColumnName,
java.lang.String datsetName)
Sets the column names when rendering this dataset in a JTable. |
void |
setXYColumnNames(java.lang.String _xColumnName,
java.lang.String _yColumnName)
Sets the column names for all datasets when rendering this dataset in a JTable. |
void |
setYColumnVisible(int datasetIndex,
boolean visible)
Sets the visibility of the y column in a table view. |
java.lang.String |
toString()
Create a string representation of the data. |
| Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DatasetManager()
public DatasetManager(boolean linked)
linked -
public DatasetManager(boolean _connected,
boolean _sorted)
_connected - Description of Parameter_sorted - Description of Parameter
public DatasetManager(boolean _connected,
boolean _sorted,
boolean _linked,
int _markerShape)
_connected - Description of Parameter_sorted - Description of Parameter_linked - _markerShape - Description of Parameter| Method Detail |
public void setXPointsLinked(boolean _linked)
_linked - The new value
public void setSorted(int datasetIndex,
boolean _sorted)
datasetIndex - The new sorted value_sorted - true<\code> to sortpublic void setSorted(boolean _sorted)
_sorted -
public void setConnected(int datasetIndex,
boolean _connected)
datasetIndex - The new connected value_connected - true<\code> if points are connectedpublic void setConnected(boolean _connected)
_connected - true if connected; false otherwise
public void setStride(int datasetIndex,
int stride)
datasetIndex - The new markerColor valuestride - public void setStride(int _stride)
public void setMarkerColor(int datasetIndex,
java.awt.Color _markerColor)
datasetIndex - _markerColor -
public void setMarkerColor(int datasetIndex,
java.awt.Color fillColor,
java.awt.Color edgeColor)
datasetIndex - fillColor - edgeColor -
public void setMarkerShape(int datasetIndex,
int _markerShape)
datasetIndex - _markerShape -
public void setCustomMarker(int datasetIndex,
java.awt.Shape marker)
datasetIndex - intmarker - Shape
public void setXColumnVisible(int datasetIndex,
boolean visible)
datasetIndex - visible -
public void setYColumnVisible(int datasetIndex,
boolean visible)
datasetIndex - visible -
public void setMarkerSize(int datasetIndex,
int _markerSize)
datasetIndex - _markerSize - in pixels
public void setLineColor(int datasetIndex,
java.awt.Color _lineColor)
datasetIndex - _lineColor -
public void setXYColumnNames(int datasetIndex,
java.lang.String xColumnName,
java.lang.String yColumnName,
java.lang.String datsetName)
datasetIndex - xColumnName - yColumnName - datsetName -
public void setXYColumnNames(int datasetIndex,
java.lang.String xColumnName,
java.lang.String yColumnName)
datasetIndex - xColumnName - yColumnName - public boolean isMeasured()
isMeasured in interface Measurabletrue<\code> if measure is validpublic double getXMin()
getXMin in interface Measurablepublic double getXMax()
getXMax in interface Measurablepublic double getYMin()
getYMin in interface Measurablepublic double getYMax()
getYMax in interface Measurablepublic double[] getXPoints(int datasetIndex)
datasetIndex - Description of Parameter
public double[] getYPoints(int datasetIndex)
datasetIndex - Description of Parameter
public boolean isSorted(int datasetIndex)
datasetIndex - Description of Parameter
true<\code> if the data is sortedpublic boolean isConnected(int datasetIndex)
datasetIndex - Description of Parameter
true<\code> if points are connectedpublic int getColumnCount()
getColumnCount in interface javax.swing.table.TableModelpublic int getRowCount()
getRowCount in interface javax.swing.table.TableModelpublic java.lang.String getColumnName(int tableColumnIndex)
getColumnName in interface javax.swing.table.TableModeltableColumnIndex -
public java.lang.Object getValueAt(int rowIndex,
int tableColumnIndex)
getValueAt in interface javax.swing.table.TableModelrowIndex - tableColumnIndex -
public java.lang.Class getColumnClass(int columnIndex)
getColumnClass in interface javax.swing.table.TableModelcolumnIndex -
public void append(int datasetIndex,
double x,
double y)
x - y - datasetIndex - Description of Parameter
public void append(int datasetIndex,
double x,
double y,
double delx,
double dely)
datasetIndex - x - y - delx - dely -
public void append(int datasetIndex,
double[] xpoints,
double[] ypoints)
xpoints - ypoints - datasetIndex - Description of Parameter
public void append(int datasetIndex,
double[] xpoints,
double[] ypoints,
double[] delx,
double[] dely)
datasetIndex - xpoints - ypoints - delx - dely -
public void draw(DrawingPanel drawingPanel,
java.awt.Graphics g)
draw in interface DrawabledrawingPanel - g - public void clear(int datasetIndex)
datasetIndex - Description of Parameterpublic void clear()
public void removeDatasets()
public Dataset getDataset(int datasetIndex)
datasetIndex -
public java.util.ArrayList getDatasets()
public java.lang.String toString()
public void setXYColumnNames(java.lang.String _xColumnName,
java.lang.String _yColumnName)
_xColumnName - _yColumnName - public static java.awt.Color getLineColor(int index)
index - int
protected void checkDatasetIndex(int datasetIndex)
datasetIndex - public static XML.ObjectLoader getLoader()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||