Package com.digitizer.core
Class Dataset
java.lang.Object
com.digitizer.core.Dataset
Represents a dataset with a name, color and a mutable collection of
Points.
Each dataset contains a user-visible name and a CSS hex color string.
The color is cached as a Color for efficient
rendering on the CanvasPanel. While datasets
may be modified at runtime, callers should generally avoid changing
internal lists directly unless intentionally editing the dataset state.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a point to this dataset.voidClears all points from this dataset.booleanjavafx.scene.paint.ColorgetColor()getName()intGets the number of points in this dataset.inthashCode()booleanbooleanremovePoint(int index) Removes a point at the specified index.booleanremovePoint(Point point) Removes a point from this dataset.voidsetHexColor(String hexColor) voidvoidvoidsetUseSecondaryYAxis(boolean useSecondaryYAxis) voidsetVisible(boolean visible) toString()
-
Constructor Details
-
Dataset
Constructs a new Dataset with the given name and hex color.- Parameters:
name- the dataset name (user-visible label)hexColor- the color as a hex string (e.g., "#0072B2")
-
Dataset
Copy constructor for creating a new instance with the same data.- Parameters:
other- the dataset to copy
-
-
Method Details
-
isVisible
public boolean isVisible() -
setVisible
public void setVisible(boolean visible) -
getName
-
setName
-
getHexColor
-
setHexColor
-
getColor
public javafx.scene.paint.Color getColor() -
isUseSecondaryYAxis
public boolean isUseSecondaryYAxis() -
setUseSecondaryYAxis
public void setUseSecondaryYAxis(boolean useSecondaryYAxis) -
getPoints
-
setPoints
-
addPoint
Adds a point to this dataset.- Parameters:
point- the point to add
-
removePoint
Removes a point from this dataset.- Parameters:
point- the point to remove- Returns:
- true if the point was removed, false if it was not in the list
-
removePoint
Removes a point at the specified index.- Parameters:
index- the index of the point to remove- Returns:
- the removed point
- Throws:
IndexOutOfBoundsException- if the index is out of range
-
clearPoints
public void clearPoints()Clears all points from this dataset. -
getPointCount
public int getPointCount()Gets the number of points in this dataset.- Returns:
- the point count
-
toString
-
equals
-
hashCode
public int hashCode()
-