Checkstyle: fix naming convention issues

Fixed warnings: AbbreviationAsWordInName, ClassTypeParameterName, LocalVariableName, MemberName, MethodName.
This commit is contained in:
mkpaz 2023-02-10 14:05:26 +04:00
parent c7f1f2701b
commit c3a9b71e93
6 changed files with 43 additions and 43 deletions

@ -298,7 +298,7 @@ public class Breadcrumbs<T> extends Control {
/**
* Represents an Event which is fired when a bread crumb was activated.
*/
public static class BreadCrumbActionEvent<TE> extends Event {
public static class BreadCrumbActionEvent<T> extends Event {
/**
* The event type that should be listened to by people interested in
@ -308,17 +308,17 @@ public class Breadcrumbs<T> extends Control {
public static final EventType<BreadCrumbActionEvent<?>> CRUMB_ACTION
= new EventType<>("CRUMB_ACTION" + UUID.randomUUID());
private final BreadCrumbItem<TE> selectedCrumb;
private final BreadCrumbItem<T> selectedCrumb;
/**
* Creates a new event that can subsequently be fired.
*/
public BreadCrumbActionEvent(BreadCrumbItem<TE> selectedCrumb) {
public BreadCrumbActionEvent(BreadCrumbItem<T> selectedCrumb) {
super(CRUMB_ACTION);
this.selectedCrumb = selectedCrumb;
}
public BreadCrumbItem<TE> getSelectedCrumb() {
public BreadCrumbItem<T> getSelectedCrumb() {
return selectedCrumb;
}
}

@ -336,7 +336,7 @@
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9]\w*$"/>
<property name="format" value="^[a-z]\w*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>

@ -18,7 +18,7 @@ import atlantafx.sampler.page.components.ComboBoxPage;
import atlantafx.sampler.page.components.CustomTextFieldPage;
import atlantafx.sampler.page.components.DatePickerPage;
import atlantafx.sampler.page.components.DialogPage;
import atlantafx.sampler.page.components.HTMLEditorPage;
import atlantafx.sampler.page.components.HtmlEditorPage;
import atlantafx.sampler.page.components.InputGroupPage;
import atlantafx.sampler.page.components.LabelPage;
import atlantafx.sampler.page.components.ListPage;
@ -239,7 +239,7 @@ class Sidebar extends StackPane {
navLink(CustomTextFieldPage.NAME, CustomTextFieldPage.class),
navLink(DatePickerPage.NAME, DatePickerPage.class),
navLink(DialogPage.NAME, DialogPage.class),
navLink(HTMLEditorPage.NAME, HTMLEditorPage.class),
navLink(HtmlEditorPage.NAME, HtmlEditorPage.class),
navLink(LabelPage.NAME, LabelPage.class),
navLink(ListPage.NAME, ListPage.class),
navLink(MenuPage.NAME, MenuPage.class),

@ -19,7 +19,7 @@ import javafx.scene.text.Text;
import javafx.scene.text.TextFlow;
import javafx.scene.web.HTMLEditor;
public class HTMLEditorPage extends AbstractPage {
public class HtmlEditorPage extends AbstractPage {
private static final PseudoClass USE_LOCAL_URL = PseudoClass.getPseudoClass("use-local-url");
@ -32,7 +32,7 @@ public class HTMLEditorPage extends AbstractPage {
private HTMLEditor editor = createEditor();
public HTMLEditorPage() {
public HtmlEditorPage() {
super();
setUserContent(new VBox(editorSample()));

@ -56,8 +56,8 @@ class ContrastChecker extends GridPane {
private String bgColorName;
private String fgColorName;
private final ObservableHSLAColor bgColor = new ObservableHSLAColor(Color.WHITE);
private final ObservableHSLAColor fgColor = new ObservableHSLAColor(Color.BLACK);
private final ObservableHslaColor bgColor = new ObservableHslaColor(Color.WHITE);
private final ObservableHslaColor fgColor = new ObservableHslaColor(Color.BLACK);
private final ReadOnlyObjectProperty<Color> bgBaseColor;
private final DoubleBinding contrastRatio;
@ -418,15 +418,15 @@ class ContrastChecker extends GridPane {
///////////////////////////////////////////////////////////////////////////
private static class ObservableHSLAColor {
private static class ObservableHslaColor {
private final ObservableList<Float> values = FXCollections.observableArrayList(0f, 0f, 0f, 0f);
private final ReadOnlyObjectWrapper<Color> color = new ReadOnlyObjectWrapper<>() {
};
public ObservableHSLAColor(Color initialColor) {
public ObservableHslaColor(Color initialColor) {
values.addListener((ListChangeListener<Float>) c -> {
float[] rgb = getRGBAArithmeticColor();
float[] rgb = getRgbaArithmeticColor();
color.set(Color.color(rgb[0], rgb[1], rgb[2], getAlpha()));
});
setColor(initialColor);
@ -477,7 +477,7 @@ class ContrastChecker extends GridPane {
values.set(3, value);
}
public float[] getRGBAArithmeticColor() {
public float[] getRgbaArithmeticColor() {
float[] hsl = new float[] {getHue(), getSaturation(), getLightness()};
var color = JColor.color(hsl, getAlpha());
return new float[] {
@ -496,9 +496,9 @@ class ContrastChecker extends GridPane {
private static class RightClickMenu extends ContextMenu {
private final ObservableHSLAColor color;
private final ObservableHslaColor color;
public RightClickMenu(ObservableHSLAColor color) {
public RightClickMenu(ObservableHslaColor color) {
super();
this.color = color;

@ -185,9 +185,9 @@ final class ColorThief {
private final int[] histo;
private int[] _avg;
private Integer _volume;
private Integer _count;
private int[] gAvg;
private Integer gVolume;
private Integer gCount;
public VBox(int r1, int r2, int g1, int g2, int b1, int b2, int[] histo) {
this.r1 = r1;
@ -205,14 +205,14 @@ final class ColorThief {
}
public int volume(boolean force) {
if (_volume == null || force) {
_volume = ((r2 - r1 + 1) * (g2 - g1 + 1) * (b2 - b1 + 1));
if (gVolume == null || force) {
gVolume = ((r2 - r1 + 1) * (g2 - g1 + 1) * (b2 - b1 + 1));
}
return _volume;
return gVolume;
}
public int count(boolean force) {
if (_count == null || force) {
if (gCount == null || force) {
int npix = 0;
int i, j, k, index;
@ -225,10 +225,10 @@ final class ColorThief {
}
}
_count = npix;
gCount = npix;
}
return _count;
return gCount;
}
@Override
@ -238,7 +238,7 @@ final class ColorThief {
}
public int[] avg(boolean force) {
if (_avg == null || force) {
if (gAvg == null || force) {
int ntot = 0;
int rsum = 0;
int gsum = 0;
@ -259,14 +259,14 @@ final class ColorThief {
}
if (ntot > 0) {
_avg = new int[] {(rsum / ntot), (gsum / ntot), (bsum / ntot)};
gAvg = new int[] {(rsum / ntot), (gsum / ntot), (bsum / ntot)};
} else {
_avg = new int[] {(MULT * (r1 + r2 + 1) / 2), (MULT * (g1 + g2 + 1) / 2),
gAvg = new int[] {(MULT * (r1 + r2 + 1) / 2), (MULT * (g1 + g2 + 1) / 2),
(MULT * (b1 + b2 + 1) / 2)};
}
}
return _avg;
return gAvg;
}
public boolean contains(int[] pixel) {
@ -457,36 +457,36 @@ final class ColorThief {
int[] lookAheadSum,
int total
) {
int vbox_dim1;
int vbox_dim2;
int vboxDim1;
int vboxDim2;
if (color == 'r') {
vbox_dim1 = vbox.r1;
vbox_dim2 = vbox.r2;
vboxDim1 = vbox.r1;
vboxDim2 = vbox.r2;
} else if (color == 'g') {
vbox_dim1 = vbox.g1;
vbox_dim2 = vbox.g2;
vboxDim1 = vbox.g1;
vboxDim2 = vbox.g2;
} else {
vbox_dim1 = vbox.b1;
vbox_dim2 = vbox.b2;
vboxDim1 = vbox.b1;
vboxDim2 = vbox.b2;
}
int left, right;
VBox vbox1, vbox2;
int d2, count2;
for (int i = vbox_dim1; i <= vbox_dim2; i++) {
for (int i = vboxDim1; i <= vboxDim2; i++) {
if (partialSum[i] > total / 2) {
vbox1 = vbox.clone();
vbox2 = vbox.clone();
left = i - vbox_dim1;
right = vbox_dim2 - i;
left = i - vboxDim1;
right = vboxDim2 - i;
if (left <= right) {
d2 = Math.min(vbox_dim2 - 1, (i + right / 2));
d2 = Math.min(vboxDim2 - 1, (i + right / 2));
} else {
d2 = Math.max(vbox_dim1, ((int) (i - 1 - left / 2.0)));
d2 = Math.max(vboxDim1, ((int) (i - 1 - left / 2.0)));
}
while (d2 < 0 || partialSum[d2] <= 0) {