mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-10 22:17:13 -06:00
minor code cleanup:
- remove redundant semicolon - create array with curly
This commit is contained in:
@@ -30,7 +30,7 @@ import com.formdev.flatlaf.FlatSystemProperties;
|
||||
*/
|
||||
public class TestUtils
|
||||
{
|
||||
public static final float[] FACTORS = new float[] { 1f, 1.25f, 1.5f, 1.75f, 2f, 2.25f, 2.5f, 2.75f, 3f, 3.25f, 3.5f, 3.75f, 4f, 5f, 6f };
|
||||
public static final float[] FACTORS = { 1f, 1.25f, 1.5f, 1.75f, 2f, 2.25f, 2.5f, 2.75f, 3f, 3.25f, 3.5f, 3.75f, 4f, 5f, 6f };
|
||||
|
||||
public static void setup( boolean withFocus ) {
|
||||
System.setProperty( FlatSystemProperties.UI_SCALE, "1x" );
|
||||
|
||||
@@ -290,10 +290,10 @@ class DataComponentsPanel
|
||||
"Not editable", "Text", "Combo", "Combo Editable", "Integer", "Boolean"
|
||||
}
|
||||
) {
|
||||
Class<?>[] columnTypes = new Class<?>[] {
|
||||
Class<?>[] columnTypes = {
|
||||
Object.class, Object.class, String.class, String.class, Integer.class, Boolean.class
|
||||
};
|
||||
boolean[] columnEditable = new boolean[] {
|
||||
boolean[] columnEditable = {
|
||||
false, true, true, true, true, true
|
||||
};
|
||||
@Override
|
||||
|
||||
@@ -511,7 +511,7 @@ class MoreComponentsPanel
|
||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||
|
||||
if( FlatLafDemo.screenshotsMode ) {
|
||||
Component[] components = new Component[] {
|
||||
Component[] components = {
|
||||
indeterminateCheckBox,
|
||||
toolTipLabel, toolTip1, toolTip2,
|
||||
toolBarLabel, toolBar1, toolBar2,
|
||||
|
||||
@@ -889,7 +889,7 @@ class TabsPanel
|
||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||
|
||||
if( FlatLafDemo.screenshotsMode ) {
|
||||
Component[] components = new Component[] {
|
||||
Component[] components = {
|
||||
tabPlacementLabel, tabPlacementToolBar, tabPlacementTabbedPane,
|
||||
iconBottomTabbedPane, iconTrailingTabbedPane,
|
||||
alignLeadingTabbedPane, alignTrailingTabbedPane, alignFillTabbedPane,
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.formdev.flatlaf.util.SystemInfo;
|
||||
*/
|
||||
public class FlatDesktop
|
||||
{
|
||||
public enum Action { APP_ABOUT, APP_PREFERENCES, APP_QUIT_HANDLER };
|
||||
public enum Action { APP_ABOUT, APP_PREFERENCES, APP_QUIT_HANDLER }
|
||||
|
||||
/**
|
||||
* Checks whether the given action is supported on the current platform.
|
||||
|
||||
@@ -634,7 +634,7 @@ public class FlatSVGIcon
|
||||
int iconWidth = getIconWidth();
|
||||
int iconHeight = getIconHeight();
|
||||
|
||||
Dimension[] dimensions = new Dimension[] {
|
||||
Dimension[] dimensions = {
|
||||
new Dimension( iconWidth, iconHeight ),
|
||||
new Dimension( iconWidth * 2, iconHeight * 2 ),
|
||||
};
|
||||
@@ -897,7 +897,7 @@ public class FlatSVGIcon
|
||||
color = mapper.apply( color );
|
||||
|
||||
return color;
|
||||
};
|
||||
}
|
||||
|
||||
private Color applyMappings( Color color ) {
|
||||
if( colorMap != null ) {
|
||||
|
||||
@@ -364,7 +364,7 @@ public class FlatTabbedPane
|
||||
|
||||
|
||||
// NOTE: enum names must be equal to allowed strings
|
||||
/** @since 2 */ public enum TabType { underlined, card };
|
||||
/** @since 2 */ public enum TabType { underlined, card }
|
||||
|
||||
/**
|
||||
* Returns type of selected tab.
|
||||
@@ -387,7 +387,7 @@ public class FlatTabbedPane
|
||||
|
||||
|
||||
// NOTE: enum names must be equal to allowed strings
|
||||
public enum TabsPopupPolicy { never, asNeeded };
|
||||
public enum TabsPopupPolicy { never, asNeeded }
|
||||
|
||||
/**
|
||||
* Returns the display policy for the "more tabs" button,
|
||||
@@ -408,7 +408,7 @@ public class FlatTabbedPane
|
||||
|
||||
|
||||
// NOTE: enum names must be equal to allowed strings
|
||||
public enum ScrollButtonsPolicy { never, asNeeded, asNeededSingle };
|
||||
public enum ScrollButtonsPolicy { never, asNeeded, asNeededSingle }
|
||||
|
||||
/**
|
||||
* Returns the display policy for the forward/backward scroll arrow buttons.
|
||||
@@ -427,7 +427,7 @@ public class FlatTabbedPane
|
||||
|
||||
|
||||
// NOTE: enum names must be equal to allowed strings
|
||||
public enum ScrollButtonsPlacement { both, trailing };
|
||||
public enum ScrollButtonsPlacement { both, trailing }
|
||||
|
||||
/**
|
||||
* Returns the placement of the forward/backward scroll arrow buttons.
|
||||
@@ -446,7 +446,7 @@ public class FlatTabbedPane
|
||||
|
||||
|
||||
// NOTE: enum names must be equal to allowed strings
|
||||
public enum TabAreaAlignment { leading, trailing, center, fill };
|
||||
public enum TabAreaAlignment { leading, trailing, center, fill }
|
||||
|
||||
/**
|
||||
* Returns the alignment of the tab area.
|
||||
@@ -465,7 +465,7 @@ public class FlatTabbedPane
|
||||
|
||||
|
||||
// NOTE: enum names must be equal to allowed strings
|
||||
public enum TabAlignment { leading, trailing, center };
|
||||
public enum TabAlignment { leading, trailing, center }
|
||||
|
||||
/**
|
||||
* Returns the horizontal alignment of the tab title and icon.
|
||||
@@ -484,7 +484,7 @@ public class FlatTabbedPane
|
||||
|
||||
|
||||
// NOTE: enum names must be equal to allowed strings
|
||||
public enum TabWidthMode { preferred, equal, compact };
|
||||
public enum TabWidthMode { preferred, equal, compact }
|
||||
|
||||
/**
|
||||
* Returns how the tabs should be sized.
|
||||
|
||||
@@ -164,7 +164,7 @@ public class FlatTextField
|
||||
|
||||
|
||||
// NOTE: enum names must be equal to allowed strings
|
||||
public enum SelectAllOnFocusPolicy { never, once, always };
|
||||
public enum SelectAllOnFocusPolicy { never, once, always }
|
||||
|
||||
/**
|
||||
* Returns whether all text is selected when the text component gains focus.
|
||||
|
||||
@@ -155,7 +155,7 @@ public class FlatComponents2Test
|
||||
|
||||
private void initTableEditors( JTable table ) {
|
||||
TableColumnModel cm = table.getColumnModel();
|
||||
String[] months = new String[] {
|
||||
String[] months = {
|
||||
"January", "February", "March", "April", "May", "June",
|
||||
"July", "August", "September", "October", "November", "December"
|
||||
};
|
||||
@@ -427,7 +427,7 @@ public class FlatComponents2Test
|
||||
if( !(sel instanceof String) )
|
||||
return;
|
||||
|
||||
JTree[] trees = new JTree[] { tree1, tree2, xTree1 };
|
||||
JTree[] trees = { tree1, tree2, xTree1 };
|
||||
switch( (String) sel ) {
|
||||
case "default":
|
||||
for( JTree tree : trees )
|
||||
@@ -1321,19 +1321,19 @@ public class FlatComponents2Test
|
||||
private class TestTableModel
|
||||
extends AbstractTableModel
|
||||
{
|
||||
private final String[] columnNames = new String[] {
|
||||
private final String[] columnNames = {
|
||||
"Not editable", "Text", "Combo", "Combo Editable", "Integer", "Boolean"
|
||||
};
|
||||
|
||||
private final Class<?>[] columnTypes = new Class<?>[] {
|
||||
private final Class<?>[] columnTypes = {
|
||||
Object.class, Object.class, String.class, String.class, Integer.class, Boolean.class
|
||||
};
|
||||
|
||||
private final boolean[] columnEditable = new boolean[] {
|
||||
private final boolean[] columnEditable = {
|
||||
false, true, true, true, true, true
|
||||
};
|
||||
|
||||
private final Object[][] rows = new Object[][] {
|
||||
private final Object[][] rows = {
|
||||
{ "item 1", "item 1b", "January", "July", 123, null },
|
||||
{ "item 2", "item 2b", "February", "August", 456, true },
|
||||
{ "item 3", null, "March", null, null, null },
|
||||
|
||||
@@ -942,7 +942,7 @@ public class FlatContainerTest
|
||||
TabPlacement( int value ) {
|
||||
this.value = value;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//---- enum TabIconPlacement ----------------------------------------------
|
||||
|
||||
@@ -957,7 +957,7 @@ public class FlatContainerTest
|
||||
TabIconPlacement( int value ) {
|
||||
this.value = value;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//---- class Tab1Panel ----------------------------------------------------
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ public class FlatPaintingStringTest
|
||||
return (float) -(y - (int) y);
|
||||
};
|
||||
|
||||
float[] scaleFactors = new float[] { 1f, 1.25f, 1.5f, 1.75f, 2f, 2.25f, 2.5f, 3f, 3.5f, 4f };
|
||||
float[] scaleFactors = { 1f, 1.25f, 1.5f, 1.75f, 2f, 2.25f, 2.5f, 3f, 3.5f, 4f };
|
||||
|
||||
for( float scaleFactor : scaleFactors ) {
|
||||
add( new JLabel( String.valueOf( scaleFactor ) ), "newLine" );
|
||||
|
||||
@@ -708,7 +708,7 @@ public class FlatJideOssContainerTest
|
||||
TabPlacement( int value ) {
|
||||
this.value = value;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//---- enum JideTabAlignment ----------------------------------------------
|
||||
|
||||
@@ -721,7 +721,7 @@ public class FlatJideOssContainerTest
|
||||
JideTabAlignment( int value ) {
|
||||
this.value = value;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//---- enum JideTabResizeMode ---------------------------------------------
|
||||
|
||||
@@ -736,7 +736,7 @@ public class FlatJideOssContainerTest
|
||||
JideTabResizeMode( int value ) {
|
||||
this.value = value;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//---- class Tab1Panel ----------------------------------------------------
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ class FlatThemeEditorOverlay
|
||||
|
||||
// resolve lazy value
|
||||
if( value instanceof LazyValue ) {
|
||||
Object[] pValue = new Object[] { value };
|
||||
Object[] pValue = { value };
|
||||
FlatLaf.runWithUIDefaultsGetter( key -> {
|
||||
return (key instanceof String)
|
||||
? textArea.propertiesSupport.getParsedProperty( (String) key )
|
||||
|
||||
Reference in New Issue
Block a user