Checkstyle: fix variable declaration [VariableDeclarationUsageDistance]
This commit is contained in:
parent
3e9189ff44
commit
4c3daeb798
@ -306,26 +306,24 @@ public class PopoverSkin implements Skin<Popover> {
|
||||
lineJLeft;
|
||||
|
||||
private void createPathElements() {
|
||||
DoubleProperty centerYProperty = new SimpleDoubleProperty();
|
||||
DoubleProperty centerXProperty = new SimpleDoubleProperty();
|
||||
final DoubleProperty centerYProperty = new SimpleDoubleProperty();
|
||||
final DoubleProperty centerXProperty = new SimpleDoubleProperty();
|
||||
|
||||
DoubleProperty leftEdgeProperty = new SimpleDoubleProperty();
|
||||
DoubleProperty leftEdgePlusRadiusProperty = new SimpleDoubleProperty();
|
||||
final DoubleProperty leftEdgeProperty = new SimpleDoubleProperty();
|
||||
final DoubleProperty leftEdgePlusRadiusProperty = new SimpleDoubleProperty();
|
||||
|
||||
DoubleProperty topEdgeProperty = new SimpleDoubleProperty();
|
||||
DoubleProperty topEdgePlusRadiusProperty = new SimpleDoubleProperty();
|
||||
final DoubleProperty topEdgeProperty = new SimpleDoubleProperty();
|
||||
final DoubleProperty topEdgePlusRadiusProperty = new SimpleDoubleProperty();
|
||||
|
||||
DoubleProperty rightEdgeProperty = new SimpleDoubleProperty();
|
||||
DoubleProperty rightEdgeMinusRadiusProperty = new SimpleDoubleProperty();
|
||||
final DoubleProperty rightEdgeProperty = new SimpleDoubleProperty();
|
||||
final DoubleProperty rightEdgeMinusRadiusProperty = new SimpleDoubleProperty();
|
||||
|
||||
DoubleProperty bottomEdgeProperty = new SimpleDoubleProperty();
|
||||
DoubleProperty bottomEdgeMinusRadiusProperty = new SimpleDoubleProperty();
|
||||
final DoubleProperty bottomEdgeProperty = new SimpleDoubleProperty();
|
||||
final DoubleProperty bottomEdgeMinusRadiusProperty = new SimpleDoubleProperty();
|
||||
|
||||
DoubleProperty cornerProperty = getSkinnable().cornerRadiusProperty();
|
||||
|
||||
DoubleProperty arrowSizeProperty = getSkinnable().arrowSizeProperty();
|
||||
DoubleProperty arrowIndentProperty = getSkinnable()
|
||||
.arrowIndentProperty();
|
||||
final DoubleProperty cornerProperty = getSkinnable().cornerRadiusProperty();
|
||||
final DoubleProperty arrowSizeProperty = getSkinnable().arrowSizeProperty();
|
||||
final DoubleProperty arrowIndentProperty = getSkinnable().arrowIndentProperty();
|
||||
|
||||
centerYProperty.bind(Bindings.divide(stackPane.heightProperty(), 2));
|
||||
centerXProperty.bind(Bindings.divide(stackPane.widthProperty(), 2));
|
||||
@ -351,52 +349,44 @@ public class PopoverSkin implements Skin<Popover> {
|
||||
|
||||
// == TOP EDGE ==
|
||||
lineBTop = new HLineTo();
|
||||
lineBTop.xProperty().bind(
|
||||
Bindings.add(leftEdgePlusRadiusProperty, arrowIndentProperty));
|
||||
lineBTop.xProperty().bind(Bindings.add(leftEdgePlusRadiusProperty, arrowIndentProperty));
|
||||
|
||||
lineCTop = new LineTo();
|
||||
lineCTop.xProperty().bind(
|
||||
Bindings.add(lineBTop.xProperty(), arrowSizeProperty));
|
||||
lineCTop.yProperty().bind(
|
||||
Bindings.subtract(topEdgeProperty, arrowSizeProperty));
|
||||
lineCTop.xProperty().bind(Bindings.add(lineBTop.xProperty(), arrowSizeProperty));
|
||||
lineCTop.yProperty().bind(Bindings.subtract(topEdgeProperty, arrowSizeProperty));
|
||||
|
||||
lineDTop = new LineTo();
|
||||
lineDTop.xProperty().bind(
|
||||
Bindings.add(lineCTop.xProperty(), arrowSizeProperty));
|
||||
lineDTop.xProperty().bind(Bindings.add(lineCTop.xProperty(), arrowSizeProperty));
|
||||
lineDTop.yProperty().bind(topEdgeProperty);
|
||||
|
||||
lineETop = new HLineTo();
|
||||
lineETop.xProperty().bind(
|
||||
Bindings.subtract(centerXProperty, arrowSizeProperty));
|
||||
lineETop.xProperty().bind(Bindings.subtract(centerXProperty, arrowSizeProperty));
|
||||
|
||||
lineFTop = new LineTo();
|
||||
lineFTop.xProperty().bind(centerXProperty);
|
||||
lineFTop.yProperty().bind(
|
||||
Bindings.subtract(topEdgeProperty, arrowSizeProperty));
|
||||
lineFTop.yProperty().bind(Bindings.subtract(topEdgeProperty, arrowSizeProperty));
|
||||
|
||||
lineGTop = new LineTo();
|
||||
lineGTop.xProperty().bind(
|
||||
Bindings.add(centerXProperty, arrowSizeProperty));
|
||||
lineGTop.xProperty().bind(Bindings.add(centerXProperty, arrowSizeProperty));
|
||||
lineGTop.yProperty().bind(topEdgeProperty);
|
||||
|
||||
lineHTop = new HLineTo();
|
||||
lineHTop.xProperty().bind(
|
||||
Bindings.subtract(Bindings.subtract(
|
||||
rightEdgeMinusRadiusProperty, arrowIndentProperty),
|
||||
Bindings.multiply(arrowSizeProperty, 2)));
|
||||
lineHTop.xProperty().bind(Bindings.subtract(
|
||||
Bindings.subtract(rightEdgeMinusRadiusProperty, arrowIndentProperty),
|
||||
Bindings.multiply(arrowSizeProperty, 2)
|
||||
));
|
||||
|
||||
lineITop = new LineTo();
|
||||
lineITop.xProperty().bind(
|
||||
Bindings.subtract(Bindings.subtract(
|
||||
rightEdgeMinusRadiusProperty, arrowIndentProperty),
|
||||
arrowSizeProperty));
|
||||
lineITop.yProperty().bind(
|
||||
Bindings.subtract(topEdgeProperty, arrowSizeProperty));
|
||||
lineITop.xProperty().bind(Bindings.subtract(
|
||||
Bindings.subtract(rightEdgeMinusRadiusProperty, arrowIndentProperty),
|
||||
arrowSizeProperty
|
||||
));
|
||||
lineITop.yProperty().bind(Bindings.subtract(topEdgeProperty, arrowSizeProperty));
|
||||
|
||||
lineJTop = new LineTo();
|
||||
lineJTop.xProperty().bind(
|
||||
Bindings.subtract(rightEdgeMinusRadiusProperty,
|
||||
arrowIndentProperty));
|
||||
lineJTop.xProperty().bind(Bindings.subtract(
|
||||
rightEdgeMinusRadiusProperty, arrowIndentProperty
|
||||
));
|
||||
lineJTop.yProperty().bind(topEdgeProperty);
|
||||
|
||||
lineKTop = new HLineTo();
|
||||
@ -405,59 +395,51 @@ public class PopoverSkin implements Skin<Popover> {
|
||||
// == RIGHT EDGE ==
|
||||
rightCurveTo = new QuadCurveTo();
|
||||
rightCurveTo.xProperty().bind(rightEdgeProperty);
|
||||
rightCurveTo.yProperty().bind(
|
||||
Bindings.add(topEdgeProperty, cornerProperty));
|
||||
rightCurveTo.yProperty().bind(Bindings.add(topEdgeProperty, cornerProperty));
|
||||
rightCurveTo.controlXProperty().bind(rightEdgeProperty);
|
||||
rightCurveTo.controlYProperty().bind(topEdgeProperty);
|
||||
|
||||
lineBRight = new VLineTo();
|
||||
lineBRight.yProperty().bind(
|
||||
Bindings.add(topEdgePlusRadiusProperty, arrowIndentProperty));
|
||||
lineBRight.yProperty().bind(Bindings.add(topEdgePlusRadiusProperty, arrowIndentProperty));
|
||||
|
||||
lineCRight = new LineTo();
|
||||
lineCRight.xProperty().bind(
|
||||
Bindings.add(rightEdgeProperty, arrowSizeProperty));
|
||||
lineCRight.yProperty().bind(
|
||||
Bindings.add(lineBRight.yProperty(), arrowSizeProperty));
|
||||
lineCRight.xProperty().bind(Bindings.add(rightEdgeProperty, arrowSizeProperty));
|
||||
lineCRight.yProperty().bind(Bindings.add(lineBRight.yProperty(), arrowSizeProperty));
|
||||
|
||||
lineDRight = new LineTo();
|
||||
lineDRight.xProperty().bind(rightEdgeProperty);
|
||||
lineDRight.yProperty().bind(
|
||||
Bindings.add(lineCRight.yProperty(), arrowSizeProperty));
|
||||
lineDRight.yProperty().bind(Bindings.add(lineCRight.yProperty(), arrowSizeProperty));
|
||||
|
||||
lineERight = new VLineTo();
|
||||
lineERight.yProperty().bind(
|
||||
Bindings.subtract(centerYProperty, arrowSizeProperty));
|
||||
lineERight.yProperty().bind(Bindings.subtract(centerYProperty, arrowSizeProperty));
|
||||
|
||||
lineFRight = new LineTo();
|
||||
lineFRight.xProperty().bind(
|
||||
Bindings.add(rightEdgeProperty, arrowSizeProperty));
|
||||
lineFRight.xProperty().bind(Bindings.add(rightEdgeProperty, arrowSizeProperty));
|
||||
lineFRight.yProperty().bind(centerYProperty);
|
||||
|
||||
lineGRight = new LineTo();
|
||||
lineGRight.xProperty().bind(rightEdgeProperty);
|
||||
lineGRight.yProperty().bind(
|
||||
Bindings.add(centerYProperty, arrowSizeProperty));
|
||||
lineGRight.yProperty().bind(Bindings.add(centerYProperty, arrowSizeProperty));
|
||||
|
||||
lineHRight = new VLineTo();
|
||||
lineHRight.yProperty().bind(
|
||||
Bindings.subtract(Bindings.subtract(
|
||||
bottomEdgeMinusRadiusProperty, arrowIndentProperty),
|
||||
Bindings.multiply(arrowSizeProperty, 2)));
|
||||
lineHRight.yProperty().bind(Bindings.subtract(
|
||||
Bindings.subtract(bottomEdgeMinusRadiusProperty, arrowIndentProperty),
|
||||
Bindings.multiply(arrowSizeProperty, 2)
|
||||
));
|
||||
|
||||
lineIRight = new LineTo();
|
||||
lineIRight.xProperty().bind(
|
||||
Bindings.add(rightEdgeProperty, arrowSizeProperty));
|
||||
lineIRight.yProperty().bind(
|
||||
Bindings.subtract(Bindings.subtract(
|
||||
bottomEdgeMinusRadiusProperty, arrowIndentProperty),
|
||||
arrowSizeProperty));
|
||||
lineIRight.xProperty().bind(Bindings.add(rightEdgeProperty, arrowSizeProperty));
|
||||
lineIRight.yProperty().bind(Bindings.subtract(
|
||||
Bindings.subtract(bottomEdgeMinusRadiusProperty, arrowIndentProperty),
|
||||
arrowSizeProperty
|
||||
));
|
||||
|
||||
lineJRight = new LineTo();
|
||||
lineJRight.xProperty().bind(rightEdgeProperty);
|
||||
lineJRight.yProperty().bind(
|
||||
Bindings.subtract(bottomEdgeMinusRadiusProperty,
|
||||
arrowIndentProperty));
|
||||
lineJRight.yProperty().bind(Bindings.subtract(
|
||||
bottomEdgeMinusRadiusProperty,
|
||||
arrowIndentProperty
|
||||
));
|
||||
|
||||
lineKRight = new VLineTo();
|
||||
lineKRight.yProperty().bind(bottomEdgeMinusRadiusProperty);
|
||||
@ -470,51 +452,42 @@ public class PopoverSkin implements Skin<Popover> {
|
||||
bottomCurveTo.controlYProperty().bind(bottomEdgeProperty);
|
||||
|
||||
lineBBottom = new HLineTo();
|
||||
lineBBottom.xProperty().bind(
|
||||
Bindings.subtract(rightEdgeMinusRadiusProperty,
|
||||
arrowIndentProperty));
|
||||
lineBBottom.xProperty().bind(Bindings.subtract(rightEdgeMinusRadiusProperty, arrowIndentProperty));
|
||||
|
||||
lineCBottom = new LineTo();
|
||||
lineCBottom.xProperty().bind(
|
||||
Bindings.subtract(lineBBottom.xProperty(), arrowSizeProperty));
|
||||
lineCBottom.yProperty().bind(
|
||||
Bindings.add(bottomEdgeProperty, arrowSizeProperty));
|
||||
lineCBottom.xProperty().bind(Bindings.subtract(lineBBottom.xProperty(), arrowSizeProperty));
|
||||
lineCBottom.yProperty().bind(Bindings.add(bottomEdgeProperty, arrowSizeProperty));
|
||||
|
||||
lineDBottom = new LineTo();
|
||||
lineDBottom.xProperty().bind(
|
||||
Bindings.subtract(lineCBottom.xProperty(), arrowSizeProperty));
|
||||
lineDBottom.xProperty().bind(Bindings.subtract(lineCBottom.xProperty(), arrowSizeProperty));
|
||||
lineDBottom.yProperty().bind(bottomEdgeProperty);
|
||||
|
||||
lineEBottom = new HLineTo();
|
||||
lineEBottom.xProperty().bind(
|
||||
Bindings.add(centerXProperty, arrowSizeProperty));
|
||||
lineEBottom.xProperty().bind(Bindings.add(centerXProperty, arrowSizeProperty));
|
||||
|
||||
lineFBottom = new LineTo();
|
||||
lineFBottom.xProperty().bind(centerXProperty);
|
||||
lineFBottom.yProperty().bind(
|
||||
Bindings.add(bottomEdgeProperty, arrowSizeProperty));
|
||||
lineFBottom.yProperty().bind(Bindings.add(bottomEdgeProperty, arrowSizeProperty));
|
||||
|
||||
lineGBottom = new LineTo();
|
||||
lineGBottom.xProperty().bind(
|
||||
Bindings.subtract(centerXProperty, arrowSizeProperty));
|
||||
lineGBottom.xProperty().bind(Bindings.subtract(centerXProperty, arrowSizeProperty));
|
||||
lineGBottom.yProperty().bind(bottomEdgeProperty);
|
||||
|
||||
lineHBottom = new HLineTo();
|
||||
lineHBottom.xProperty().bind(
|
||||
Bindings.add(Bindings.add(leftEdgePlusRadiusProperty,
|
||||
arrowIndentProperty), Bindings.multiply(
|
||||
arrowSizeProperty, 2)));
|
||||
lineHBottom.xProperty().bind(Bindings.add(
|
||||
Bindings.add(leftEdgePlusRadiusProperty, arrowIndentProperty),
|
||||
Bindings.multiply(arrowSizeProperty, 2)
|
||||
));
|
||||
|
||||
lineIBottom = new LineTo();
|
||||
lineIBottom.xProperty().bind(
|
||||
Bindings.add(Bindings.add(leftEdgePlusRadiusProperty,
|
||||
arrowIndentProperty), arrowSizeProperty));
|
||||
lineIBottom.yProperty().bind(
|
||||
Bindings.add(bottomEdgeProperty, arrowSizeProperty));
|
||||
lineIBottom.xProperty().bind(Bindings.add(
|
||||
Bindings.add(leftEdgePlusRadiusProperty, arrowIndentProperty),
|
||||
arrowSizeProperty
|
||||
));
|
||||
lineIBottom.yProperty().bind(Bindings.add(bottomEdgeProperty, arrowSizeProperty));
|
||||
|
||||
lineJBottom = new LineTo();
|
||||
lineJBottom.xProperty().bind(
|
||||
Bindings.add(leftEdgePlusRadiusProperty, arrowIndentProperty));
|
||||
lineJBottom.xProperty().bind(Bindings.add(leftEdgePlusRadiusProperty, arrowIndentProperty));
|
||||
lineJBottom.yProperty().bind(bottomEdgeProperty);
|
||||
|
||||
lineKBottom = new HLineTo();
|
||||
@ -523,58 +496,48 @@ public class PopoverSkin implements Skin<Popover> {
|
||||
// == LEFT EDGE ==
|
||||
leftCurveTo = new QuadCurveTo();
|
||||
leftCurveTo.xProperty().bind(leftEdgeProperty);
|
||||
leftCurveTo.yProperty().bind(
|
||||
Bindings.subtract(bottomEdgeProperty, cornerProperty));
|
||||
leftCurveTo.yProperty().bind(Bindings.subtract(bottomEdgeProperty, cornerProperty));
|
||||
leftCurveTo.controlXProperty().bind(leftEdgeProperty);
|
||||
leftCurveTo.controlYProperty().bind(bottomEdgeProperty);
|
||||
|
||||
lineBLeft = new VLineTo();
|
||||
lineBLeft.yProperty().bind(
|
||||
Bindings.subtract(bottomEdgeMinusRadiusProperty,
|
||||
arrowIndentProperty));
|
||||
lineBLeft.yProperty().bind(Bindings.subtract(bottomEdgeMinusRadiusProperty, arrowIndentProperty));
|
||||
|
||||
lineCLeft = new LineTo();
|
||||
lineCLeft.xProperty().bind(
|
||||
Bindings.subtract(leftEdgeProperty, arrowSizeProperty));
|
||||
lineCLeft.yProperty().bind(
|
||||
Bindings.subtract(lineBLeft.yProperty(), arrowSizeProperty));
|
||||
lineCLeft.xProperty().bind(Bindings.subtract(leftEdgeProperty, arrowSizeProperty));
|
||||
lineCLeft.yProperty().bind(Bindings.subtract(lineBLeft.yProperty(), arrowSizeProperty));
|
||||
|
||||
lineDLeft = new LineTo();
|
||||
lineDLeft.xProperty().bind(leftEdgeProperty);
|
||||
lineDLeft.yProperty().bind(
|
||||
Bindings.subtract(lineCLeft.yProperty(), arrowSizeProperty));
|
||||
lineDLeft.yProperty().bind(Bindings.subtract(lineCLeft.yProperty(), arrowSizeProperty));
|
||||
|
||||
lineELeft = new VLineTo();
|
||||
lineELeft.yProperty().bind(
|
||||
Bindings.add(centerYProperty, arrowSizeProperty));
|
||||
lineELeft.yProperty().bind(Bindings.add(centerYProperty, arrowSizeProperty));
|
||||
|
||||
lineFLeft = new LineTo();
|
||||
lineFLeft.xProperty().bind(
|
||||
Bindings.subtract(leftEdgeProperty, arrowSizeProperty));
|
||||
lineFLeft.xProperty().bind(Bindings.subtract(leftEdgeProperty, arrowSizeProperty));
|
||||
lineFLeft.yProperty().bind(centerYProperty);
|
||||
|
||||
lineGLeft = new LineTo();
|
||||
lineGLeft.xProperty().bind(leftEdgeProperty);
|
||||
lineGLeft.yProperty().bind(
|
||||
Bindings.subtract(centerYProperty, arrowSizeProperty));
|
||||
lineGLeft.yProperty().bind(Bindings.subtract(centerYProperty, arrowSizeProperty));
|
||||
|
||||
lineHLeft = new VLineTo();
|
||||
lineHLeft.yProperty().bind(
|
||||
Bindings.add(Bindings.add(topEdgePlusRadiusProperty,
|
||||
arrowIndentProperty), Bindings.multiply(
|
||||
arrowSizeProperty, 2)));
|
||||
lineHLeft.yProperty().bind(Bindings.add(
|
||||
Bindings.add(topEdgePlusRadiusProperty, arrowIndentProperty),
|
||||
Bindings.multiply(arrowSizeProperty, 2)
|
||||
));
|
||||
|
||||
lineILeft = new LineTo();
|
||||
lineILeft.xProperty().bind(
|
||||
Bindings.subtract(leftEdgeProperty, arrowSizeProperty));
|
||||
lineILeft.yProperty().bind(
|
||||
Bindings.add(Bindings.add(topEdgePlusRadiusProperty,
|
||||
arrowIndentProperty), arrowSizeProperty));
|
||||
lineILeft.xProperty().bind(Bindings.subtract(leftEdgeProperty, arrowSizeProperty));
|
||||
lineILeft.yProperty().bind(Bindings.add(
|
||||
Bindings.add(topEdgePlusRadiusProperty, arrowIndentProperty),
|
||||
arrowSizeProperty
|
||||
));
|
||||
|
||||
lineJLeft = new LineTo();
|
||||
lineJLeft.xProperty().bind(leftEdgeProperty);
|
||||
lineJLeft.yProperty().bind(
|
||||
Bindings.add(topEdgePlusRadiusProperty, arrowIndentProperty));
|
||||
lineJLeft.yProperty().bind(Bindings.add(topEdgePlusRadiusProperty, arrowIndentProperty));
|
||||
|
||||
lineKLeft = new VLineTo();
|
||||
lineKLeft.yProperty().bind(topEdgePlusRadiusProperty);
|
||||
|
@ -270,7 +270,9 @@
|
||||
</module>
|
||||
<module name="NoWhitespaceBeforeCaseDefaultColon"/>
|
||||
<module name="OverloadMethodsDeclarationOrder"/>
|
||||
<module name="VariableDeclarationUsageDistance"/>
|
||||
<module name="VariableDeclarationUsageDistance">
|
||||
<property name="allowedDistance" value="10"/>
|
||||
</module>
|
||||
<module name="CustomImportOrder">
|
||||
<property name="sortImportsInGroupAlphabetically" value="true"/>
|
||||
<property name="separateLineBetweenGroups" value="true"/>
|
||||
|
@ -140,8 +140,6 @@ public class DialogPage extends AbstractPage {
|
||||
var printWriter = new PrintWriter(stringWriter);
|
||||
exception.printStackTrace(printWriter);
|
||||
|
||||
var label = new Label("Full stacktrace:");
|
||||
|
||||
var textArea = new TextArea(stringWriter.toString());
|
||||
textArea.setEditable(false);
|
||||
textArea.setWrapText(false);
|
||||
@ -152,7 +150,7 @@ public class DialogPage extends AbstractPage {
|
||||
|
||||
var content = new GridPane();
|
||||
content.setMaxWidth(Double.MAX_VALUE);
|
||||
content.add(label, 0, 0);
|
||||
content.add(new Label("Full stacktrace:"), 0, 0);
|
||||
content.add(textArea, 0, 1);
|
||||
|
||||
alert.getDialogPane().setExpandableContent(content);
|
||||
|
@ -232,9 +232,9 @@ public class ProgressPage extends AbstractPage {
|
||||
}
|
||||
|
||||
private SampleBlock colorChangeSample() {
|
||||
var stateSuccess = PseudoClass.getPseudoClass("state-success");
|
||||
var stateDanger = PseudoClass.getPseudoClass("state-danger");
|
||||
var width = 300;
|
||||
final var stateSuccess = PseudoClass.getPseudoClass("state-success");
|
||||
final var stateDanger = PseudoClass.getPseudoClass("state-danger");
|
||||
final var width = 300;
|
||||
|
||||
var bar = new ProgressBar(0);
|
||||
bar.getStyleClass().add(LARGE);
|
||||
|
@ -248,8 +248,8 @@ public class TablePage extends AbstractPage {
|
||||
}
|
||||
|
||||
private MenuButton createTablePropertiesMenu(TableView<Product> table) {
|
||||
var resizePolicyCaption = new CaptionMenuItem("Resize Policy");
|
||||
var resizePolicyGroup = new ToggleGroup();
|
||||
final var resizePolicyCaption = new CaptionMenuItem("Resize Policy");
|
||||
final var resizePolicyGroup = new ToggleGroup();
|
||||
resizePolicyGroup.selectedToggleProperty().addListener((obs, old, val) -> {
|
||||
if (val != null && val.getUserData() instanceof Callback policy) {
|
||||
//noinspection rawtypes,unchecked
|
||||
@ -257,51 +257,51 @@ public class TablePage extends AbstractPage {
|
||||
}
|
||||
});
|
||||
|
||||
var unconstrainedResizeItem = new RadioMenuItem("Unconstrained");
|
||||
final var unconstrainedResizeItem = new RadioMenuItem("Unconstrained");
|
||||
unconstrainedResizeItem.setToggleGroup(resizePolicyGroup);
|
||||
unconstrainedResizeItem.setUserData(TableView.UNCONSTRAINED_RESIZE_POLICY);
|
||||
unconstrainedResizeItem.setSelected(true);
|
||||
|
||||
var constrainedResizeItem = new RadioMenuItem("Constrained");
|
||||
final var constrainedResizeItem = new RadioMenuItem("Constrained");
|
||||
constrainedResizeItem.setToggleGroup(resizePolicyGroup);
|
||||
constrainedResizeItem.setUserData(TableView.CONSTRAINED_RESIZE_POLICY);
|
||||
|
||||
// ~
|
||||
|
||||
var selectionModeCaption = new CaptionMenuItem("Selection Mode");
|
||||
var selectionModeGroup = new ToggleGroup();
|
||||
final var selectionModeCaption = new CaptionMenuItem("Selection Mode");
|
||||
final var selectionModeGroup = new ToggleGroup();
|
||||
selectionModeGroup.selectedToggleProperty().addListener((obs, old, val) -> {
|
||||
if (val != null && val.getUserData() instanceof SelectionMode mode) {
|
||||
table.getSelectionModel().setSelectionMode(mode);
|
||||
}
|
||||
});
|
||||
|
||||
var singleSelectionItem = new RadioMenuItem("Single");
|
||||
final var singleSelectionItem = new RadioMenuItem("Single");
|
||||
singleSelectionItem.setToggleGroup(selectionModeGroup);
|
||||
singleSelectionItem.setUserData(SelectionMode.SINGLE);
|
||||
|
||||
var multiSelectionItem = new RadioMenuItem("Multiple");
|
||||
final var multiSelectionItem = new RadioMenuItem("Multiple");
|
||||
multiSelectionItem.setToggleGroup(selectionModeGroup);
|
||||
multiSelectionItem.setUserData(SelectionMode.MULTIPLE);
|
||||
multiSelectionItem.setSelected(true);
|
||||
|
||||
// ~
|
||||
|
||||
var editCellsItem = new CheckMenuItem("Editable");
|
||||
final var editCellsItem = new CheckMenuItem("Editable");
|
||||
table.editableProperty().bind(editCellsItem.selectedProperty());
|
||||
editCellsItem.setSelected(true);
|
||||
|
||||
var cellSelectionItem = new CheckMenuItem("Enable cell selection");
|
||||
final var cellSelectionItem = new CheckMenuItem("Enable cell selection");
|
||||
table.getSelectionModel().cellSelectionEnabledProperty().bind(cellSelectionItem.selectedProperty());
|
||||
cellSelectionItem.setSelected(false);
|
||||
|
||||
// ~
|
||||
|
||||
var menuButtonItem = new CheckMenuItem("Show menu button");
|
||||
final var menuButtonItem = new CheckMenuItem("Show menu button");
|
||||
table.tableMenuButtonVisibleProperty().bind(menuButtonItem.selectedProperty());
|
||||
menuButtonItem.setSelected(true);
|
||||
|
||||
var propertiesMenu = new MenuButton("Properties");
|
||||
final var propertiesMenu = new MenuButton("Properties");
|
||||
propertiesMenu.getItems().setAll(
|
||||
resizePolicyCaption,
|
||||
unconstrainedResizeItem,
|
||||
|
@ -227,8 +227,8 @@ public class TreeTablePage extends AbstractPage {
|
||||
}
|
||||
|
||||
private MenuButton createPropertiesMenu(TreeTableView<Product> treeTable) {
|
||||
var resizePolicyCaption = new CaptionMenuItem("Resize Policy");
|
||||
var resizePolicyGroup = new ToggleGroup();
|
||||
final var resizePolicyCaption = new CaptionMenuItem("Resize Policy");
|
||||
final var resizePolicyGroup = new ToggleGroup();
|
||||
resizePolicyGroup.selectedToggleProperty().addListener((obs, old, val) -> {
|
||||
if (val != null && val.getUserData() instanceof Callback policy) {
|
||||
//noinspection rawtypes,unchecked
|
||||
@ -236,55 +236,55 @@ public class TreeTablePage extends AbstractPage {
|
||||
}
|
||||
});
|
||||
|
||||
var unconstrainedResizeItem = new RadioMenuItem("Unconstrained");
|
||||
final var unconstrainedResizeItem = new RadioMenuItem("Unconstrained");
|
||||
unconstrainedResizeItem.setToggleGroup(resizePolicyGroup);
|
||||
unconstrainedResizeItem.setUserData(TreeTableView.UNCONSTRAINED_RESIZE_POLICY);
|
||||
unconstrainedResizeItem.setSelected(true);
|
||||
|
||||
var constrainedResizeItem = new RadioMenuItem("Constrained");
|
||||
final var constrainedResizeItem = new RadioMenuItem("Constrained");
|
||||
constrainedResizeItem.setToggleGroup(resizePolicyGroup);
|
||||
constrainedResizeItem.setUserData(TreeTableView.CONSTRAINED_RESIZE_POLICY);
|
||||
|
||||
// ~
|
||||
|
||||
var selectionModeCaption = new CaptionMenuItem("Selection Mode");
|
||||
var selectionModeGroup = new ToggleGroup();
|
||||
final var selectionModeCaption = new CaptionMenuItem("Selection Mode");
|
||||
final var selectionModeGroup = new ToggleGroup();
|
||||
selectionModeGroup.selectedToggleProperty().addListener((obs, old, val) -> {
|
||||
if (val != null && val.getUserData() instanceof SelectionMode mode) {
|
||||
treeTable.getSelectionModel().setSelectionMode(mode);
|
||||
}
|
||||
});
|
||||
|
||||
var singleSelectionItem = new RadioMenuItem("Single");
|
||||
final var singleSelectionItem = new RadioMenuItem("Single");
|
||||
singleSelectionItem.setToggleGroup(selectionModeGroup);
|
||||
singleSelectionItem.setUserData(SelectionMode.SINGLE);
|
||||
|
||||
var multiSelectionItem = new RadioMenuItem("Multiple");
|
||||
final var multiSelectionItem = new RadioMenuItem("Multiple");
|
||||
multiSelectionItem.setToggleGroup(selectionModeGroup);
|
||||
multiSelectionItem.setUserData(SelectionMode.MULTIPLE);
|
||||
multiSelectionItem.setSelected(true);
|
||||
|
||||
// ~
|
||||
|
||||
var showRootItem = new CheckMenuItem("Show root");
|
||||
final var showRootItem = new CheckMenuItem("Show root");
|
||||
treeTable.showRootProperty().bind(showRootItem.selectedProperty());
|
||||
showRootItem.setSelected(true);
|
||||
|
||||
var editCellsItem = new CheckMenuItem("Editable");
|
||||
final var editCellsItem = new CheckMenuItem("Editable");
|
||||
treeTable.editableProperty().bind(editCellsItem.selectedProperty());
|
||||
editCellsItem.setSelected(true);
|
||||
|
||||
var cellSelectionItem = new CheckMenuItem("Enable cell selection");
|
||||
final var cellSelectionItem = new CheckMenuItem("Enable cell selection");
|
||||
treeTable.getSelectionModel().cellSelectionEnabledProperty().bind(cellSelectionItem.selectedProperty());
|
||||
cellSelectionItem.setSelected(false);
|
||||
|
||||
// ~
|
||||
|
||||
var menuButtonItem = new CheckMenuItem("Show menu button");
|
||||
final var menuButtonItem = new CheckMenuItem("Show menu button");
|
||||
treeTable.tableMenuButtonVisibleProperty().bind(menuButtonItem.selectedProperty());
|
||||
menuButtonItem.setSelected(true);
|
||||
|
||||
var propertiesMenu = new MenuButton("Properties");
|
||||
final var propertiesMenu = new MenuButton("Properties");
|
||||
propertiesMenu.getItems().setAll(
|
||||
resizePolicyCaption,
|
||||
unconstrainedResizeItem,
|
||||
|
@ -159,7 +159,7 @@ class ContrastChecker extends GridPane {
|
||||
var aaaLargeLabel = contrastLevelLabel();
|
||||
var aaaLargeBox = contrastLevelBox(aaaLargeLabel, "AAA Large");
|
||||
|
||||
var contrastLevels = new HBox(20, aaNormalBox, aaLargeBox, aaaNormalBox, aaaLargeBox);
|
||||
final var contrastLevels = new HBox(20, aaNormalBox, aaLargeBox, aaaNormalBox, aaaLargeBox);
|
||||
|
||||
contrastRatio.addListener((obs, old, val) -> {
|
||||
if (val == null) {
|
||||
|
@ -64,8 +64,6 @@ public class FileManagerPage extends ShowcasePage {
|
||||
}
|
||||
|
||||
private void createView() {
|
||||
var topBar = new ToolBar();
|
||||
|
||||
var backBtn = iconButton(Feather.ARROW_LEFT, false);
|
||||
backBtn.setOnAction(e -> model.back());
|
||||
backBtn.disableProperty().bind(model.getHistory().canGoBackProperty().not());
|
||||
@ -92,6 +90,7 @@ public class FileManagerPage extends ShowcasePage {
|
||||
menuBtn.getItems().setAll(toggleHiddenCheck);
|
||||
menuBtn.getStyleClass().addAll(BUTTON_ICON, Tweaks.NO_ARROW);
|
||||
|
||||
var topBar = new ToolBar();
|
||||
topBar.getItems().setAll(
|
||||
backBtn,
|
||||
forthBtn,
|
||||
|
@ -36,9 +36,6 @@ public class MusicPlayerPage extends ShowcasePage {
|
||||
}
|
||||
|
||||
private void createView() {
|
||||
var startScreen = new StartScreen(model);
|
||||
var playerScreen = new PlayerScreen(model);
|
||||
|
||||
var aboutBox = new HBox(new Text("Simple music player that able to play MP3 files."));
|
||||
aboutBox.setPadding(new Insets(5, 0, 5, 0));
|
||||
aboutBox.getStyleClass().add("about");
|
||||
@ -52,6 +49,8 @@ public class MusicPlayerPage extends ShowcasePage {
|
||||
creditsBox.setPadding(new Insets(5, 0, 5, 0));
|
||||
|
||||
// ~
|
||||
var startScreen = new StartScreen(model);
|
||||
var playerScreen = new PlayerScreen(model);
|
||||
|
||||
var root = new BorderPane();
|
||||
root.setCenter(startScreen);
|
||||
|
Loading…
Reference in New Issue
Block a user