diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c7e1ae7..4198d2c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ FlatLaf Change Log ================== -## 1.6-SNAPSHOT +## 1.6 #### New features and improvements @@ -20,10 +20,20 @@ FlatLaf Change Log - OptionPane: Fixed rendering of longer HTML text if it is passed as `StringBuilder`, `StringBuffer`, or any other object that returns HTML text in method `toString()`. (similar to issue #12) +- ComboBox: Fixed popup border painting on HiDPI screens (e.g. at 150% scaling). +- ComboBox: Fixed popup location if shown above of combo box (Java 8 only). +- ComboBox (editable): Fixed wrong border of internal text field under special + circumstances. +- Spinner: Fixed painting of border corners on left side. (issue #382; + regression since FlatLaf 1.4) - TableHeader: Do not show resize cursor for last column if resizing last column is not possible because auto resize mode of table is not off. (issue #332) +- TableHeader: Fixed missing trailing vertical separator line if used in upper + left corner of scroll pane. (issue #332) - TextField, FormattedTextField, PasswordField and ComboBox: Fixed alignment of placeholder text in right-to-left component orientation. +- Slider: Fixed calculation of baseline, which was wrong under some + circumstances. ## 1.5 diff --git a/build.gradle.kts b/build.gradle.kts index 711ea707..69eb9fa7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,8 +14,8 @@ * limitations under the License. */ -val releaseVersion = "1.5" -val developmentVersion = "1.6-SNAPSHOT" +val releaseVersion = "1.6" +val developmentVersion = "2.0-SNAPSHOT" version = if( java.lang.Boolean.getBoolean( "release" ) ) releaseVersion else developmentVersion diff --git a/flatlaf-core/build.gradle.kts b/flatlaf-core/build.gradle.kts index 97f2fab0..f2102c9b 100644 --- a/flatlaf-core/build.gradle.kts +++ b/flatlaf-core/build.gradle.kts @@ -21,10 +21,15 @@ plugins { `flatlaf-publish` } +val sigtest = configurations.create( "sigtest" ) + dependencies { testImplementation( "org.junit.jupiter:junit-jupiter-api:5.7.2" ) testImplementation( "org.junit.jupiter:junit-jupiter-params" ) testRuntimeOnly( "org.junit.jupiter:junit-jupiter-engine" ) + + // https://github.com/jtulach/netbeans-apitest + sigtest( "org.netbeans.tools:sigtest-maven-plugin:1.4" ) } java { @@ -59,10 +64,60 @@ tasks { archiveBaseName.set( "flatlaf" ) } + check { + dependsOn( "sigtestCheck" ) + } + test { useJUnitPlatform() testLogging.exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL } + + register( "sigtestGenerate" ) { + group = "verification" + dependsOn( "jar" ) + + doLast { + ant.withGroovyBuilder { + "taskdef"( + "name" to "sigtest", + "classname" to "org.netbeans.apitest.Sigtest", + "classpath" to sigtest.asPath ) + + "sigtest"( + "action" to "generate", + "fileName" to "${project.name}-sigtest.txt", + "classpath" to jar.get().outputs.files.asPath, + "packages" to "com.formdev.flatlaf,com.formdev.flatlaf.util", + "version" to version, + "release" to "1.8", // Java version + "failonerror" to "true" ) + } + } + } + + register( "sigtestCheck" ) { + group = "verification" + dependsOn( "jar" ) + + doLast { + ant.withGroovyBuilder { + "taskdef"( + "name" to "sigtest", + "classname" to "org.netbeans.apitest.Sigtest", + "classpath" to sigtest.asPath ) + + "sigtest"( + "action" to "check", + "fileName" to "${project.name}-sigtest.txt", + "classpath" to jar.get().outputs.files.asPath, + "packages" to "com.formdev.flatlaf,com.formdev.flatlaf.util", + "version" to version, + "release" to "1.8", // Java version + "failonerror" to "true" ) + } + } + } } flatlafPublish { diff --git a/flatlaf-core/flatlaf-core-sigtest.txt b/flatlaf-core/flatlaf-core-sigtest.txt new file mode 100644 index 00000000..ca7b3fdb --- /dev/null +++ b/flatlaf-core/flatlaf-core-sigtest.txt @@ -0,0 +1,1029 @@ +#Signature file v4.1 +#Version 1.6 + +CLSS public abstract interface com.formdev.flatlaf.FlatClientProperties +fld public final static java.lang.String BUTTON_TYPE = "JButton.buttonType" +fld public final static java.lang.String BUTTON_TYPE_BORDERLESS = "borderless" +fld public final static java.lang.String BUTTON_TYPE_HELP = "help" +fld public final static java.lang.String BUTTON_TYPE_ROUND_RECT = "roundRect" +fld public final static java.lang.String BUTTON_TYPE_SQUARE = "square" +fld public final static java.lang.String BUTTON_TYPE_TAB = "tab" +fld public final static java.lang.String BUTTON_TYPE_TOOLBAR_BUTTON = "toolBarButton" +fld public final static java.lang.String COMPONENT_FOCUS_OWNER = "JComponent.focusOwner" +fld public final static java.lang.String COMPONENT_ROUND_RECT = "JComponent.roundRect" +fld public final static java.lang.String MENU_BAR_EMBEDDED = "JRootPane.menuBarEmbedded" +fld public final static java.lang.String MINIMUM_HEIGHT = "JComponent.minimumHeight" +fld public final static java.lang.String MINIMUM_WIDTH = "JComponent.minimumWidth" +fld public final static java.lang.String OUTLINE = "JComponent.outline" +fld public final static java.lang.String OUTLINE_ERROR = "error" +fld public final static java.lang.String OUTLINE_WARNING = "warning" +fld public final static java.lang.String PLACEHOLDER_TEXT = "JTextField.placeholderText" +fld public final static java.lang.String POPUP_DROP_SHADOW_PAINTED = "Popup.dropShadowPainted" +fld public final static java.lang.String POPUP_FORCE_HEAVY_WEIGHT = "Popup.forceHeavyWeight" +fld public final static java.lang.String PROGRESS_BAR_LARGE_HEIGHT = "JProgressBar.largeHeight" +fld public final static java.lang.String PROGRESS_BAR_SQUARE = "JProgressBar.square" +fld public final static java.lang.String SCROLL_BAR_SHOW_BUTTONS = "JScrollBar.showButtons" +fld public final static java.lang.String SCROLL_PANE_SMOOTH_SCROLLING = "JScrollPane.smoothScrolling" +fld public final static java.lang.String SELECTED_STATE = "JButton.selectedState" +fld public final static java.lang.String SELECTED_STATE_INDETERMINATE = "indeterminate" +fld public final static java.lang.String SELECT_ALL_ON_FOCUS_POLICY = "JTextField.selectAllOnFocusPolicy" +fld public final static java.lang.String SELECT_ALL_ON_FOCUS_POLICY_ALWAYS = "always" +fld public final static java.lang.String SELECT_ALL_ON_FOCUS_POLICY_NEVER = "never" +fld public final static java.lang.String SELECT_ALL_ON_FOCUS_POLICY_ONCE = "once" +fld public final static java.lang.String SQUARE_SIZE = "JButton.squareSize" +fld public final static java.lang.String TABBED_PANE_ALIGN_CENTER = "center" +fld public final static java.lang.String TABBED_PANE_ALIGN_FILL = "fill" +fld public final static java.lang.String TABBED_PANE_ALIGN_LEADING = "leading" +fld public final static java.lang.String TABBED_PANE_ALIGN_TRAILING = "trailing" +fld public final static java.lang.String TABBED_PANE_HAS_FULL_BORDER = "JTabbedPane.hasFullBorder" +fld public final static java.lang.String TABBED_PANE_HIDE_TAB_AREA_WITH_ONE_TAB = "JTabbedPane.hideTabAreaWithOneTab" +fld public final static java.lang.String TABBED_PANE_LEADING_COMPONENT = "JTabbedPane.leadingComponent" +fld public final static java.lang.String TABBED_PANE_MAXIMUM_TAB_WIDTH = "JTabbedPane.maximumTabWidth" +fld public final static java.lang.String TABBED_PANE_MINIMUM_TAB_WIDTH = "JTabbedPane.minimumTabWidth" +fld public final static java.lang.String TABBED_PANE_PLACEMENT_BOTH = "both" +fld public final static java.lang.String TABBED_PANE_PLACEMENT_TRAILING = "trailing" +fld public final static java.lang.String TABBED_PANE_POLICY_AS_NEEDED = "asNeeded" +fld public final static java.lang.String TABBED_PANE_POLICY_AS_NEEDED_SINGLE = "asNeededSingle" +fld public final static java.lang.String TABBED_PANE_POLICY_NEVER = "never" +fld public final static java.lang.String TABBED_PANE_SCROLL_BUTTONS_PLACEMENT = "JTabbedPane.scrollButtonsPlacement" +fld public final static java.lang.String TABBED_PANE_SCROLL_BUTTONS_POLICY = "JTabbedPane.scrollButtonsPolicy" +fld public final static java.lang.String TABBED_PANE_SHOW_CONTENT_SEPARATOR = "JTabbedPane.showContentSeparator" +fld public final static java.lang.String TABBED_PANE_SHOW_TAB_SEPARATORS = "JTabbedPane.showTabSeparators" +fld public final static java.lang.String TABBED_PANE_TABS_POPUP_POLICY = "JTabbedPane.tabsPopupPolicy" +fld public final static java.lang.String TABBED_PANE_TAB_ALIGNMENT = "JTabbedPane.tabAlignment" +fld public final static java.lang.String TABBED_PANE_TAB_AREA_ALIGNMENT = "JTabbedPane.tabAreaAlignment" +fld public final static java.lang.String TABBED_PANE_TAB_AREA_INSETS = "JTabbedPane.tabAreaInsets" +fld public final static java.lang.String TABBED_PANE_TAB_CLOSABLE = "JTabbedPane.tabClosable" +fld public final static java.lang.String TABBED_PANE_TAB_CLOSE_CALLBACK = "JTabbedPane.tabCloseCallback" +fld public final static java.lang.String TABBED_PANE_TAB_CLOSE_TOOLTIPTEXT = "JTabbedPane.tabCloseToolTipText" +fld public final static java.lang.String TABBED_PANE_TAB_HEIGHT = "JTabbedPane.tabHeight" +fld public final static java.lang.String TABBED_PANE_TAB_ICON_PLACEMENT = "JTabbedPane.tabIconPlacement" +fld public final static java.lang.String TABBED_PANE_TAB_INSETS = "JTabbedPane.tabInsets" +fld public final static java.lang.String TABBED_PANE_TAB_WIDTH_MODE = "JTabbedPane.tabWidthMode" +fld public final static java.lang.String TABBED_PANE_TAB_WIDTH_MODE_COMPACT = "compact" +fld public final static java.lang.String TABBED_PANE_TAB_WIDTH_MODE_EQUAL = "equal" +fld public final static java.lang.String TABBED_PANE_TAB_WIDTH_MODE_PREFERRED = "preferred" +fld public final static java.lang.String TABBED_PANE_TRAILING_COMPONENT = "JTabbedPane.trailingComponent" +fld public final static java.lang.String TAB_BUTTON_SELECTED_BACKGROUND = "JToggleButton.tab.selectedBackground" +fld public final static java.lang.String TAB_BUTTON_UNDERLINE_COLOR = "JToggleButton.tab.underlineColor" +fld public final static java.lang.String TAB_BUTTON_UNDERLINE_HEIGHT = "JToggleButton.tab.underlineHeight" +fld public final static java.lang.String TEXT_FIELD_PADDING = "JTextField.padding" +fld public final static java.lang.String TITLE_BAR_BACKGROUND = "JRootPane.titleBarBackground" +fld public final static java.lang.String TITLE_BAR_FOREGROUND = "JRootPane.titleBarForeground" +fld public final static java.lang.String TREE_PAINT_SELECTION = "JTree.paintSelection" +fld public final static java.lang.String TREE_WIDE_SELECTION = "JTree.wideSelection" +fld public final static java.lang.String USE_WINDOW_DECORATIONS = "JRootPane.useWindowDecorations" +meth public static boolean clientPropertyBoolean(javax.swing.JComponent,java.lang.String,boolean) +meth public static boolean clientPropertyEquals(javax.swing.JComponent,java.lang.String,java.lang.Object) +meth public static int clientPropertyInt(javax.swing.JComponent,java.lang.String,int) +meth public static java.awt.Color clientPropertyColor(javax.swing.JComponent,java.lang.String,java.awt.Color) +meth public static java.lang.Boolean clientPropertyBooleanStrict(javax.swing.JComponent,java.lang.String,java.lang.Boolean) + +CLSS public com.formdev.flatlaf.FlatDarculaLaf +cons public init() +fld public final static java.lang.String NAME = "FlatLaf Darcula" +meth public java.lang.String getDescription() +meth public java.lang.String getName() +meth public static boolean install() + anno 0 java.lang.Deprecated() +meth public static boolean setup() +meth public static void installLafInfo() +supr com.formdev.flatlaf.FlatDarkLaf + +CLSS public com.formdev.flatlaf.FlatDarkLaf +cons public init() +fld public final static java.lang.String NAME = "FlatLaf Dark" +meth public boolean isDark() +meth public java.lang.String getDescription() +meth public java.lang.String getName() +meth public static boolean install() + anno 0 java.lang.Deprecated() +meth public static boolean setup() +meth public static void installLafInfo() +supr com.formdev.flatlaf.FlatLaf + +CLSS public abstract com.formdev.flatlaf.FlatDefaultsAddon +cons public init() +meth public int getPriority() +meth public java.io.InputStream getDefaults(java.lang.Class) +meth public void afterDefaultsLoading(javax.swing.LookAndFeel,javax.swing.UIDefaults) +supr java.lang.Object + +CLSS public final !enum com.formdev.flatlaf.FlatIconColors +fld public final boolean dark +fld public final boolean light +fld public final int rgb +fld public final java.lang.String key +fld public final static com.formdev.flatlaf.FlatIconColors ACTIONS_BLUE +fld public final static com.formdev.flatlaf.FlatIconColors ACTIONS_BLUE_DARK +fld public final static com.formdev.flatlaf.FlatIconColors ACTIONS_GREEN +fld public final static com.formdev.flatlaf.FlatIconColors ACTIONS_GREEN_DARK +fld public final static com.formdev.flatlaf.FlatIconColors ACTIONS_GREY +fld public final static com.formdev.flatlaf.FlatIconColors ACTIONS_GREYINLINE +fld public final static com.formdev.flatlaf.FlatIconColors ACTIONS_GREYINLINE_DARK +fld public final static com.formdev.flatlaf.FlatIconColors ACTIONS_GREY_DARK +fld public final static com.formdev.flatlaf.FlatIconColors ACTIONS_RED +fld public final static com.formdev.flatlaf.FlatIconColors ACTIONS_RED_DARK +fld public final static com.formdev.flatlaf.FlatIconColors ACTIONS_YELLOW +fld public final static com.formdev.flatlaf.FlatIconColors ACTIONS_YELLOW_DARK +fld public final static com.formdev.flatlaf.FlatIconColors OBJECTS_BLACK_TEXT +fld public final static com.formdev.flatlaf.FlatIconColors OBJECTS_BLUE +fld public final static com.formdev.flatlaf.FlatIconColors OBJECTS_GREEN +fld public final static com.formdev.flatlaf.FlatIconColors OBJECTS_GREEN_ANDROID +fld public final static com.formdev.flatlaf.FlatIconColors OBJECTS_GREY +fld public final static com.formdev.flatlaf.FlatIconColors OBJECTS_PINK +fld public final static com.formdev.flatlaf.FlatIconColors OBJECTS_PURPLE +fld public final static com.formdev.flatlaf.FlatIconColors OBJECTS_RED +fld public final static com.formdev.flatlaf.FlatIconColors OBJECTS_RED_STATUS +fld public final static com.formdev.flatlaf.FlatIconColors OBJECTS_YELLOW +fld public final static com.formdev.flatlaf.FlatIconColors OBJECTS_YELLOW_DARK +meth public static com.formdev.flatlaf.FlatIconColors valueOf(java.lang.String) +meth public static com.formdev.flatlaf.FlatIconColors[] values() +supr java.lang.Enum + +CLSS public com.formdev.flatlaf.FlatIntelliJLaf +cons public init() +fld public final static java.lang.String NAME = "FlatLaf IntelliJ" +meth public java.lang.String getDescription() +meth public java.lang.String getName() +meth public static boolean install() + anno 0 java.lang.Deprecated() +meth public static boolean setup() +meth public static void installLafInfo() +supr com.formdev.flatlaf.FlatLightLaf + +CLSS public abstract com.formdev.flatlaf.FlatLaf +cons public init() +fld public final static java.lang.Object NULL_VALUE +innr public abstract interface static DisabledIconProvider +meth protected java.util.List> getLafClassesForDefaultsLoading() +meth protected java.util.Properties getAdditionalDefaults() +meth public abstract boolean isDark() +meth public boolean getSupportsWindowDecorations() +meth public boolean isNativeLookAndFeel() +meth public boolean isSupportedLookAndFeel() +meth public final boolean equals(java.lang.Object) +meth public final int hashCode() +meth public java.lang.String getID() +meth public javax.swing.Icon getDisabledIcon(javax.swing.JComponent,javax.swing.Icon) +meth public javax.swing.UIDefaults getDefaults() +meth public static boolean install(javax.swing.LookAndFeel) + anno 0 java.lang.Deprecated() +meth public static boolean isLafDark() +meth public static boolean isShowMnemonics() +meth public static boolean isUseNativeWindowDecorations() +meth public static boolean setup(javax.swing.LookAndFeel) +meth public static boolean supportsNativeWindowDecorations() +meth public static javax.swing.UIDefaults$ActiveValue createActiveFontValue(float) +meth public static void hideMnemonics() +meth public static void initIconColors(javax.swing.UIDefaults,boolean) +meth public static void installLafInfo(java.lang.String,java.lang.Class) +meth public static void registerCustomDefaultsSource(java.io.File) +meth public static void registerCustomDefaultsSource(java.lang.String) +meth public static void registerCustomDefaultsSource(java.lang.String,java.lang.ClassLoader) +meth public static void repaintAllFramesAndDialogs() +meth public static void revalidateAndRepaintAllFramesAndDialogs() +meth public static void runWithUIDefaultsGetter(java.util.function.Function,java.lang.Runnable) +meth public static void setUseNativeWindowDecorations(boolean) +meth public static void showMnemonics(java.awt.Component) +meth public static void unregisterCustomDefaultsSource(java.io.File) +meth public static void unregisterCustomDefaultsSource(java.lang.String) +meth public static void unregisterCustomDefaultsSource(java.lang.String,java.lang.ClassLoader) +meth public static void updateUI() +meth public static void updateUILater() +meth public void initialize() +meth public void registerUIDefaultsGetter(java.util.function.Function) +meth public void uninitialize() +meth public void unregisterUIDefaultsGetter(java.util.function.Function) +supr javax.swing.plaf.basic.BasicLookAndFeel +hfds DESKTOPFONTHINTS,aquaLoaded,customDefaultsSources,desktopPropertyListener,desktopPropertyName,desktopPropertyName2,mnemonicHandler,oldPopupFactory,postInitialization,uiDefaultsGetters,updateUIPending +hcls ActiveFont,FlatUIDefaults,ImageIconUIResource + +CLSS public abstract interface static com.formdev.flatlaf.FlatLaf$DisabledIconProvider + outer com.formdev.flatlaf.FlatLaf +meth public abstract javax.swing.Icon getDisabledIcon() + +CLSS public com.formdev.flatlaf.FlatLightLaf +cons public init() +fld public final static java.lang.String NAME = "FlatLaf Light" +meth public boolean isDark() +meth public java.lang.String getDescription() +meth public java.lang.String getName() +meth public static boolean install() + anno 0 java.lang.Deprecated() +meth public static boolean setup() +meth public static void installLafInfo() +supr com.formdev.flatlaf.FlatLaf + +CLSS public com.formdev.flatlaf.FlatPropertiesLaf +cons public init(java.lang.String,java.io.File) throws java.io.IOException +cons public init(java.lang.String,java.io.InputStream) throws java.io.IOException +cons public init(java.lang.String,java.util.Properties) +meth protected java.util.ArrayList> getLafClassesForDefaultsLoading() +meth protected java.util.Properties getAdditionalDefaults() +meth public boolean isDark() +meth public java.lang.String getDescription() +meth public java.lang.String getName() +meth public java.util.Properties getProperties() +supr com.formdev.flatlaf.FlatLaf +hfds baseTheme,dark,name,properties + +CLSS public abstract interface com.formdev.flatlaf.FlatSystemProperties +fld public final static java.lang.String ANIMATION = "flatlaf.animation" +fld public final static java.lang.String MENUBAR_EMBEDDED = "flatlaf.menuBarEmbedded" +fld public final static java.lang.String UI_SCALE = "flatlaf.uiScale" +fld public final static java.lang.String UI_SCALE_ALLOW_SCALE_DOWN = "flatlaf.uiScale.allowScaleDown" +fld public final static java.lang.String UI_SCALE_ENABLED = "flatlaf.uiScale.enabled" +fld public final static java.lang.String USE_JETBRAINS_CUSTOM_DECORATIONS = "flatlaf.useJetBrainsCustomDecorations" +fld public final static java.lang.String USE_TEXT_Y_CORRECTION = "flatlaf.useTextYCorrection" +fld public final static java.lang.String USE_UBUNTU_FONT = "flatlaf.useUbuntuFont" +fld public final static java.lang.String USE_WINDOW_DECORATIONS = "flatlaf.useWindowDecorations" +meth public static boolean getBoolean(java.lang.String,boolean) +meth public static java.lang.Boolean getBooleanStrict(java.lang.String,java.lang.Boolean) + +CLSS public com.formdev.flatlaf.IntelliJTheme +cons public init(java.io.InputStream) throws java.io.IOException +fld public final boolean dark +fld public final java.lang.String author +fld public final java.lang.String name +innr public static ThemeLaf +meth public static boolean install(java.io.InputStream) + anno 0 java.lang.Deprecated() +meth public static boolean setup(java.io.InputStream) +meth public static com.formdev.flatlaf.FlatLaf createLaf(com.formdev.flatlaf.IntelliJTheme) +meth public static com.formdev.flatlaf.FlatLaf createLaf(java.io.InputStream) throws java.io.IOException +supr java.lang.Object +hfds checkboxDuplicateColors,checkboxKeyMapping,colors,icons,isMaterialUILite,namedColors,ui,uiKeyCopying,uiKeyInverseMapping,uiKeyMapping + +CLSS public static com.formdev.flatlaf.IntelliJTheme$ThemeLaf + outer com.formdev.flatlaf.IntelliJTheme +cons public init(com.formdev.flatlaf.IntelliJTheme) +meth protected java.util.ArrayList> getLafClassesForDefaultsLoading() +meth public boolean isDark() +meth public com.formdev.flatlaf.IntelliJTheme getTheme() +meth public java.lang.String getDescription() +meth public java.lang.String getName() +supr com.formdev.flatlaf.FlatLaf +hfds theme + +CLSS public abstract interface com.formdev.flatlaf.util.AnimatedIcon +innr public static AnimationSupport +intf javax.swing.Icon +meth public abstract float getValue(java.awt.Component) +meth public abstract void paintIconAnimated(java.awt.Component,java.awt.Graphics,int,int,float) +meth public boolean isAnimationEnabled() +meth public com.formdev.flatlaf.util.Animator$Interpolator getAnimationInterpolator() +meth public int getAnimationDuration() +meth public int getAnimationResolution() +meth public java.lang.Object getClientPropertyKey() +meth public void paintIcon(java.awt.Component,java.awt.Graphics,int,int) + +CLSS public static com.formdev.flatlaf.util.AnimatedIcon$AnimationSupport + outer com.formdev.flatlaf.util.AnimatedIcon +cons public init() +meth public static void paintIcon(com.formdev.flatlaf.util.AnimatedIcon,java.awt.Component,java.awt.Graphics,int,int) +meth public static void saveIconLocation(com.formdev.flatlaf.util.AnimatedIcon,java.awt.Component,int,int) +supr java.lang.Object +hfds animatedValue,animator,fraction,startValue,targetValue,x,y + +CLSS public com.formdev.flatlaf.util.Animator +cons public init(int) +cons public init(int,com.formdev.flatlaf.util.Animator$TimingTarget) +cons public init(int,com.formdev.flatlaf.util.Animator$TimingTarget,java.lang.Runnable) +innr public abstract interface static Interpolator +innr public abstract interface static TimingTarget +meth public boolean isRunning() +meth public com.formdev.flatlaf.util.Animator$Interpolator getInterpolator() +meth public int getDuration() +meth public int getResolution() +meth public static boolean useAnimation() +meth public void addTarget(com.formdev.flatlaf.util.Animator$TimingTarget) +meth public void cancel() +meth public void removeTarget(com.formdev.flatlaf.util.Animator$TimingTarget) +meth public void restart() +meth public void setDuration(int) +meth public void setInterpolator(com.formdev.flatlaf.util.Animator$Interpolator) +meth public void setResolution(int) +meth public void start() +meth public void stop() +supr java.lang.Object +hfds duration,endRunnable,hasBegun,interpolator,resolution,running,startTime,targets,timeToStop,timer + +CLSS public abstract interface static com.formdev.flatlaf.util.Animator$Interpolator + outer com.formdev.flatlaf.util.Animator + anno 0 java.lang.FunctionalInterface() +meth public abstract float interpolate(float) + +CLSS public abstract interface static com.formdev.flatlaf.util.Animator$TimingTarget + outer com.formdev.flatlaf.util.Animator + anno 0 java.lang.FunctionalInterface() +meth public abstract void timingEvent(float) +meth public void begin() +meth public void end() + +CLSS public com.formdev.flatlaf.util.ColorFunctions +cons public init() +innr public abstract interface static ColorFunction +innr public static Fade +innr public static HSLChange +innr public static HSLIncreaseDecrease +innr public static Mix +meth public !varargs static java.awt.Color applyFunctions(java.awt.Color,com.formdev.flatlaf.util.ColorFunctions$ColorFunction[]) +meth public static float clamp(float) +meth public static java.awt.Color mix(java.awt.Color,java.awt.Color,float) +supr java.lang.Object + +CLSS public abstract interface static com.formdev.flatlaf.util.ColorFunctions$ColorFunction + outer com.formdev.flatlaf.util.ColorFunctions +meth public abstract void apply(float[]) + +CLSS public static com.formdev.flatlaf.util.ColorFunctions$Fade + outer com.formdev.flatlaf.util.ColorFunctions +cons public init(float) +fld public final float amount +intf com.formdev.flatlaf.util.ColorFunctions$ColorFunction +meth public java.lang.String toString() +meth public void apply(float[]) +supr java.lang.Object + +CLSS public static com.formdev.flatlaf.util.ColorFunctions$HSLChange + outer com.formdev.flatlaf.util.ColorFunctions +cons public init(int,float) +fld public final float value +fld public final int hslIndex +intf com.formdev.flatlaf.util.ColorFunctions$ColorFunction +meth public java.lang.String toString() +meth public void apply(float[]) +supr java.lang.Object + +CLSS public static com.formdev.flatlaf.util.ColorFunctions$HSLIncreaseDecrease + outer com.formdev.flatlaf.util.ColorFunctions +cons public init(int,boolean,float,boolean,boolean) +fld public final boolean autoInverse +fld public final boolean increase +fld public final boolean relative +fld public final float amount +fld public final int hslIndex +intf com.formdev.flatlaf.util.ColorFunctions$ColorFunction +meth protected boolean shouldInverse(float[]) +meth public java.lang.String toString() +meth public void apply(float[]) +supr java.lang.Object + +CLSS public static com.formdev.flatlaf.util.ColorFunctions$Mix + outer com.formdev.flatlaf.util.ColorFunctions +cons public init(java.awt.Color,float) +fld public final float weight +fld public final java.awt.Color color2 +intf com.formdev.flatlaf.util.ColorFunctions$ColorFunction +meth public java.lang.String toString() +meth public void apply(float[]) +supr java.lang.Object + +CLSS public com.formdev.flatlaf.util.CubicBezierEasing +cons public init(float,float,float,float) +fld public final static com.formdev.flatlaf.util.CubicBezierEasing EASE +fld public final static com.formdev.flatlaf.util.CubicBezierEasing EASE_IN +fld public final static com.formdev.flatlaf.util.CubicBezierEasing EASE_IN_OUT +fld public final static com.formdev.flatlaf.util.CubicBezierEasing EASE_OUT +fld public final static com.formdev.flatlaf.util.CubicBezierEasing STANDARD_EASING +intf com.formdev.flatlaf.util.Animator$Interpolator +meth public float interpolate(float) +supr java.lang.Object +hfds x1,x2,y1,y2 + +CLSS public com.formdev.flatlaf.util.DerivedColor +cons public !varargs init(java.awt.Color,com.formdev.flatlaf.util.ColorFunctions$ColorFunction[]) +meth public com.formdev.flatlaf.util.ColorFunctions$ColorFunction[] getFunctions() +meth public java.awt.Color derive(java.awt.Color) +meth public java.lang.String toString() +supr javax.swing.plaf.ColorUIResource +hfds baseOfDefaultColorRGB,functions,hasBaseOfDefaultColor + +CLSS public com.formdev.flatlaf.util.Graphics2DProxy +cons public init(java.awt.Graphics2D) +meth public boolean drawImage(java.awt.Image,int,int,int,int,int,int,int,int,java.awt.Color,java.awt.image.ImageObserver) +meth public boolean drawImage(java.awt.Image,int,int,int,int,int,int,int,int,java.awt.image.ImageObserver) +meth public boolean drawImage(java.awt.Image,int,int,int,int,java.awt.Color,java.awt.image.ImageObserver) +meth public boolean drawImage(java.awt.Image,int,int,int,int,java.awt.image.ImageObserver) +meth public boolean drawImage(java.awt.Image,int,int,java.awt.Color,java.awt.image.ImageObserver) +meth public boolean drawImage(java.awt.Image,int,int,java.awt.image.ImageObserver) +meth public boolean drawImage(java.awt.Image,java.awt.geom.AffineTransform,java.awt.image.ImageObserver) +meth public boolean hit(java.awt.Rectangle,java.awt.Shape,boolean) +meth public boolean hitClip(int,int,int,int) +meth public java.awt.Color getBackground() +meth public java.awt.Color getColor() +meth public java.awt.Composite getComposite() +meth public java.awt.Font getFont() +meth public java.awt.FontMetrics getFontMetrics() +meth public java.awt.FontMetrics getFontMetrics(java.awt.Font) +meth public java.awt.Graphics create() +meth public java.awt.Graphics create(int,int,int,int) +meth public java.awt.GraphicsConfiguration getDeviceConfiguration() +meth public java.awt.Paint getPaint() +meth public java.awt.Rectangle getClipBounds() +meth public java.awt.Rectangle getClipBounds(java.awt.Rectangle) +meth public java.awt.Rectangle getClipRect() +meth public java.awt.RenderingHints getRenderingHints() +meth public java.awt.Shape getClip() +meth public java.awt.Stroke getStroke() +meth public java.awt.font.FontRenderContext getFontRenderContext() +meth public java.awt.geom.AffineTransform getTransform() +meth public java.lang.Object getRenderingHint(java.awt.RenderingHints$Key) +meth public java.lang.String toString() +meth public void addRenderingHints(java.util.Map) +meth public void clearRect(int,int,int,int) +meth public void clip(java.awt.Shape) +meth public void clipRect(int,int,int,int) +meth public void copyArea(int,int,int,int,int,int) +meth public void dispose() +meth public void draw(java.awt.Shape) +meth public void draw3DRect(int,int,int,int,boolean) +meth public void drawArc(int,int,int,int,int,int) +meth public void drawBytes(byte[],int,int,int,int) +meth public void drawChars(char[],int,int,int,int) +meth public void drawGlyphVector(java.awt.font.GlyphVector,float,float) +meth public void drawImage(java.awt.image.BufferedImage,java.awt.image.BufferedImageOp,int,int) +meth public void drawLine(int,int,int,int) +meth public void drawOval(int,int,int,int) +meth public void drawPolygon(int[],int[],int) +meth public void drawPolygon(java.awt.Polygon) +meth public void drawPolyline(int[],int[],int) +meth public void drawRect(int,int,int,int) +meth public void drawRenderableImage(java.awt.image.renderable.RenderableImage,java.awt.geom.AffineTransform) +meth public void drawRenderedImage(java.awt.image.RenderedImage,java.awt.geom.AffineTransform) +meth public void drawRoundRect(int,int,int,int,int,int) +meth public void drawString(java.lang.String,float,float) +meth public void drawString(java.lang.String,int,int) +meth public void drawString(java.text.AttributedCharacterIterator,float,float) +meth public void drawString(java.text.AttributedCharacterIterator,int,int) +meth public void fill(java.awt.Shape) +meth public void fill3DRect(int,int,int,int,boolean) +meth public void fillArc(int,int,int,int,int,int) +meth public void fillOval(int,int,int,int) +meth public void fillPolygon(int[],int[],int) +meth public void fillPolygon(java.awt.Polygon) +meth public void fillRect(int,int,int,int) +meth public void fillRoundRect(int,int,int,int,int,int) +meth public void rotate(double) +meth public void rotate(double,double,double) +meth public void scale(double,double) +meth public void setBackground(java.awt.Color) +meth public void setClip(int,int,int,int) +meth public void setClip(java.awt.Shape) +meth public void setColor(java.awt.Color) +meth public void setComposite(java.awt.Composite) +meth public void setFont(java.awt.Font) +meth public void setPaint(java.awt.Paint) +meth public void setPaintMode() +meth public void setRenderingHint(java.awt.RenderingHints$Key,java.lang.Object) +meth public void setRenderingHints(java.util.Map) +meth public void setStroke(java.awt.Stroke) +meth public void setTransform(java.awt.geom.AffineTransform) +meth public void setXORMode(java.awt.Color) +meth public void shear(double,double) +meth public void transform(java.awt.geom.AffineTransform) +meth public void translate(double,double) +meth public void translate(int,int) +supr java.awt.Graphics2D +hfds delegate + +CLSS public com.formdev.flatlaf.util.GrayFilter +cons public init() +cons public init(int,int,int) +meth public int filterRGB(int,int,int) +meth public int getAlpha() +meth public int getBrightness() +meth public int getContrast() +meth public static com.formdev.flatlaf.util.GrayFilter createDisabledIconFilter(boolean) +supr java.awt.image.RGBImageFilter +hfds alpha,brightness,contrast,origBrightness,origContrast + +CLSS public com.formdev.flatlaf.util.HSLColor +cons public init(float,float,float) +cons public init(float,float,float,float) +cons public init(float[]) +cons public init(float[],float) +cons public init(java.awt.Color) +meth public float getAlpha() +meth public float getHue() +meth public float getLuminance() +meth public float getSaturation() +meth public float[] getHSL() +meth public java.awt.Color adjustHue(float) +meth public java.awt.Color adjustLuminance(float) +meth public java.awt.Color adjustSaturation(float) +meth public java.awt.Color adjustShade(float) +meth public java.awt.Color adjustTone(float) +meth public java.awt.Color getComplementary() +meth public java.awt.Color getRGB() +meth public java.lang.String toString() +meth public static float[] fromRGB(java.awt.Color) +meth public static java.awt.Color toRGB(float,float,float) +meth public static java.awt.Color toRGB(float,float,float,float) +meth public static java.awt.Color toRGB(float[]) +meth public static java.awt.Color toRGB(float[],float) +supr java.lang.Object +hfds alpha,hsl,rgb + +CLSS public com.formdev.flatlaf.util.HiDPIUtils +cons public init() +innr public abstract interface static Painter +meth public static float computeTextYCorrection(java.awt.Graphics2D) +meth public static java.awt.Graphics2D createGraphicsTextYCorrection(java.awt.Graphics2D) +meth public static void drawStringUnderlineCharAtWithYCorrection(javax.swing.JComponent,java.awt.Graphics2D,java.lang.String,int,int,int) +meth public static void drawStringWithYCorrection(javax.swing.JComponent,java.awt.Graphics2D,java.lang.String,int,int) +meth public static void paintAtScale1x(java.awt.Graphics2D,int,int,int,int,com.formdev.flatlaf.util.HiDPIUtils$Painter) +meth public static void paintAtScale1x(java.awt.Graphics2D,javax.swing.JComponent,com.formdev.flatlaf.util.HiDPIUtils$Painter) +supr java.lang.Object +hfds useTextYCorrection + +CLSS public abstract interface static com.formdev.flatlaf.util.HiDPIUtils$Painter + outer com.formdev.flatlaf.util.HiDPIUtils +meth public abstract void paint(java.awt.Graphics2D,int,int,int,int,double) + +CLSS public com.formdev.flatlaf.util.JavaCompatibility +cons public init() +meth public static java.lang.String getClippedString(javax.swing.JComponent,java.awt.FontMetrics,java.lang.String,int) +meth public static void drawStringUnderlineCharAt(javax.swing.JComponent,java.awt.Graphics,java.lang.String,int,int,int) +supr java.lang.Object +hfds drawStringUnderlineCharAtMethod,getClippedStringMethod + +CLSS public abstract interface com.formdev.flatlaf.util.LoggingFacade +fld public final static com.formdev.flatlaf.util.LoggingFacade INSTANCE +meth public abstract void logConfig(java.lang.String,java.lang.Throwable) +meth public abstract void logSevere(java.lang.String,java.lang.Throwable) + +CLSS public com.formdev.flatlaf.util.MultiResolutionImageSupport +cons public init() +meth public !varargs static java.awt.Image create(int,java.awt.Image[]) +meth public static boolean isAvailable() +meth public static boolean isMultiResolutionImage(java.awt.Image) +meth public static java.awt.Image create(int,java.awt.Dimension[],java.util.function.Function) +meth public static java.awt.Image getResolutionVariant(java.awt.Image,int,int) +meth public static java.awt.Image map(java.awt.Image,java.util.function.Function) +meth public static java.util.List getResolutionVariants(java.awt.Image) +supr java.lang.Object + +CLSS public com.formdev.flatlaf.util.NativeLibrary +cons public init(java.lang.String,java.lang.ClassLoader,boolean) +meth public boolean isLoaded() +supr java.lang.Object +hfds DELETE_SUFFIX,deletedTemporary,loaded + +CLSS public com.formdev.flatlaf.util.ScaledEmptyBorder +cons public init(int,int,int,int) +cons public init(java.awt.Insets) +meth public java.awt.Insets getBorderInsets() +meth public java.awt.Insets getBorderInsets(java.awt.Component,java.awt.Insets) +supr javax.swing.border.EmptyBorder + +CLSS public com.formdev.flatlaf.util.ScaledImageIcon +cons public init(javax.swing.ImageIcon) +cons public init(javax.swing.ImageIcon,int,int) +intf javax.swing.Icon +meth protected java.awt.Image getResolutionVariant(int,int) +meth public int getIconHeight() +meth public int getIconWidth() +meth public void paintIcon(java.awt.Component,java.awt.Graphics,int,int) +supr java.lang.Object +hfds iconHeight,iconWidth,imageIcon,lastImage,lastSystemScaleFactor,lastUserScaleFactor + +CLSS public com.formdev.flatlaf.util.StringUtils +cons public init() +meth public static boolean isEmpty(java.lang.String) +meth public static java.lang.String removeLeading(java.lang.String,java.lang.String) +meth public static java.lang.String removeTrailing(java.lang.String,java.lang.String) +meth public static java.util.List split(java.lang.String,char) +supr java.lang.Object + +CLSS public com.formdev.flatlaf.util.SystemInfo +cons public init() +fld public final static boolean isJava_11_orLater +fld public final static boolean isJava_15_orLater +fld public final static boolean isJava_9_orLater +fld public final static boolean isJetBrainsJVM +fld public final static boolean isJetBrainsJVM_11_orLater +fld public final static boolean isKDE +fld public final static boolean isLinux +fld public final static boolean isMacOS +fld public final static boolean isMacOS_10_11_ElCapitan_orLater +fld public final static boolean isMacOS_10_14_Mojave_orLater +fld public final static boolean isMacOS_10_15_Catalina_orLater +fld public final static boolean isProjector +fld public final static boolean isWebswing +fld public final static boolean isWinPE +fld public final static boolean isWindows +fld public final static boolean isWindows_10_orLater +fld public final static boolean isX86_64 +fld public final static long javaVersion +fld public final static long osVersion +meth public static long scanVersion(java.lang.String) +meth public static long toVersion(int,int,int,int) +supr java.lang.Object + +CLSS public com.formdev.flatlaf.util.UIScale +cons public init() +meth public static boolean isSystemScalingEnabled() +meth public static double getSystemScaleFactor(java.awt.Graphics2D) +meth public static double getSystemScaleFactor(java.awt.GraphicsConfiguration) +meth public static float getUserScaleFactor() +meth public static float scale(float) +meth public static float unscale(float) +meth public static int scale(int) +meth public static int scale2(int) +meth public static int unscale(int) +meth public static java.awt.Dimension scale(java.awt.Dimension) +meth public static java.awt.Insets scale(java.awt.Insets) +meth public static javax.swing.plaf.FontUIResource applyCustomScaleFactor(javax.swing.plaf.FontUIResource) +meth public static void addPropertyChangeListener(java.beans.PropertyChangeListener) +meth public static void removePropertyChangeListener(java.beans.PropertyChangeListener) +meth public static void scaleGraphics(java.awt.Graphics2D) +supr java.lang.Object +hfds DEBUG,changeSupport,initialized,jreHiDPI,scaleFactor + +CLSS public java.awt.Color +cons public init(float,float,float) +cons public init(float,float,float,float) +cons public init(int) +cons public init(int,boolean) +cons public init(int,int,int) +cons public init(int,int,int,int) + anno 0 java.beans.ConstructorProperties(java.lang.String[] value=["red", "green", "blue", "alpha"]) +cons public init(java.awt.color.ColorSpace,float[],float) +fld public final static java.awt.Color BLACK +fld public final static java.awt.Color BLUE +fld public final static java.awt.Color CYAN +fld public final static java.awt.Color DARK_GRAY +fld public final static java.awt.Color GRAY +fld public final static java.awt.Color GREEN +fld public final static java.awt.Color LIGHT_GRAY +fld public final static java.awt.Color MAGENTA +fld public final static java.awt.Color ORANGE +fld public final static java.awt.Color PINK +fld public final static java.awt.Color RED +fld public final static java.awt.Color WHITE +fld public final static java.awt.Color YELLOW +fld public final static java.awt.Color black +fld public final static java.awt.Color blue +fld public final static java.awt.Color cyan +fld public final static java.awt.Color darkGray +fld public final static java.awt.Color gray +fld public final static java.awt.Color green +fld public final static java.awt.Color lightGray +fld public final static java.awt.Color magenta +fld public final static java.awt.Color orange +fld public final static java.awt.Color pink +fld public final static java.awt.Color red +fld public final static java.awt.Color white +fld public final static java.awt.Color yellow +intf java.awt.Paint +intf java.io.Serializable +meth public boolean equals(java.lang.Object) +meth public float[] getColorComponents(float[]) +meth public float[] getColorComponents(java.awt.color.ColorSpace,float[]) +meth public float[] getComponents(float[]) +meth public float[] getComponents(java.awt.color.ColorSpace,float[]) +meth public float[] getRGBColorComponents(float[]) +meth public float[] getRGBComponents(float[]) +meth public int getAlpha() +meth public int getBlue() +meth public int getGreen() +meth public int getRGB() +meth public int getRed() +meth public int getTransparency() +meth public int hashCode() +meth public java.awt.Color brighter() +meth public java.awt.Color darker() +meth public java.awt.PaintContext createContext(java.awt.image.ColorModel,java.awt.Rectangle,java.awt.geom.Rectangle2D,java.awt.geom.AffineTransform,java.awt.RenderingHints) +meth public java.awt.color.ColorSpace getColorSpace() +meth public java.lang.String toString() +meth public static float[] RGBtoHSB(int,int,int,float[]) +meth public static int HSBtoRGB(float,float,float) +meth public static java.awt.Color decode(java.lang.String) +meth public static java.awt.Color getColor(java.lang.String) +meth public static java.awt.Color getColor(java.lang.String,int) +meth public static java.awt.Color getColor(java.lang.String,java.awt.Color) +meth public static java.awt.Color getHSBColor(float,float,float) +supr java.lang.Object + +CLSS public abstract java.awt.Graphics +cons protected init() +meth public abstract boolean drawImage(java.awt.Image,int,int,int,int,int,int,int,int,java.awt.Color,java.awt.image.ImageObserver) +meth public abstract boolean drawImage(java.awt.Image,int,int,int,int,int,int,int,int,java.awt.image.ImageObserver) +meth public abstract boolean drawImage(java.awt.Image,int,int,int,int,java.awt.Color,java.awt.image.ImageObserver) +meth public abstract boolean drawImage(java.awt.Image,int,int,int,int,java.awt.image.ImageObserver) +meth public abstract boolean drawImage(java.awt.Image,int,int,java.awt.Color,java.awt.image.ImageObserver) +meth public abstract boolean drawImage(java.awt.Image,int,int,java.awt.image.ImageObserver) +meth public abstract java.awt.Color getColor() +meth public abstract java.awt.Font getFont() +meth public abstract java.awt.FontMetrics getFontMetrics(java.awt.Font) +meth public abstract java.awt.Graphics create() +meth public abstract java.awt.Rectangle getClipBounds() +meth public abstract java.awt.Shape getClip() +meth public abstract void clearRect(int,int,int,int) +meth public abstract void clipRect(int,int,int,int) +meth public abstract void copyArea(int,int,int,int,int,int) +meth public abstract void dispose() +meth public abstract void drawArc(int,int,int,int,int,int) +meth public abstract void drawLine(int,int,int,int) +meth public abstract void drawOval(int,int,int,int) +meth public abstract void drawPolygon(int[],int[],int) +meth public abstract void drawPolyline(int[],int[],int) +meth public abstract void drawRoundRect(int,int,int,int,int,int) +meth public abstract void drawString(java.lang.String,int,int) +meth public abstract void drawString(java.text.AttributedCharacterIterator,int,int) +meth public abstract void fillArc(int,int,int,int,int,int) +meth public abstract void fillOval(int,int,int,int) +meth public abstract void fillPolygon(int[],int[],int) +meth public abstract void fillRect(int,int,int,int) +meth public abstract void fillRoundRect(int,int,int,int,int,int) +meth public abstract void setClip(int,int,int,int) +meth public abstract void setClip(java.awt.Shape) +meth public abstract void setColor(java.awt.Color) +meth public abstract void setFont(java.awt.Font) +meth public abstract void setPaintMode() +meth public abstract void setXORMode(java.awt.Color) +meth public abstract void translate(int,int) +meth public boolean hitClip(int,int,int,int) +meth public java.awt.FontMetrics getFontMetrics() +meth public java.awt.Graphics create(int,int,int,int) +meth public java.awt.Rectangle getClipBounds(java.awt.Rectangle) +meth public java.awt.Rectangle getClipRect() + anno 0 java.lang.Deprecated() +meth public java.lang.String toString() +meth public void draw3DRect(int,int,int,int,boolean) +meth public void drawBytes(byte[],int,int,int,int) +meth public void drawChars(char[],int,int,int,int) +meth public void drawPolygon(java.awt.Polygon) +meth public void drawRect(int,int,int,int) +meth public void fill3DRect(int,int,int,int,boolean) +meth public void fillPolygon(java.awt.Polygon) +meth public void finalize() +supr java.lang.Object + +CLSS public abstract java.awt.Graphics2D +cons protected init() +meth public abstract boolean drawImage(java.awt.Image,java.awt.geom.AffineTransform,java.awt.image.ImageObserver) +meth public abstract boolean hit(java.awt.Rectangle,java.awt.Shape,boolean) +meth public abstract java.awt.Color getBackground() +meth public abstract java.awt.Composite getComposite() +meth public abstract java.awt.GraphicsConfiguration getDeviceConfiguration() +meth public abstract java.awt.Paint getPaint() +meth public abstract java.awt.RenderingHints getRenderingHints() +meth public abstract java.awt.Stroke getStroke() +meth public abstract java.awt.font.FontRenderContext getFontRenderContext() +meth public abstract java.awt.geom.AffineTransform getTransform() +meth public abstract java.lang.Object getRenderingHint(java.awt.RenderingHints$Key) +meth public abstract void addRenderingHints(java.util.Map) +meth public abstract void clip(java.awt.Shape) +meth public abstract void draw(java.awt.Shape) +meth public abstract void drawGlyphVector(java.awt.font.GlyphVector,float,float) +meth public abstract void drawImage(java.awt.image.BufferedImage,java.awt.image.BufferedImageOp,int,int) +meth public abstract void drawRenderableImage(java.awt.image.renderable.RenderableImage,java.awt.geom.AffineTransform) +meth public abstract void drawRenderedImage(java.awt.image.RenderedImage,java.awt.geom.AffineTransform) +meth public abstract void drawString(java.lang.String,float,float) +meth public abstract void drawString(java.lang.String,int,int) +meth public abstract void drawString(java.text.AttributedCharacterIterator,float,float) +meth public abstract void drawString(java.text.AttributedCharacterIterator,int,int) +meth public abstract void fill(java.awt.Shape) +meth public abstract void rotate(double) +meth public abstract void rotate(double,double,double) +meth public abstract void scale(double,double) +meth public abstract void setBackground(java.awt.Color) +meth public abstract void setComposite(java.awt.Composite) +meth public abstract void setPaint(java.awt.Paint) +meth public abstract void setRenderingHint(java.awt.RenderingHints$Key,java.lang.Object) +meth public abstract void setRenderingHints(java.util.Map) +meth public abstract void setStroke(java.awt.Stroke) +meth public abstract void setTransform(java.awt.geom.AffineTransform) +meth public abstract void shear(double,double) +meth public abstract void transform(java.awt.geom.AffineTransform) +meth public abstract void translate(double,double) +meth public abstract void translate(int,int) +meth public void draw3DRect(int,int,int,int,boolean) +meth public void fill3DRect(int,int,int,int,boolean) +supr java.awt.Graphics + +CLSS public abstract interface java.awt.Paint +intf java.awt.Transparency +meth public abstract java.awt.PaintContext createContext(java.awt.image.ColorModel,java.awt.Rectangle,java.awt.geom.Rectangle2D,java.awt.geom.AffineTransform,java.awt.RenderingHints) + +CLSS public abstract interface java.awt.Transparency +fld public final static int BITMASK = 2 +fld public final static int OPAQUE = 1 +fld public final static int TRANSLUCENT = 3 +meth public abstract int getTransparency() + +CLSS public abstract interface java.awt.image.ImageConsumer +fld public final static int COMPLETESCANLINES = 4 +fld public final static int IMAGEABORTED = 4 +fld public final static int IMAGEERROR = 1 +fld public final static int RANDOMPIXELORDER = 1 +fld public final static int SINGLEFRAME = 16 +fld public final static int SINGLEFRAMEDONE = 2 +fld public final static int SINGLEPASS = 8 +fld public final static int STATICIMAGEDONE = 3 +fld public final static int TOPDOWNLEFTRIGHT = 2 +meth public abstract void imageComplete(int) +meth public abstract void setColorModel(java.awt.image.ColorModel) +meth public abstract void setDimensions(int,int) +meth public abstract void setHints(int) +meth public abstract void setPixels(int,int,int,int,java.awt.image.ColorModel,byte[],int,int) +meth public abstract void setPixels(int,int,int,int,java.awt.image.ColorModel,int[],int,int) +meth public abstract void setProperties(java.util.Hashtable) + +CLSS public java.awt.image.ImageFilter +cons public init() +fld protected java.awt.image.ImageConsumer consumer +intf java.awt.image.ImageConsumer +intf java.lang.Cloneable +meth public java.awt.image.ImageFilter getFilterInstance(java.awt.image.ImageConsumer) +meth public java.lang.Object clone() +meth public void imageComplete(int) +meth public void resendTopDownLeftRight(java.awt.image.ImageProducer) +meth public void setColorModel(java.awt.image.ColorModel) +meth public void setDimensions(int,int) +meth public void setHints(int) +meth public void setPixels(int,int,int,int,java.awt.image.ColorModel,byte[],int,int) +meth public void setPixels(int,int,int,int,java.awt.image.ColorModel,int[],int,int) +meth public void setProperties(java.util.Hashtable) +supr java.lang.Object + +CLSS public abstract java.awt.image.RGBImageFilter +cons public init() +fld protected boolean canFilterIndexColorModel +fld protected java.awt.image.ColorModel newmodel +fld protected java.awt.image.ColorModel origmodel +meth public abstract int filterRGB(int,int,int) +meth public java.awt.image.IndexColorModel filterIndexColorModel(java.awt.image.IndexColorModel) +meth public void filterRGBPixels(int,int,int,int,int[],int,int) +meth public void setColorModel(java.awt.image.ColorModel) +meth public void setPixels(int,int,int,int,java.awt.image.ColorModel,byte[],int,int) +meth public void setPixels(int,int,int,int,java.awt.image.ColorModel,int[],int,int) +meth public void substituteColorModel(java.awt.image.ColorModel,java.awt.image.ColorModel) +supr java.awt.image.ImageFilter + +CLSS public abstract interface java.io.Serializable + +CLSS public abstract interface java.lang.Cloneable + +CLSS public abstract interface java.lang.Comparable<%0 extends java.lang.Object> +meth public abstract int compareTo({java.lang.Comparable%0}) + +CLSS public abstract java.lang.Enum<%0 extends java.lang.Enum<{java.lang.Enum%0}>> +cons protected init(java.lang.String,int) +intf java.io.Serializable +intf java.lang.Comparable<{java.lang.Enum%0}> +meth protected final java.lang.Object clone() throws java.lang.CloneNotSupportedException +meth protected final void finalize() +meth public final boolean equals(java.lang.Object) +meth public final int compareTo({java.lang.Enum%0}) +meth public final int hashCode() +meth public final int ordinal() +meth public final java.lang.Class<{java.lang.Enum%0}> getDeclaringClass() +meth public final java.lang.String name() +meth public java.lang.String toString() +meth public static <%0 extends java.lang.Enum<{%%0}>> {%%0} valueOf(java.lang.Class<{%%0}>,java.lang.String) +supr java.lang.Object + +CLSS public abstract interface !annotation java.lang.FunctionalInterface + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation + +CLSS public java.lang.Object +cons public init() +meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException +meth protected void finalize() throws java.lang.Throwable +meth public boolean equals(java.lang.Object) +meth public final java.lang.Class getClass() +meth public final void notify() +meth public final void notifyAll() +meth public final void wait() throws java.lang.InterruptedException +meth public final void wait(long) throws java.lang.InterruptedException +meth public final void wait(long,int) throws java.lang.InterruptedException +meth public int hashCode() +meth public java.lang.String toString() + +CLSS public abstract interface java.lang.annotation.Annotation +meth public abstract boolean equals(java.lang.Object) +meth public abstract int hashCode() +meth public abstract java.lang.Class annotationType() +meth public abstract java.lang.String toString() + +CLSS public abstract interface !annotation java.lang.annotation.Documented + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation + +CLSS public abstract interface !annotation java.lang.annotation.Retention + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.annotation.RetentionPolicy value() + +CLSS public abstract interface !annotation java.lang.annotation.Target + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.annotation.ElementType[] value() + +CLSS public abstract interface javax.swing.Icon +meth public abstract int getIconHeight() +meth public abstract int getIconWidth() +meth public abstract void paintIcon(java.awt.Component,java.awt.Graphics,int,int) + +CLSS public abstract javax.swing.LookAndFeel +cons public init() +meth public abstract boolean isNativeLookAndFeel() +meth public abstract boolean isSupportedLookAndFeel() +meth public abstract java.lang.String getDescription() +meth public abstract java.lang.String getID() +meth public abstract java.lang.String getName() +meth public boolean getSupportsWindowDecorations() +meth public java.lang.String toString() +meth public javax.swing.Icon getDisabledIcon(javax.swing.JComponent,javax.swing.Icon) +meth public javax.swing.Icon getDisabledSelectedIcon(javax.swing.JComponent,javax.swing.Icon) +meth public javax.swing.LayoutStyle getLayoutStyle() +meth public javax.swing.UIDefaults getDefaults() +meth public static java.lang.Object getDesktopPropertyValue(java.lang.String,java.lang.Object) +meth public static java.lang.Object makeIcon(java.lang.Class,java.lang.String) +meth public static javax.swing.ComponentInputMap makeComponentInputMap(javax.swing.JComponent,java.lang.Object[]) +meth public static javax.swing.InputMap makeInputMap(java.lang.Object[]) +meth public static javax.swing.text.JTextComponent$KeyBinding[] makeKeyBindings(java.lang.Object[]) +meth public static void installBorder(javax.swing.JComponent,java.lang.String) +meth public static void installColors(javax.swing.JComponent,java.lang.String,java.lang.String) +meth public static void installColorsAndFont(javax.swing.JComponent,java.lang.String,java.lang.String,java.lang.String) +meth public static void installProperty(javax.swing.JComponent,java.lang.String,java.lang.Object) +meth public static void loadKeyBindings(javax.swing.InputMap,java.lang.Object[]) +meth public static void uninstallBorder(javax.swing.JComponent) +meth public void initialize() +meth public void provideErrorFeedback(java.awt.Component) +meth public void uninitialize() +supr java.lang.Object + +CLSS public abstract javax.swing.border.AbstractBorder +cons public init() +intf java.io.Serializable +intf javax.swing.border.Border +meth public boolean isBorderOpaque() +meth public int getBaseline(java.awt.Component,int,int) +meth public java.awt.Component$BaselineResizeBehavior getBaselineResizeBehavior(java.awt.Component) +meth public java.awt.Insets getBorderInsets(java.awt.Component) +meth public java.awt.Insets getBorderInsets(java.awt.Component,java.awt.Insets) +meth public java.awt.Rectangle getInteriorRectangle(java.awt.Component,int,int,int,int) +meth public static java.awt.Rectangle getInteriorRectangle(java.awt.Component,javax.swing.border.Border,int,int,int,int) +meth public void paintBorder(java.awt.Component,java.awt.Graphics,int,int,int,int) +supr java.lang.Object + +CLSS public abstract interface javax.swing.border.Border +meth public abstract boolean isBorderOpaque() +meth public abstract java.awt.Insets getBorderInsets(java.awt.Component) +meth public abstract void paintBorder(java.awt.Component,java.awt.Graphics,int,int,int,int) + +CLSS public javax.swing.border.EmptyBorder +cons public init(int,int,int,int) +cons public init(java.awt.Insets) + anno 0 java.beans.ConstructorProperties(java.lang.String[] value=["borderInsets"]) +fld protected int bottom +fld protected int left +fld protected int right +fld protected int top +intf java.io.Serializable +meth public boolean isBorderOpaque() +meth public java.awt.Insets getBorderInsets() +meth public java.awt.Insets getBorderInsets(java.awt.Component,java.awt.Insets) +meth public void paintBorder(java.awt.Component,java.awt.Graphics,int,int,int,int) +supr javax.swing.border.AbstractBorder + +CLSS public javax.swing.plaf.ColorUIResource +cons public init(float,float,float) +cons public init(int) +cons public init(int,int,int) + anno 0 java.beans.ConstructorProperties(java.lang.String[] value=["red", "green", "blue"]) +cons public init(java.awt.Color) +intf javax.swing.plaf.UIResource +supr java.awt.Color + +CLSS public abstract interface javax.swing.plaf.UIResource + +CLSS public abstract javax.swing.plaf.basic.BasicLookAndFeel +cons public init() +intf java.io.Serializable +meth protected javax.swing.Action createAudioAction(java.lang.Object) +meth protected javax.swing.ActionMap getAudioActionMap() +meth protected void initClassDefaults(javax.swing.UIDefaults) +meth protected void initComponentDefaults(javax.swing.UIDefaults) +meth protected void initSystemColorDefaults(javax.swing.UIDefaults) +meth protected void loadSystemColors(javax.swing.UIDefaults,java.lang.String[],boolean) +meth protected void playSound(javax.swing.Action) +meth public javax.swing.UIDefaults getDefaults() +meth public void initialize() +meth public void uninitialize() +supr javax.swing.LookAndFeel + diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java index b4b975d4..6982a601 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java @@ -47,7 +47,6 @@ import java.util.concurrent.atomic.AtomicBoolean; import javax.swing.AbstractAction; import javax.swing.BorderFactory; import javax.swing.CellRendererPane; -import javax.swing.ComboBoxEditor; import javax.swing.DefaultListCellRenderer; import javax.swing.InputMap; import javax.swing.JButton; @@ -362,33 +361,25 @@ public class FlatComboBoxUI } @Override - protected ComboBoxEditor createEditor() { - ComboBoxEditor comboBoxEditor = super.createEditor(); + protected void configureEditor() { + super.configureEditor(); - Component editor = comboBoxEditor.getEditorComponent(); if( editor instanceof JTextField ) { JTextField textField = (JTextField) editor; textField.setColumns( editorColumns ); - // assign a non-null and non-javax.swing.plaf.UIResource border to the text field, - // otherwise it is replaced with default text field border when switching LaF - // because javax.swing.plaf.basic.BasicComboBoxEditor.BorderlessTextField.setBorder() - // uses "border instanceof javax.swing.plaf.basic.BasicComboBoxEditor.UIResource" - // instead of "border instanceof javax.swing.plaf.UIResource" - textField.setBorder( BorderFactory.createEmptyBorder() ); + // remove default text field border from editor + Border border = textField.getBorder(); + if( border == null || border instanceof UIResource ) { + // assign a non-null and non-javax.swing.plaf.UIResource border to the text field, + // otherwise it is replaced with default text field border when switching LaF + // because javax.swing.plaf.basic.BasicComboBoxEditor.BorderlessTextField.setBorder() + // uses "border instanceof javax.swing.plaf.basic.BasicComboBoxEditor.UIResource" + // instead of "border instanceof javax.swing.plaf.UIResource" + textField.setBorder( BorderFactory.createEmptyBorder() ); + } } - return comboBoxEditor; - } - - @Override - protected void configureEditor() { - super.configureEditor(); - - // remove default text field border from editor - if( editor instanceof JTextField && ((JTextField)editor).getBorder() instanceof FlatTextBorder ) - ((JTextField)editor).setBorder( BorderFactory.createEmptyBorder() ); - // explicitly make non-opaque if( editor instanceof JComponent ) ((JComponent)editor).setOpaque( false ); @@ -782,6 +773,9 @@ public class FlatComboBoxUI protected void configurePopup() { super.configurePopup(); + // make opaque to avoid that background shines thru border (e.g. at 150% scaling) + setOpaque( true ); + Border border = UIManager.getBorder( "PopupMenu.border" ); if( border != null ) setBorder( border ); @@ -818,6 +812,21 @@ public class FlatComboBoxUI return height; } + @Override + public void show( Component invoker, int x, int y ) { + // Java 8: fix y coordinate if popup is shown above the combobox + // (already fixed in Java 9+ https://bugs.openjdk.java.net/browse/JDK-7072653) + if( y < 0 && !SystemInfo.isJava_9_orLater ) { + Border popupBorder = getBorder(); + if( popupBorder != null ) { + Insets insets = popupBorder.getBorderInsets( this ); + y -= insets.top + insets.bottom; + } + } + + super.show( invoker, x, y ); + } + @Override protected void paintChildren( Graphics g ) { super.paintChildren( g ); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatInternalFrameUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatInternalFrameUI.java index 0faca855..834ebfc5 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatInternalFrameUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatInternalFrameUI.java @@ -283,6 +283,9 @@ public class FlatInternalFrameUI //---- class FlatBorderListener ------------------------------------------- + /** + * @since 1.6 + */ protected class FlatBorderListener extends BorderListener { diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeWindowBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeWindowBorder.java index 86bc8dc4..291f7c27 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeWindowBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeWindowBorder.java @@ -17,6 +17,7 @@ package com.formdev.flatlaf.ui; import java.awt.Color; +import java.awt.Container; import java.awt.Rectangle; import java.awt.Window; import java.beans.PropertyChangeListener; @@ -24,7 +25,6 @@ import java.util.List; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JRootPane; -import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.event.ChangeListener; import com.formdev.flatlaf.FlatClientProperties; @@ -76,6 +76,11 @@ public class FlatNativeWindowBorder if( !isSupported() ) return null; + // do nothing if root pane has a parent that is not a window (e.g. a JInternalFrame) + Container parent = rootPane.getParent(); + if( parent != null && !(parent instanceof Window) ) + return null; + // Check whether root pane already has a window, which is the case when // switching from another LaF to FlatLaf. // Also check whether the window is displayable, which is required to install @@ -83,9 +88,8 @@ public class FlatNativeWindowBorder // If the window is not displayable, then it was probably closed/disposed but not yet removed // from the list of windows that AWT maintains and returns with Window.getWindows(). // It could be also be a window that is currently hidden, but may be shown later. - Window window = SwingUtilities.windowForComponent( rootPane ); - if( window != null && window.isDisplayable() ) - install( window ); + if( parent instanceof Window && parent.isDisplayable() ) + install( (Window) parent ); // Install FlatLaf native window border, which must be done late, // when the native window is already created, because it needs access to the window. @@ -174,9 +178,9 @@ public class FlatNativeWindowBorder return; // uninstall native window border - Window window = SwingUtilities.windowForComponent( rootPane ); - if( window != null ) - uninstall( window ); + Container parent = rootPane.getParent(); + if( parent instanceof Window ) + uninstall( (Window) parent ); } private static void uninstall( Window window ) { diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSliderUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSliderUI.java index bd4c266b..d72fa7b1 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSliderUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSliderUI.java @@ -18,9 +18,11 @@ package com.formdev.flatlaf.ui; import java.awt.Color; import java.awt.Dimension; +import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.Insets; import java.awt.Rectangle; import java.awt.Shape; import java.awt.event.MouseEvent; @@ -223,9 +225,27 @@ public class FlatSliderUI if( slider.getOrientation() == JSlider.VERTICAL ) return -1; + // use default font (instead of slider font) because the slider font size + // may be different to label font size, but we want align the track/thumb with labels + Font font = UIManager.getFont( "defaultFont" ); + if( font == null ) + font = slider.getFont(); + FontMetrics fm = slider.getFontMetrics( font ); + + // calculate track y coordinate and height + // (not using field trackRect here because slider size may be [0,0] + // and field trackRect may have invalid values in this case) + Insets insets = slider.getInsets(); + int thumbHeight = getThumbSize().height; + int contentHeight = height - insets.top - insets.bottom - focusInsets.top - focusInsets.bottom; + int centerSpacing = thumbHeight + + (slider.getPaintTicks() ? getTickLength() : 0) + + (slider.getPaintLabels() ? getHeightOfTallestLabel() : 0); + int trackY = insets.top + focusInsets.top + (contentHeight - centerSpacing - 1) / 2; + int trackHeight = thumbHeight; + // compute a baseline so that the track is vertically centered - FontMetrics fm = slider.getFontMetrics( slider.getFont() ); - return trackRect.y + Math.round( (trackRect.height - fm.getHeight()) / 2f ) + fm.getAscent() - 1; + return trackY + Math.round( (trackHeight - fm.getHeight()) / 2f ) + fm.getAscent() - 1; } @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSpinnerUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSpinnerUI.java index 1431ba24..1092434f 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSpinnerUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSpinnerUI.java @@ -219,15 +219,7 @@ public class FlatSpinnerUI @Override protected JComponent createEditor() { JComponent editor = super.createEditor(); - - // explicitly make non-opaque - editor.setOpaque( false ); - JTextField textField = getEditorTextField( editor ); - if( textField != null ) - textField.setOpaque( false ); - - updateEditorPadding(); - updateEditorColors(); + configureEditor( editor ); return editor; } @@ -235,8 +227,19 @@ public class FlatSpinnerUI protected void replaceEditor( JComponent oldEditor, JComponent newEditor ) { super.replaceEditor( oldEditor, newEditor ); + configureEditor( newEditor ); + removeEditorFocusListener( oldEditor ); addEditorFocusListener( newEditor ); + } + + /** @since 1.6 */ + protected void configureEditor( JComponent editor ) { + // explicitly make non-opaque + editor.setOpaque( false ); + JTextField textField = getEditorTextField( editor ); + if( textField != null ) + textField.setOpaque( false ); updateEditorPadding(); updateEditorColors(); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableHeaderBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableHeaderBorder.java index f47dd5e3..7e554dce 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableHeaderBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableHeaderBorder.java @@ -25,6 +25,7 @@ import java.awt.Insets; import java.awt.geom.Rectangle2D; import javax.swing.JScrollBar; import javax.swing.JScrollPane; +import javax.swing.JViewport; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.table.JTableHeader; @@ -45,7 +46,7 @@ public class FlatTableHeaderBorder { protected Color separatorColor = UIManager.getColor( "TableHeader.separatorColor" ); protected Color bottomSeparatorColor = UIManager.getColor( "TableHeader.bottomSeparatorColor" ); - protected boolean showLastVerticalLine = UIManager.getBoolean( "TableHeader.showLastVerticalLine" ); + /** @since 1.6 */ protected boolean showTrailingVerticalLine = UIManager.getBoolean( "TableHeader.showTrailingVerticalLine" ); public FlatTableHeaderBorder() { super( UIManager.getInsets( "TableHeader.cellMargins" ) ); @@ -138,15 +139,23 @@ public class FlatTableHeaderBorder } protected boolean hideTrailingVerticalLine( JTableHeader header ) { - if( showLastVerticalLine ) + if( showTrailingVerticalLine ) return false; + // do not hide if table header is not a child of a scroll pane Container viewport = header.getParent(); Container viewportParent = (viewport != null) ? viewport.getParent() : null; if( !(viewportParent instanceof JScrollPane) ) - return true; + return false; - JScrollBar vsb = ((JScrollPane)viewportParent).getVerticalScrollBar(); + // do not hide if table header is not the column header of the scroll pane + JScrollPane scrollPane = (JScrollPane) viewportParent; + JViewport columnHeader = scrollPane.getColumnHeader(); + if( viewport != columnHeader ) + return false; + + // hide if vertical scroll bar is not shown + JScrollBar vsb = scrollPane.getVerticalScrollBar(); if( vsb == null || !vsb.isVisible() ) return true; diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableHeaderUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableHeaderUI.java index 2ef37e0b..663e2fca 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableHeaderUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableHeaderUI.java @@ -66,7 +66,7 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault TableHeader.cellMargins Insets * @uiDefault TableHeader.separatorColor Color * @uiDefault TableHeader.bottomSeparatorColor Color - * @uiDefault TableHeader.showLastVerticalLine boolean + * @uiDefault TableHeader.showTrailingVerticalLine boolean * * * diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableUI.java index 4d2f43ab..16ade184 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableUI.java @@ -75,7 +75,7 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault Table.rowHeight int * @uiDefault Table.showHorizontalLines boolean * @uiDefault Table.showVerticalLines boolean - * @uiDefault Table.showLastVerticalLine boolean + * @uiDefault Table.showTrailingVerticalLine boolean * @uiDefault Table.intercellSpacing Dimension * @uiDefault Table.selectionInactiveBackground Color * @uiDefault Table.selectionInactiveForeground Color @@ -98,7 +98,7 @@ public class FlatTableUI { protected boolean showHorizontalLines; protected boolean showVerticalLines; - protected boolean showLastVerticalLine; + /** @since 1.6 */ protected boolean showTrailingVerticalLine; protected Dimension intercellSpacing; @Styleable protected Color selectionBackground; @@ -135,7 +135,7 @@ public class FlatTableUI showHorizontalLines = UIManager.getBoolean( "Table.showHorizontalLines" ); showVerticalLines = UIManager.getBoolean( "Table.showVerticalLines" ); - showLastVerticalLine = UIManager.getBoolean( "Table.showLastVerticalLine" ); + showTrailingVerticalLine = UIManager.getBoolean( "Table.showTrailingVerticalLine" ); intercellSpacing = UIManager.getDimension( "Table.intercellSpacing" ); selectionBackground = UIManager.getColor( "Table.selectionBackground" ); @@ -392,9 +392,10 @@ public class FlatTableUI } protected boolean hideLastVerticalLine() { - if( showLastVerticalLine ) + if( showTrailingVerticalLine ) return false; + // do not hide if table is not a child of a scroll pane Container viewport = SwingUtilities.getUnwrappedParent( table ); Container viewportParent = (viewport != null) ? viewport.getParent() : null; if( !(viewportParent instanceof JScrollPane) ) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/JBRCustomDecorations.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/JBRCustomDecorations.java index 7acac163..3cd6156d 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/JBRCustomDecorations.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/JBRCustomDecorations.java @@ -70,9 +70,10 @@ public class JBRCustomDecorations return null; // check whether root pane already has a parent, which is the case when switching LaF - Window window = SwingUtilities.windowForComponent( rootPane ); - if( window != null ) { - FlatNativeWindowBorder.install( window ); + Container parent = rootPane.getParent(); + if( parent != null ) { + if( parent instanceof Window ) + FlatNativeWindowBorder.install( (Window) parent ); return null; } @@ -110,9 +111,9 @@ public class JBRCustomDecorations // since it is actually not possible to uninstall JBR decorations, // simply reduce titleBarHeight so that it is still possible to resize window // and remove hitTestSpots - Window window = SwingUtilities.windowForComponent( rootPane ); - if( window != null ) - setHasCustomDecoration( window, false ); + Container parent = rootPane.getParent(); + if( parent instanceof Window ) + setHasCustomDecoration( (Window) parent, false ); } static boolean hasCustomDecoration( Window window ) { diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties index 77b28abc..b1876838 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties @@ -628,7 +628,7 @@ TabbedPane.closeCrossLineWidth = {float}1 Table.rowHeight = 20 Table.showHorizontalLines = false Table.showVerticalLines = false -Table.showLastVerticalLine = false +Table.showTrailingVerticalLine = false Table.consistentHomeEndKeyBehavior = true Table.intercellSpacing = {dimension}0,0 Table.scrollPaneBorder = com.formdev.flatlaf.ui.FlatBorder @@ -658,7 +658,7 @@ TableHeader.cellBorder = com.formdev.flatlaf.ui.FlatTableHeaderBorder TableHeader.cellMargins = 2,3,2,3 TableHeader.focusCellBackground = $TableHeader.background TableHeader.background = @textComponentBackground -TableHeader.showLastVerticalLine = false +TableHeader.showTrailingVerticalLine = false #---- TextArea ---- diff --git a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt index 7078e1ca..93b118b9 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt @@ -1078,7 +1078,7 @@ Table.selectionForeground #bbbbbb HSL 0 0 73 javax.swing.plaf.Colo Table.selectionInactiveBackground #0d293e HSL 206 65 15 javax.swing.plaf.ColorUIResource [UI] Table.selectionInactiveForeground #bbbbbb HSL 0 0 73 javax.swing.plaf.ColorUIResource [UI] Table.showHorizontalLines false -Table.showLastVerticalLine false +Table.showTrailingVerticalLine false Table.showVerticalLines false Table.sortIconColor #adadad HSL 0 0 68 javax.swing.plaf.ColorUIResource [UI] @@ -1094,7 +1094,7 @@ TableHeader.font [active] $defaultFont [UI] TableHeader.foreground #bbbbbb HSL 0 0 73 javax.swing.plaf.ColorUIResource [UI] TableHeader.height 25 TableHeader.separatorColor #5e6364 HSL 190 3 38 javax.swing.plaf.ColorUIResource [UI] -TableHeader.showLastVerticalLine false +TableHeader.showTrailingVerticalLine false TableHeaderUI com.formdev.flatlaf.ui.FlatTableHeaderUI diff --git a/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt index 722b34f6..edf9ea1e 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt @@ -1083,7 +1083,7 @@ Table.selectionForeground #ffffff HSL 0 0 100 javax.swing.plaf.Colo Table.selectionInactiveBackground #d4d4d4 HSL 0 0 83 javax.swing.plaf.ColorUIResource [UI] Table.selectionInactiveForeground #000000 HSL 0 0 0 javax.swing.plaf.ColorUIResource [UI] Table.showHorizontalLines false -Table.showLastVerticalLine false +Table.showTrailingVerticalLine false Table.showVerticalLines false Table.sortIconColor #afafaf HSL 0 0 69 javax.swing.plaf.ColorUIResource [UI] @@ -1099,7 +1099,7 @@ TableHeader.font [active] $defaultFont [UI] TableHeader.foreground #000000 HSL 0 0 0 javax.swing.plaf.ColorUIResource [UI] TableHeader.height 25 TableHeader.separatorColor #e6e6e6 HSL 0 0 90 javax.swing.plaf.ColorUIResource [UI] -TableHeader.showLastVerticalLine false +TableHeader.showTrailingVerticalLine false TableHeaderUI com.formdev.flatlaf.ui.FlatTableHeaderUI diff --git a/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt index 394f5678..ba7d5eeb 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt @@ -1088,7 +1088,7 @@ Table.selectionForeground #ffff00 HSL 60 100 50 javax.swing.plaf.Colo Table.selectionInactiveBackground #888888 HSL 0 0 53 javax.swing.plaf.ColorUIResource [UI] Table.selectionInactiveForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] Table.showHorizontalLines false -Table.showLastVerticalLine false +Table.showTrailingVerticalLine false Table.showVerticalLines false Table.sortIconColor #ffff00 HSL 60 100 50 javax.swing.plaf.ColorUIResource [UI] @@ -1104,7 +1104,7 @@ TableHeader.font [active] $defaultFont [UI] TableHeader.foreground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] TableHeader.height 25 TableHeader.separatorColor #00ff00 HSL 120 100 50 javax.swing.plaf.ColorUIResource [UI] -TableHeader.showLastVerticalLine false +TableHeader.showTrailingVerticalLine false TableHeaderUI com.formdev.flatlaf.ui.FlatTableHeaderUI diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java index b74c3aa8..d63e1fd4 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java @@ -1621,6 +1621,10 @@ public class FlatComponentsTest // customRenderer.setBorder( new LineBorder( Color.red ) ); // comboBox1.setRenderer( customRenderer ); // comboBox3.setRenderer( customRenderer ); + + // for testing issue #382 +// spinner1.setModel( new SpinnerNumberModel( 0, null, 100, 1 ) ); +// comboBox1.setEditor( new BasicComboBoxEditor() ); } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatSingleComponentTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatSingleComponentTest.java index 2465c478..050a15be 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatSingleComponentTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatSingleComponentTest.java @@ -139,6 +139,8 @@ public class FlatSingleComponentTest applyComponentOrientation( getComponentOrientation().isLeftToRight() ? ComponentOrientation.RIGHT_TO_LEFT : ComponentOrientation.LEFT_TO_RIGHT ); + revalidate(); + repaint(); }, KeyStroke.getKeyStroke( "alt R" ), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java index b86fa60e..e3ad1e27 100644 --- a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java @@ -831,14 +831,14 @@ class FlatThemeFileEditor state.put( KEY_WINDOW_BOUNDS, x + "," + y + ',' + width + ',' + height ); } - private static void putPrefsBoolean( Preferences prefs, String key, boolean value, boolean defaultValue ) { + static void putPrefsBoolean( Preferences prefs, String key, boolean value, boolean defaultValue ) { if( value != defaultValue ) prefs.putBoolean( key, value ); else prefs.remove( key ); } - private static void putPrefsString( Preferences prefs, String key, String value ) { + static void putPrefsString( Preferences prefs, String key, String value ) { if( !StringUtils.isEmpty( value ) ) prefs.put( key, value ); else diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreview.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreview.java index f8239751..5872f8ad 100644 --- a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreview.java +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreview.java @@ -41,7 +41,11 @@ class FlatThemePreview private final FlatSyntaxTextArea textArea; private final Timer timer; - private final Preferences state; + final Preferences state; + + private final FlatThemePreviewAll allTab; + private final FlatThemePreviewButtons buttonsTab; + private final FlatThemePreviewSwitches switchesTab; private final Map lazyValueCache = new WeakHashMap<>(); private int runWithUIDefaultsGetterLevel; @@ -53,9 +57,12 @@ class FlatThemePreview initComponents(); // add tabs - tabbedPane.addTab( "All", createPreviewTab( new FlatThemePreviewAll( this ) ) ); - tabbedPane.addTab( "Buttons", createPreviewTab( new FlatThemePreviewButtons() ) ); - tabbedPane.addTab( "Switches", createPreviewTab( new FlatThemePreviewSwitches() ) ); + allTab = new FlatThemePreviewAll( this ); + buttonsTab = new FlatThemePreviewButtons( this ); + switchesTab = new FlatThemePreviewSwitches(); + tabbedPane.addTab( "All", createPreviewTab( allTab ) ); + tabbedPane.addTab( "Buttons", createPreviewTab( buttonsTab ) ); + tabbedPane.addTab( "Switches", createPreviewTab( switchesTab ) ); selectRecentTab(); tabbedPane.addChangeListener( e -> selectedTabChanged() ); @@ -85,8 +92,14 @@ class FlatThemePreview private void selectRecentTab() { int selectedTab = state.getInt( KEY_SELECTED_TAB, -1 ); - if( selectedTab >= 0 && selectedTab < tabbedPane.getTabCount() ) + if( selectedTab >= 0 && selectedTab < tabbedPane.getTabCount() ) { tabbedPane.setSelectedIndex( selectedTab ); + + switch( selectedTab ) { + case 0: allTab.activated(); break; + case 1: buttonsTab.activated(); break; + } + } } private void selectedTabChanged() { diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreviewAll.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreviewAll.java index 9f6c2542..b9dac102 100644 --- a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreviewAll.java +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreviewAll.java @@ -19,6 +19,7 @@ package com.formdev.flatlaf.themeeditor; import java.awt.*; import java.awt.event.ActionEvent; +import java.beans.Beans; import java.beans.PropertyVetoException; import java.util.function.Function; import java.util.function.Predicate; @@ -39,6 +40,11 @@ import net.miginfocom.swing.*; class FlatThemePreviewAll extends JPanel { + private static final String KEY_ENABLED = "preview.enabled"; + private static final String KEY_EDITABLE = "preview.editable"; + private static final String KEY_FOCUSED = "preview.focused"; + private static final String KEY_MENU_UNDERLINE_SELECTION = "preview.menuUnderlineSelection"; + private final FlatThemePreview preview; FlatThemePreviewAll( FlatThemePreview preview ) { @@ -78,6 +84,33 @@ class FlatThemePreviewAll } ); } + void activated() { + boolean enabled = preview.state.getBoolean( KEY_ENABLED, true ); + boolean editable = preview.state.getBoolean( KEY_EDITABLE, true ); + boolean focused = preview.state.getBoolean( KEY_FOCUSED, false ); + boolean menuUnderlineSelection = preview.state.getBoolean( KEY_MENU_UNDERLINE_SELECTION, false ); + + if( enabled != enabledCheckBox.isSelected() ) { + enabledCheckBox.setSelected( enabled ); + enabledChanged(); + } + + if( editable != editableCheckBox.isSelected() ) { + editableCheckBox.setSelected( editable ); + editableChanged(); + } + + if( focused != focusedCheckBox.isSelected() ) { + focusedCheckBox.setSelected( focused ); + focusedChanged(); + } + + if( menuUnderlineSelection != menuUnderlineSelectionButton.isSelected() ) { + menuUnderlineSelectionButton.setSelected( menuUnderlineSelection ); + menuUnderlineSelectionChanged(); + } + } + private void enabledChanged() { boolean enabled = enabledCheckBox.isSelected(); @@ -89,10 +122,12 @@ class FlatThemePreviewAll preview.runWithUIDefaultsGetter( () -> { enableDisable( this, enabled ); } ); + + FlatThemeFileEditor.putPrefsBoolean( preview.state, KEY_ENABLED, enabled, true ); } private void enableDisable( Component comp, boolean enabled ) { - if( comp != enabledCheckBox && comp != focusedCheckBox && comp != menu2 ) + if( !isControlComponent( comp ) ) comp.setEnabled( enabled ); if( !(comp instanceof Container) || comp instanceof JInternalFrame ) @@ -119,16 +154,38 @@ class FlatThemePreviewAll } } + private void editableChanged() { + boolean editable = editableCheckBox.isSelected(); + + preview.runWithUIDefaultsGetter( () -> { + textField1.setEditable( editable ); + formattedTextField1.setEditable( editable ); + passwordField1.setEditable( editable ); + textArea1.setEditable( editable ); + editorPane1.setEditable( editable ); + textPane1.setEditable( editable ); + + editorPane1.updateUI(); + textPane1.updateUI(); + } ); + + FlatThemeFileEditor.putPrefsBoolean( preview.state, KEY_EDITABLE, editable, true ); + } + private void focusedChanged() { - Predicate value = focusedCheckBox.isSelected() && enabledCheckBox.isSelected() + boolean focused = focusedCheckBox.isSelected(); + + Predicate value = focused && enabledCheckBox.isSelected() ? value = c -> true : null; focusComponent( this, value ); repaint(); + + FlatThemeFileEditor.putPrefsBoolean( preview.state, KEY_FOCUSED, focused,false ); } private void focusComponent( Component comp, Object value ) { - if( comp != enabledCheckBox && comp != focusedCheckBox && comp != menu2 && comp instanceof JComponent ) + if( !isControlComponent( comp ) && comp instanceof JComponent ) ((JComponent)comp).putClientProperty( FlatClientProperties.COMPONENT_FOCUS_OWNER, value ); if( !(comp instanceof Container) || comp instanceof JInternalFrame ) @@ -142,6 +199,21 @@ class FlatThemePreviewAll } } + private boolean isControlComponent( Component c ) { + return c == enabledCheckBox || + c == editableCheckBox || + c == focusedCheckBox || + c == menuUnderlineSelectionButton || + c == menu2; + } + + private void menuUnderlineSelectionChanged() { + boolean menuUnderlineSelection = menuUnderlineSelectionButton.isSelected(); + UIManager.put( "MenuItem.selectionType", menuUnderlineSelection ? "underline" : null ); + + FlatThemeFileEditor.putPrefsBoolean( preview.state, KEY_MENU_UNDERLINE_SELECTION, menuUnderlineSelection, false ); + } + private void changeProgress() { int value = slider3.getValue(); progressBar1.setValue( value ); @@ -165,7 +237,9 @@ class FlatThemePreviewAll private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + JPanel hSpacer1 = new JPanel(null); enabledCheckBox = new JCheckBox(); + editableCheckBox = new JCheckBox(); focusedCheckBox = new JCheckBox(); JLabel labelLabel = new JLabel(); JLabel label1 = new JLabel(); @@ -173,20 +247,15 @@ class FlatThemePreviewAll JLabel buttonLabel = new JLabel(); JButton button1 = new JButton(); FlatThemePreviewAll.PreviewDefaultButton testDefaultButton1 = new FlatThemePreviewAll.PreviewDefaultButton(); - FlatButton helpButton = new FlatButton(); - JPanel hSpacer2 = new JPanel(null); JLabel toggleButtonLabel = new JLabel(); JToggleButton toggleButton1 = new JToggleButton(); JToggleButton toggleButton3 = new JToggleButton(); - JPanel hSpacer1 = new JPanel(null); JLabel checkBoxLabel = new JLabel(); JCheckBox checkBox1 = new JCheckBox(); JCheckBox checkBox3 = new JCheckBox(); - JPanel hSpacer3 = new JPanel(null); JLabel radioButtonLabel = new JLabel(); JRadioButton radioButton1 = new JRadioButton(); JRadioButton radioButton3 = new JRadioButton(); - JPanel hSpacer4 = new JPanel(null); JLabel comboBoxLabel = new JLabel(); FlatComboBox comboBox1 = new FlatComboBox<>(); JComboBox comboBox3 = new JComboBox<>(); @@ -194,16 +263,17 @@ class FlatThemePreviewAll JSpinner spinner1 = new JSpinner(); JLabel textFieldLabel = new JLabel(); textField1 = new FlatTextField(); - FlatFormattedTextField formattedTextField1 = new FlatFormattedTextField(); - FlatPasswordField passwordField1 = new FlatPasswordField(); + formattedTextField1 = new FlatFormattedTextField(); + passwordField1 = new FlatPasswordField(); JLabel textAreaLabel = new JLabel(); JScrollPane scrollPane1 = new JScrollPane(); - JTextArea textArea1 = new JTextArea(); + textArea1 = new JTextArea(); JScrollPane scrollPane5 = new JScrollPane(); - JEditorPane editorPane1 = new JEditorPane(); + editorPane1 = new JEditorPane(); JScrollPane scrollPane9 = new JScrollPane(); - JTextPane textPane1 = new JTextPane(); + textPane1 = new JTextPane(); JLabel menuBarLabel = new JLabel(); + menuUnderlineSelectionButton = new FlatToggleButton(); JMenuBar menuBar1 = new JMenuBar(); menu2 = new JMenu(); JMenuItem menuItem3 = new JMenuItem(); @@ -239,6 +309,7 @@ class FlatThemePreviewAll JButton button6 = new JButton(); JToggleButton button7 = new JToggleButton(); JToggleButton button8 = new JToggleButton(); + JToggleButton button9 = new JToggleButton(); JLabel tabbedPaneLabel = new JLabel(); tabbedPane1 = new FlatThemePreviewAll.PreviewTabbedPane(); JLabel listTreeLabel = new JLabel(); @@ -260,15 +331,10 @@ class FlatThemePreviewAll "insets dialog,hidemode 3", // columns "[fill]" + - "[130,fill]", + "[60,sizegroup 1,fill]" + + "[60,sizegroup 1,fill]", // rows - "[]unrel" + - "[]" + - "[]" + - "[]" + - "[]" + - "[]" + - "[]" + + "[]para" + "[]" + "[]" + "[]" + @@ -278,9 +344,14 @@ class FlatThemePreviewAll "[]" + "[]" + "[]" + + "[fill]" + + "[]" + + "[]4" + "[]" + "[]" + + "[]0" + "[]" + + "[]0" + "[]" + "[]" + "[]" + @@ -289,17 +360,24 @@ class FlatThemePreviewAll "[]" + "[100,fill]" + "[grow]")); + add(hSpacer1, "cell 0 0 3 1,growx"); //---- enabledCheckBox ---- enabledCheckBox.setText("Enabled"); enabledCheckBox.setSelected(true); enabledCheckBox.addActionListener(e -> enabledChanged()); - add(enabledCheckBox, "cell 0 0 2 1,alignx left,growx 0"); + add(enabledCheckBox, "cell 0 0 3 1"); + + //---- editableCheckBox ---- + editableCheckBox.setText("Editable"); + editableCheckBox.setSelected(true); + editableCheckBox.addActionListener(e -> editableChanged()); + add(editableCheckBox, "cell 0 0 3 1"); //---- focusedCheckBox ---- focusedCheckBox.setText("Focused"); focusedCheckBox.addActionListener(e -> focusedChanged()); - add(focusedCheckBox, "cell 0 0 2 1"); + add(focusedCheckBox, "cell 0 0 3 1"); //---- labelLabel ---- labelLabel.setText("JLabel:"); @@ -307,7 +385,7 @@ class FlatThemePreviewAll //---- label1 ---- label1.setText("Some Text"); - add(label1, "cell 1 1"); + add(label1, "cell 1 1 2 1"); //---- flatButton1 ---- flatButton1.setText("Help"); @@ -321,16 +399,11 @@ class FlatThemePreviewAll //---- button1 ---- button1.setText("OK"); - add(button1, "cell 1 2,alignx left,growx 0"); + add(button1, "cell 1 2"); //---- testDefaultButton1 ---- testDefaultButton1.setText("Default"); - add(testDefaultButton1, "cell 1 2"); - - //---- helpButton ---- - helpButton.setButtonType(FlatButton.ButtonType.help); - add(helpButton, "cell 1 2"); - add(hSpacer2, "cell 1 2"); + add(testDefaultButton1, "cell 2 2"); //---- toggleButtonLabel ---- toggleButtonLabel.setText("JToggleButton:"); @@ -338,13 +411,12 @@ class FlatThemePreviewAll //---- toggleButton1 ---- toggleButton1.setText("Unselected"); - add(toggleButton1, "cell 1 3,alignx left,growx 0"); + add(toggleButton1, "cell 1 3"); //---- toggleButton3 ---- toggleButton3.setText("Selected"); toggleButton3.setSelected(true); - add(toggleButton3, "cell 1 3"); - add(hSpacer1, "cell 1 3"); + add(toggleButton3, "cell 2 3"); //---- checkBoxLabel ---- checkBoxLabel.setText("JCheckBox"); @@ -357,8 +429,7 @@ class FlatThemePreviewAll //---- checkBox3 ---- checkBox3.setText("Selected"); checkBox3.setSelected(true); - add(checkBox3, "cell 1 4,alignx left,growx 0"); - add(hSpacer3, "cell 1 4"); + add(checkBox3, "cell 2 4,alignx left,growx 0"); //---- radioButtonLabel ---- radioButtonLabel.setText("JRadioButton:"); @@ -371,8 +442,7 @@ class FlatThemePreviewAll //---- radioButton3 ---- radioButton3.setText("Selected"); radioButton3.setSelected(true); - add(radioButton3, "cell 1 5,alignx left,growx 0"); - add(hSpacer4, "cell 1 5"); + add(radioButton3, "cell 2 5,alignx left,growx 0"); //---- comboBoxLabel ---- comboBoxLabel.setText("JComboBox:"); @@ -396,7 +466,7 @@ class FlatThemePreviewAll })); comboBox1.setMaximumRowCount(6); comboBox1.setPlaceholderText("placeholder text"); - add(comboBox1, "cell 1 6,width 50"); + add(comboBox1, "cell 1 6"); //---- comboBox3 ---- comboBox3.setModel(new DefaultComboBoxModel<>(new String[] { @@ -414,12 +484,12 @@ class FlatThemePreviewAll "kkk" })); comboBox3.setMaximumRowCount(6); - add(comboBox3, "cell 1 6,width 50"); + add(comboBox3, "cell 2 6"); //---- spinnerLabel ---- spinnerLabel.setText("JSpinner:"); add(spinnerLabel, "cell 0 7"); - add(spinner1, "cell 1 7"); + add(spinner1, "cell 1 7 2 1"); //---- textFieldLabel ---- textFieldLabel.setText("JTextField:
JFormattedTextF.:
JPasswordField:"); @@ -428,21 +498,21 @@ class FlatThemePreviewAll //---- textField1 ---- textField1.setText("Some Text"); textField1.setPlaceholderText("placeholder text"); - add(textField1, "cell 1 8"); + add(textField1, "cell 1 8 2 1"); //---- formattedTextField1 ---- formattedTextField1.setText("Some Text"); formattedTextField1.setPlaceholderText("placeholder text"); - add(formattedTextField1, "cell 1 9,width 50"); + add(formattedTextField1, "cell 1 9"); //---- passwordField1 ---- passwordField1.setText("Some Text"); passwordField1.setPlaceholderText("placeholder text"); - add(passwordField1, "cell 1 9,width 50"); + add(passwordField1, "cell 2 9"); //---- textAreaLabel ---- - textAreaLabel.setText("JTextArea:

JEditorPane:
JTextPane:"); - add(textAreaLabel, "cell 0 10 1 2"); + textAreaLabel.setText("JTextArea:
JEditorPane:
JTextPane:"); + add(textAreaLabel, "cell 0 10"); //======== scrollPane1 ======== { @@ -450,11 +520,11 @@ class FlatThemePreviewAll scrollPane1.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textArea1 ---- - textArea1.setText("Some Text"); + textArea1.setText("Text"); textArea1.setRows(2); scrollPane1.setViewportView(textArea1); } - add(scrollPane1, "cell 1 10"); + add(scrollPane1, "cell 1 10 2 1,width 40"); //======== scrollPane5 ======== { @@ -462,10 +532,10 @@ class FlatThemePreviewAll scrollPane5.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- editorPane1 ---- - editorPane1.setText("Some Text"); + editorPane1.setText("Text"); scrollPane5.setViewportView(editorPane1); } - add(scrollPane5, "cell 1 11,width 50"); + add(scrollPane5, "cell 1 10 2 1,width 40"); //======== scrollPane9 ======== { @@ -473,14 +543,23 @@ class FlatThemePreviewAll scrollPane9.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textPane1 ---- - textPane1.setText("Some Text"); + textPane1.setText("Text"); scrollPane9.setViewportView(textPane1); } - add(scrollPane9, "cell 1 11,width 50"); + add(scrollPane9, "cell 1 10 2 1,width 40"); //---- menuBarLabel ---- menuBarLabel.setText("JMenuBar:"); - add(menuBarLabel, "cell 0 12"); + add(menuBarLabel, "cell 0 11"); + + //---- menuUnderlineSelectionButton ---- + menuUnderlineSelectionButton.setText("_"); + menuUnderlineSelectionButton.setButtonType(FlatButton.ButtonType.toolBarButton); + menuUnderlineSelectionButton.setToolTipText("menu underline selection"); + menuUnderlineSelectionButton.setFocusable(false); + menuUnderlineSelectionButton.setFont(menuUnderlineSelectionButton.getFont().deriveFont(menuUnderlineSelectionButton.getFont().getSize() - 2f)); + menuUnderlineSelectionButton.addActionListener(e -> menuUnderlineSelectionChanged()); + add(menuUnderlineSelectionButton, "cell 0 11"); //======== menuBar1 ======== { @@ -558,33 +637,33 @@ class FlatThemePreviewAll } menuBar1.add(menu3); } - add(menuBar1, "cell 1 12"); + add(menuBar1, "cell 1 11 2 1"); //---- scrollBarLabel ---- scrollBarLabel.setText("JScrollBar:"); - add(scrollBarLabel, "cell 0 13"); + add(scrollBarLabel, "cell 0 12 1 2,aligny top,growy 0"); //---- scrollBar1 ---- scrollBar1.setOrientation(Adjustable.HORIZONTAL); - add(scrollBar1, "cell 1 13"); + add(scrollBar1, "cell 1 12 2 1"); //---- scrollBar5 ---- scrollBar5.setOrientation(Adjustable.HORIZONTAL); scrollBar5.setShowButtons(true); - add(scrollBar5, "cell 1 14"); + add(scrollBar5, "cell 1 13 2 1"); //---- separatorLabel ---- separatorLabel.setText("JSeparator:"); - add(separatorLabel, "cell 0 15"); - add(separator1, "cell 1 15"); + add(separatorLabel, "cell 0 14"); + add(separator1, "cell 1 14 2 1"); //---- sliderLabel ---- sliderLabel.setText("JSlider:"); - add(sliderLabel, "cell 0 16"); + add(sliderLabel, "cell 0 15"); //---- slider1 ---- slider1.setValue(30); - add(slider1, "cell 1 16"); + add(slider1, "cell 1 15 2 1,width 100"); //---- slider3 ---- slider3.setMinorTickSpacing(10); @@ -593,32 +672,32 @@ class FlatThemePreviewAll slider3.setPaintLabels(true); slider3.setValue(30); slider3.addChangeListener(e -> changeProgress()); - add(slider3, "cell 1 17"); + add(slider3, "cell 1 16 2 1,width 100"); //---- progressBarLabel ---- progressBarLabel.setText("JProgressBar:"); - add(progressBarLabel, "cell 0 18"); + add(progressBarLabel, "cell 0 17"); //---- progressBar1 ---- progressBar1.setValue(60); - add(progressBar1, "cell 1 18"); + add(progressBar1, "cell 1 17 2 1"); //---- progressBar2 ---- progressBar2.setValue(50); progressBar2.setStringPainted(true); - add(progressBar2, "cell 1 19"); + add(progressBar2, "cell 1 18 2 1"); //---- toolTipLabel ---- toolTipLabel.setText("JToolTip:"); - add(toolTipLabel, "cell 0 20"); + add(toolTipLabel, "cell 0 19"); //---- toolTip1 ---- toolTip1.setTipText("Some text in tool tip."); - add(toolTip1, "cell 1 20,alignx left,growx 0"); + add(toolTip1, "cell 1 19 2 1,alignx left,growx 0"); //---- toolBarLabel ---- toolBarLabel.setText("JToolBar:"); - add(toolBarLabel, "cell 0 21"); + add(toolBarLabel, "cell 0 20"); //======== toolBar1 ======== { @@ -640,17 +719,22 @@ class FlatThemePreviewAll button8.setIcon(UIManager.getIcon("Tree.leafIcon")); button8.setSelected(true); toolBar1.add(button8); + + //---- button9 ---- + button9.setIcon(UIManager.getIcon("Tree.leafIcon")); + button9.setSelected(true); + toolBar1.add(button9); } - add(toolBar1, "cell 1 21"); + add(toolBar1, "cell 1 20 2 1"); //---- tabbedPaneLabel ---- tabbedPaneLabel.setText("JTabbedPane:"); - add(tabbedPaneLabel, "cell 0 22"); - add(tabbedPane1, "cell 1 22"); + add(tabbedPaneLabel, "cell 0 21"); + add(tabbedPane1, "cell 1 21 2 1"); //---- listTreeLabel ---- listTreeLabel.setText("JList / JTree:
JSplitPane:"); - add(listTreeLabel, "cell 0 23,aligny top,growy 0"); + add(listTreeLabel, "cell 0 22,aligny top,growy 0"); //======== splitPane1 ======== { @@ -693,11 +777,11 @@ class FlatThemePreviewAll } splitPane1.setRightComponent(scrollPane3); } - add(splitPane1, "cell 1 23,height 50"); + add(splitPane1, "cell 1 22 2 1,height 50"); //---- tableLabel ---- tableLabel.setText("JTable:"); - add(tableLabel, "cell 0 24"); + add(tableLabel, "cell 0 23"); //======== scrollPane4 ======== { @@ -714,11 +798,11 @@ class FlatThemePreviewAll )); scrollPane4.setViewportView(table1); } - add(scrollPane4, "cell 1 24,height 70"); + add(scrollPane4, "cell 1 23 2 1,width 100,height 70"); //---- internalFrameLabel ---- internalFrameLabel.setText("JDesktopPane:
JInternalFrame:"); - add(internalFrameLabel, "cell 0 25,aligny top,growy 0"); + add(internalFrameLabel, "cell 0 24,aligny top,growy 0"); //======== desktopPane1 ======== { @@ -751,7 +835,7 @@ class FlatThemePreviewAll desktopPane1.add(internalFrame2, JLayeredPane.DEFAULT_LAYER); internalFrame2.setBounds(new Rectangle(new Point(5, 50), internalFrame2.getPreferredSize())); } - add(desktopPane1, "cell 1 25"); + add(desktopPane1, "cell 1 24 2 1"); //---- buttonGroup1 ---- ButtonGroup buttonGroup1 = new ButtonGroup(); @@ -767,8 +851,15 @@ class FlatThemePreviewAll // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables private JCheckBox enabledCheckBox; + private JCheckBox editableCheckBox; private JCheckBox focusedCheckBox; private FlatTextField textField1; + private FlatFormattedTextField formattedTextField1; + private FlatPasswordField passwordField1; + private JTextArea textArea1; + private JEditorPane editorPane1; + private JTextPane textPane1; + private FlatToggleButton menuUnderlineSelectionButton; private JMenu menu2; private JSlider slider1; private JSlider slider3; @@ -804,7 +895,10 @@ class FlatThemePreviewAll @Override public void updateUI() { - setUI( new PreviewFlatTabbedPaneUI( uiDefaultsGetter ) ); + if( !Beans.isDesignTime() ) + setUI( new PreviewFlatTabbedPaneUI( uiDefaultsGetter ) ); + else + super.updateUI(); } } @@ -848,10 +942,13 @@ class FlatThemePreviewAll @Override public void paint( Graphics g ) { - // needed for DefaultTableCellRenderer - FlatLaf.runWithUIDefaultsGetter( uiDefaultsGetter, () -> { + if( !Beans.isDesignTime() ) { + // needed for DefaultTableCellRenderer + FlatLaf.runWithUIDefaultsGetter( uiDefaultsGetter, () -> { + super.paint( g ); + } ); + } else super.paint( g ); - } ); } } } diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreviewAll.jfd b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreviewAll.jfd index 34b3de15..1a25ffb7 100644 --- a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreviewAll.jfd +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreviewAll.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.4.0.360" Java: "16" encoding: "UTF-8" +JFDML JFormDesigner: "999.9.9.9.9999" Java: "1.8.0_202" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -8,10 +8,15 @@ new FormModel { } add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "insets dialog,hidemode 3" - "$columnConstraints": "[fill][130,fill]" - "$rowConstraints": "[]unrel[][][][][][][][][][][][][][][][][][][][][][][][][100,fill][grow]" + "$columnConstraints": "[fill][60,sizegroup 1,fill][60,sizegroup 1,fill]" + "$rowConstraints": "[]para[][][][][][][][][][fill][][]4[][][]0[][]0[][][][][][][100,fill][grow]" } ) { name: "this" + add( new FormComponent( "com.jformdesigner.designer.wrapper.HSpacer" ) { + name: "hSpacer1" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0 3 1,growx" + } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "enabledCheckBox" "text": "Enabled" @@ -21,7 +26,18 @@ new FormModel { } addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "enabledChanged", false ) ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 0 2 1,alignx left,growx 0" + "value": "cell 0 0 3 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "editableCheckBox" + "text": "Editable" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "editableChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0 3 1" } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "focusedCheckBox" @@ -31,7 +47,7 @@ new FormModel { } addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "focusedChanged", false ) ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 0 2 1" + "value": "cell 0 0 3 1" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "labelLabel" @@ -43,7 +59,7 @@ new FormModel { name: "label1" "text": "Some Text" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 1" + "value": "cell 1 1 2 1" } ) add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatButton" ) { name: "flatButton1" @@ -63,24 +79,13 @@ new FormModel { name: "button1" "text": "OK" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 2,alignx left,growx 0" + "value": "cell 1 2" } ) add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewAll$PreviewDefaultButton" ) { name: "testDefaultButton1" "text": "Default" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 2" - } ) - add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatButton" ) { - name: "helpButton" - "buttonType": enum com.formdev.flatlaf.extras.components.FlatButton$ButtonType help - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 2" - } ) - add( new FormComponent( "com.jformdesigner.designer.wrapper.HSpacer" ) { - name: "hSpacer2" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 2" + "value": "cell 2 2" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "toggleButtonLabel" @@ -92,19 +97,14 @@ new FormModel { name: "toggleButton1" "text": "Unselected" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 3,alignx left,growx 0" + "value": "cell 1 3" } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton3" "text": "Selected" "selected": true }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 3" - } ) - add( new FormComponent( "com.jformdesigner.designer.wrapper.HSpacer" ) { - name: "hSpacer1" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 3" + "value": "cell 2 3" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "checkBoxLabel" @@ -123,12 +123,7 @@ new FormModel { "text": "Selected" "selected": true }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 4,alignx left,growx 0" - } ) - add( new FormComponent( "com.jformdesigner.designer.wrapper.HSpacer" ) { - name: "hSpacer3" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 4" + "value": "cell 2 4,alignx left,growx 0" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "radioButtonLabel" @@ -149,12 +144,7 @@ new FormModel { "selected": true "$buttonGroup": new FormReference( "buttonGroup1" ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 5,alignx left,growx 0" - } ) - add( new FormComponent( "com.jformdesigner.designer.wrapper.HSpacer" ) { - name: "hSpacer4" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 5" + "value": "cell 2 5,alignx left,growx 0" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "comboBoxLabel" @@ -186,7 +176,7 @@ new FormModel { "JavaCodeGenerator.typeParameters": "String" } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 6,width 50" + "value": "cell 1 6" } ) add( new FormComponent( "javax.swing.JComboBox" ) { name: "comboBox3" @@ -207,7 +197,7 @@ new FormModel { } "maximumRowCount": 6 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 6,width 50" + "value": "cell 2 6" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "spinnerLabel" @@ -218,7 +208,7 @@ new FormModel { add( new FormComponent( "javax.swing.JSpinner" ) { name: "spinner1" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 7" + "value": "cell 1 7 2 1" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "textFieldLabel" @@ -234,27 +224,33 @@ new FormModel { "JavaCodeGenerator.variableLocal": false } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 8" + "value": "cell 1 8 2 1" } ) add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatFormattedTextField" ) { name: "formattedTextField1" "text": "Some Text" "placeholderText": "placeholder text" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 9,width 50" + "value": "cell 1 9" } ) add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatPasswordField" ) { name: "passwordField1" "text": "Some Text" "placeholderText": "placeholder text" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 9,width 50" + "value": "cell 2 9" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "textAreaLabel" - "text": "JTextArea:

JEditorPane:
JTextPane:" + "text": "JTextArea:
JEditorPane:
JTextPane:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 10 1 2" + "value": "cell 0 10" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane1" @@ -262,11 +258,14 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextArea" ) { name: "textArea1" - "text": "Some Text" + "text": "Text" "rows": 2 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 10" + "value": "cell 1 10 2 1,width 40" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane5" @@ -274,10 +273,13 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JEditorPane" ) { name: "editorPane1" - "text": "Some Text" + "text": "Text" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 11,width 50" + "value": "cell 1 10 2 1,width 40" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane9" @@ -285,16 +287,33 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextPane" ) { name: "textPane1" - "text": "Some Text" + "text": "Text" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 11,width 50" + "value": "cell 1 10 2 1,width 40" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "menuBarLabel" "text": "JMenuBar:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 12" + "value": "cell 0 11" + } ) + add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatToggleButton" ) { + name: "menuUnderlineSelectionButton" + "text": "_" + "buttonType": enum com.formdev.flatlaf.extras.components.FlatButton$ButtonType toolBarButton + "toolTipText": "menu underline selection" + "focusable": false + "font": new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuUnderlineSelectionChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 11" } ) add( new FormContainer( "javax.swing.JMenuBar", new FormLayoutManager( class javax.swing.JMenuBar ) ) { name: "menuBar1" @@ -375,43 +394,43 @@ new FormModel { } ) } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 12" + "value": "cell 1 11 2 1" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "scrollBarLabel" "text": "JScrollBar:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 13" + "value": "cell 0 12 1 2,aligny top,growy 0" } ) add( new FormComponent( "javax.swing.JScrollBar" ) { name: "scrollBar1" "orientation": 0 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 13" + "value": "cell 1 12 2 1" } ) add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatScrollBar" ) { name: "scrollBar5" "orientation": 0 "showButtons": true }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 14" + "value": "cell 1 13 2 1" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "separatorLabel" "text": "JSeparator:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 15" + "value": "cell 0 14" } ) add( new FormComponent( "javax.swing.JSeparator" ) { name: "separator1" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 15" + "value": "cell 1 14 2 1" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "sliderLabel" "text": "JSlider:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 16" + "value": "cell 0 15" } ) add( new FormComponent( "javax.swing.JSlider" ) { name: "slider1" @@ -420,7 +439,7 @@ new FormModel { "JavaCodeGenerator.variableLocal": false } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 16" + "value": "cell 1 15 2 1,width 100" } ) add( new FormComponent( "javax.swing.JSlider" ) { name: "slider3" @@ -434,13 +453,13 @@ new FormModel { } addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "changeProgress", false ) ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 17" + "value": "cell 1 16 2 1,width 100" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "progressBarLabel" "text": "JProgressBar:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 18" + "value": "cell 0 17" } ) add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatProgressBar" ) { name: "progressBar1" @@ -449,7 +468,7 @@ new FormModel { "JavaCodeGenerator.variableLocal": false } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 18" + "value": "cell 1 17 2 1" } ) add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatProgressBar" ) { name: "progressBar2" @@ -459,25 +478,25 @@ new FormModel { "JavaCodeGenerator.variableLocal": false } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 19" + "value": "cell 1 18 2 1" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "toolTipLabel" "text": "JToolTip:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 20" + "value": "cell 0 19" } ) add( new FormComponent( "javax.swing.JToolTip" ) { name: "toolTip1" "tipText": "Some text in tool tip." }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 20,alignx left,growx 0" + "value": "cell 1 19 2 1,alignx left,growx 0" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "toolBarLabel" "text": "JToolBar:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 21" + "value": "cell 0 20" } ) add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { name: "toolBar1" @@ -504,14 +523,19 @@ new FormModel { "icon": #SwingIcon0 "selected": true } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button9" + "icon": #SwingIcon0 + "selected": true + } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 21" + "value": "cell 1 20 2 1" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "tabbedPaneLabel" "text": "JTabbedPane:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 22" + "value": "cell 0 21" } ) add( new FormContainer( "com.formdev.flatlaf.themeeditor.FlatThemePreviewAll$PreviewTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { name: "tabbedPane1" @@ -519,13 +543,13 @@ new FormModel { "JavaCodeGenerator.variableLocal": false } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 22" + "value": "cell 1 21 2 1" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "listTreeLabel" "text": "JList / JTree:
JSplitPane:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 23,aligny top,growy 0" + "value": "cell 0 22,aligny top,growy 0" } ) add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) { name: "splitPane1" @@ -570,13 +594,13 @@ new FormModel { "value": "right" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 23,height 50" + "value": "cell 1 22 2 1,height 50" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "tableLabel" "text": "JTable:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 24" + "value": "cell 0 23" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane4" @@ -609,13 +633,13 @@ new FormModel { } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 24,height 70" + "value": "cell 1 23 2 1,width 100,height 70" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "internalFrameLabel" "text": "JDesktopPane:
JInternalFrame:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 25,aligny top,growy 0" + "value": "cell 0 24,aligny top,growy 0" } ) add( new FormContainer( "javax.swing.JDesktopPane", new FormLayoutManager( class javax.swing.JDesktopPane ) ) { name: "desktopPane1" @@ -653,7 +677,7 @@ new FormModel { "y": 50 } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 25" + "value": "cell 1 24 2 1" } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreviewButtons.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreviewButtons.java index 4771bda9..b358acda 100644 --- a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreviewButtons.java +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePreviewButtons.java @@ -16,11 +16,11 @@ package com.formdev.flatlaf.themeeditor; +import static com.formdev.flatlaf.FlatClientProperties.*; import java.awt.Component; import java.util.Objects; import java.util.function.Predicate; import javax.swing.*; -import com.formdev.flatlaf.FlatClientProperties; import net.miginfocom.swing.*; /** @@ -29,31 +29,64 @@ import net.miginfocom.swing.*; class FlatThemePreviewButtons extends JPanel { - FlatThemePreviewButtons() { + private static final String KEY_BUTTON_TYPE = "preview.buttonType"; + + private final FlatThemePreview preview; + + FlatThemePreviewButtons( FlatThemePreview preview ) { + this.preview = preview; + initComponents(); } - private void buttonTypeChanged() { - Object buttonType = null; + void activated() { + String buttonType = preview.state.get( KEY_BUTTON_TYPE, null ); + + if( !Objects.equals( buttonType, getButtonType() ) ) { + setButtonType( buttonType ); + buttonTypeChanged(); + } + } + + private String getButtonType() { + String buttonType = null; if( squareButton.isSelected() ) - buttonType = FlatClientProperties.BUTTON_TYPE_SQUARE; + buttonType = BUTTON_TYPE_SQUARE; else if( roundRectButton.isSelected() ) - buttonType = FlatClientProperties.BUTTON_TYPE_ROUND_RECT; + buttonType = BUTTON_TYPE_ROUND_RECT; else if( tabButton.isSelected() ) - buttonType = FlatClientProperties.BUTTON_TYPE_TAB; + buttonType = BUTTON_TYPE_TAB; else if( toolBarButtonButton.isSelected() ) - buttonType = FlatClientProperties.BUTTON_TYPE_TOOLBAR_BUTTON; + buttonType = BUTTON_TYPE_TOOLBAR_BUTTON; else if( borderlessButton.isSelected() ) - buttonType = FlatClientProperties.BUTTON_TYPE_BORDERLESS; + buttonType = BUTTON_TYPE_BORDERLESS; + return buttonType; + } + + private void setButtonType( String buttonType ) { + switch( String.valueOf( buttonType ) ) { + case BUTTON_TYPE_SQUARE: squareButton.setSelected( true ); break; + case BUTTON_TYPE_ROUND_RECT: roundRectButton.setSelected( true ); break; + case BUTTON_TYPE_TAB: tabButton.setSelected( true ); break; + case BUTTON_TYPE_TOOLBAR_BUTTON: toolBarButtonButton.setSelected( true ); break; + case BUTTON_TYPE_BORDERLESS: borderlessButton.setSelected( true ); break; + default: noneButton.setSelected( true ); break; + } + } + + private void buttonTypeChanged() { + String buttonType = getButtonType(); for( Component c : getComponents() ) { if( !(c instanceof AbstractButton) ) continue; AbstractButton b = (AbstractButton) c; - if( !Objects.equals( b.getClientProperty( FlatClientProperties.BUTTON_TYPE ), FlatClientProperties.BUTTON_TYPE_HELP ) ) - b.putClientProperty( FlatClientProperties.BUTTON_TYPE, buttonType ); + if( !Objects.equals( b.getClientProperty( BUTTON_TYPE ), BUTTON_TYPE_HELP ) ) + b.putClientProperty( BUTTON_TYPE, buttonType ); } + + FlatThemeFileEditor.putPrefsString( preview.state, KEY_BUTTON_TYPE, buttonType ); } private void initComponents() { @@ -664,7 +697,7 @@ class FlatThemePreviewButtons } } ); - putClientProperty( FlatClientProperties.COMPONENT_FOCUS_OWNER, + putClientProperty( COMPONENT_FOCUS_OWNER, (Predicate) c -> { return ((TestStateButton)c).isStateFocused(); } ); @@ -734,7 +767,7 @@ class FlatThemePreviewButtons } } ); - putClientProperty( FlatClientProperties.COMPONENT_FOCUS_OWNER, + putClientProperty( COMPONENT_FOCUS_OWNER, (Predicate) c -> { return ((TestStateToggleButton)c).isStateFocused(); } ); diff --git a/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt index fd85f54b..45a0555b 100644 --- a/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt +++ b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt @@ -830,7 +830,7 @@ Table.selectionForeground Table.selectionInactiveBackground Table.selectionInactiveForeground Table.showHorizontalLines -Table.showLastVerticalLine +Table.showTrailingVerticalLine Table.showVerticalLines Table.sortIconColor TableHeader.ancestorInputMap @@ -843,7 +843,7 @@ TableHeader.font TableHeader.foreground TableHeader.height TableHeader.separatorColor -TableHeader.showLastVerticalLine +TableHeader.showTrailingVerticalLine TableHeaderUI TableUI TaskPane.background