Skip to content

Commit

Permalink
removed delegating methods for the grid renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
ennerf committed Aug 8, 2023
1 parent f6c0a75 commit f198dea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 103 deletions.
54 changes: 0 additions & 54 deletions chartfx-chart/src/main/java/io/fair_acc/chartfx/XYChart.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,24 +161,6 @@ public Axis getYAxis() {
return getFirstAxis(Orientation.VERTICAL);
}

/**
* Indicates whether horizontal grid lines are visible or not.
*
* @return horizontalGridLinesVisible property
*/
public final BooleanProperty horizontalGridLinesVisibleProperty() {
return gridRenderer.horizontalGridLinesVisibleProperty();
}

/**
* Indicates whether horizontal grid lines are visible.
*
* @return {@code true} if horizontal grid lines are visible else {@code false}.
*/
public final boolean isHorizontalGridLinesVisible() {
return horizontalGridLinesVisibleProperty().get();
}

/**
* whether renderer should use polar coordinates (x -> interpreted as phi, y as radial coordinate)
*
Expand All @@ -188,15 +170,6 @@ public final boolean isPolarPlot() {
return polarPlotProperty().get();
}

/**
* Indicates whether vertical grid lines are visible.
*
* @return {@code true} if vertical grid lines are visible else {@code false}.
*/
public final boolean isVerticalGridLinesVisible() {
return verticalGridLinesVisibleProperty().get();
}

/**
* Sets whether renderer should use polar coordinates (x -> interpreted as phi, y as radial coordinate)
*
Expand All @@ -210,15 +183,6 @@ public ObjectProperty<PolarTickStep> polarStepSizeProperty() {
return polarStepSize;
}

/**
* Sets the value of the {@link #verticalGridLinesVisibleProperty()}.
*
* @param value {@code true} to make vertical lines visible
*/
public final void setHorizontalGridLinesVisible(final boolean value) {
horizontalGridLinesVisibleProperty().set(value);
}

/**
* Sets whether renderer should use polar coordinates (x -&gt; interpreted as phi, y as radial coordinate)
*
Expand All @@ -234,15 +198,6 @@ public void setPolarStepSize(final PolarTickStep step) {
polarStepSizeProperty().set(step);
}

/**
* Sets the value of the {@link #verticalGridLinesVisibleProperty()}.
*
* @param value {@code true} to make vertical lines visible
*/
public final void setVerticalGridLinesVisible(final boolean value) {
verticalGridLinesVisibleProperty().set(value);
}

@Override
public void updateAxisRange() {
if (isDataEmpty()) {
Expand All @@ -262,15 +217,6 @@ public void updateAxisRange() {

}

/**
* Indicates whether vertical grid lines are visible or not.
*
* @return verticalGridLinesVisible property
*/
public final BooleanProperty verticalGridLinesVisibleProperty() {
return gridRenderer.verticalGridLinesVisibleProperty();
}

private boolean isDataEmpty() {
return getAllDatasets() == null || getAllDatasets().isEmpty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,6 @@ public Canvas drawLegendSymbol(DataSet dataSet, int dsIndex, int width, int heig
return null;
}

/**
* Indicates whether grid lines should be drawn on top or beneath graphs
*
* @return drawOnTop property
*/
public final BooleanProperty drawOnTopProperty() {
return drawGridOnTop;
}

protected void drawPolarCircle(final GraphicsContext gc, final Axis yAxis, final double yRange,
final double xCentre, final double yCentre, final double maxRadius) {
if (!horMajorGridStyleNode.isVisible() && !horMinorGridStyleNode.isVisible()) {
Expand Down Expand Up @@ -321,30 +312,30 @@ public LineStyle getVerticalMinorGrid() {
}

/**
* Indicates whether horizontal major grid lines are visible or not.
* Indicates whether grid lines should be drawn on top or beneath graphs
*
* @return verticalGridLinesVisible property
* @param state true: draw on top
*/
public final BooleanProperty horizontalGridLinesVisibleProperty() {
return horMajorGridStyleNode.visibleProperty();
public final void setDrawOnTop(boolean state) {
drawOnTopProperty().set(state);
}

/**
* Indicates whether horizontal minor grid lines are visible or not.
* Indicates whether grid lines should be drawn on top or beneath graphs
*
* @return verticalGridLinesVisible property
* @return drawOnTop state
*/
public final BooleanProperty horizontalMinorGridLinesVisibleProperty() {
return horMinorGridStyleNode.visibleProperty();
public final boolean isDrawOnTop() {
return drawOnTopProperty().get();
}

/**
* Indicates whether grid lines should be drawn on top or beneath graphs
*
* @return drawOnTop state
* @return drawOnTop property
*/
public final boolean isDrawOnTop() {
return drawOnTopProperty().get();
public final BooleanProperty drawOnTopProperty() {
return drawGridOnTop;
}

@Override
Expand All @@ -365,15 +356,6 @@ public List<DataSet> render(final GraphicsContext gc, final Chart chart, final i
return Collections.emptyList();
}

/**
* Indicates whether grid lines should be drawn on top or beneath graphs
*
* @param state true: draw on top
*/
public final void setDrawOnTop(boolean state) {
drawOnTopProperty().set(state);
}

@Override
public Renderer setShowInLegend(final boolean state) {
return this;
Expand All @@ -389,24 +371,6 @@ public BooleanProperty showInLegendProperty() {
return null;
}

/**
* Indicates whether vertical major grid lines are visible or not.
*
* @return verticalGridLinesVisible property
*/
public final BooleanProperty verticalGridLinesVisibleProperty() {
return verMajorGridStyleNode.visibleProperty();
}

/**
* Indicates whether vertical minor grid lines are visible or not.
*
* @return verticalGridLinesVisible property
*/
public final BooleanProperty verticalMinorGridLinesVisibleProperty() {
return verMinorGridStyleNode.visibleProperty();
}

@Override
public List<CssMetaData<? extends Styleable, ?>> getCssMetaData() {
return getClassCssMetaData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private Tab getChartTab(XYChart chart) {

final CheckBox gridVisibleX = new CheckBox("");
gridVisibleX.setSelected(true);
chart.horizontalGridLinesVisibleProperty().bindBidirectional(gridVisibleX.selectedProperty());
chart.getGridRenderer().getHorizontalMajorGrid().visibleProperty().bindBidirectional(gridVisibleX.selectedProperty());
pane.addToParameterPane("Show X-Grid: ", gridVisibleX);

final CheckBox gridVisibleXMinor = new CheckBox("");
Expand All @@ -205,7 +205,7 @@ private Tab getChartTab(XYChart chart) {

final CheckBox gridVisibleY = new CheckBox("");
gridVisibleY.setSelected(true);
chart.verticalGridLinesVisibleProperty().bindBidirectional(gridVisibleY.selectedProperty());
chart.getGridRenderer().getVerticalMajorGrid().visibleProperty().bindBidirectional(gridVisibleY.selectedProperty());
pane.addToParameterPane("Show Y-Grid: ", gridVisibleY);

final CheckBox gridVisibleYMinor = new CheckBox("");
Expand Down

0 comments on commit f198dea

Please sign in to comment.