Package org.opensourcephysics.display
Class HighlightableDataset
java.lang.Object
org.opensourcephysics.display.DataTable.DataModel
org.opensourcephysics.display.Dataset
org.opensourcephysics.display.HighlightableDataset
- All Implemented Interfaces:
Data,Drawable,Interactive,LogMeasurable,Measurable
A Dataset that can highlight selected points.
- Version:
- 1.0
- Author:
- Doug Brown
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensourcephysics.display.Dataset
Dataset.Model -
Field Summary
Fields inherited from class org.opensourcephysics.display.Dataset
AREA, BAR, CIRCLE, columnID, CUSTOM, customMarker, datasetID, errorBars, generalPath, id, index, maxPoints, maxPointsMultiplier, model, NO_MARKER, PIXEL, POST, shift, sorted, SQUARE, update, visible, xColumnDescription, xmax, xmaxLogscale, xmin, xminLogscale, xpoints, yColumnDescription, ymax, ymaxLogscale, ymin, yminLogscale, ypoints -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.HighlightableDataset(Color markerColor) Constructor specifying the marker color. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all data from this Dataset.voidClears highlights.voiddraw(DrawingPanel drawingPanel, Graphics g) Draw this Dataset in the drawing panel.findInteractive(DrawingPanel panel, int xpix, int ypix) Returns the Interactive object at a specified pixel position.intintGets the most recent hit index.static XML.ObjectLoaderReturns the XML.ObjectLoader for this class.double[][]Gets the screen coordinates of all data points.intdoublegetX()Implements Interactive.doublegetY()Implements Interactive.booleanImplements Interactive.booleanisHighlighted(int n) Gets the highlighted flag for the specified point.voidRestores previous highlights.voidsetEnabled(boolean enabled) Implements Interactive.voidsetHighlightColor(Color color) Sets the highlight color.voidsetHighlighted(int i, boolean highlight) Sets the highlighted flag for the specified point.voidsetHighlights(BitSet bs) voidsetX(double x) Implements Interactive.voidsetXY(double x, double y) Implements Interactive.voidsetY(double y) Implements Interactive.Methods inherited from class org.opensourcephysics.display.Dataset
append, append, append, append, append, convertTableColumnIndex, countColumnsVisible, drawable, drawClip, drawData, drawScatterPlot, findDataSet, getColumnCount, getColumnID, getColumnName, getColumnNames, getData2D, getData3D, getDataList, getDatasets, getEdgeColor, getFillColor, getFillColors, getID, getIndex, getLineColor, getLineColors, getMarkerShape, getMarkerSize, getMean, getName, getNaNCount, getPoints, getRowCount, getShift, getTranslateInstance, getValidXPoints, getValidYPoints, getValueAt, getVisible, getX, getXColumnDescription, getXColumnName, getXMax, getXMaxLogscale, getXMin, getXMinLogscale, getXPoints, getXPointsRaw, getY, getYColumnDescription, getYColumnName, getYMax, getYMaxLogscale, getYMin, getYMinLogscale, getYPoints, getYPointsRaw, getYShifted, insertionSort, isConnected, isMeasured, isShifted, isSorted, isXColumnVisible, isYColumnVisible, loadDatasets, read, recalculatePath, set, setColumnID, setConnected, setCustomMarker, setID, setLineColor, setMarkerColor, setMarkerColor, setMarkerColor, setMarkerShape, setMarkerSize, setMaximumPoints, setName, setShift, setShifted, setShiftedValue, setSorted, setStride, setVisible, setXColumnDescription, setXColumnVisible, setXYColumnNames, setXYColumnNames, setYColumnDescription, setYColumnVisible, toBoolArray, toString, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opensourcephysics.display.Interactive
isInteractiveMethods inherited from interface org.opensourcephysics.display.Measurable
getXMax, getXMin, getYMax, getYMin, isMeasured
-
Constructor Details
-
HighlightableDataset
public HighlightableDataset()Default constructor. -
HighlightableDataset
Constructor specifying the marker color.- Parameters:
markerColor- marker color
-
-
Method Details
-
clear
public void clear()Clear all data from this Dataset. -
restoreHighlights
public void restoreHighlights()Restores previous highlights. -
clearHighlights
public void clearHighlights()Clears highlights. -
setHighlighted
public void setHighlighted(int i, boolean highlight) Sets the highlighted flag for the specified point.- Parameters:
i- the array indexhighlight- true to highlight the point
-
isHighlighted
public boolean isHighlighted(int n) Gets the highlighted flag for the specified point.- Parameters:
n- the array index- Returns:
- true if point is highlighted
-
setHighlightColor
Sets the highlight color.- Parameters:
color- the color
-
draw
Draw this Dataset in the drawing panel. -
findInteractive
Returns the Interactive object at a specified pixel position. Implements Interactive.- Specified by:
findInteractivein interfaceInteractive- Parameters:
panel- the drawing panelxpix- the x pixel position on the panelypix- the y pixel position on the panel- Returns:
- the object
-
getHitIndex
public int getHitIndex()Gets the most recent hit index.- Returns:
- the hit index
-
getScreenCoordinates
public double[][] getScreenCoordinates()Gets the screen coordinates of all data points.- Returns:
- screen coordinates
-
setEnabled
public void setEnabled(boolean enabled) Implements Interactive.- Specified by:
setEnabledin interfaceInteractive- Parameters:
enabled- ignored
-
isEnabled
public boolean isEnabled()Implements Interactive.- Specified by:
isEnabledin interfaceInteractive- Returns:
- true
-
setXY
public void setXY(double x, double y) Implements Interactive.- Specified by:
setXYin interfaceInteractive- Parameters:
x- ignoredy- ignored
-
setX
public void setX(double x) Implements Interactive.- Specified by:
setXin interfaceInteractive- Parameters:
x- ignored
-
setY
public void setY(double y) Implements Interactive.- Specified by:
setYin interfaceInteractive- Parameters:
y- ignored
-
getX
public double getX()Implements Interactive.- Specified by:
getXin interfaceInteractive- Returns:
- the x value at the current hit index, or Double.NaN if none
-
getY
public double getY()Implements Interactive.- Specified by:
getYin interfaceInteractive- Returns:
- the y value at the current hit index, or Double.NaN if none
-
getLoader
Returns the XML.ObjectLoader for this class.- Returns:
- the object loader
-
setHighlights
-
getHighlightedBS
-
getHighlightCount
public int getHighlightCount() -
getValidYCount
public int getValidYCount()
-