Skip to content

Commit

Permalink
format files
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-eucalyptus committed Nov 30, 2023
1 parent a489304 commit 7a17458
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
1 change: 1 addition & 0 deletions xchart/src/main/java/org/knowm/xchart/CategoryChart.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ public CategorySeries updateCategorySeries(
Utils.getNumberListFromDoubleArray(newYData),
Utils.getNumberListFromDoubleArray(newErrorBarData));
}

///////////////////////////////////////////////////
// Internal Members and Methods ///////////////////
///////////////////////////////////////////////////
Expand Down
2 changes: 2 additions & 0 deletions xchart/src/main/java/org/knowm/xchart/OHLCSeries.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions xchart/src/main/java/org/knowm/xchart/RadarChart.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public void setRadiiLabels(String[] radiiLabels) {

this.radiiLabels = radiiLabels;
}

/**
* Add a series for a Radar type chart
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,22 @@ public class Axis<ST extends AxesChartStyler, S extends AxesChartSeries> impleme
private final Rectangle2D.Double bounds;

private final ST axesChartStyler;

/** the axis title */
private final AxisTitle<ST, S> axisTitle;

/** the axis tick */
private final AxisTick<ST, S> 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ public class AxisTick<ST extends AxesChartStyler, S extends AxesChartSeries> imp

private final Chart<ST, S> chart;
private final Direction direction;

/** the axisticklabels */
private final AxisTickLabels<ST, S> axisTickLabels;

/** the axistickmarks */
private final AxisTickMarks<ST, S> axisTickMarks;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ protected void setHeight(int height) {

this.height = height;
}

// TODO remove public
public String getTitle() {

Expand Down Expand Up @@ -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) {

Expand Down Expand Up @@ -172,6 +174,7 @@ public void setCustomXAxisTickLabelsFormatter(Function<Double, String> customFor
AxesChartStyler axesChartStyler = (AxesChartStyler) (styler);
axesChartStyler.setxAxisTickLabelsFormattingFunction(customFormattingFunction);
}

/**
* @Deprecated - use styler instead
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public boolean filterXByScreen(int screenXmin, int screenXmax) {
}
return filtered;
}

/**
* Is there a point selected in all series.
*
Expand Down Expand Up @@ -218,6 +219,7 @@ public void actionPerformed(ActionEvent e) {
// reset button pressed
resetZoom();
}

/**
* Whether the selectZoom overlaps with the chart.plot
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class PlotContent_Pie<ST extends PieStyler, S extends PieSeries>
super(chart);
pieStyler = chart.getStyler();
}

// TODO get rid of this
public static Shape getDonutSliceShape(
Rectangle2D pieBounds, double thickness, double start, double extent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public void paint(Graphics2D g) {
}
}
}

////////////////////////////////////////////////
/// PAINTING //////////////////////////////////
///////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions xchart/src/main/java/org/knowm/xchart/style/PieStyler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -324,6 +325,7 @@ public PieStyler setLabelsFontColorAutomaticDark(Color labelsFontColorAutomaticD
this.labelsFontColorAutomaticDark = labelsFontColorAutomaticDark;
return this;
}

/**
* Set the theme the styler should use
*
Expand Down
5 changes: 5 additions & 0 deletions xchart/src/main/java/org/knowm/xchart/style/Styler.java
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ public Color getLegendBackgroundColor() {

return legendBackgroundColor;
}

/**
* Set the chart legend background color
*
Expand Down Expand Up @@ -499,6 +500,7 @@ public enum LegendPosition {
InsideS,
OutsideS
}

/**
* Set the legend layout
*
Expand Down Expand Up @@ -680,6 +682,7 @@ public Styler setAnnotationLineColor(Color annotationLineColor) {
this.annotationLineColor = annotationLineColor;
return this;
}

// Chart Button ///////////////////////////////

public Color getChartButtonBackgroundColor() {
Expand Down Expand Up @@ -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) {

Expand Down Expand Up @@ -948,6 +952,7 @@ public Styler setYAxisGroupTitleColor(int yAxisGroup, Color yAxisColor) {
yAxisGroupTitleColorMap.put(yAxisGroup, yAxisColor);
return this;
}

// Line, Scatter, Area Charts ///////////////////////////////

public int getMarkerSize() {
Expand Down
3 changes: 3 additions & 0 deletions xchart/src/main/java/org/knowm/xchart/style/XYStyler.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ protected void setAllStyles() {
this.cursorFontColor = theme.getCursorFontColor();
this.cursorBackgroundColor = theme.getCursorBackgroundColor();
}

/**
* Set the theme the styler should use
*
Expand Down Expand Up @@ -82,6 +83,7 @@ public XYStyler setDefaultSeriesRenderStyle(XYSeriesRenderStyle xySeriesRenderSt
this.xySeriesRenderStyle = xySeriesRenderStyle;
return this;
}

// Zoom ///////////////////////////////

public boolean isZoomEnabled() {
Expand Down Expand Up @@ -207,6 +209,7 @@ public void setCustomCursorXDataFormattingFunction(
public Function<Double, String> getCustomCursorYDataFormattingFunction() {
return customCursorYDataFormattingFunction;
}

/**
* Set the custom function for formatting the cursor tooltip based on the series Y-Axis data
*
Expand Down

0 comments on commit 7a17458

Please sign in to comment.