-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added dedicated dataset node parameters class
- Loading branch information
Showing
7 changed files
with
156 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
chartfx-chart/src/main/java/io/fair_acc/chartfx/ui/css/DataSetNodeParameter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package io.fair_acc.chartfx.ui.css; | ||
|
||
import io.fair_acc.chartfx.marker.DefaultMarker; | ||
import io.fair_acc.chartfx.utils.PropUtil; | ||
import javafx.beans.property.*; | ||
import javafx.css.*; | ||
import javafx.scene.Node; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Holds the styleable parameters of the DataSetNode | ||
* | ||
* @author ennerf | ||
*/ | ||
public abstract class DataSetNodeParameter extends TextStyle { | ||
|
||
public DataSetNodeParameter() { | ||
PropUtil.runOnChange(super::incrementChangeCounter, | ||
colorIndex, | ||
intensity, | ||
showInLegend, | ||
markerType | ||
); | ||
} | ||
|
||
final IntegerProperty colorIndex = new SimpleIntegerProperty(); | ||
final DoubleProperty intensity = css().createDoubleProperty(this, "intensity", 100); | ||
final BooleanProperty showInLegend = css().createBooleanProperty(this, "showInLegend", true); | ||
final ObjectProperty<DefaultMarker> markerType = css().createEnumProperty(this, "markerType", DefaultMarker.DEFAULT, true, DefaultMarker.class); | ||
|
||
public int getColorIndex() { | ||
return colorIndex.get(); | ||
} | ||
|
||
public IntegerProperty colorIndexProperty() { | ||
return colorIndex; | ||
} | ||
|
||
public void setColorIndex(int colorIndex) { | ||
this.colorIndex.set(colorIndex); | ||
} | ||
|
||
public double getIntensity() { | ||
return intensity.get(); | ||
} | ||
|
||
public DoubleProperty intensityProperty() { | ||
return intensity; | ||
} | ||
|
||
public void setIntensity(double intensity) { | ||
this.intensity.set(intensity); | ||
} | ||
|
||
public boolean isShowInLegend() { | ||
return showInLegend.get(); | ||
} | ||
|
||
public BooleanProperty showInLegendProperty() { | ||
return showInLegend; | ||
} | ||
|
||
public void setShowInLegend(boolean showInLegend) { | ||
this.showInLegend.set(showInLegend); | ||
} | ||
|
||
public DefaultMarker getMarkerType() { | ||
return markerType.get(); | ||
} | ||
|
||
public ObjectProperty<DefaultMarker> markerTypeProperty() { | ||
return markerType; | ||
} | ||
|
||
public void setMarkerType(DefaultMarker markerType) { | ||
this.markerType.set(markerType); | ||
} | ||
|
||
@Override | ||
public Node getStyleableNode() { | ||
return this; | ||
} | ||
|
||
protected CssPropertyFactory<DataSetNodeParameter> css() { | ||
return CSS; | ||
} | ||
|
||
@Override | ||
public List<CssMetaData<? extends Styleable, ?>> getCssMetaData() { | ||
return css().getCssMetaData(); | ||
} | ||
|
||
private static final CssPropertyFactory<DataSetNodeParameter> CSS = new CssPropertyFactory<>(TextStyle.getClassCssMetaData()); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters