Skip to content

Commit

Permalink
applied restyle patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ennerf committed Sep 26, 2023
1 parent ef3cbe1 commit 01fd934
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package io.fair_acc.chartfx.plugins;

import io.fair_acc.bench.BenchLevel;
import io.fair_acc.bench.MeasurementRecorder;
import io.fair_acc.chartfx.XYChart;
import io.fair_acc.chartfx.bench.LiveDisplayRecorder;
import io.fair_acc.chartfx.utils.FXUtils;
import io.fair_acc.dataset.utils.AssertUtils;
import java.util.Optional;
import java.util.function.UnaryOperator;

import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.event.ActionEvent;
Expand All @@ -15,10 +12,15 @@
import javafx.scene.control.Tooltip;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;

import org.kordamp.ikonli.javafx.FontIcon;

import java.util.Optional;
import java.util.function.UnaryOperator;
import io.fair_acc.bench.BenchLevel;
import io.fair_acc.bench.MeasurementRecorder;
import io.fair_acc.chartfx.XYChart;
import io.fair_acc.chartfx.bench.LiveDisplayRecorder;
import io.fair_acc.chartfx.utils.FXUtils;
import io.fair_acc.dataset.utils.AssertUtils;

/**
* Experimental plugin that measures and displays the internal
Expand Down Expand Up @@ -83,8 +85,8 @@ private void enable(ActionEvent event) {
if (!enabled.get() && getChart() != null && getChart() instanceof XYChart) {
XYChart chart = (XYChart) getChart();
String title = Optional.ofNullable(chart.getTitle())
.filter(string -> !string.isEmpty())
.orElse("Benchmark");
.filter(string -> !string.isEmpty())
.orElse("Benchmark");
LiveDisplayRecorder recorder = LiveDisplayRecorder.createChart(title, pane -> {
Scene scene = new Scene(pane);
scene.getStylesheets().addAll(chart.getScene().getStylesheets());
Expand All @@ -106,8 +108,6 @@ private void disable() {
}
}

private static final Runnable NO_OP = () -> {
};
private static final Runnable NO_OP = () -> {};
private Runnable resetRecorder = NO_OP;

Check warning on line 112 in chartfx-chart/src/main/java/io/fair_acc/chartfx/plugins/BenchPlugin.java

View check run for this annotation

Codecov / codecov/patch

chartfx-chart/src/main/java/io/fair_acc/chartfx/plugins/BenchPlugin.java#L111-L112

Added lines #L111 - L112 were not covered by tests

}
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
package io.fair_acc.chartfx.renderer.spi;

import java.security.InvalidParameterException;

import javafx.geometry.Orientation;
import javafx.scene.canvas.GraphicsContext;

import io.fair_acc.bench.DurationMeasure;
import io.fair_acc.bench.Measurable;
import io.fair_acc.bench.MeasurementRecorder;
Expand All @@ -15,6 +10,10 @@
import io.fair_acc.chartfx.ui.css.DataSetNode;
import io.fair_acc.dataset.DataSet;
import io.fair_acc.dataset.utils.AssertUtils;
import javafx.geometry.Orientation;
import javafx.scene.canvas.GraphicsContext;

import java.security.InvalidParameterException;

/**
* Renderer that requires an X and a Y axis
Expand All @@ -37,7 +36,7 @@ private XYChart requireChartXY(Chart chart) {
return (XYChart) chart;
}
throw new InvalidParameterException("must be derivative of XYChart for renderer - "
+ this.getClass().getSimpleName());
+ this.getClass().getSimpleName());
}

@Override
Expand Down Expand Up @@ -137,5 +136,4 @@ public void setRecorder(MeasurementRecorder recorder) {

private DurationMeasure benchDrawAll = DurationMeasure.DISABLED;
private DurationMeasure benchDrawOne = DurationMeasure.DISABLED;

}

0 comments on commit 01fd934

Please sign in to comment.