From aac2984a6f89e39d52d576bb05c5631b6529ad9e Mon Sep 17 00:00:00 2001 From: weisj Date: Mon, 20 Apr 2020 17:38:19 +0200 Subject: [PATCH] Updated formatting rules. --- .../darklaf/color/DarkColorModelHSL.java | 4 +- .../components/tabframe/PanelPopup.java | 4 +- .../components/tabframe/ToggleSplitPane.java | 4 +- .../components/tooltip/ToolTipContext.java | 8 +- .../darklaf/settings/ThemeSettingsPanel.java | 18 +- .../darklaf/ui/button/DarkButtonBorder.java | 6 +- .../weisj/darklaf/ui/button/DarkButtonUI.java | 6 +- .../ui/colorchooser/ColorValueFormatter.java | 4 +- .../colorchooser/DarkColorChooserPanel.java | 2 +- .../ui/colorchooser/SlideComponent.java | 4 +- .../darklaf/ui/combobox/DarkComboBoxUI.java | 6 +- .../filechooser/DarkFileChooserUIBridge.java | 6 +- .../ui/filechooser/DarkFilePaneUIBridge.java | 10 +- .../darklaf/ui/popupmenu/DarkPopupMenuUI.java | 2 +- .../darklaf/ui/rootpane/DarkRootPaneUI.java | 2 +- .../ui/scrollpane/DarkScrollPaneUI.java | 2 +- .../weisj/darklaf/ui/slider/DarkSliderUI.java | 6 +- .../darklaf/ui/spinner/DarkSpinnerBorder.java | 4 +- .../ui/splitpane/DarkSplitPaneDivider.java | 8 +- .../DarkTabbedPaneScrollLayout.java | 14 +- .../ui/tabbedpane/DarkTabbedPaneUIBridge.java | 26 +- .../ui/tabbedpane/TabbedPaneLayout.java | 8 +- .../tabbedpane/TabbedPaneTransferHandler.java | 2 +- .../darklaf/ui/tabframe/DarkPanelPopupUI.java | 4 +- .../tabframe/DarkTabFrameTabContainerUI.java | 8 +- .../ui/tabframe/DarkTabFrameTabLabelUI.java | 18 +- .../ui/tabframe/DarkTabbedPopupUI.java | 4 +- .../darklaf/ui/table/DarkTableHeaderUI.java | 4 +- .../ui/table/DarkTableHeaderUIBridge.java | 4 +- .../weisj/darklaf/ui/table/DarkTableUI.java | 6 +- .../weisj/darklaf/ui/table/TableUIBridge.java | 4 +- .../weisj/darklaf/ui/text/DarkTextBorder.java | 2 +- .../darklaf/ui/text/DarkTextFieldUI.java | 8 +- .../darklaf/ui/togglebutton/StateIconUI.java | 6 +- .../DarkTristateCheckBoxMenuItemUI.java | 2 +- .../tristate/DarkTristateCheckBoxUI.java | 2 +- .../darklaf/ui/tooltip/DarkTooltipUI.java | 2 +- .../weisj/darklaf/ui/tooltip/ToolTipUtil.java | 2 +- .../weisj/darklaf/ui/tree/DarkTreeUI.java | 8 +- .../weisj/darklaf/util/GraphicsContext.java | 2 +- .../weisj/darklaf/util/GraphicsUtil.java | 6 +- .../github/weisj/darklaf/util/ImageUtil.java | 4 +- core/src/test/java/icon/IconDemo.java | 2 +- core/src/test/java/ui/button/ButtonDemo.java | 2 +- .../test/java/ui/button/ToggleButtonDemo.java | 2 +- .../test/java/ui/checkBox/CheckBoxDemo.java | 2 +- .../java/ui/checkBox/TriCheckBoxDemo.java | 2 +- .../test/java/ui/comboBox/ComboBoxDemo.java | 5 +- core/src/test/java/ui/label/LabelDemo.java | 2 +- .../java/ui/progressBar/ProgressBarDemo.java | 5 +- .../java/ui/radioButton/RadioButtonDemo.java | 2 +- .../java/ui/scrollPane/ScrollPaneDemo.java | 5 +- core/src/test/java/ui/slider/SliderDemo.java | 8 +- .../src/test/java/ui/spinner/SpinnerDemo.java | 4 +- .../java/ui/tabbedPane/TabbedPaneDemo.java | 5 +- core/src/test/java/ui/table/TableDemo.java | 2 +- .../test/java/ui/text/PasswordFieldDemo.java | 5 +- core/src/test/java/ui/text/TextFieldDemo.java | 5 +- core/src/test/java/ui/tree/TreeDemo.java | 2 +- darklaf_java.eclipseformat.xml | 324 ++++++------------ .../github/weisj/darklaf/PropertyLoader.java | 8 +- .../github/weisj/darklaf/icons/StateIcon.java | 6 +- .../theme/info/DefaultThemeProvider.java | 2 +- .../darklaf/platform/windows/PointerUtil.java | 2 +- .../platform/windows/ui/WindowsTitlePane.java | 8 +- 65 files changed, 279 insertions(+), 383 deletions(-) diff --git a/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSL.java b/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSL.java index c291d892..0484b026 100644 --- a/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSL.java +++ b/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSL.java @@ -88,8 +88,8 @@ public class DarkColorModelHSL extends DarkColorModel { double saturation = (max - min); if (saturation > 0.0f) { saturation /= (summa > 1.0f) - ? 2.0f - summa - : summa; + ? 2.0f - summa + : summa; } return new double[]{ getHue(r / 255.0, g / 255.0, b / 255.0, max, min), diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/PanelPopup.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/PanelPopup.java index a54f1e1d..398ed047 100644 --- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/PanelPopup.java +++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/PanelPopup.java @@ -177,8 +177,8 @@ public class PanelPopup extends JPanel implements TabFramePopup { public void setAlignment(final Alignment alignment) { if (alignment == null || this.alignment == Alignment.CENTER) { throw new IllegalArgumentException("Illegal alignment: " + (alignment != null - ? alignment.toString() - : "null")); + ? alignment.toString() + : "null")); } Alignment old = this.alignment; this.alignment = alignment; diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/ToggleSplitPane.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/ToggleSplitPane.java index 062411c4..0cae3e35 100644 --- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/ToggleSplitPane.java +++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/ToggleSplitPane.java @@ -175,7 +175,7 @@ public class ToggleSplitPane extends JSplitPane { public int getMinimumDividerLocation() { Component comp = getRightComponent(); return comp == null ? 0 : getOrientation() == HORIZONTAL_SPLIT - ? comp.getMinimumSize().width - : comp.getMinimumSize().height; + ? comp.getMinimumSize().width + : comp.getMinimumSize().height; } } diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipContext.java b/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipContext.java index ae2989ef..66e83264 100644 --- a/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipContext.java +++ b/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipContext.java @@ -371,8 +371,8 @@ public class ToolTipContext { if (toolTip != null) { toolTip.putClientProperty(DarkTooltipUI.KEY_POINTER_LOCATION, alignment == Alignment.CENTER - ? centerAlignment.opposite() - : alignInside ? alignment : alignment.opposite()); + ? centerAlignment.opposite() + : alignInside ? alignment : alignment.opposite()); toolTip.putClientProperty(DarkTooltipUI.KEY_INSETS, insets); toolTip.putClientProperty(DarkTooltipUI.KEY_STYLE, style); toolTip.doLayout(); @@ -482,9 +482,9 @@ public class ToolTipContext { mousePoint = alignCenter(dim, mRect); } else { compPoint = alignInside ? alignInside(dim, rect) - : alignOutside(dim, rect); + : alignOutside(dim, rect); mousePoint = alignInside ? alignInside(dim, mRect) - : alignOutside(dim, mRect); + : alignOutside(dim, mRect); } return alignmentStrategy.align(compPoint, mousePoint); diff --git a/core/src/main/java/com/github/weisj/darklaf/settings/ThemeSettingsPanel.java b/core/src/main/java/com/github/weisj/darklaf/settings/ThemeSettingsPanel.java index 1fac72a4..3fbc0467 100644 --- a/core/src/main/java/com/github/weisj/darklaf/settings/ThemeSettingsPanel.java +++ b/core/src/main/java/com/github/weisj/darklaf/settings/ThemeSettingsPanel.java @@ -156,7 +156,7 @@ public class ThemeSettingsPanel extends JPanel { } if (ignoreSettings || isFontSizeFollowsSystem()) { setFontSizeRule(isFontSizeFollowsSystem() ? theme.getFontSizeRule() - : currentTheme.getFontSizeRule()); + : currentTheme.getFontSizeRule()); } if (ignoreSettings || isAccentColorFollowsSystem()) { setAccentColor(getAccentColor(isAccentColorFollowsSystem() ? theme : currentTheme, true)); @@ -349,8 +349,8 @@ public class ThemeSettingsPanel extends JPanel { protected Theme getTheme(final PreferredThemeStyle preferredThemeStyle) { return isThemeFollowsSystem() - ? LafManager.themeForPreferredStyle(preferredThemeStyle) - : (Theme) themeComboBox.getSelectedItem(); + ? LafManager.themeForPreferredStyle(preferredThemeStyle) + : (Theme) themeComboBox.getSelectedItem(); } public FontSizeRule getFontSizeRule() { @@ -361,8 +361,8 @@ public class ThemeSettingsPanel extends JPanel { protected FontSizeRule getFontSizeRule(final Theme theme, final PreferredThemeStyle preferredThemeStyle) { if (theme == null) return FontSizeRule.getDefault(); return isFontSizeFollowsSystem() - ? preferredThemeStyle.getFontSizeRule() - : FontSizeRule.relativeAdjustment(fontSlider.getValue()); + ? preferredThemeStyle.getFontSizeRule() + : FontSizeRule.relativeAdjustment(fontSlider.getValue()); } public AccentColorRule getAccentColorRule() { @@ -379,14 +379,14 @@ public class ThemeSettingsPanel extends JPanel { protected Color getAccentColor(final Theme theme, final boolean useThemeColor) { return theme.supportsCustomAccentColor() ? useThemeColor ? theme.getAccentColorRule().getAccentColor() - : getSelectedColor(bgAccent, defaultAccent) - : null; + : getSelectedColor(bgAccent, defaultAccent) + : null; } protected Color getSelectionColor(final Theme theme, final boolean useThemeColor) { return theme.supportsCustomSelectionColor() ? useThemeColor ? theme.getAccentColorRule().getSelectionColor() - : getSelectedColor(bgSelection, defaultSelection) - : null; + : getSelectedColor(bgSelection, defaultSelection) + : null; } public void setEnabledSystemPreferences(final boolean enabled) { diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java index 2a3d6fe1..1855f623 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java @@ -279,9 +279,9 @@ public class DarkButtonBorder implements Border, UIResource { int shadow = shadowVariant ? 0 : getShadowSize(); boolean square = ButtonConstants.isSquare(c); Insets pad = ButtonConstants.isThin(c) ? square ? squareThinInsets - : thinInsets - : square ? squareInsets - : insets; + : thinInsets + : square ? squareInsets + : insets; return maskInsets(new InsetsUIResource(pad.top, pad.left, pad.bottom, pad.right), c, shadow); } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java index 8bd9ca42..71da2558 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java @@ -371,7 +371,7 @@ public class DarkButtonUI extends BasicButtonUI implements ButtonConstants { Object colorClick = c.getClientProperty(KEY_CLICK_COLOR); boolean armed = c.getModel().isArmed(); return armed ? colorClick instanceof Color ? (Color) colorClick : borderlessClick - : colorHover instanceof Color ? (Color) colorHover : borderlessHover; + : colorHover instanceof Color ? (Color) colorHover : borderlessHover; } protected Color getBorderlessOutline(final AbstractButton c) { @@ -409,8 +409,8 @@ public class DarkButtonUI extends BasicButtonUI implements ButtonConstants { b.getVerticalTextPosition(), b.getHorizontalTextPosition(), viewRect, iconRect, textRect, b.getText() == null || ButtonConstants.isIconOnly(b) - ? 0 - : b.getIconTextGap()); + ? 0 + : b.getIconTextGap()); } @Override diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/ColorValueFormatter.java b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/ColorValueFormatter.java index bb3005e0..d77743e6 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/ColorValueFormatter.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/ColorValueFormatter.java @@ -218,8 +218,8 @@ public final class ColorValueFormatter extends JFormattedTextField.AbstractForma int b = Integer.valueOf(hexStr.substring(4, 6), 16); checkRange(b, 0, 255); int alpha = hexStr.length() >= 8 - ? Integer.valueOf(hexStr.substring(6, 8), 16) - : 255; + ? Integer.valueOf(hexStr.substring(6, 8), 16) + : 255; checkRange(alpha, 0, 255); return new Color(r, g, b, alpha); } else { diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserPanel.java b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserPanel.java index 80fa054b..711c9554 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserPanel.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserPanel.java @@ -127,7 +127,7 @@ public class DarkColorChooserPanel extends AbstractColorChooserPanel implements try { String hexStr = String.format("%1$-" + 8 + "s", textHex.getText()).replaceAll(" ", "F"); int alpha = isColorTransparencySelectionEnabled() - ? Integer.valueOf(hexStr.substring(6, 8), 16) : 255; + ? Integer.valueOf(hexStr.substring(6, 8), 16) : 255; return new Color(Integer.valueOf(hexStr.substring(0, 2), 16), Integer.valueOf(hexStr.substring(2, 4), 16), Integer.valueOf(hexStr.substring(4, 6), 16), diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/SlideComponent.java b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/SlideComponent.java index 478fb72a..8eef4c61 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/SlideComponent.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/SlideComponent.java @@ -261,13 +261,13 @@ class SlideComponent extends JComponent implements ColorListener { @Override public Dimension getPreferredSize() { return vertical ? new Dimension(22, 100) - : new Dimension(100, 22); + : new Dimension(100, 22); } @Override public Dimension getMinimumSize() { return vertical ? new Dimension(22, 50) - : new Dimension(50, 22); + : new Dimension(50, 22); } @Override diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java index 4e1bb3f9..7be377c5 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java @@ -305,9 +305,9 @@ public class DarkComboBoxUI extends BasicComboBoxUI implements ComboBoxConstants // calculate the width and height of the button int buttonHeight = size.height; int buttonWidth = squareButton - ? buttonHeight - : arrowButton.getPreferredSize().width - + arrowButton.getInsets().left + arrowButton.getInsets().right; + ? buttonHeight + : arrowButton.getPreferredSize().width + + arrowButton.getInsets().left + arrowButton.getInsets().right; // adjust the size based on the button width size.height += insets.top + insets.bottom; size.width += insets.left + insets.right + buttonWidth; diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUIBridge.java b/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUIBridge.java index 30849f46..1c31c862 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUIBridge.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUIBridge.java @@ -926,8 +926,8 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI { directories.clear(); File[] baseFolders = (useShellFolder) - ? (File[]) ShellFolder.get("fileChooserComboBoxFolders") - : fsv.getRoots(); + ? (File[]) ShellFolder.get("fileChooserComboBoxFolders") + : fsv.getRoots(); directories.addAll(Arrays.asList(baseFolders)); // Get the canonical (full) path. This has the side @@ -944,7 +944,7 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI { // create File instances of each directory leading up to the top try { File sf = useShellFolder ? ShellFolder.getShellFolder(canonical) - : canonical; + : canonical; File f = sf; Vector path = new Vector<>(10); do { diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFilePaneUIBridge.java b/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFilePaneUIBridge.java index 14afa353..1745c63b 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFilePaneUIBridge.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFilePaneUIBridge.java @@ -350,7 +350,7 @@ public abstract class DarkFilePaneUIBridge extends JPanel implements PropertyCha Boolean prop = (Boolean) chooser.getClientProperty("FileChooser.useShellFolder"); return prop == null ? chooser.getFileSystemView().equals(FileSystemView.getFileSystemView()) - : prop; + : prop; } public void uninstallUI() { @@ -1275,8 +1275,8 @@ public abstract class DarkFilePaneUIBridge extends JPanel implements PropertyCha return f.isDirectory() ? null : f.length(); } return (col == COLUMN_FILENAME) - ? f // always return the file itself for the 1st column - : ShellFolder.getFolderColumnValue(f, columnMap[col]); + ? f // always return the file itself for the 1st column + : ShellFolder.getFolderColumnValue(f, columnMap[col]); } public void intervalAdded(final ListDataEvent e) { @@ -1453,8 +1453,8 @@ public abstract class DarkFilePaneUIBridge extends JPanel implements PropertyCha Integer alignment = columnInfo.getAlignment(); if (alignment == null) { alignment = (value instanceof Number) - ? SwingConstants.RIGHT - : SwingConstants.LEADING; + ? SwingConstants.RIGHT + : SwingConstants.LEADING; } setHorizontalAlignment(alignment); diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/popupmenu/DarkPopupMenuUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/popupmenu/DarkPopupMenuUI.java index e8934cbb..ba06f189 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/popupmenu/DarkPopupMenuUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/popupmenu/DarkPopupMenuUI.java @@ -168,7 +168,7 @@ public class DarkPopupMenuUI extends BasicPopupMenuUI { invoker = ((JPopupMenu) invoker).getInvoker(); } grabbedWindow = (invoker == null) ? null : ((invoker instanceof Window) ? (Window) invoker - : SwingUtilities.getWindowAncestor(invoker)); + : SwingUtilities.getWindowAncestor(invoker)); if (grabbedWindow != null) { if (tk instanceof sun.awt.SunToolkit) { ((sun.awt.SunToolkit) tk).grab(grabbedWindow); diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/rootpane/DarkRootPaneUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/rootpane/DarkRootPaneUI.java index ea4cb5da..19a6c489 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/rootpane/DarkRootPaneUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/rootpane/DarkRootPaneUI.java @@ -144,7 +144,7 @@ public class DarkRootPaneUI extends BasicRootPaneUI implements HierarchyListener private void installClientDecorations(final JRootPane root) { updateWindow(rootPane.getParent()); int style = decorationsStyleFromWindow(window, windowDecorationsStyle < 0 ? root.getWindowDecorationStyle() - : windowDecorationsStyle); + : windowDecorationsStyle); CustomTitlePane titlePane = DecorationsHandler.getSharedInstance().createTitlePane(root, style, window); installLayout(root); setTitlePane(root, titlePane); diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/scrollpane/DarkScrollPaneUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/scrollpane/DarkScrollPaneUI.java index 4df9ecf2..3bbfce24 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/scrollpane/DarkScrollPaneUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/scrollpane/DarkScrollPaneUI.java @@ -65,7 +65,7 @@ public class DarkScrollPaneUI extends BasicScrollPaneUI { return; } JScrollBar scrollbar = e.isShiftDown() ? scrollpane.getHorizontalScrollBar() - : scrollpane.getVerticalScrollBar(); + : scrollpane.getVerticalScrollBar(); scrollbar.setValueIsAdjusting(true); ScrollBarUtil.doScroll(scrollbar, scrollpane.getViewport(), e, scrollpane.getComponentOrientation().isLeftToRight()); diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/slider/DarkSliderUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/slider/DarkSliderUI.java index 765a2cd4..2b8e28ba 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/slider/DarkSliderUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/slider/DarkSliderUI.java @@ -340,8 +340,8 @@ public class DarkSliderUI extends BasicSliderUI implements PropertyChangeListene return new Dimension(plainThumbRadius + 6, plainThumbRadius + 6); } return isHorizontal() - ? new Dimension(thumbSize.width, thumbSize.height) - : new Dimension(thumbSize.height, thumbSize.width); + ? new Dimension(thumbSize.width, thumbSize.height) + : new Dimension(thumbSize.height, thumbSize.width); } @Override @@ -818,7 +818,7 @@ public class DarkSliderUI extends BasicSliderUI implements PropertyChangeListene private int getSnappedValue(final MouseEvent e) { int value = isHorizontal() ? valueForXPosition(e.getX()) - : valueForYPosition(e.getY()); + : valueForYPosition(e.getY()); return DarkSliderUI.this.getSnappedValue(value); } } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerBorder.java b/core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerBorder.java index 898cc621..db329076 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerBorder.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerBorder.java @@ -78,8 +78,8 @@ public class DarkSpinnerBorder implements Border, UIResource { JComponent editor = spinner.getEditor(); if (editor != null) { int off = spinner.getComponentOrientation().isLeftToRight() - ? editor.getBounds().x + editor.getWidth() - : editor.getBounds().x - 1 - borderSize; + ? editor.getBounds().x + editor.getWidth() + : editor.getBounds().x - 1 - borderSize; g.setColor(getBorderColor(spinner)); if (!treeCellEditor) { g.fillRect(off, size, 1, height - 2 * size); diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/splitpane/DarkSplitPaneDivider.java b/core/src/main/java/com/github/weisj/darklaf/ui/splitpane/DarkSplitPaneDivider.java index ed563901..1391b6a6 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/splitpane/DarkSplitPaneDivider.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/splitpane/DarkSplitPaneDivider.java @@ -149,8 +149,8 @@ public class DarkSplitPaneDivider extends BasicSplitPaneDivider { public Icon getIcon() { if (splitPane != null) { return splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT - ? getRightOneTouchIcon() - : getBottomOneTouchIcon(); + ? getRightOneTouchIcon() + : getBottomOneTouchIcon(); } return EmptyIcon.create(0); } @@ -161,8 +161,8 @@ public class DarkSplitPaneDivider extends BasicSplitPaneDivider { public Icon getIcon() { if (splitPane != null) { return splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT - ? getLeftOneTouchIcon() - : getTopOneTouchIcon(); + ? getLeftOneTouchIcon() + : getTopOneTouchIcon(); } return EmptyIcon.create(0); } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneScrollLayout.java b/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneScrollLayout.java index 9b3b3665..dfdf1c08 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneScrollLayout.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneScrollLayout.java @@ -146,12 +146,12 @@ public class DarkTabbedPaneScrollLayout extends TabbedPaneScrollLayout { int vw = tw; int vh = th; Dimension butSize = moreTabs.isVisible() - ? moreTabs.getPreferredSize() - : new Dimension(0, 0); + ? moreTabs.getPreferredSize() + : new Dimension(0, 0); boolean showNewTabButton = newTab.isVisible() && newTab.getParent() == ui.tabPane; Dimension butSize2 = showNewTabButton - ? newTab.getPreferredSize() - : new Dimension(0, 0); + ? newTab.getPreferredSize() + : new Dimension(0, 0); boolean leftToRight = ui.tabPane.getComponentOrientation().isLeftToRight(); if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { vh = th - butSize.height - butSize2.height; @@ -311,8 +311,8 @@ public class DarkTabbedPaneScrollLayout extends TabbedPaneScrollLayout { JButton tabsButton = ui.scrollableTabSupport.moreTabsButton; Rectangle selectedBounds = ui.tabPane.getSelectedIndex() > 0 - ? new Rectangle(ui.rects[ui.tabPane.getSelectedIndex()]) - : new Rectangle(0, 0, 0, 0); + ? new Rectangle(ui.rects[ui.tabPane.getSelectedIndex()]) + : new Rectangle(0, 0, 0, 0); if (!verticalTabRuns) { int rightMargin = size.width - (insets.right + tabAreaInsets.right + insets.left + tabAreaInsets.left); @@ -663,7 +663,7 @@ public class DarkTabbedPaneScrollLayout extends TabbedPaneScrollLayout { int maxStart = ui.maxVisible < 0 || ui.maxVisible >= tabCount ? tabCount - 1 : ui.maxVisible; int currShift = isX ? ui.currentShiftXTmp + shift : ui.currentShiftYTmp + shift; Function isVisible = isX ? (i -> isVisibleX(i, currShift, minVal, returnAt)) - : (i -> isVisibleY(i, currShift, minVal, returnAt)); + : (i -> isVisibleY(i, currShift, minVal, returnAt)); if (isVisible.apply(minStart)) { // Descent to find minimum. min = minStart; diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneUIBridge.java b/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneUIBridge.java index dd374cc1..b335351f 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneUIBridge.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneUIBridge.java @@ -639,7 +639,7 @@ public abstract class DarkTabbedPaneUIBridge extends TabbedPaneUI implements Swi */ protected Icon getIconForTab(final int tabIndex) { return (!tabPane.isEnabled() || !tabPane.isEnabledAt(tabIndex)) ? tabPane.getDisabledIconAt(tabIndex) - : tabPane.getIconAt(tabIndex); + : tabPane.getIconAt(tabIndex); } /** @@ -840,7 +840,7 @@ public abstract class DarkTabbedPaneUIBridge extends TabbedPaneUI implements Swi protected int getTabLabelShiftY(final int tabPlacement, final int tabIndex, final boolean isSelected) { Rectangle tabRect = rects[tabIndex]; int nudge = (isSelected ? DefaultLookup.getInt(tabPane, this, "TabbedPane.selectedLabelShift", -1) - : DefaultLookup.getInt(tabPane, this, "TabbedPane.labelShift", 1)); + : DefaultLookup.getInt(tabPane, this, "TabbedPane.labelShift", 1)); switch (tabPlacement) { case BOTTOM : @@ -1621,7 +1621,7 @@ public abstract class DarkTabbedPaneUIBridge extends TabbedPaneUI implements Swi int tabRunOverlay = getTabRunOverlay(tabPlacement); return (horizRunCount > 0 ? horizRunCount * (maxTabHeight - tabRunOverlay) + tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom - : 0); + : 0); } /** @@ -1637,7 +1637,7 @@ public abstract class DarkTabbedPaneUIBridge extends TabbedPaneUI implements Swi int tabRunOverlay = getTabRunOverlay(tabPlacement); return (vertRunCount > 0 ? vertRunCount * (maxTabWidth - tabRunOverlay) + tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right - : 0); + : 0); } /** @@ -1719,7 +1719,7 @@ public abstract class DarkTabbedPaneUIBridge extends TabbedPaneUI implements Swi int tabPlacement = tabPane.getTabPlacement(); int current = DefaultLookup.getBoolean(tabPane, this, "TabbedPane.selectionFollowsFocus", true) ? tabPane.getSelectedIndex() - : getFocusIndex(); + : getFocusIndex(); int tabCount = tabPane.getTabCount(); boolean leftToRight = tabPane.getComponentOrientation().isLeftToRight(); @@ -2046,11 +2046,11 @@ public abstract class DarkTabbedPaneUIBridge extends TabbedPaneUI implements Swi case LEFT : { if (run == 0) { offset = (forward ? -(calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth) - maxTabWidth) - : -maxTabWidth); + : -maxTabWidth); } else if (run == runCount - 1) { offset = (forward ? maxTabWidth - : calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth) - maxTabWidth); + : calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth) - maxTabWidth); } else { offset = (forward ? maxTabWidth : -maxTabWidth); } @@ -2059,10 +2059,10 @@ public abstract class DarkTabbedPaneUIBridge extends TabbedPaneUI implements Swi case RIGHT : { if (run == 0) { offset = (forward ? maxTabWidth - : calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth) - maxTabWidth); + : calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth) - maxTabWidth); } else if (run == runCount - 1) { offset = (forward ? -(calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth) - maxTabWidth) - : -maxTabWidth); + : -maxTabWidth); } else { offset = (forward ? maxTabWidth : -maxTabWidth); } @@ -2071,10 +2071,10 @@ public abstract class DarkTabbedPaneUIBridge extends TabbedPaneUI implements Swi case BOTTOM : { if (run == 0) { offset = (forward ? maxTabHeight - : calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight) - maxTabHeight); + : calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight) - maxTabHeight); } else if (run == runCount - 1) { offset = (forward ? -(calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight) - maxTabHeight) - : -maxTabHeight); + : -maxTabHeight); } else { offset = (forward ? maxTabHeight : -maxTabHeight); } @@ -2084,10 +2084,10 @@ public abstract class DarkTabbedPaneUIBridge extends TabbedPaneUI implements Swi default : { if (run == 0) { offset = (forward ? -(calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight) - maxTabHeight) - : -maxTabHeight); + : -maxTabHeight); } else if (run == runCount - 1) { offset = (forward ? maxTabHeight - : calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight) - maxTabHeight); + : calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight) - maxTabHeight); } else { offset = (forward ? maxTabHeight : -maxTabHeight); } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/TabbedPaneLayout.java b/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/TabbedPaneLayout.java index f5bafc22..4e8d271d 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/TabbedPaneLayout.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/TabbedPaneLayout.java @@ -150,11 +150,11 @@ public abstract class TabbedPaneLayout implements LayoutManager { if (child == ui.tabContainer) { int tabContainerWidth = totalTabWidth == 0 ? bounds.width - : totalTabWidth + insets.left + insets.right + - contentInsets.left + contentInsets.right; + : totalTabWidth + insets.left + insets.right + + contentInsets.left + contentInsets.right; int tabContainerHeight = totalTabHeight == 0 ? bounds.height - : totalTabHeight + insets.top + insets.bottom + - contentInsets.top + contentInsets.bottom; + : totalTabHeight + insets.top + insets.bottom + + contentInsets.top + contentInsets.bottom; int tabContainerX = 0; int tabContainerY = 0; diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/TabbedPaneTransferHandler.java b/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/TabbedPaneTransferHandler.java index 9e5a27fb..6de62ed8 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/TabbedPaneTransferHandler.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/TabbedPaneTransferHandler.java @@ -169,7 +169,7 @@ public class TabbedPaneTransferHandler extends TransferHandler implements DropTa protected void createDragImage(final JTabbedPane tabbedPane, final DarkTabbedPaneUI ui) { Color color = ui != null ? ui.getDragBorderColor() - : tabbedPane.getBackgroundAt(currentTransferable.transferData.tabIndex); + : tabbedPane.getBackgroundAt(currentTransferable.transferData.tabIndex); Image tabImage = ImageUtil.createDragImage(tabbedPane, currentTransferable.transferData.tabBounds, 2, color); int w = tabImage.getWidth(null); int h = tabImage.getHeight(null); diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkPanelPopupUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkPanelPopupUI.java index b498f8ee..cece902a 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkPanelPopupUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkPanelPopupUI.java @@ -378,9 +378,9 @@ public class DarkPanelPopupUI extends DarkPanelUI implements PropertyChangeListe public void setFocus(final boolean focus) { putClientProperty(DarkButtonUI.KEY_HOVER_COLOR, focus ? ui.headerButtonFocusHoverBackground - : ui.headerButtonHoverBackground); + : ui.headerButtonHoverBackground); putClientProperty(DarkButtonUI.KEY_CLICK_COLOR, focus ? ui.headerButtonFocusClickBackground - : ui.headerButtonClickBackground); + : ui.headerButtonClickBackground); } } } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameTabContainerUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameTabContainerUI.java index a13ca0ea..d153652c 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameTabContainerUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameTabContainerUI.java @@ -209,9 +209,9 @@ public class DarkTabFrameTabContainerUI extends DarkPanelUI implements PropertyC public Color getBackground(final TabFrameTabContainer tab) { if (printing) return tab.getBackground(); return tab.isSelected() - ? selectedColor - : hoverListener.isHover() && !tab.getTabFrame().isInTransfer() - ? hoverColor - : tab.getBackground(); + ? selectedColor + : hoverListener.isHover() && !tab.getTabFrame().isInTransfer() + ? hoverColor + : tab.getBackground(); } } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameTabLabelUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameTabLabelUI.java index 9a113dbf..355bc91a 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameTabLabelUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameTabLabelUI.java @@ -183,7 +183,7 @@ public class DarkTabFrameTabLabelUI extends DarkLabelUI implements PropertyChang String key = e.getPropertyName(); if (TabFrameTab.KEY_SELECTED.equals(key)) { tabComponent.setForeground(Boolean.TRUE.equals(e.getNewValue()) - ? selectedFontColor : defaultFontColor); + ? selectedFontColor : defaultFontColor); tabComponent.repaint(); } else if (TabFrameTab.KEY_TITLE.equals(key)) { updateText(); @@ -259,19 +259,19 @@ public class DarkTabFrameTabLabelUI extends DarkLabelUI implements PropertyChang public Color getBackground(final TabFrameTabLabel tab) { if (printing || !tab.isEnabled()) return tab.getBackground(); return tab.isSelected() - ? selectedColor - : hoverListener.isHover() && !tab.getTabFrame().isInTransfer() - ? hoverColor - : tab.getBackground(); + ? selectedColor + : hoverListener.isHover() && !tab.getTabFrame().isInTransfer() + ? hoverColor + : tab.getBackground(); } public Color getForeground(final TabFrameTabLabel tab) { if (printing) return tab.getForeground(); return tab.isSelected() - ? selectedFontColor - : hoverListener.isHover() && !tab.getTabFrame().isInTransfer() - ? fontHoverColor - : tab.getForeground(); + ? selectedFontColor + : hoverListener.isHover() && !tab.getTabFrame().isInTransfer() + ? fontHoverColor + : tab.getForeground(); } protected Icon getIcon() { diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabbedPopupUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabbedPopupUI.java index bfe6aa7a..16ed041c 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabbedPopupUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabbedPopupUI.java @@ -127,9 +127,9 @@ public class DarkTabbedPopupUI extends DarkPanelPopupUI implements TabFrameTabbe if (oldFocus != focus) { if (newTabButton != null) { newTabButton.putClientProperty(DarkButtonUI.KEY_HOVER_COLOR, focus ? headerButtonFocusHoverBackground - : headerButtonHoverBackground); + : headerButtonHoverBackground); newTabButton.putClientProperty(DarkButtonUI.KEY_CLICK_COLOR, focus ? headerButtonFocusClickBackground - : headerButtonClickBackground); + : headerButtonClickBackground); newTabButton.repaint(); } holder.setBackground(focus ? headerFocusBackground : headerBackground); diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableHeaderUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableHeaderUI.java index c4fd8bad..207e5a17 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableHeaderUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableHeaderUI.java @@ -116,8 +116,8 @@ public class DarkTableHeaderUI extends DarkTableHeaderUIBridge { } Color borderColor = c.getBorder() instanceof DarkTableScrollPaneBorder - ? ((DarkTableScrollPaneBorder) c.getBorder()).getBorderColor() - : getBorderColor(); + ? ((DarkTableScrollPaneBorder) c.getBorder()).getBorderColor() + : getBorderColor(); g.setColor(borderColor); TableColumn draggedColumn = header.getDraggedColumn(); diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableHeaderUIBridge.java b/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableHeaderUIBridge.java index d6c0a6ed..27ad0b07 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableHeaderUIBridge.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableHeaderUIBridge.java @@ -713,10 +713,10 @@ public class DarkTableHeaderUIBridge extends BasicTableHeaderUI { if (th.getComponentOrientation().isLeftToRight()) { newIndex = leftArrow ? ui.selectPreviousColumn(doIt) - : ui.selectNextColumn(doIt); + : ui.selectNextColumn(doIt); } else { newIndex = leftArrow ? ui.selectNextColumn(doIt) - : ui.selectPreviousColumn(doIt); + : ui.selectPreviousColumn(doIt); } if (newIndex != oldIndex) { diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableUI.java index 5306bc33..41053fee 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableUI.java @@ -304,7 +304,7 @@ public class DarkTableUI extends DarkTableUIBridge implements FocusListener { int dist = header != null ? adjustDistance(header.getDraggedDistance(), table.getCellRect(0, draggedIndex, true), table) - : 0; + : 0; boolean isDragged = column == draggedIndex && dist != 0; if (!scrollVisible) { if (ltr) { @@ -539,11 +539,11 @@ public class DarkTableUI extends DarkTableUIBridge implements FocusListener { JTableHeader header = table.getTableHeader(); int draggedIndex = header != null ? viewIndexForColumn(header.getDraggedColumn()) - : -1; + : -1; int dist = header != null ? adjustDistance(header.getDraggedDistance(), table.getCellRect(row, draggedIndex, true), table) - : 0; + : 0; boolean isDragged = column == draggedIndex && dist != 0; Rectangle rectWithSpacing = table.getCellRect(row, cMin, true); Rectangle r = new Rectangle(cellRect); diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/table/TableUIBridge.java b/core/src/main/java/com/github/weisj/darklaf/ui/table/TableUIBridge.java index 327589a0..0f186642 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/table/TableUIBridge.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/table/TableUIBridge.java @@ -240,7 +240,7 @@ public abstract class TableUIBridge extends TableUI { */ protected static int getAdjustedLead(final JTable table, final boolean row) { return row ? getAdjustedLead(table, row, table.getSelectionModel()) - : getAdjustedLead(table, row, table.getColumnModel().getSelectionModel()); + : getAdjustedLead(table, row, table.getColumnModel().getSelectionModel()); } /** @@ -1452,7 +1452,7 @@ public abstract class TableUIBridge extends TableUI { boolean ltr = table.getComponentOrientation().isLeftToRight(); newColumn = forwards ? (ltr ? table.getColumnCount() : 0) - : (ltr ? 0 : table.getColumnCount()); + : (ltr ? 0 : table.getColumnCount()); } this.dx = newColumn - leadColumn; diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextBorder.java b/core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextBorder.java index 3c05863e..b9d7a9fc 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextBorder.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextBorder.java @@ -117,7 +117,7 @@ public class DarkTextBorder implements Border, UIResource { final boolean editable, final boolean enabled) { if (focus) { return error ? focusErrorBorderColor - : enabled && editable ? focusBorderColor : inactiveFocusBorderColor; + : enabled && editable ? focusBorderColor : inactiveFocusBorderColor; } else if (error) { return errorBorderColor; } else { diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextFieldUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextFieldUI.java index 66982f85..1d125a39 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextFieldUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextFieldUI.java @@ -118,15 +118,15 @@ public class DarkTextFieldUI extends DarkTextFieldUIBridge implements PropertyCh Rectangle drawRect = getDrawingRect(getComponent()); Rectangle textRect = getTextRect(getComponent()); int rightBoundary = getComponent().getText().isEmpty() - ? drawRect.x + drawRect.width - : getClearIconCoord().x; + ? drawRect.x + drawRect.width + : getClearIconCoord().x; boolean insideTextArea = drawRect.contains(p) && p.x >= textRect.x && p.x < rightBoundary; if (insideTextArea) { getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); } else { Cursor cursor = action == ClickAction.NONE - ? Cursor.getDefaultCursor() - : Cursor.getPredefinedCursor(Cursor.HAND_CURSOR); + ? Cursor.getDefaultCursor() + : Cursor.getPredefinedCursor(Cursor.HAND_CURSOR); getComponent().setCursor(cursor); } } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/StateIconUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/StateIconUI.java index 4139b0b5..6ff8698d 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/StateIconUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/StateIconUI.java @@ -44,8 +44,8 @@ public interface StateIconUI { boolean enabled = b.isEnabled(); boolean hasFocus = b.hasFocus(); return selected ? enabled ? hasFocus ? ui.getSelectedFocusedIcon() : ui.getSelectedIcon() - : ui.getSelectedDisabledIcon() - : enabled ? hasFocus ? ui.getFocusedIcon() : ui.getIcon() - : ui.getDisabledIcon(); + : ui.getSelectedDisabledIcon() + : enabled ? hasFocus ? ui.getFocusedIcon() : ui.getIcon() + : ui.getDisabledIcon(); } } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/tristate/DarkTristateCheckBoxMenuItemUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/tristate/DarkTristateCheckBoxMenuItemUI.java index 4b2ba38d..a964464f 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/tristate/DarkTristateCheckBoxMenuItemUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/tristate/DarkTristateCheckBoxMenuItemUI.java @@ -63,7 +63,7 @@ public class DarkTristateCheckBoxMenuItemUI extends DarkCheckBoxMenuItemUI { if (((TristateCheckBoxMenuItem) b).getTristateModel().isIndeterminate()) { if (b.isEnabled()) { return b.hasFocus() ? checkBoxIndeterminateFocusedIcon - : checkBoxIndeterminateIcon; + : checkBoxIndeterminateIcon; } else { return checkBoxIndeterminateDisabledIcon; } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/tristate/DarkTristateCheckBoxUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/tristate/DarkTristateCheckBoxUI.java index 20d746cb..8240c68c 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/tristate/DarkTristateCheckBoxUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/tristate/DarkTristateCheckBoxUI.java @@ -57,7 +57,7 @@ public class DarkTristateCheckBoxUI extends DarkCheckBoxUI { if (((TristateCheckBox) b).getTristateModel().isIndeterminate()) { if (b.isEnabled()) { return b.hasFocus() ? checkBoxIndeterminateFocusedIcon - : checkBoxIndeterminateIcon; + : checkBoxIndeterminateIcon; } else { return checkBoxIndeterminateDisabledIcon; } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tooltip/DarkTooltipUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/tooltip/DarkTooltipUI.java index 6215da01..3a763370 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tooltip/DarkTooltipUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tooltip/DarkTooltipUI.java @@ -309,7 +309,7 @@ public class DarkTooltipUI extends BasicToolTipUI implements PropertyChangeListe ToolTipStyle style = getStyle(comp.getClientProperty(KEY_STYLE)); ToolTipStyle tooltipStyle = getStyle(toolTip.getClientProperty(KEY_STYLE)); toolTip.putClientProperty(KEY_STYLE, style != null ? style : tooltipStyle != null ? tooltipStyle - : ToolTipStyle.PLAIN_BALLOON); + : ToolTipStyle.PLAIN_BALLOON); } } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tooltip/ToolTipUtil.java b/core/src/main/java/com/github/weisj/darklaf/ui/tooltip/ToolTipUtil.java index 2d1cecf9..a636b7da 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tooltip/ToolTipUtil.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tooltip/ToolTipUtil.java @@ -69,7 +69,7 @@ public class ToolTipUtil { Alignment[] alignments = getAlignments(isCenter ? originalCenter : original); Point pos = null; BiConsumer setter = isCenter ? ToolTipContext::setCenterAlignment - : ToolTipContext::setAlignment; + : ToolTipContext::setAlignment; // Check if a position keeps the tooltip inside the window. for (Alignment a : alignments) { pos = tryPosition(a, context, p, tooltipBounds, windowBounds, screenBounds, setter); diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java index 19a530ac..4986956d 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java @@ -510,11 +510,11 @@ public class DarkTreeUI extends BasicTreeUI implements PropertyChangeListener { final int row, final boolean isExpanded, final boolean hasBeenExpanded, final boolean isLeaf) { final int containerWidth = tree.getParent() instanceof JViewport - ? tree.getParent().getWidth() - : tree.getWidth(); + ? tree.getParent().getWidth() + : tree.getWidth(); final int xOffset = tree.getParent() instanceof JViewport - ? ((JViewport) tree.getParent()).getViewPosition().x - : 0; + ? ((JViewport) tree.getParent()).getViewPosition().x + : 0; if (path != null) { boolean selected = tree.isPathSelected(path); diff --git a/core/src/main/java/com/github/weisj/darklaf/util/GraphicsContext.java b/core/src/main/java/com/github/weisj/darklaf/util/GraphicsContext.java index 8059c036..4d20ff13 100644 --- a/core/src/main/java/com/github/weisj/darklaf/util/GraphicsContext.java +++ b/core/src/main/java/com/github/weisj/darklaf/util/GraphicsContext.java @@ -55,7 +55,7 @@ public class GraphicsContext { public GraphicsContext setAntialiasing(final boolean on) { graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, on ? RenderingHints.VALUE_ANTIALIAS_ON - : RenderingHints.VALUE_ANTIALIAS_OFF); + : RenderingHints.VALUE_ANTIALIAS_OFF); return this; } diff --git a/core/src/main/java/com/github/weisj/darklaf/util/GraphicsUtil.java b/core/src/main/java/com/github/weisj/darklaf/util/GraphicsUtil.java index 1f3bd2e0..e8d45371 100644 --- a/core/src/main/java/com/github/weisj/darklaf/util/GraphicsUtil.java +++ b/core/src/main/java/com/github/weisj/darklaf/util/GraphicsUtil.java @@ -51,8 +51,8 @@ public final class GraphicsUtil { } else { g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, enableAA - ? RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HBGR - : RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); + ? RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HBGR + : RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); } } return config; @@ -81,7 +81,7 @@ public final class GraphicsUtil { g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, useQuartz() ? RenderingHints.VALUE_STROKE_PURE - : RenderingHints.VALUE_STROKE_NORMALIZE); + : RenderingHints.VALUE_STROKE_NORMALIZE); return context; } diff --git a/core/src/main/java/com/github/weisj/darklaf/util/ImageUtil.java b/core/src/main/java/com/github/weisj/darklaf/util/ImageUtil.java index a2e65976..981e576b 100644 --- a/core/src/main/java/com/github/weisj/darklaf/util/ImageUtil.java +++ b/core/src/main/java/com/github/weisj/darklaf/util/ImageUtil.java @@ -145,8 +145,8 @@ public final class ImageUtil { public static BufferedImage createCompatibleTranslucentImage(final int width, final int height) { return isHeadless() ? new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB) - : getGraphicsConfiguration().createCompatibleImage(width, height, - Transparency.TRANSLUCENT); + : getGraphicsConfiguration().createCompatibleImage(width, height, + Transparency.TRANSLUCENT); } private static boolean isHeadless() { diff --git a/core/src/test/java/icon/IconDemo.java b/core/src/test/java/icon/IconDemo.java index 8988ea73..fc8c2c1b 100644 --- a/core/src/test/java/icon/IconDemo.java +++ b/core/src/test/java/icon/IconDemo.java @@ -74,7 +74,7 @@ public class IconDemo implements ComponentDemo { { putClientProperty("JToggleButton.variant", "slider"); addActionListener(e -> LafManager.installTheme(isSelected() ? new DarculaTheme() - : new IntelliJTheme())); + : new IntelliJTheme())); } }); controlPanel.add(new QuickColorChooser("Themed icon color", UIManager.getColor("TestIcon.color"), diff --git a/core/src/test/java/ui/button/ButtonDemo.java b/core/src/test/java/ui/button/ButtonDemo.java index 62fd4f18..c5bf4f21 100644 --- a/core/src/test/java/ui/button/ButtonDemo.java +++ b/core/src/test/java/ui/button/ButtonDemo.java @@ -71,7 +71,7 @@ public class ButtonDemo implements ComponentDemo { { setSelected(button.getComponentOrientation().isLeftToRight()); addActionListener(e -> button.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox("Rollover") { diff --git a/core/src/test/java/ui/button/ToggleButtonDemo.java b/core/src/test/java/ui/button/ToggleButtonDemo.java index ffb24f0a..9406e6c4 100644 --- a/core/src/test/java/ui/button/ToggleButtonDemo.java +++ b/core/src/test/java/ui/button/ToggleButtonDemo.java @@ -58,7 +58,7 @@ public class ToggleButtonDemo implements ComponentDemo { { setSelected(button.getComponentOrientation().isLeftToRight()); addActionListener(e -> button.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox(DarkToggleButtonUI.KEY_IS_TREE_EDITOR) { diff --git a/core/src/test/java/ui/checkBox/CheckBoxDemo.java b/core/src/test/java/ui/checkBox/CheckBoxDemo.java index fa94f6f3..95363bfc 100644 --- a/core/src/test/java/ui/checkBox/CheckBoxDemo.java +++ b/core/src/test/java/ui/checkBox/CheckBoxDemo.java @@ -55,7 +55,7 @@ public class CheckBoxDemo implements ComponentDemo { { setSelected(button.getComponentOrientation().isLeftToRight()); addActionListener(e -> button.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox("Rollover") { diff --git a/core/src/test/java/ui/checkBox/TriCheckBoxDemo.java b/core/src/test/java/ui/checkBox/TriCheckBoxDemo.java index 91f18f36..aa2c3fb0 100644 --- a/core/src/test/java/ui/checkBox/TriCheckBoxDemo.java +++ b/core/src/test/java/ui/checkBox/TriCheckBoxDemo.java @@ -57,7 +57,7 @@ public class TriCheckBoxDemo implements ComponentDemo { { setSelected(button.getComponentOrientation().isLeftToRight()); addActionListener(e -> button.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox("Rollover") { diff --git a/core/src/test/java/ui/comboBox/ComboBoxDemo.java b/core/src/test/java/ui/comboBox/ComboBoxDemo.java index 3f504780..6e9f6608 100644 --- a/core/src/test/java/ui/comboBox/ComboBoxDemo.java +++ b/core/src/test/java/ui/comboBox/ComboBoxDemo.java @@ -64,8 +64,9 @@ public class ComboBoxDemo implements ComponentDemo { controlPanel.add(new JCheckBox("LeftToRight") { { setSelected(comboBox.getComponentOrientation().isLeftToRight()); - addActionListener(e -> comboBox.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + addActionListener(e -> comboBox.setComponentOrientation(isSelected() + ? ComponentOrientation.LEFT_TO_RIGHT + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox(ComboBoxConstants.KEY_IS_TREE_EDITOR) { diff --git a/core/src/test/java/ui/label/LabelDemo.java b/core/src/test/java/ui/label/LabelDemo.java index 64389b85..405c3a27 100644 --- a/core/src/test/java/ui/label/LabelDemo.java +++ b/core/src/test/java/ui/label/LabelDemo.java @@ -55,7 +55,7 @@ public class LabelDemo implements ComponentDemo { { setSelected(label.getComponentOrientation().isLeftToRight()); addActionListener(e -> label.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + : ComponentOrientation.RIGHT_TO_LEFT)); } }); return panel; diff --git a/core/src/test/java/ui/progressBar/ProgressBarDemo.java b/core/src/test/java/ui/progressBar/ProgressBarDemo.java index da65950c..412264fd 100644 --- a/core/src/test/java/ui/progressBar/ProgressBarDemo.java +++ b/core/src/test/java/ui/progressBar/ProgressBarDemo.java @@ -64,8 +64,9 @@ public class ProgressBarDemo implements ComponentDemo { controlPanel.add(new JCheckBox("LeftToRight") { { setSelected(progressBar.getComponentOrientation().isLeftToRight()); - addActionListener(e -> progressBar.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + addActionListener(e -> progressBar.setComponentOrientation(isSelected() + ? ComponentOrientation.LEFT_TO_RIGHT + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox("String painted") { diff --git a/core/src/test/java/ui/radioButton/RadioButtonDemo.java b/core/src/test/java/ui/radioButton/RadioButtonDemo.java index aa349c2b..86b98a51 100644 --- a/core/src/test/java/ui/radioButton/RadioButtonDemo.java +++ b/core/src/test/java/ui/radioButton/RadioButtonDemo.java @@ -55,7 +55,7 @@ public class RadioButtonDemo implements ComponentDemo { { setSelected(button.getComponentOrientation().isLeftToRight()); addActionListener(e -> button.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox("Rollover") { diff --git a/core/src/test/java/ui/scrollPane/ScrollPaneDemo.java b/core/src/test/java/ui/scrollPane/ScrollPaneDemo.java index 95162287..5ebd1439 100644 --- a/core/src/test/java/ui/scrollPane/ScrollPaneDemo.java +++ b/core/src/test/java/ui/scrollPane/ScrollPaneDemo.java @@ -63,8 +63,9 @@ public final class ScrollPaneDemo implements ComponentDemo { controlPanel.add(new JCheckBox("LeftToRight") { { setSelected(scrollPane.getComponentOrientation().isLeftToRight()); - addActionListener(e -> scrollPane.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + addActionListener(e -> scrollPane.setComponentOrientation(isSelected() + ? ComponentOrientation.LEFT_TO_RIGHT + : ComponentOrientation.RIGHT_TO_LEFT)); } }, "span"); diff --git a/core/src/test/java/ui/slider/SliderDemo.java b/core/src/test/java/ui/slider/SliderDemo.java index 4b3f2036..79de13c9 100644 --- a/core/src/test/java/ui/slider/SliderDemo.java +++ b/core/src/test/java/ui/slider/SliderDemo.java @@ -55,7 +55,7 @@ public class SliderDemo implements ComponentDemo { addItem("Vertical"); setSelectedItem("Horizontal"); addItemListener(e -> slider.setOrientation(e.getItem() == "Vertical" ? JSlider.VERTICAL - : JSlider.HORIZONTAL)); + : JSlider.HORIZONTAL)); } }); controlPanel = panel.addControls(); @@ -69,7 +69,7 @@ public class SliderDemo implements ComponentDemo { { setSelected(slider.getComponentOrientation().isLeftToRight()); addActionListener(e -> slider.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox("inverted") { @@ -105,8 +105,8 @@ public class SliderDemo implements ComponentDemo { controlPanel.add(new JCheckBox(DarkSliderUI.KEY_VARIANT + " = " + DarkSliderUI.VARIANT_VOLUME) { { addActionListener(e -> slider.putClientProperty(DarkSliderUI.KEY_VARIANT, isSelected() - ? DarkSliderUI.VARIANT_VOLUME - : null)); + ? DarkSliderUI.VARIANT_VOLUME + : null)); } }); controlPanel.add(new JCheckBox(DarkSliderUI.KEY_INSTANT_SCROLL) { diff --git a/core/src/test/java/ui/spinner/SpinnerDemo.java b/core/src/test/java/ui/spinner/SpinnerDemo.java index b1c7256e..d153e450 100644 --- a/core/src/test/java/ui/spinner/SpinnerDemo.java +++ b/core/src/test/java/ui/spinner/SpinnerDemo.java @@ -55,14 +55,14 @@ public class SpinnerDemo implements ComponentDemo { { setSelected(spinner.getComponentOrientation().isLeftToRight()); addActionListener(e -> spinner.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox(SpinnerConstants.KEY_VARIANT + " = " + SpinnerConstants.VARIANT_PLUS_MINUS) { { addActionListener(e -> spinner.putClientProperty(SpinnerConstants.KEY_VARIANT, isSelected() ? SpinnerConstants.VARIANT_PLUS_MINUS - : null)); + : null)); } }); controlPanel.add(new JCheckBox(SpinnerConstants.KEY_IS_TREE_EDITOR) { diff --git a/core/src/test/java/ui/tabbedPane/TabbedPaneDemo.java b/core/src/test/java/ui/tabbedPane/TabbedPaneDemo.java index 7caf4e3a..d801bb20 100644 --- a/core/src/test/java/ui/tabbedPane/TabbedPaneDemo.java +++ b/core/src/test/java/ui/tabbedPane/TabbedPaneDemo.java @@ -99,8 +99,9 @@ public class TabbedPaneDemo implements ComponentDemo { controlPanel.add(new JCheckBox("LeftToRight") { { setSelected(tabbedPane.getComponentOrientation().isLeftToRight()); - addActionListener(e -> tabbedPane.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + addActionListener(e -> tabbedPane.setComponentOrientation(isSelected() + ? ComponentOrientation.LEFT_TO_RIGHT + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox(DarkTabbedPaneUI.KEY_CENTER_TABS) { diff --git a/core/src/test/java/ui/table/TableDemo.java b/core/src/test/java/ui/table/TableDemo.java index a196a546..9b03cdec 100644 --- a/core/src/test/java/ui/table/TableDemo.java +++ b/core/src/test/java/ui/table/TableDemo.java @@ -107,7 +107,7 @@ public class TableDemo implements ComponentDemo { { setSelected(table.getComponentOrientation().isLeftToRight()); addActionListener(e -> table.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox(DarkTableUI.KEY_ALTERNATE_ROW_COLOR) { diff --git a/core/src/test/java/ui/text/PasswordFieldDemo.java b/core/src/test/java/ui/text/PasswordFieldDemo.java index cadbc687..13d0d6ee 100644 --- a/core/src/test/java/ui/text/PasswordFieldDemo.java +++ b/core/src/test/java/ui/text/PasswordFieldDemo.java @@ -60,8 +60,9 @@ public class PasswordFieldDemo implements ComponentDemo { controlPanel.add(new JCheckBox("LeftToRight") { { setEnabled(true); - addActionListener(e -> textField.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + addActionListener(e -> textField.setComponentOrientation(isSelected() + ? ComponentOrientation.LEFT_TO_RIGHT + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox("JTextComponent.roundedSelection") { diff --git a/core/src/test/java/ui/text/TextFieldDemo.java b/core/src/test/java/ui/text/TextFieldDemo.java index aa6e6634..3a574d12 100644 --- a/core/src/test/java/ui/text/TextFieldDemo.java +++ b/core/src/test/java/ui/text/TextFieldDemo.java @@ -60,8 +60,9 @@ public class TextFieldDemo implements ComponentDemo { controlPanel.add(new JCheckBox("LeftToRight") { { setEnabled(true); - addActionListener(e -> textField.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + addActionListener(e -> textField.setComponentOrientation(isSelected() + ? ComponentOrientation.LEFT_TO_RIGHT + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox("JTextComponent.roundedSelection") { diff --git a/core/src/test/java/ui/tree/TreeDemo.java b/core/src/test/java/ui/tree/TreeDemo.java index 5abd245b..58b33423 100644 --- a/core/src/test/java/ui/tree/TreeDemo.java +++ b/core/src/test/java/ui/tree/TreeDemo.java @@ -85,7 +85,7 @@ public class TreeDemo implements ComponentDemo { { setSelected(tree.getComponentOrientation().isLeftToRight()); addActionListener(e -> tree.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT - : ComponentOrientation.RIGHT_TO_LEFT)); + : ComponentOrientation.RIGHT_TO_LEFT)); } }); controlPanel.add(new JCheckBox("show root handles") { diff --git a/darklaf_java.eclipseformat.xml b/darklaf_java.eclipseformat.xml index bac5de80..1028de7b 100644 --- a/darklaf_java.eclipseformat.xml +++ b/darklaf_java.eclipseformat.xml @@ -27,34 +27,26 @@ - - + + - + - + - - + + - + @@ -64,51 +56,40 @@ - + - + - + - + - + - + - + - + - + - + @@ -118,61 +99,46 @@ - - + + - + - + - + - + - + - + - + - - - + + + - - + + - + @@ -181,23 +147,19 @@ - + - + - + - + @@ -212,15 +174,13 @@ - + - + @@ -228,20 +188,16 @@ - + - + - - - + + + @@ -250,33 +206,27 @@ - + - + - + - + - - + + - + @@ -284,19 +234,15 @@ - - + + - + - + @@ -306,145 +252,102 @@ - + - + - - + + - - + + - - + + - + - + - + - + - + - - - + + + - - - + + + - + - - - - + + + + - + - + - + - + - - + + - - + + - + - + - + - + - + - + - - + + - + @@ -454,46 +357,33 @@ - + - - - - - + + + + + - - + + - + - + - + - + diff --git a/property-loader/src/main/java/com/github/weisj/darklaf/PropertyLoader.java b/property-loader/src/main/java/com/github/weisj/darklaf/PropertyLoader.java index 0f96b3d0..88002d89 100644 --- a/property-loader/src/main/java/com/github/weisj/darklaf/PropertyLoader.java +++ b/property-loader/src/main/java/com/github/weisj/darklaf/PropertyLoader.java @@ -214,8 +214,8 @@ public final class PropertyLoader { final Color color = ColorUtil.fromHex(value, null); final Integer invVal = getInteger(value); final Boolean boolVal = PropertyValue.TRUE.equalsIgnoreCase(value) - ? Boolean.TRUE - : PropertyValue.FALSE.equalsIgnoreCase(value) ? Boolean.FALSE : null; + ? Boolean.TRUE + : PropertyValue.FALSE.equalsIgnoreCase(value) ? Boolean.FALSE : null; if (color != null && (value.length() == 6 || value.length() == 8)) { return new ColorUIResource(color); } else if (invVal != null) { @@ -257,11 +257,11 @@ public final class PropertyLoader { "Maybe is a forward reference"); } Object returnVal = accumulatorContainsKey ? accumulator.get(val) - : currentDefault.get(val); + : currentDefault.get(val); if (addReferenceInfo) { if (returnVal == null) { returnVal = accumulatorContainsKey ? accumulator.get(referenceFreeKey) - : currentDefault.get(val); + : currentDefault.get(val); } returnVal = new Pair<>(value, returnVal); } diff --git a/property-loader/src/main/java/com/github/weisj/darklaf/icons/StateIcon.java b/property-loader/src/main/java/com/github/weisj/darklaf/icons/StateIcon.java index 0150805f..175d9635 100644 --- a/property-loader/src/main/java/com/github/weisj/darklaf/icons/StateIcon.java +++ b/property-loader/src/main/java/com/github/weisj/darklaf/icons/StateIcon.java @@ -81,9 +81,9 @@ public class StateIcon implements Icon { boolean enabled = b.isEnabled(); boolean hasFocus = b.hasFocus(); Icon icn = selected ? enabled ? hasFocus ? selectedFocusedIcon : selectedIcon - : selectedDisabledIcon - : enabled ? hasFocus ? focusedIcon : icon - : disabledIcon; + : selectedDisabledIcon + : enabled ? hasFocus ? focusedIcon : icon + : disabledIcon; return icn != null ? icn : EmptyIcon.create(0); } diff --git a/theme/src/main/java/com/github/weisj/darklaf/theme/info/DefaultThemeProvider.java b/theme/src/main/java/com/github/weisj/darklaf/theme/info/DefaultThemeProvider.java index 29bf8dde..88ccbbe3 100644 --- a/theme/src/main/java/com/github/weisj/darklaf/theme/info/DefaultThemeProvider.java +++ b/theme/src/main/java/com/github/weisj/darklaf/theme/info/DefaultThemeProvider.java @@ -85,7 +85,7 @@ public class DefaultThemeProvider implements ThemeProvider { boolean dark = themeStyle.getColorToneRule() == ColorToneRule.DARK; boolean highContrast = themeStyle.getContrastRule() == ContrastRule.HIGH_CONTRAST; Theme theme = dark ? highContrast ? darkHighContrastTheme : darkTheme - : highContrast ? lightHighContrastTheme : lightTheme; + : highContrast ? lightHighContrastTheme : lightTheme; return theme.derive(themeStyle.getFontSizeRule(), themeStyle.getAccentColorRule()); } diff --git a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/PointerUtil.java b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/PointerUtil.java index 4075c901..ac55ad2d 100644 --- a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/PointerUtil.java +++ b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/PointerUtil.java @@ -40,7 +40,7 @@ public class PointerUtil { */ public static long getHWND(final Component component) { Window window = component instanceof Window ? (Window) component - : SwingUtilities.getWindowAncestor(component); + : SwingUtilities.getWindowAncestor(component); return Native.getComponentID(window); } } diff --git a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java index 867ccf5d..d45cf850 100644 --- a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java +++ b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java @@ -173,8 +173,8 @@ public class WindowsTitlePane extends CustomTitlePane { public Insets getWindowSizeAdjustment() { // Compensate for the insets of the native window peer that include the decorations. Insets insets = window != null && windowHandle != 0 - ? window.getInsets() - : new Insets(0, 0, 0, 0); + ? window.getInsets() + : new Insets(0, 0, 0, 0); insets.set(-insets.top, -insets.left, -insets.bottom, -insets.right); return insets; } @@ -566,7 +566,7 @@ public class WindowsTitlePane extends CustomTitlePane { protected boolean isLeftToRight(final Window window) { return (window == null) ? getRootPane().getComponentOrientation().isLeftToRight() - : window.getComponentOrientation().isLeftToRight(); + : window.getComponentOrientation().isLeftToRight(); } private void updateSystemIcon() { @@ -703,7 +703,7 @@ public class WindowsTitlePane extends CustomTitlePane { .getIconHeight(), windowIconButton.getIcon() .getIconWidth()) - : ICON_WIDTH; + : ICON_WIDTH; windowButtonWidth = Math.min(ICON_WIDTH, windowButtonWidth); windowIconButton.setBounds(start + PAD, y, windowButtonWidth, height); start += windowButtonWidth + 2 * PAD;