diff --git a/README.md b/README.md index 6b253964..e756ad34 100644 --- a/README.md +++ b/README.md @@ -579,7 +579,7 @@ libraryDependencies += "org.knowm.xchart" % "xchart" % "3.8.6" exclude("de.erich #### Formatting - mvn com.coveo:fmt-maven-plugin:format + mvn com.spotify.fmt:fmt-maven-plugin:format Formats your code using [google-java-format](https://github.com/google/google-java-format) which follows [Google's code styleguide](https://google.github.io/styleguide/javaguide.html). diff --git a/xchart/src/main/java/org/knowm/xchart/CategoryChart.java b/xchart/src/main/java/org/knowm/xchart/CategoryChart.java index da7e44d3..30c3487c 100644 --- a/xchart/src/main/java/org/knowm/xchart/CategoryChart.java +++ b/xchart/src/main/java/org/knowm/xchart/CategoryChart.java @@ -257,6 +257,7 @@ public CategorySeries updateCategorySeries( Utils.getNumberListFromDoubleArray(newYData), Utils.getNumberListFromDoubleArray(newErrorBarData)); } + /////////////////////////////////////////////////// // Internal Members and Methods /////////////////// /////////////////////////////////////////////////// diff --git a/xchart/src/main/java/org/knowm/xchart/OHLCSeries.java b/xchart/src/main/java/org/knowm/xchart/OHLCSeries.java index bea3c9e6..99205ff3 100644 --- a/xchart/src/main/java/org/knowm/xchart/OHLCSeries.java +++ b/xchart/src/main/java/org/knowm/xchart/OHLCSeries.java @@ -15,8 +15,10 @@ public class OHLCSeries extends MarkerSeries { private long[] volumeData; private double[] yData; private OHLCSeriesRenderStyle ohlcSeriesRenderStyle; + /** Up Color */ private Color upColor; + /** Down Color */ private Color downColor; diff --git a/xchart/src/main/java/org/knowm/xchart/RadarChart.java b/xchart/src/main/java/org/knowm/xchart/RadarChart.java index a7db383d..8f03c760 100644 --- a/xchart/src/main/java/org/knowm/xchart/RadarChart.java +++ b/xchart/src/main/java/org/knowm/xchart/RadarChart.java @@ -77,6 +77,7 @@ public void setRadiiLabels(String[] radiiLabels) { this.radiiLabels = radiiLabels; } + /** * Add a series for a Radar type chart * diff --git a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Axis.java b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Axis.java index cf9d5fde..8a08d2fc 100644 --- a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Axis.java +++ b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Axis.java @@ -39,16 +39,22 @@ public class Axis impleme private final Rectangle2D.Double bounds; private final ST axesChartStyler; + /** the axis title */ private final AxisTitle axisTitle; + /** the axis tick */ private final AxisTick axisTick; + /** the axis direction */ private final Direction direction; + /** the axis group index * */ private final int index; + /** the dataType */ private Series.DataType dataType; + /** the axis tick calculator */ private AxisTickCalculator axisTickCalculator; diff --git a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/AxisTick.java b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/AxisTick.java index 926066b4..3fdc4e89 100644 --- a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/AxisTick.java +++ b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/AxisTick.java @@ -11,8 +11,10 @@ public class AxisTick imp private final Chart chart; private final Direction direction; + /** the axisticklabels */ private final AxisTickLabels axisTickLabels; + /** the axistickmarks */ private final AxisTickMarks axisTickMarks; diff --git a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Chart.java b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Chart.java index 7ba3785b..fc4e6e4d 100644 --- a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Chart.java +++ b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Chart.java @@ -111,6 +111,7 @@ protected void setHeight(int height) { this.height = height; } + // TODO remove public public String getTitle() { @@ -142,6 +143,7 @@ public void setYAxisTitle(String yAxisTitle) { this.yAxisTitle = yAxisTitle; } + // TODO these related methods don't make sense for all chart types public String getYAxisGroupTitle(int yAxisGroup) { @@ -172,6 +174,7 @@ public void setCustomXAxisTickLabelsFormatter(Function customFor AxesChartStyler axesChartStyler = (AxesChartStyler) (styler); axesChartStyler.setxAxisTickLabelsFormattingFunction(customFormattingFunction); } + /** * @Deprecated - use styler instead * diff --git a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/ChartZoom.java b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/ChartZoom.java index 53e57092..98d28b5c 100644 --- a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/ChartZoom.java +++ b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/ChartZoom.java @@ -146,6 +146,7 @@ public boolean filterXByScreen(int screenXmin, int screenXmax) { } return filtered; } + /** * Is there a point selected in all series. * @@ -218,6 +219,7 @@ public void actionPerformed(ActionEvent e) { // reset button pressed resetZoom(); } + /** * Whether the selectZoom overlaps with the chart.plot * diff --git a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotContent_Pie.java b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotContent_Pie.java index 18bf9d95..94d6f52d 100644 --- a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotContent_Pie.java +++ b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotContent_Pie.java @@ -29,6 +29,7 @@ public class PlotContent_Pie super(chart); pieStyler = chart.getStyler(); } + // TODO get rid of this public static Shape getDonutSliceShape( Rectangle2D pieBounds, double thickness, double start, double extent) { diff --git a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/ToolTips.java b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/ToolTips.java index 16fd90b0..9fc4634a 100644 --- a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/ToolTips.java +++ b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/ToolTips.java @@ -125,6 +125,7 @@ public void paint(Graphics2D g) { } } } + //////////////////////////////////////////////// /// PAINTING ////////////////////////////////// /////////////////////////////////////////////// diff --git a/xchart/src/main/java/org/knowm/xchart/internal/series/AxesChartSeries.java b/xchart/src/main/java/org/knowm/xchart/internal/series/AxesChartSeries.java index bc0aced9..9d8bdcff 100644 --- a/xchart/src/main/java/org/knowm/xchart/internal/series/AxesChartSeries.java +++ b/xchart/src/main/java/org/knowm/xchart/internal/series/AxesChartSeries.java @@ -7,18 +7,25 @@ public abstract class AxesChartSeries extends Series { final DataType xAxisDataType; final DataType yAxisType; + /** the minimum value of axis range */ protected double xMin; + /** the maximum value of axis range */ protected double xMax; + /** the minimum value of axis range */ protected double yMin; + /** the maximum value of axis range */ protected double yMax; + /** Line Style */ private BasicStroke stroke; + /** Line Color */ private Color lineColor; + /** Line Width */ private float lineWidth = -1.0f; diff --git a/xchart/src/main/java/org/knowm/xchart/internal/series/Series.java b/xchart/src/main/java/org/knowm/xchart/internal/series/Series.java index d31a366e..91c21696 100644 --- a/xchart/src/main/java/org/knowm/xchart/internal/series/Series.java +++ b/xchart/src/main/java/org/knowm/xchart/internal/series/Series.java @@ -16,6 +16,7 @@ public abstract class Series { // TODO there is not always a y-axis group (pie chart for example) move this to an axis series // tyoe?? private int yAxisGroup = 0; + /** the yAxis decimalPattern */ private String yAxisDecimalPattern; diff --git a/xchart/src/main/java/org/knowm/xchart/style/PieStyler.java b/xchart/src/main/java/org/knowm/xchart/style/PieStyler.java index 66b6a249..6df15afa 100644 --- a/xchart/src/main/java/org/knowm/xchart/style/PieStyler.java +++ b/xchart/src/main/java/org/knowm/xchart/style/PieStyler.java @@ -288,6 +288,7 @@ public Color getLabelsFontColor(Color backgroundColor) { return FontColorDetector.getAutomaticFontColor( backgroundColor, labelsFontColorAutomaticDark, labelsFontColorAutomaticLight); } + /** * Sets the color of the Font used for chart annotations * @@ -324,6 +325,7 @@ public PieStyler setLabelsFontColorAutomaticDark(Color labelsFontColorAutomaticD this.labelsFontColorAutomaticDark = labelsFontColorAutomaticDark; return this; } + /** * Set the theme the styler should use * diff --git a/xchart/src/main/java/org/knowm/xchart/style/Styler.java b/xchart/src/main/java/org/knowm/xchart/style/Styler.java index 38f3438a..c30218eb 100644 --- a/xchart/src/main/java/org/knowm/xchart/style/Styler.java +++ b/xchart/src/main/java/org/knowm/xchart/style/Styler.java @@ -397,6 +397,7 @@ public Color getLegendBackgroundColor() { return legendBackgroundColor; } + /** * Set the chart legend background color * @@ -499,6 +500,7 @@ public enum LegendPosition { InsideS, OutsideS } + /** * Set the legend layout * @@ -680,6 +682,7 @@ public Styler setAnnotationLineColor(Color annotationLineColor) { this.annotationLineColor = annotationLineColor; return this; } + // Chart Button /////////////////////////////// public Color getChartButtonBackgroundColor() { @@ -876,6 +879,7 @@ public boolean getAntiAlias() { return antiAlias; } + // TODO add javadocs to all setters that are not yet documented. public Styler setAntiAlias(boolean newVal) { @@ -948,6 +952,7 @@ public Styler setYAxisGroupTitleColor(int yAxisGroup, Color yAxisColor) { yAxisGroupTitleColorMap.put(yAxisGroup, yAxisColor); return this; } + // Line, Scatter, Area Charts /////////////////////////////// public int getMarkerSize() { diff --git a/xchart/src/main/java/org/knowm/xchart/style/XYStyler.java b/xchart/src/main/java/org/knowm/xchart/style/XYStyler.java index 84939f37..d300abef 100644 --- a/xchart/src/main/java/org/knowm/xchart/style/XYStyler.java +++ b/xchart/src/main/java/org/knowm/xchart/style/XYStyler.java @@ -55,6 +55,7 @@ protected void setAllStyles() { this.cursorFontColor = theme.getCursorFontColor(); this.cursorBackgroundColor = theme.getCursorBackgroundColor(); } + /** * Set the theme the styler should use * @@ -82,6 +83,7 @@ public XYStyler setDefaultSeriesRenderStyle(XYSeriesRenderStyle xySeriesRenderSt this.xySeriesRenderStyle = xySeriesRenderStyle; return this; } + // Zoom /////////////////////////////// public boolean isZoomEnabled() { @@ -207,6 +209,7 @@ public void setCustomCursorXDataFormattingFunction( public Function getCustomCursorYDataFormattingFunction() { return customCursorYDataFormattingFunction; } + /** * Set the custom function for formatting the cursor tooltip based on the series Y-Axis data *