|
|||||||||
| 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.Dataset
org.opensourcephysics.display.HighlightableDataset
public class HighlightableDataset
A Dataset that can highlight selected points.
| Field Summary |
|---|
| Fields inherited from class org.opensourcephysics.display.Dataset |
|---|
AREA, BAR, CIRCLE, columnID, CUSTOM, customMarker, datasetID, errorBars, generalPath, index, maxPoints, NO_MARKER, PIXEL, POST, sorted, SQUARE, visible, xmax, xmaxLogscale, xmin, xminLogscale, xpoints, ymax, ymaxLogscale, ymin, yminLogscale, ypoints |
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
HighlightableDataset()
Default constructor. |
|
HighlightableDataset(java.awt.Color markerColor)
Constructor specifying the marker color. |
|
HighlightableDataset(java.awt.Color markerColor,
java.awt.Color lineColor,
boolean connected)
Constructor specifying the marker color, line color, and whether points are connected. |
|
| Method Summary | |
|---|---|
void |
append(double[] xarray,
double[] yarray)
Appends (x,y) arrays to the Dataset. |
void |
append(double x,
double y)
Appends an (x,y) datum to the Dataset. |
void |
clear()
Clear all data from this Dataset. |
void |
clearHighlights()
Clears highlights. |
void |
draw(DrawingPanel drawingPanel,
java.awt.Graphics g)
Draw this Dataset in the drawing panel. |
Interactive |
findInteractive(DrawingPanel panel,
int xpix,
int ypix)
Returns the Interactive object at a specified pixel position. |
int |
getHitIndex()
|
static XML.ObjectLoader |
getLoader()
Returns the XML.ObjectLoader for this class. |
double |
getX()
Implements Interactive. |
double |
getY()
Implements Interactive. |
boolean |
isEnabled()
Implements Interactive. |
boolean |
isHighlighted(int i)
Gets the highlighted flag for the specified point. |
protected void |
moveDatum(int loc)
Move an out-of-place datum into its correct position. |
void |
restoreHighlights()
Restores previous highlights. |
void |
setEnabled(boolean enabled)
Implements Interactive. |
void |
setHighlightColor(java.awt.Color color)
Sets the highlight color. |
void |
setHighlighted(int i,
boolean highlight)
Sets the highlighted flag for the specified point. |
void |
setX(double x)
Implements Interactive. |
void |
setXY(double x,
double y)
Implements Interactive. |
void |
setY(double y)
Implements Interactive. |
| 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 |
| Methods inherited from interface org.opensourcephysics.display.Measurable |
|---|
getXMax, getXMin, getYMax, getYMin, isMeasured |
| Constructor Detail |
|---|
public HighlightableDataset()
public HighlightableDataset(java.awt.Color markerColor)
markerColor - marker color
public HighlightableDataset(java.awt.Color markerColor,
java.awt.Color lineColor,
boolean connected)
markerColor - marker colorlineColor - line colorconnected - true to connect points with line| Method Detail |
|---|
public void append(double x,
double y)
append in class Datasetx - the x valuey - the y value
public void append(double[] xarray,
double[] yarray)
append in class Datasetxarray - the x arrayyarray - the y arraypublic void clear()
clear in class Datasetpublic void restoreHighlights()
public void clearHighlights()
public void setHighlighted(int i,
boolean highlight)
i - the array indexhighlight - true to highlight the pointpublic boolean isHighlighted(int i)
i - the array index
public void setHighlightColor(java.awt.Color color)
color - the colorprotected void moveDatum(int loc)
moveDatum in class Datasetloc - the datum
public void draw(DrawingPanel drawingPanel,
java.awt.Graphics g)
draw in interface Drawabledraw in class DatasetdrawingPanel - the drawing panelg - the graphics
public Interactive findInteractive(DrawingPanel panel,
int xpix,
int ypix)
findInteractive in interface Interactivepanel - the drawing panelxpix - the x pixel position on the panelypix - the y pixel position on the panel
public int getHitIndex()
public void setEnabled(boolean enabled)
setEnabled in interface Interactiveenabled - ignoredpublic boolean isEnabled()
isEnabled in interface Interactive
public void setXY(double x,
double y)
setXY in interface Interactivex - ignoredy - ignoredpublic void setX(double x)
setX in interface Interactivex - ignoredpublic void setY(double y)
setY in interface Interactivey - ignoredpublic double getX()
getX in interface Interactivepublic double getY()
getY in interface Interactivepublic static XML.ObjectLoader getLoader()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||