public class DatasetManager extends javax.swing.table.AbstractTableModel implements Measurable, Data
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).| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addDataset(Dataset dataset)
Adds a dataset.
|
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 column for rendering in a JTable
|
java.util.ArrayList |
getComplexDatasets()
Gets the ComplexDatasets.
|
double[][] |
getData2D()
Gets a 2D array of data.
|
double[][][] |
getData3D()
Gets a 3D array of data.
|
Dataset |
getDataset(int datasetIndex)
Gets a dataset with the given index.
|
int |
getDatasetIndex(java.lang.String yColumnName)
Returns the index of the first dataset with the specified y column name.
|
java.util.ArrayList |
getDatasets()
Gets a shallow clone of the dataset list.
|
static XML.ObjectLoader |
getLoader()
Returns the XML.ObjectLoader for this class.
|
java.lang.String |
getName()
Gets the name of this data.
|
java.util.Map |
getProperties()
Returns the properties map.
|
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.
|
boolean |
isXPointsLinked()
Gets the linked flag.
|
Dataset |
removeDataset(int index)
Removes the dataset at the specified index.
|
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 |
setName(java.lang.String name)
Sets the name of this data.
|
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.
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAtpublic DatasetManager()
public DatasetManager(boolean linked)
linked - public DatasetManager(boolean _connected,
boolean _sorted)
_connected - Description of Parameter_sorted - Description of Parameterpublic DatasetManager(boolean _connected,
boolean _sorted,
boolean _linked,
int _markerShape)
_connected - Description of Parameter_sorted - Description of Parameter_linked - _markerShape - Description of Parameterpublic void setXPointsLinked(boolean _linked)
_linked - The new valuepublic boolean isXPointsLinked()
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 otherwisepublic 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 - Shapepublic 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 pixelspublic 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 Parameterpublic double[] getYPoints(int datasetIndex)
datasetIndex - Description of Parameterpublic boolean isSorted(int datasetIndex)
datasetIndex - Description of Parametertrue<\code> if the data is sortedpublic boolean isConnected(int datasetIndex)
datasetIndex - Description of Parametertrue<\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 getName()
public void setName(java.lang.String name)
public java.lang.String getColumnName(int tableColumnIndex)
getColumnName in interface javax.swing.table.TableModelgetColumnName in class javax.swing.table.AbstractTableModeltableColumnIndex - 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.TableModelgetColumnClass in class javax.swing.table.AbstractTableModelcolumnIndex - public void append(int datasetIndex,
double x,
double y)
x - y - datasetIndex - Description of Parameterpublic 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 Parameterpublic 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)
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()
getDatasets in interface Datapublic double[][] getData2D()
public java.util.ArrayList getComplexDatasets()
getComplexDatasets in interface Datapublic double[][][] getData3D()
public int addDataset(Dataset dataset)
dataset - the Dataset to addpublic Dataset removeDataset(int index)
index - the indexpublic int getDatasetIndex(java.lang.String yColumnName)
yColumnName - the y column namepublic java.util.Map getProperties()
public java.lang.String toString()
toString in class java.lang.Objectpublic void setXYColumnNames(java.lang.String _xColumnName,
java.lang.String _yColumnName)
_xColumnName - _yColumnName - protected void checkDatasetIndex(int datasetIndex)
datasetIndex - public static XML.ObjectLoader getLoader()