mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 14:37:13 -06:00
Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a29753912 | ||
|
|
a467356437 | ||
|
|
094967f52a | ||
|
|
757b0812ba | ||
|
|
8f4f5d8c92 | ||
|
|
4e266483ba | ||
|
|
7433dc9cf3 | ||
|
|
409a773e36 | ||
|
|
48bdd5c3df | ||
|
|
c8248e91ca | ||
|
|
7317ce44e7 | ||
|
|
10e2a5b1eb | ||
|
|
e675d1b7e2 | ||
|
|
499c4dadd5 | ||
|
|
f550f84acd | ||
|
|
8021f1a7fc | ||
|
|
d50fe606ee | ||
|
|
281f014aa0 | ||
|
|
2f6da3e84a | ||
|
|
f9accc2a7a | ||
|
|
fe15078bbd | ||
|
|
27d4b5eba7 | ||
|
|
e378576632 | ||
|
|
74909da110 | ||
|
|
655bf112ac | ||
|
|
5c3638a5a4 | ||
|
|
2459a3654b | ||
|
|
e9a3456cf5 |
53
CHANGELOG.md
53
CHANGELOG.md
@@ -1,6 +1,59 @@
|
||||
FlatLaf Change Log
|
||||
==================
|
||||
|
||||
## 0.26
|
||||
|
||||
- Menus:
|
||||
- Changed menu bar and popup menu background colors (made brighter in light
|
||||
themes and darker in dark themes).
|
||||
- Highlight items in menu bar on mouse hover. (issue #49)
|
||||
- Popup menus now have empty space at the top and bottom.
|
||||
- Menu items now have larger left and right margins.
|
||||
- Made `JMenu`, `JMenuItem`, `JCheckBoxMenuItem` and `JRadioButtonMenuItem`
|
||||
non-opaque.
|
||||
- TextField, FormattedTextField and PasswordField: Select all text when a text
|
||||
field gains focus for the first time and selection was not set explicitly.
|
||||
This can be configured to newer or always select all text on focus gain (see
|
||||
UI default value `TextComponent.selectAllOnFocusPolicy`).
|
||||
- ProgressBar: Made progress bar paint smooth in indeterminate mode.
|
||||
|
||||
|
||||
## 0.25.1
|
||||
|
||||
Re-release of 0.25 because of problems with Maven Central.
|
||||
|
||||
|
||||
## 0.25
|
||||
|
||||
- Hide menu mnemonics by default and show them only when <kbd>Alt</kbd> key is
|
||||
pressed. (issue #43)
|
||||
- Menu: Fixed vertical alignment of sub-menus. (issue #42)
|
||||
- TabbedPane: In scroll-tab-layout, the cropped line is now hidden. (issue #40)
|
||||
- Tree: UI default value `Tree.textBackground` now has a valid color and is no
|
||||
longer `null`.
|
||||
- Tree on macOS: Fixed <kbd>Left</kbd> and <kbd>Right</kbd> keys to collapse or
|
||||
expand nodes.
|
||||
- ComboBox on macOS: Fixed keyboard navigation and show/hide popup.
|
||||
- Button and ToggleButton: Support per component minimum height (set client
|
||||
property `JComponent.minimumHeight` to an integer). (issue #44)
|
||||
- Button and ToggleButton: Do not apply minimum width if button border was
|
||||
changed (is no longer an instance of `FlatButtonBorder`).
|
||||
- ToggleButton: Renamed toggle button type "underline" to "tab" (value of client
|
||||
property `JButton.buttonType` is now `tab`).
|
||||
- ToggleButton: Support per component styling for tab-style toggle buttons with
|
||||
client properties `JToggleButton.tab.underlineHeight` (integer),
|
||||
`JToggleButton.tab.underlineColor` (Color) and
|
||||
`JToggleButton.tab.selectedBackground` (Color). (issue #45)
|
||||
- ToggleButton: No longer use focus width for tab-style toggle buttons to
|
||||
compute component size, which reduces/fixes component size in "Flat IntelliJ"
|
||||
and "Flat Darcula" themes.
|
||||
- TabbedPane: Support per component tab height (set client property
|
||||
`JTabbedPane.tabHeight` to an integer).
|
||||
- ProgressBar: Support square painting (set client property
|
||||
`JProgressBar.square` to `true`) and larger height even if no string is
|
||||
painted (set client property `JProgressBar.largeHeight` to `true`).
|
||||
|
||||
|
||||
## 0.24
|
||||
|
||||
- Support smooth scrolling with touchpads and high precision mouse wheels.
|
||||
|
||||
@@ -45,7 +45,7 @@ build script:
|
||||
|
||||
groupId: com.formdev
|
||||
artifactId: flatlaf
|
||||
version: 0.24
|
||||
version: (see button below)
|
||||
|
||||
Otherwise download `flatlaf-<version>.jar` here:
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
version = "0.24"
|
||||
version = "0.26"
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -68,6 +68,7 @@ tasks {
|
||||
options {
|
||||
this as StandardJavadocDocletOptions
|
||||
tags = listOf( "uiDefault", "clientProperty" )
|
||||
addStringOption( "Xdoclint:all,-missing", "-Xdoclint:all,-missing" )
|
||||
}
|
||||
isFailOnError = false
|
||||
}
|
||||
@@ -106,7 +107,7 @@ publishing {
|
||||
licenses {
|
||||
license {
|
||||
name.set( "The Apache License, Version 2.0" )
|
||||
url.set( "http://www.apache.org/licenses/LICENSE-2.0.txt" )
|
||||
url.set( "https://www.apache.org/licenses/LICENSE-2.0.txt" )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.formdev.flatlaf;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Objects;
|
||||
import javax.swing.JComponent;
|
||||
|
||||
@@ -43,13 +44,13 @@ public interface FlatClientProperties
|
||||
String BUTTON_TYPE_SQUARE = "square";
|
||||
|
||||
/**
|
||||
* Paint the toggle button in underline style.
|
||||
* Paint the toggle button in tab style.
|
||||
* <p>
|
||||
* <strong>Components</strong> {@link javax.swing.JToggleButton}
|
||||
*
|
||||
* @see #TOGGLE_BUTTON_TYPE
|
||||
* @see #BUTTON_TYPE
|
||||
*/
|
||||
String BUTTON_TYPE_UNDERLINE = "underline";
|
||||
String BUTTON_TYPE_TAB = "tab";
|
||||
|
||||
/**
|
||||
* Paint a help button (circle with question mark).
|
||||
@@ -79,11 +80,35 @@ public interface FlatClientProperties
|
||||
/**
|
||||
* Specifies minimum width of a component.
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JButton} and {@link javax.swing.text.JTextComponent}<br>
|
||||
* <strong>Component</strong> {@link javax.swing.JButton}, {@link javax.swing.JToggleButton} and {@link javax.swing.text.JTextComponent}<br>
|
||||
* <strong>Value type</strong> {@link java.lang.Integer}<br>
|
||||
*/
|
||||
String MINIMUM_WIDTH = "JComponent.minimumWidth";
|
||||
|
||||
/**
|
||||
* Specifies minimum height of a component.
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JButton} and {@link javax.swing.JToggleButton}<br>
|
||||
* <strong>Value type</strong> {@link java.lang.Integer}<br>
|
||||
*/
|
||||
String MINIMUM_HEIGHT = "JComponent.minimumHeight";
|
||||
|
||||
/**
|
||||
* Specifies whether the progress bar has always the larger height even if no string is painted.
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JProgressBar}<br>
|
||||
* <strong>Value type</strong> {@link java.lang.Boolean}
|
||||
*/
|
||||
String PROGRESS_BAR_LARGE_HEIGHT = "JProgressBar.largeHeight";
|
||||
|
||||
/**
|
||||
* Specifies whether the progress bar is paint with square edges.
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JProgressBar}<br>
|
||||
* <strong>Value type</strong> {@link java.lang.Boolean}
|
||||
*/
|
||||
String PROGRESS_BAR_SQUARE = "JProgressBar.square";
|
||||
|
||||
/**
|
||||
* Specifies whether the decrease/increase arrow buttons of a scrollbar are shown.
|
||||
* <p>
|
||||
@@ -108,14 +133,80 @@ public interface FlatClientProperties
|
||||
*/
|
||||
String TABBED_PANE_HAS_FULL_BORDER = "JTabbedPane.hasFullBorder";
|
||||
|
||||
/**
|
||||
* Specifies the height of a tab.
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JTabbedPane}<br>
|
||||
* <strong>Value type</strong> {@link java.lang.Integer}
|
||||
*/
|
||||
String TABBED_PANE_TAB_HEIGHT = "JTabbedPane.tabHeight";
|
||||
|
||||
/**
|
||||
* Specifies whether all text is selected when the text component gains focus.
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JTextField} (and subclasses)<br>
|
||||
* <strong>Value type</strong> {@link java.lang.String}<br>
|
||||
* <strong>Allowed Values</strong> {@link #SELECT_ALL_ON_FOCUS_POLICY_NEVER},
|
||||
* {@link #SELECT_ALL_ON_FOCUS_POLICY_ONCE} (default) or
|
||||
* {@link #SELECT_ALL_ON_FOCUS_POLICY_ALWAYS}
|
||||
*/
|
||||
String SELECT_ALL_ON_FOCUS_POLICY = "JTextField.selectAllOnFocusPolicy";
|
||||
|
||||
/**
|
||||
* Never select all text when the text component gains focus.
|
||||
*
|
||||
* @see #SELECT_ALL_ON_FOCUS_POLICY
|
||||
*/
|
||||
String SELECT_ALL_ON_FOCUS_POLICY_NEVER = "never";
|
||||
|
||||
/**
|
||||
* Select all text when the text component gains focus for the first time
|
||||
* and selection was not modified (is at end of text).
|
||||
* This is the default.
|
||||
*
|
||||
* @see #SELECT_ALL_ON_FOCUS_POLICY
|
||||
*/
|
||||
String SELECT_ALL_ON_FOCUS_POLICY_ONCE = "once";
|
||||
|
||||
/**
|
||||
* Always select all text when the text component gains focus.
|
||||
*
|
||||
* @see #SELECT_ALL_ON_FOCUS_POLICY
|
||||
*/
|
||||
String SELECT_ALL_ON_FOCUS_POLICY_ALWAYS = "always";
|
||||
|
||||
/**
|
||||
* Placeholder text that is only painted if the text field is empty.
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JTextField} or {@link javax.swing.JComboBox}<br>
|
||||
* <strong>Component</strong> {@link javax.swing.JTextField} (and subclasses) or {@link javax.swing.JComboBox}<br>
|
||||
* <strong>Value type</strong> {@link java.lang.String}
|
||||
*/
|
||||
String PLACEHOLDER_TEXT = "JTextField.placeholderText";
|
||||
|
||||
/**
|
||||
* Height of underline if toggle button type is {@link #BUTTON_TYPE_TAB}.
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JToggleButton}<br>
|
||||
* <strong>Value type</strong> {@link java.lang.Integer}
|
||||
*/
|
||||
String TAB_BUTTON_UNDERLINE_HEIGHT = "JToggleButton.tab.underlineHeight";
|
||||
|
||||
/**
|
||||
* Color of underline if toggle button type is {@link #BUTTON_TYPE_TAB}.
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JToggleButton}<br>
|
||||
* <strong>Value type</strong> {@link java.awt.Color}
|
||||
*/
|
||||
String TAB_BUTTON_UNDERLINE_COLOR = "JToggleButton.tab.underlineColor";
|
||||
|
||||
/**
|
||||
* Background color if selected and toggle button type is {@link #BUTTON_TYPE_TAB}.
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JToggleButton}<br>
|
||||
* <strong>Value type</strong> {@link java.awt.Color}
|
||||
*/
|
||||
String TAB_BUTTON_SELECTED_BACKGROUND = "JToggleButton.tab.selectedBackground";
|
||||
|
||||
/**
|
||||
* Checks whether a client property of a component has the given value.
|
||||
*/
|
||||
@@ -131,4 +222,22 @@ public interface FlatClientProperties
|
||||
Object value = c.getClientProperty( key );
|
||||
return (value instanceof Boolean) ? (boolean) value : defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a client property of a component is an integer and returns its value.
|
||||
* If the client property is not set, or not an integer, defaultValue is returned.
|
||||
*/
|
||||
static int clientPropertyInt( JComponent c, String key, int defaultValue ) {
|
||||
Object value = c.getClientProperty( key );
|
||||
return (value instanceof Integer) ? (int) value : defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a client property of a component is a color and returns its value.
|
||||
* If the client property is not set, or not a color, defaultValue is returned.
|
||||
*/
|
||||
static Color clientPropertyColor( JComponent c, String key, Color defaultValue ) {
|
||||
Object value = c.getClientProperty( key );
|
||||
return (value instanceof Color) ? (Color) value : defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,17 +28,22 @@ import java.awt.Window;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.InputMap;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JRootPane;
|
||||
import javax.swing.JTabbedPane;
|
||||
import javax.swing.KeyStroke;
|
||||
import javax.swing.LookAndFeel;
|
||||
import javax.swing.PopupFactory;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIDefaults;
|
||||
import javax.swing.UIDefaults.LazyValue;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.UnsupportedLookAndFeelException;
|
||||
import javax.swing.plaf.ColorUIResource;
|
||||
@@ -66,6 +71,7 @@ public abstract class FlatLaf
|
||||
|
||||
private KeyEventPostProcessor mnemonicListener;
|
||||
private static boolean showMnemonics;
|
||||
private static WeakReference<Window> lastShowMnemonicWindow;
|
||||
|
||||
private Consumer<UIDefaults> postInitialization;
|
||||
|
||||
@@ -229,6 +235,7 @@ public abstract class FlatLaf
|
||||
|
||||
initFonts( defaults );
|
||||
initIconColors( defaults, isDark() );
|
||||
initInputMaps( defaults );
|
||||
|
||||
// load defaults from properties
|
||||
List<Class<?>> lafClassesForDefaultsLoading = getLafClassesForDefaultsLoading();
|
||||
@@ -335,6 +342,57 @@ public abstract class FlatLaf
|
||||
defaults.put( "Objects.BlackText", new ColorUIResource( 0x231F20 ) );
|
||||
}
|
||||
|
||||
private void initInputMaps( UIDefaults defaults ) {
|
||||
if( SystemInfo.IS_MAC ) {
|
||||
// AquaLookAndFeel (the base for UI defaults on macOS) uses special
|
||||
// action keys (e.g. "aquaExpandNode") for some macOS specific behaviour.
|
||||
// Those action keys are not available in FlatLaf, which makes it
|
||||
// necessary to make some modifications.
|
||||
|
||||
// combobox
|
||||
defaults.put( "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap( new Object[] {
|
||||
"ESCAPE", "hidePopup",
|
||||
"PAGE_UP", "pageUpPassThrough",
|
||||
"PAGE_DOWN", "pageDownPassThrough",
|
||||
"HOME", "homePassThrough",
|
||||
"END", "endPassThrough",
|
||||
"DOWN", "selectNext",
|
||||
"KP_DOWN", "selectNext",
|
||||
"SPACE", "spacePopup",
|
||||
"ENTER", "enterPressed",
|
||||
"UP", "selectPrevious",
|
||||
"KP_UP", "selectPrevious"
|
||||
} ) );
|
||||
|
||||
// tree node expanding/collapsing
|
||||
modifyInputMap( defaults, "Tree.focusInputMap",
|
||||
"RIGHT", "selectChild",
|
||||
"KP_RIGHT", "selectChild",
|
||||
"LEFT", "selectParent",
|
||||
"KP_LEFT", "selectParent",
|
||||
"shift RIGHT", null,
|
||||
"shift KP_RIGHT", null,
|
||||
"shift LEFT", null,
|
||||
"shift KP_LEFT", null,
|
||||
"ctrl LEFT", null,
|
||||
"ctrl KP_LEFT", null,
|
||||
"ctrl RIGHT", null,
|
||||
"ctrl KP_RIGHT", null
|
||||
);
|
||||
defaults.put( "Tree.focusInputMap.RightToLeft", new UIDefaults.LazyInputMap( new Object[] {
|
||||
"RIGHT", "selectParent",
|
||||
"KP_RIGHT", "selectParent",
|
||||
"LEFT", "selectChild",
|
||||
"KP_LEFT", "selectChild"
|
||||
} ) );
|
||||
}
|
||||
}
|
||||
|
||||
private void modifyInputMap( UIDefaults defaults, String key, Object... bindings ) {
|
||||
// Note: not using `defaults.get(key)` here because this would resolve the lazy value
|
||||
defaults.put( key, new LazyModifyInputMap( defaults.remove( key ), bindings ) );
|
||||
}
|
||||
|
||||
private static void reSetLookAndFeel() {
|
||||
EventQueue.invokeLater( () -> {
|
||||
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
|
||||
@@ -373,15 +431,15 @@ public abstract class FlatLaf
|
||||
if( SystemInfo.IS_MAC ) {
|
||||
// Ctrl+Alt keys must be pressed on Mac
|
||||
if( keyCode == KeyEvent.VK_CONTROL || keyCode == KeyEvent.VK_ALT )
|
||||
showMnemonics( e.getID() == KeyEvent.KEY_PRESSED && e.isControlDown() && e.isAltDown() );
|
||||
showMnemonics( e.getID() == KeyEvent.KEY_PRESSED && e.isControlDown() && e.isAltDown(), e.getComponent() );
|
||||
} else {
|
||||
// Alt key must be pressed on Windows and Linux
|
||||
if( keyCode == KeyEvent.VK_ALT )
|
||||
showMnemonics( e.getID() == KeyEvent.KEY_PRESSED );
|
||||
showMnemonics( e.getID() == KeyEvent.KEY_PRESSED, e.getComponent() );
|
||||
}
|
||||
}
|
||||
|
||||
private static void showMnemonics( boolean show ) {
|
||||
private static void showMnemonics( boolean show, Component c ) {
|
||||
if( show == showMnemonics )
|
||||
return;
|
||||
|
||||
@@ -391,22 +449,35 @@ public abstract class FlatLaf
|
||||
if( !UIManager.getBoolean( "Component.hideMnemonics" ) )
|
||||
return;
|
||||
|
||||
// get focus owner
|
||||
Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
|
||||
if( focusOwner == null )
|
||||
return;
|
||||
if( show ) {
|
||||
// get root pane
|
||||
JRootPane rootPane = SwingUtilities.getRootPane( c );
|
||||
if( rootPane == null )
|
||||
return;
|
||||
|
||||
// get focused window
|
||||
Window window = SwingUtilities.windowForComponent( focusOwner );
|
||||
if( window == null )
|
||||
return;
|
||||
// get window
|
||||
Window window = SwingUtilities.getWindowAncestor( rootPane );
|
||||
if( window == null )
|
||||
return;
|
||||
|
||||
// repaint components with mnemonics in focused window
|
||||
repaintMnemonics( window );
|
||||
// repaint components with mnemonics in focused window
|
||||
repaintMnemonics( window );
|
||||
|
||||
lastShowMnemonicWindow = new WeakReference<>( window );
|
||||
} else if( lastShowMnemonicWindow != null ) {
|
||||
Window window = lastShowMnemonicWindow.get();
|
||||
if( window != null )
|
||||
repaintMnemonics( window );
|
||||
|
||||
lastShowMnemonicWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static void repaintMnemonics( Container container ) {
|
||||
for( Component c : container.getComponents() ) {
|
||||
if( !c.isVisible() )
|
||||
continue;
|
||||
|
||||
if( hasMnemonic( c ) )
|
||||
c.repaint();
|
||||
|
||||
@@ -433,4 +504,40 @@ public abstract class FlatLaf
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//---- class LazyModifyInputMap -------------------------------------------
|
||||
|
||||
/**
|
||||
* Takes a (lazy) base input map and lazily applies modifications to it specified in bindings.
|
||||
*/
|
||||
private static class LazyModifyInputMap
|
||||
implements LazyValue
|
||||
{
|
||||
private final Object baseInputMap;
|
||||
private final Object[] bindings;
|
||||
|
||||
public LazyModifyInputMap( Object baseInputMap, Object[] bindings ) {
|
||||
this.baseInputMap = baseInputMap;
|
||||
this.bindings = bindings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object createValue( UIDefaults table ) {
|
||||
// get base input map
|
||||
InputMap inputMap = (baseInputMap instanceof LazyValue)
|
||||
? (InputMap) ((LazyValue)baseInputMap).createValue( table )
|
||||
: (InputMap) baseInputMap;
|
||||
|
||||
// modify input map (replace or remove)
|
||||
for( int i = 0; i < bindings.length; i += 2 ) {
|
||||
KeyStroke keyStroke = KeyStroke.getKeyStroke( (String) bindings[i] );
|
||||
if( bindings[i + 1] != null )
|
||||
inputMap.put( keyStroke, bindings[i + 1] );
|
||||
else
|
||||
inputMap.remove( keyStroke );
|
||||
}
|
||||
|
||||
return inputMap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,11 +445,11 @@ public class IntelliJTheme
|
||||
for( Map.Entry<String, String> e : uiKeyMapping.entrySet() )
|
||||
uiKeyInverseMapping.put( e.getValue(), e.getKey() );
|
||||
|
||||
uiKeyCopying.put( "ToggleButton.underline.underlineColor", "TabbedPane.underlineColor" );
|
||||
uiKeyCopying.put( "ToggleButton.underline.disabledUnderlineColor", "TabbedPane.disabledUnderlineColor" );
|
||||
uiKeyCopying.put( "ToggleButton.underline.selectedBackground", "TabbedPane.selectedBackground" );
|
||||
uiKeyCopying.put( "ToggleButton.underline.hoverBackground", "TabbedPane.hoverColor" );
|
||||
uiKeyCopying.put( "ToggleButton.underline.focusBackground", "TabbedPane.focusColor" );
|
||||
uiKeyCopying.put( "ToggleButton.tab.underlineColor", "TabbedPane.underlineColor" );
|
||||
uiKeyCopying.put( "ToggleButton.tab.disabledUnderlineColor", "TabbedPane.disabledUnderlineColor" );
|
||||
uiKeyCopying.put( "ToggleButton.tab.selectedBackground", "TabbedPane.selectedBackground" );
|
||||
uiKeyCopying.put( "ToggleButton.tab.hoverBackground", "TabbedPane.hoverColor" );
|
||||
uiKeyCopying.put( "ToggleButton.tab.focusBackground", "TabbedPane.focusColor" );
|
||||
|
||||
checkboxKeyMapping.put( "Checkbox.Background.Default", "CheckBox.icon.background" );
|
||||
checkboxKeyMapping.put( "Checkbox.Background.Disabled", "CheckBox.icon.disabledBackground" );
|
||||
|
||||
@@ -73,14 +73,16 @@ public class FlatBorder
|
||||
FlatUIUtils.setRenderingHints( g2 );
|
||||
|
||||
boolean isCellEditor = isTableCellEditor( c );
|
||||
float focusWidth = isCellEditor ? 0 : getFocusWidth();
|
||||
float focusWidth = isCellEditor ? 0 : getFocusWidth( c );
|
||||
float borderWidth = getBorderWidth( c );
|
||||
float arc = isCellEditor ? 0 : getArc( c );
|
||||
|
||||
if( isFocused( c ) ) {
|
||||
float innerFocusWidth = !(c instanceof JScrollPane) ? this.innerFocusWidth : 0;
|
||||
|
||||
g2.setColor( getFocusColor( c ) );
|
||||
FlatUIUtils.paintComponentOuterBorder( g2, x, y, width, height, focusWidth,
|
||||
getLineWidth() + scale( innerFocusWidth ), arc );
|
||||
getLineWidth( c ) + scale( innerFocusWidth ), arc );
|
||||
}
|
||||
|
||||
g2.setPaint( getBorderColor( c ) );
|
||||
@@ -151,7 +153,7 @@ public class FlatBorder
|
||||
@Override
|
||||
public Insets getBorderInsets( Component c, Insets insets ) {
|
||||
boolean isCellEditor = isTableCellEditor( c );
|
||||
float ow = (isCellEditor ? 0 : getFocusWidth()) + getLineWidth();
|
||||
float ow = (isCellEditor ? 0 : getFocusWidth( c )) + getLineWidth( c );
|
||||
|
||||
insets = super.getBorderInsets( c, insets );
|
||||
insets.top = Math.round( scale( (float) insets.top ) + ow );
|
||||
@@ -161,16 +163,16 @@ public class FlatBorder
|
||||
return insets;
|
||||
}
|
||||
|
||||
protected float getFocusWidth() {
|
||||
protected float getFocusWidth( Component c ) {
|
||||
return scale( (float) focusWidth );
|
||||
}
|
||||
|
||||
protected float getLineWidth() {
|
||||
protected float getLineWidth( Component c ) {
|
||||
return scale( 1f );
|
||||
}
|
||||
|
||||
protected float getBorderWidth( Component c ) {
|
||||
return getLineWidth();
|
||||
return getLineWidth( c );
|
||||
}
|
||||
|
||||
protected float getArc( Component c ) {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class FlatButtonBorder
|
||||
|
||||
@Override
|
||||
public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) {
|
||||
if( FlatButtonUI.isContentAreaFilled( c ) && !FlatButtonUI.isHelpButton( c ) && !FlatToggleButtonUI.isUnderlineButton( c ) )
|
||||
if( FlatButtonUI.isContentAreaFilled( c ) && !FlatButtonUI.isHelpButton( c ) && !FlatToggleButtonUI.isTabButton( c ) )
|
||||
super.paintBorder( c, g, x, y, width, height );
|
||||
}
|
||||
|
||||
@@ -104,6 +104,11 @@ public class FlatButtonBorder
|
||||
return insets;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getFocusWidth( Component c ) {
|
||||
return FlatToggleButtonUI.isTabButton( c ) ? 0 : super.getFocusWidth(c );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getBorderWidth( Component c ) {
|
||||
return FlatButtonUI.isDefaultButton( c ) ? scale( (float) defaultBorderWidth ) : super.getBorderWidth( c );
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.geom.RoundRectangle2D;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.ButtonModel;
|
||||
import javax.swing.Icon;
|
||||
@@ -39,6 +40,7 @@ import javax.swing.UIManager;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.UIResource;
|
||||
import javax.swing.plaf.basic.BasicButtonListener;
|
||||
import javax.swing.plaf.basic.BasicButtonUI;
|
||||
import com.formdev.flatlaf.FlatLaf;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -180,7 +182,7 @@ public class FlatButtonUI
|
||||
LookAndFeel.installProperty( b, "opaque", false );
|
||||
LookAndFeel.installProperty( b, "iconTextGap", scale( iconTextGap ) );
|
||||
|
||||
MigLayoutVisualPadding.install( b, focusWidth );
|
||||
MigLayoutVisualPadding.install( b, getFocusWidth( b ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -191,6 +193,26 @@ public class FlatButtonUI
|
||||
defaults_initialized = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BasicButtonListener createButtonListener( AbstractButton b ) {
|
||||
return new BasicButtonListener( b ) {
|
||||
@Override
|
||||
public void propertyChange( PropertyChangeEvent e ) {
|
||||
super.propertyChange( e );
|
||||
FlatButtonUI.this.propertyChange( b, e );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected void propertyChange( AbstractButton b, PropertyChangeEvent e ) {
|
||||
switch( e.getPropertyName() ) {
|
||||
case MINIMUM_WIDTH:
|
||||
case MINIMUM_HEIGHT:
|
||||
b.revalidate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static boolean isContentAreaFilled( Component c ) {
|
||||
return !(c instanceof AbstractButton) || ((AbstractButton)c).isContentAreaFilled();
|
||||
}
|
||||
@@ -246,7 +268,7 @@ public class FlatButtonUI
|
||||
FlatUIUtils.setRenderingHints( g2 );
|
||||
|
||||
Border border = c.getBorder();
|
||||
float focusWidth = (border instanceof FlatBorder) ? scale( (float) this.focusWidth ) : 0;
|
||||
float focusWidth = (border instanceof FlatBorder) ? scale( (float) getFocusWidth( c ) ) : 0;
|
||||
float arc = ((border instanceof FlatButtonBorder && !isSquareButton( c )) || isToolBarButton( c ))
|
||||
? scale( (float) this.arc ) : 0;
|
||||
boolean def = isDefaultButton( c );
|
||||
@@ -362,9 +384,16 @@ public class FlatButtonUI
|
||||
// or apply minimum width, if not in toolbar and not a icon-only button
|
||||
if( isIconOnlyButton( c ) )
|
||||
prefSize.width = Math.max( prefSize.width, prefSize.height );
|
||||
else if( !isToolBarButton( c ) )
|
||||
else if( !isToolBarButton( c ) && c.getBorder() instanceof FlatButtonBorder ) {
|
||||
int focusWidth = getFocusWidth( c );
|
||||
prefSize.width = Math.max( prefSize.width, scale( FlatUIUtils.minimumWidth( c, minimumWidth ) + (focusWidth * 2) ) );
|
||||
prefSize.height = Math.max( prefSize.height, scale( FlatUIUtils.minimumHeight( c, 0 ) + (focusWidth * 2) ) );
|
||||
}
|
||||
|
||||
return prefSize;
|
||||
}
|
||||
|
||||
protected int getFocusWidth( JComponent c ) {
|
||||
return focusWidth;
|
||||
}
|
||||
}
|
||||
|
||||
128
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCaret.java
Normal file
128
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCaret.java
Normal file
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright 2020 FormDev Software GmbH
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.formdev.flatlaf.ui;
|
||||
|
||||
import static com.formdev.flatlaf.FlatClientProperties.*;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import javax.swing.JFormattedTextField;
|
||||
import javax.swing.plaf.UIResource;
|
||||
import javax.swing.text.DefaultCaret;
|
||||
import javax.swing.text.Document;
|
||||
import javax.swing.text.JTextComponent;
|
||||
|
||||
/**
|
||||
* Caret that can select all text on focus gained.
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
class FlatCaret
|
||||
extends DefaultCaret
|
||||
implements UIResource
|
||||
{
|
||||
private final String selectAllOnFocusPolicy;
|
||||
|
||||
private boolean wasFocused;
|
||||
private boolean wasTemporaryLost;
|
||||
private boolean isMousePressed;
|
||||
|
||||
FlatCaret( String selectAllOnFocusPolicy ) {
|
||||
this.selectAllOnFocusPolicy = selectAllOnFocusPolicy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install( JTextComponent c ) {
|
||||
super.install( c );
|
||||
|
||||
// the dot and mark are lost when switching LaF
|
||||
// --> move dot to end of text so that all text may be selected when it gains focus
|
||||
Document doc = c.getDocument();
|
||||
if( doc != null && getDot() == 0 && getMark() == 0 ) {
|
||||
int length = doc.getLength();
|
||||
if( length > 0 )
|
||||
setDot( length );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void focusGained( FocusEvent e ) {
|
||||
if( !wasTemporaryLost && !isMousePressed )
|
||||
selectAllOnFocusGained();
|
||||
wasTemporaryLost = false;
|
||||
wasFocused = true;
|
||||
|
||||
super.focusGained( e );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void focusLost( FocusEvent e ) {
|
||||
wasTemporaryLost = e.isTemporary();
|
||||
super.focusLost( e );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed( MouseEvent e ) {
|
||||
isMousePressed = true;
|
||||
super.mousePressed( e );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased( MouseEvent e ) {
|
||||
isMousePressed = false;
|
||||
super.mouseReleased( e );
|
||||
}
|
||||
|
||||
private void selectAllOnFocusGained() {
|
||||
JTextComponent c = getComponent();
|
||||
Document doc = c.getDocument();
|
||||
if( doc == null || !c.isEnabled() || !c.isEditable() )
|
||||
return;
|
||||
|
||||
Object selectAllOnFocusPolicy = c.getClientProperty( SELECT_ALL_ON_FOCUS_POLICY );
|
||||
if( selectAllOnFocusPolicy == null )
|
||||
selectAllOnFocusPolicy = this.selectAllOnFocusPolicy;
|
||||
|
||||
if( SELECT_ALL_ON_FOCUS_POLICY_NEVER.equals( selectAllOnFocusPolicy ) )
|
||||
return;
|
||||
|
||||
if( !SELECT_ALL_ON_FOCUS_POLICY_ALWAYS.equals( selectAllOnFocusPolicy ) ) {
|
||||
// policy is "once" (or null or unknown)
|
||||
|
||||
// was already focused?
|
||||
if( wasFocused )
|
||||
return;
|
||||
|
||||
// check whether selection was modified before gaining focus
|
||||
int dot = getDot();
|
||||
int mark = getMark();
|
||||
if( dot != mark || dot != doc.getLength() )
|
||||
return;
|
||||
}
|
||||
|
||||
// select all
|
||||
if( c instanceof JFormattedTextField ) {
|
||||
EventQueue.invokeLater( () -> {
|
||||
setDot( 0 );
|
||||
moveDot( doc.getLength() );
|
||||
} );
|
||||
} else {
|
||||
setDot( 0 );
|
||||
moveDot( doc.getLength() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,11 @@
|
||||
package com.formdev.flatlaf.ui;
|
||||
|
||||
import static com.formdev.flatlaf.util.UIScale.scale;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Rectangle;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.basic.BasicCheckBoxMenuItemUI;
|
||||
|
||||
@@ -74,4 +77,9 @@ public class FlatCheckBoxMenuItemUI
|
||||
defaultTextIconGap = scale( defaultTextIconGap );
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintText( Graphics g, JMenuItem menuItem, Rectangle textRect, String text ) {
|
||||
FlatMenuItemUI.paintText( g, menuItem, textRect, text, disabledForeground, selectionForeground );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ import java.awt.Insets;
|
||||
import java.awt.LayoutManager;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.FocusListener;
|
||||
import java.awt.event.MouseListener;
|
||||
@@ -35,13 +37,16 @@ import java.awt.geom.Rectangle2D;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.lang.ref.WeakReference;
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.InputMap;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JList;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.KeyStroke;
|
||||
import javax.swing.ListCellRenderer;
|
||||
import javax.swing.LookAndFeel;
|
||||
import javax.swing.SwingConstants;
|
||||
@@ -54,6 +59,7 @@ import javax.swing.plaf.basic.BasicComboPopup;
|
||||
import javax.swing.plaf.basic.ComboPopup;
|
||||
import javax.swing.text.JTextComponent;
|
||||
import com.formdev.flatlaf.FlatClientProperties;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
|
||||
/**
|
||||
@@ -271,6 +277,18 @@ public class FlatComboBoxUI
|
||||
editor.applyComponentOrientation( comboBox.getComponentOrientation() );
|
||||
|
||||
updateEditorColors();
|
||||
|
||||
// macOS
|
||||
if( SystemInfo.IS_MAC && editor instanceof JTextComponent ) {
|
||||
// delegate actions from editor text field to combobox, which is necessary
|
||||
// because text field on macOS (based on Aqua LaF UI defaults)
|
||||
// already handle those keys
|
||||
InputMap inputMap = ((JTextComponent)editor).getInputMap();
|
||||
new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "UP" ) );
|
||||
new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "KP_UP" ) );
|
||||
new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "DOWN" ) );
|
||||
new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "KP_DOWN" ) );
|
||||
}
|
||||
}
|
||||
|
||||
private void updateEditorColors() {
|
||||
@@ -608,4 +626,31 @@ public class FlatComboBoxUI
|
||||
rendererBorder.paintBorder( c, g, x, y, width, height );
|
||||
}
|
||||
}
|
||||
|
||||
//---- class EditorDelegateAction -----------------------------------------
|
||||
|
||||
/**
|
||||
* Delegates actions from editor text field to combobox.
|
||||
*/
|
||||
private class EditorDelegateAction
|
||||
extends AbstractAction
|
||||
{
|
||||
private final KeyStroke keyStroke;
|
||||
|
||||
EditorDelegateAction( InputMap inputMap, KeyStroke keyStroke ) {
|
||||
this.keyStroke = keyStroke;
|
||||
|
||||
// add to input map
|
||||
inputMap.put( keyStroke, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed( ActionEvent e ) {
|
||||
ActionListener action = comboBox.getActionForKeyStroke( keyStroke );
|
||||
if( action != null ) {
|
||||
action.actionPerformed( new ActionEvent( comboBox, e.getID(),
|
||||
e.getActionCommand(), e.getWhen(), e.getModifiers() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ import javax.swing.plaf.ComponentUI;
|
||||
* @uiDefault Component.minimumWidth int
|
||||
* @uiDefault Component.isIntelliJTheme boolean
|
||||
* @uiDefault FormattedTextField.placeholderForeground Color
|
||||
* @uiDefault TextComponent.selectAllOnFocusPolicy String never, once (default) or always
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright 2020 FormDev Software GmbH
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.formdev.flatlaf.ui;
|
||||
|
||||
import static com.formdev.flatlaf.util.UIScale.scale;
|
||||
import java.awt.Component;
|
||||
import java.awt.Insets;
|
||||
import javax.swing.JMenuBar;
|
||||
import javax.swing.UIManager;
|
||||
|
||||
/**
|
||||
* Border for {@link javax.swing.JMenu}, {@link javax.swing.JMenuItem},
|
||||
* {@link javax.swing.JCheckBoxMenuItem} and {@link javax.swing.JRadioButtonMenuItem}.
|
||||
*
|
||||
* @uiDefault MenuBar.itemMargins Insets
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class FlatMenuItemBorder
|
||||
extends FlatMarginBorder
|
||||
{
|
||||
private final Insets menuBarItemMargins = UIManager.getInsets( "MenuBar.itemMargins" );
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets( Component c, Insets insets ) {
|
||||
if( c.getParent() instanceof JMenuBar ) {
|
||||
insets.top = scale( menuBarItemMargins.top );
|
||||
insets.left = scale( menuBarItemMargins.left );
|
||||
insets.bottom = scale( menuBarItemMargins.bottom + 1 );
|
||||
insets.right = scale( menuBarItemMargins.right );
|
||||
return insets;
|
||||
} else
|
||||
return super.getBorderInsets( c, insets );
|
||||
}
|
||||
}
|
||||
@@ -17,10 +17,18 @@
|
||||
package com.formdev.flatlaf.ui;
|
||||
|
||||
import static com.formdev.flatlaf.util.UIScale.scale;
|
||||
import java.awt.Color;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Rectangle;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import javax.swing.ButtonModel;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.basic.BasicMenuItemUI;
|
||||
import com.formdev.flatlaf.FlatLaf;
|
||||
|
||||
/**
|
||||
* Provides the Flat LaF UI delegate for {@link javax.swing.JMenuItem}.
|
||||
@@ -74,4 +82,26 @@ public class FlatMenuItemUI
|
||||
defaultTextIconGap = scale( defaultTextIconGap );
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintText( Graphics g, JMenuItem menuItem, Rectangle textRect, String text ) {
|
||||
paintText( g, menuItem, textRect, text, disabledForeground, selectionForeground );
|
||||
}
|
||||
|
||||
public static void paintText( Graphics g, JMenuItem menuItem, Rectangle textRect,
|
||||
String text, Color disabledForeground, Color selectionForeground )
|
||||
{
|
||||
FontMetrics fm = menuItem.getFontMetrics( menuItem.getFont() );
|
||||
int mnemonicIndex = FlatLaf.isShowMnemonics() ? menuItem.getDisplayedMnemonicIndex() : -1;
|
||||
|
||||
ButtonModel model = menuItem.getModel();
|
||||
g.setColor( !model.isEnabled()
|
||||
? disabledForeground
|
||||
: (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())
|
||||
? selectionForeground
|
||||
: menuItem.getForeground()) );
|
||||
|
||||
FlatUIUtils.drawStringUnderlineCharAt( menuItem, g, text, mnemonicIndex,
|
||||
textRect.x, textRect.y + fm.getAscent() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,17 @@
|
||||
package com.formdev.flatlaf.ui;
|
||||
|
||||
import static com.formdev.flatlaf.util.UIScale.scale;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import javax.swing.ButtonModel;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.event.MouseInputListener;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.basic.BasicMenuUI;
|
||||
|
||||
@@ -48,11 +57,17 @@ import javax.swing.plaf.basic.BasicMenuUI;
|
||||
* @uiDefault Menu.useMenuBarBackgroundForTopLevel boolean default is false
|
||||
* @uiDefault MenuBar.background Color used if Menu.useMenuBarBackgroundForTopLevel is true
|
||||
*
|
||||
* <!-- FlatMenuUI -->
|
||||
*
|
||||
* @uiDefault MenuBar.hoverBackground Color
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class FlatMenuUI
|
||||
extends BasicMenuUI
|
||||
{
|
||||
private Color hoverBackground;
|
||||
|
||||
public static ComponentUI createUI( JComponent c ) {
|
||||
return new FlatMenuUI();
|
||||
}
|
||||
@@ -61,10 +76,21 @@ public class FlatMenuUI
|
||||
protected void installDefaults() {
|
||||
super.installDefaults();
|
||||
|
||||
menuItem.setRolloverEnabled( true );
|
||||
|
||||
hoverBackground = UIManager.getColor( "MenuBar.hoverBackground" );
|
||||
|
||||
// scale
|
||||
defaultTextIconGap = scale( defaultTextIconGap );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallDefaults() {
|
||||
super.uninstallDefaults();
|
||||
|
||||
hoverBackground = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scale defaultTextIconGap again if iconTextGap property has changed.
|
||||
*/
|
||||
@@ -77,4 +103,46 @@ public class FlatMenuUI
|
||||
defaultTextIconGap = scale( defaultTextIconGap );
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MouseInputListener createMouseInputListener( JComponent c ) {
|
||||
return new BasicMenuUI.MouseInputHandler() {
|
||||
@Override
|
||||
public void mouseEntered( MouseEvent e ) {
|
||||
super.mouseEntered( e );
|
||||
rollover( e, true );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseExited( MouseEvent e ) {
|
||||
super.mouseExited( e );
|
||||
rollover( e, false );
|
||||
}
|
||||
|
||||
private void rollover( MouseEvent e, boolean rollover ) {
|
||||
JMenu menu = (JMenu) e.getSource();
|
||||
if( menu.isTopLevelMenu() && menu.isRolloverEnabled() ) {
|
||||
menu.getModel().setRollover( rollover );
|
||||
menu.repaint();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintBackground( Graphics g, JMenuItem menuItem, Color bgColor ) {
|
||||
ButtonModel model = menuItem.getModel();
|
||||
if( model.isArmed() || model.isSelected() ) {
|
||||
super.paintBackground( g, menuItem, bgColor );
|
||||
} else if( model.isRollover() && model.isEnabled() && ((JMenu)menuItem).isTopLevelMenu() ) {
|
||||
FlatUIUtils.setColor( g, hoverBackground, menuItem.getBackground() );
|
||||
g.fillRect( 0, 0, menuItem.getWidth(), menuItem.getHeight() );
|
||||
} else
|
||||
super.paintBackground( g, menuItem, bgColor );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintText( Graphics g, JMenuItem menuItem, Rectangle textRect, String text ) {
|
||||
FlatMenuItemUI.paintText( g, menuItem, textRect, text, disabledForeground, selectionForeground );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import javax.swing.LookAndFeel;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.basic.BasicPasswordFieldUI;
|
||||
import javax.swing.text.Caret;
|
||||
import com.formdev.flatlaf.FlatClientProperties;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
|
||||
@@ -55,6 +56,7 @@ import com.formdev.flatlaf.util.SystemInfo;
|
||||
* @uiDefault Component.minimumWidth int
|
||||
* @uiDefault Component.isIntelliJTheme boolean
|
||||
* @uiDefault PasswordField.placeholderForeground Color
|
||||
* @uiDefault TextComponent.selectAllOnFocusPolicy String never, once (default) or always
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
@@ -116,6 +118,11 @@ public class FlatPasswordFieldUI
|
||||
focusListener = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Caret createCaret() {
|
||||
return new FlatCaret( UIManager.getString( "TextComponent.selectAllOnFocusPolicy" ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void propertyChange( PropertyChangeEvent e ) {
|
||||
super.propertyChange( e );
|
||||
|
||||
@@ -16,7 +16,12 @@
|
||||
|
||||
package com.formdev.flatlaf.ui;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.awt.Insets;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.UIManager;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
|
||||
/**
|
||||
* Border for {@link javax.swing.JPopupMenu}.
|
||||
@@ -33,4 +38,18 @@ public class FlatPopupMenuBorder
|
||||
super( UIManager.getInsets( "PopupMenu.borderInsets" ),
|
||||
UIManager.getColor( "PopupMenu.borderColor" ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets( Component c, Insets insets ) {
|
||||
if( c instanceof Container &&
|
||||
((Container)c).getComponentCount() > 0 &&
|
||||
((Container)c).getComponent( 0 ) instanceof JScrollPane )
|
||||
{
|
||||
// e.g. for combobox popups
|
||||
insets.left = insets.top = insets.right = insets.bottom = UIScale.scale( 1 );
|
||||
return insets;
|
||||
}
|
||||
|
||||
return super.getBorderInsets( c, insets );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.formdev.flatlaf.ui;
|
||||
|
||||
import static com.formdev.flatlaf.FlatClientProperties.*;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
@@ -23,6 +24,7 @@ import java.awt.Graphics2D;
|
||||
import java.awt.Insets;
|
||||
import java.awt.geom.Area;
|
||||
import java.awt.geom.RoundRectangle2D;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JProgressBar;
|
||||
import javax.swing.LookAndFeel;
|
||||
@@ -60,6 +62,8 @@ public class FlatProgressBarUI
|
||||
protected Dimension horizontalSize;
|
||||
protected Dimension verticalSize;
|
||||
|
||||
private PropertyChangeListener propertyChangeListener;
|
||||
|
||||
public static ComponentUI createUI( JComponent c ) {
|
||||
return new FlatProgressBarUI();
|
||||
}
|
||||
@@ -75,11 +79,35 @@ public class FlatProgressBarUI
|
||||
verticalSize = UIManager.getDimension( "ProgressBar.verticalSize" );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installListeners() {
|
||||
super.installListeners();
|
||||
|
||||
propertyChangeListener = e -> {
|
||||
switch( e.getPropertyName() ) {
|
||||
case PROGRESS_BAR_LARGE_HEIGHT:
|
||||
case PROGRESS_BAR_SQUARE:
|
||||
progressBar.revalidate();
|
||||
progressBar.repaint();
|
||||
break;
|
||||
}
|
||||
};
|
||||
progressBar.addPropertyChangeListener( propertyChangeListener );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallListeners() {
|
||||
super.uninstallListeners();
|
||||
|
||||
progressBar.removePropertyChangeListener( propertyChangeListener );
|
||||
propertyChangeListener = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize( JComponent c ) {
|
||||
Dimension size = super.getPreferredSize( c );
|
||||
|
||||
if( progressBar.isStringPainted() ) {
|
||||
if( progressBar.isStringPainted() || clientPropertyBoolean( c, PROGRESS_BAR_LARGE_HEIGHT, false ) ) {
|
||||
// recalculate progress height/width to make it smaller
|
||||
Insets insets = progressBar.getInsets();
|
||||
FontMetrics fm = progressBar.getFontMetrics( progressBar.getFont() );
|
||||
@@ -122,7 +150,9 @@ public class FlatProgressBarUI
|
||||
return;
|
||||
|
||||
boolean horizontal = (progressBar.getOrientation() == JProgressBar.HORIZONTAL);
|
||||
int arc = Math.min( UIScale.scale( this.arc ), horizontal ? height : width );
|
||||
int arc = clientPropertyBoolean( c, PROGRESS_BAR_SQUARE, false )
|
||||
? 0
|
||||
: Math.min( UIScale.scale( this.arc ), horizontal ? height : width );
|
||||
|
||||
FlatUIUtils.setRenderingHints( (Graphics2D) g );
|
||||
|
||||
|
||||
@@ -17,8 +17,11 @@
|
||||
package com.formdev.flatlaf.ui;
|
||||
|
||||
import static com.formdev.flatlaf.util.UIScale.scale;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Rectangle;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.basic.BasicRadioButtonMenuItemUI;
|
||||
|
||||
@@ -74,4 +77,9 @@ public class FlatRadioButtonMenuItemUI
|
||||
defaultTextIconGap = scale( defaultTextIconGap );
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintText( Graphics g, JMenuItem menuItem, Rectangle textRect, String text ) {
|
||||
FlatMenuItemUI.paintText( g, menuItem, textRect, text, disabledForeground, selectionForeground );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,6 +169,7 @@ public class FlatTabbedPaneUI
|
||||
switch( e.getPropertyName() ) {
|
||||
case TABBED_PANE_SHOW_TAB_SEPARATORS:
|
||||
case TABBED_PANE_HAS_FULL_BORDER:
|
||||
case TABBED_PANE_TAB_HEIGHT:
|
||||
tabPane.revalidate();
|
||||
tabPane.repaint();
|
||||
break;
|
||||
@@ -181,7 +182,7 @@ public class FlatTabbedPaneUI
|
||||
protected JButton createScrollButton( int direction ) {
|
||||
// this method is invoked before installDefaults(), so we can not use color fields here
|
||||
return new FlatArrowButton( direction, UIManager.getString( "Component.arrowType" ),
|
||||
UIManager.getColor( "TabbedPane.shadow" ),
|
||||
UIManager.getColor( "TabbedPane.foreground" ),
|
||||
UIManager.getColor( "TabbedPane.disabledForeground" ), null,
|
||||
UIManager.getColor( "TabbedPane.hoverColor" ) );
|
||||
}
|
||||
@@ -215,6 +216,7 @@ public class FlatTabbedPaneUI
|
||||
|
||||
@Override
|
||||
protected int calculateTabHeight( int tabPlacement, int tabIndex, int fontHeight ) {
|
||||
int tabHeight = clientPropertyInt( tabPane, TABBED_PANE_TAB_HEIGHT, this.tabHeight );
|
||||
return Math.max( tabHeight, super.calculateTabHeight( tabPlacement, tabIndex, fontHeight ) - 2 /* was added by superclass */ );
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ import javax.swing.UIManager;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.UIResource;
|
||||
import javax.swing.plaf.basic.BasicTextFieldUI;
|
||||
import javax.swing.text.Caret;
|
||||
import javax.swing.text.JTextComponent;
|
||||
import com.formdev.flatlaf.FlatClientProperties;
|
||||
|
||||
@@ -62,6 +63,7 @@ import com.formdev.flatlaf.FlatClientProperties;
|
||||
* @uiDefault Component.minimumWidth int
|
||||
* @uiDefault Component.isIntelliJTheme boolean
|
||||
* @uiDefault TextField.placeholderForeground Color
|
||||
* @uiDefault TextComponent.selectAllOnFocusPolicy String never, once (default) or always
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
@@ -119,6 +121,11 @@ public class FlatTextFieldUI
|
||||
focusListener = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Caret createCaret() {
|
||||
return new FlatCaret( UIManager.getString( "TextComponent.selectAllOnFocusPolicy" ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void propertyChange( PropertyChangeEvent e ) {
|
||||
super.propertyChange( e );
|
||||
|
||||
@@ -20,6 +20,7 @@ import static com.formdev.flatlaf.FlatClientProperties.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Graphics;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.ButtonModel;
|
||||
import javax.swing.JComponent;
|
||||
@@ -60,12 +61,12 @@ import com.formdev.flatlaf.util.UIScale;
|
||||
* @uiDefault ToggleButton.disabledSelectedBackground Color
|
||||
* @uiDefault ToggleButton.toolbar.selectedBackground Color
|
||||
*
|
||||
* @uiDefault ToggleButton.underline.underlineHeight int
|
||||
* @uiDefault ToggleButton.underline.underlineColor Color
|
||||
* @uiDefault ToggleButton.underline.disabledUnderlineColor Color
|
||||
* @uiDefault ToggleButton.underline.selectedBackground Color optional
|
||||
* @uiDefault ToggleButton.underline.hoverBackground Color
|
||||
* @uiDefault ToggleButton.underline.focusBackground Color
|
||||
* @uiDefault ToggleButton.tab.underlineHeight int
|
||||
* @uiDefault ToggleButton.tab.underlineColor Color
|
||||
* @uiDefault ToggleButton.tab.disabledUnderlineColor Color
|
||||
* @uiDefault ToggleButton.tab.selectedBackground Color optional
|
||||
* @uiDefault ToggleButton.tab.hoverBackground Color
|
||||
* @uiDefault ToggleButton.tab.focusBackground Color
|
||||
*
|
||||
*
|
||||
* @author Karl Tauber
|
||||
@@ -79,12 +80,12 @@ public class FlatToggleButtonUI
|
||||
|
||||
protected Color toolbarSelectedBackground;
|
||||
|
||||
protected int underlineHeight;
|
||||
protected Color underlineColor;
|
||||
protected Color disabledUnderlineColor;
|
||||
protected Color underlineSelectedBackground;
|
||||
protected Color underlineHoverBackground;
|
||||
protected Color underlineFocusBackground;
|
||||
protected int tabUnderlineHeight;
|
||||
protected Color tabUnderlineColor;
|
||||
protected Color tabDisabledUnderlineColor;
|
||||
protected Color tabSelectedBackground;
|
||||
protected Color tabHoverBackground;
|
||||
protected Color tabFocusBackground;
|
||||
|
||||
private boolean defaults_initialized = false;
|
||||
|
||||
@@ -112,12 +113,12 @@ public class FlatToggleButtonUI
|
||||
|
||||
toolbarSelectedBackground = UIManager.getColor( "ToggleButton.toolbar.selectedBackground" );
|
||||
|
||||
underlineHeight = UIManager.getInt( "ToggleButton.underline.underlineHeight" );
|
||||
underlineColor = UIManager.getColor( "ToggleButton.underline.underlineColor" );
|
||||
disabledUnderlineColor = UIManager.getColor( "ToggleButton.underline.disabledUnderlineColor" );
|
||||
underlineSelectedBackground = UIManager.getColor( "ToggleButton.underline.selectedBackground" );
|
||||
underlineHoverBackground = UIManager.getColor( "ToggleButton.underline.hoverBackground" );
|
||||
underlineFocusBackground = UIManager.getColor( "ToggleButton.underline.focusBackground" );
|
||||
tabUnderlineHeight = UIManager.getInt( "ToggleButton.tab.underlineHeight" );
|
||||
tabUnderlineColor = UIManager.getColor( "ToggleButton.tab.underlineColor" );
|
||||
tabDisabledUnderlineColor = UIManager.getColor( "ToggleButton.tab.disabledUnderlineColor" );
|
||||
tabSelectedBackground = UIManager.getColor( "ToggleButton.tab.selectedBackground" );
|
||||
tabHoverBackground = UIManager.getColor( "ToggleButton.tab.hoverBackground" );
|
||||
tabFocusBackground = UIManager.getColor( "ToggleButton.tab.focusBackground" );
|
||||
|
||||
defaults_initialized = true;
|
||||
}
|
||||
@@ -129,21 +130,44 @@ public class FlatToggleButtonUI
|
||||
defaults_initialized = false;
|
||||
}
|
||||
|
||||
static boolean isUnderlineButton( Component c ) {
|
||||
return c instanceof JToggleButton && clientPropertyEquals( (JToggleButton) c, BUTTON_TYPE, BUTTON_TYPE_UNDERLINE );
|
||||
@Override
|
||||
protected void propertyChange( AbstractButton b, PropertyChangeEvent e ) {
|
||||
super.propertyChange( b, e );
|
||||
|
||||
switch( e.getPropertyName() ) {
|
||||
case BUTTON_TYPE:
|
||||
if( BUTTON_TYPE_TAB.equals( e.getOldValue() ) || BUTTON_TYPE_TAB.equals( e.getNewValue() ) ) {
|
||||
MigLayoutVisualPadding.uninstall( b );
|
||||
MigLayoutVisualPadding.install( b, getFocusWidth( b ) );
|
||||
b.revalidate();
|
||||
}
|
||||
|
||||
b.repaint();
|
||||
break;
|
||||
|
||||
case TAB_BUTTON_UNDERLINE_HEIGHT:
|
||||
case TAB_BUTTON_UNDERLINE_COLOR:
|
||||
case TAB_BUTTON_SELECTED_BACKGROUND:
|
||||
b.repaint();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static boolean isTabButton( Component c ) {
|
||||
return c instanceof JToggleButton && clientPropertyEquals( (JToggleButton) c, BUTTON_TYPE, BUTTON_TYPE_TAB );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintBackground( Graphics g, JComponent c ) {
|
||||
if( isUnderlineButton( c ) ) {
|
||||
if( isTabButton( c ) ) {
|
||||
int height = c.getHeight();
|
||||
int width = c.getWidth();
|
||||
boolean selected = ((AbstractButton)c).isSelected();
|
||||
|
||||
// paint background
|
||||
Color background = buttonStateColor( c,
|
||||
selected ? underlineSelectedBackground : null,
|
||||
null, underlineFocusBackground, underlineHoverBackground, null );
|
||||
selected ? clientPropertyColor( c, TAB_BUTTON_SELECTED_BACKGROUND, tabSelectedBackground ) : null,
|
||||
null, tabFocusBackground, tabHoverBackground, null );
|
||||
if( background != null ) {
|
||||
g.setColor( background );
|
||||
g.fillRect( 0, 0, width, height );
|
||||
@@ -151,8 +175,10 @@ public class FlatToggleButtonUI
|
||||
|
||||
// paint underline if selected
|
||||
if( selected ) {
|
||||
int underlineHeight = UIScale.scale( this.underlineHeight );
|
||||
g.setColor( c.isEnabled() ? underlineColor : disabledUnderlineColor );
|
||||
int underlineHeight = UIScale.scale( clientPropertyInt( c, TAB_BUTTON_UNDERLINE_HEIGHT, tabUnderlineHeight ) );
|
||||
g.setColor( c.isEnabled()
|
||||
? clientPropertyColor( c, TAB_BUTTON_UNDERLINE_COLOR, tabUnderlineColor )
|
||||
: tabDisabledUnderlineColor );
|
||||
g.fillRect( 0, height - underlineHeight, width, underlineHeight );
|
||||
}
|
||||
} else
|
||||
@@ -186,4 +212,9 @@ public class FlatToggleButtonUI
|
||||
|
||||
return super.getForeground( c );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getFocusWidth( JComponent c ) {
|
||||
return isTabButton( c ) ? 0 : super.getFocusWidth( c );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,8 +113,11 @@ public class FlatUIUtils
|
||||
}
|
||||
|
||||
public static int minimumWidth( JComponent c, int minimumWidth ) {
|
||||
Object p = c.getClientProperty( FlatClientProperties.MINIMUM_WIDTH );
|
||||
return (p instanceof Integer) ? ((Integer)p).intValue() : minimumWidth;
|
||||
return FlatClientProperties.clientPropertyInt( c, FlatClientProperties.MINIMUM_WIDTH, minimumWidth );
|
||||
}
|
||||
|
||||
public static int minimumHeight( JComponent c, int minimumHeight ) {
|
||||
return FlatClientProperties.clientPropertyInt( c, FlatClientProperties.MINIMUM_HEIGHT, minimumHeight );
|
||||
}
|
||||
|
||||
public static boolean isTableCellEditor( Component c ) {
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
@selectionInactiveForeground=@foreground
|
||||
@disabledText=#777777
|
||||
@textComponentBackground=#45494A
|
||||
@menuBackground=darken(@background,5%)
|
||||
@cellFocusColor=#000000
|
||||
@icon=#adadad
|
||||
|
||||
@@ -144,6 +145,7 @@ Menu.icon.disabledArrowColor=#606060
|
||||
#---- MenuBar ----
|
||||
|
||||
MenuBar.borderColor=#515151
|
||||
MenuBar.hoverBackground=lighten($MenuBar.background,10%)
|
||||
|
||||
|
||||
#---- MenuItemCheckBox ----
|
||||
@@ -154,7 +156,7 @@ MenuItemCheckBox.icon.disabledCheckmarkColor=#606060
|
||||
|
||||
#---- PopupMenu ----
|
||||
|
||||
PopupMenu.borderColor=#515151
|
||||
PopupMenu.borderColor=#5e5e5e
|
||||
|
||||
|
||||
#---- ProgressBar ----
|
||||
|
||||
@@ -59,6 +59,7 @@ ViewportUI=com.formdev.flatlaf.ui.FlatViewportUI
|
||||
#---- variables ----
|
||||
|
||||
@textComponentMargin=2,6,2,6
|
||||
@menuItemMargin=2,8,2,8
|
||||
|
||||
|
||||
#---- system colors ----
|
||||
@@ -117,10 +118,12 @@ CheckBox.rollover=true
|
||||
|
||||
#---- CheckBoxMenuItem ----
|
||||
|
||||
CheckBoxMenuItem.border=com.formdev.flatlaf.ui.FlatMarginBorder
|
||||
CheckBoxMenuItem.border=com.formdev.flatlaf.ui.FlatMenuItemBorder
|
||||
CheckBoxMenuItem.checkIcon=com.formdev.flatlaf.icons.FlatCheckBoxMenuItemIcon
|
||||
CheckBoxMenuItem.arrowIcon=com.formdev.flatlaf.icons.FlatMenuItemArrowIcon
|
||||
CheckBoxMenuItem.margin=2,2,2,2
|
||||
CheckBoxMenuItem.margin=@menuItemMargin
|
||||
CheckBoxMenuItem.opaque=false
|
||||
CheckBoxMenuItem.background=@menuBackground
|
||||
|
||||
|
||||
#---- ColorChooser ----
|
||||
@@ -212,21 +215,29 @@ List.dropLineColor=@dropLineColor
|
||||
|
||||
#---- Menu ----
|
||||
|
||||
Menu.border=com.formdev.flatlaf.ui.FlatMarginBorder
|
||||
Menu.border=com.formdev.flatlaf.ui.FlatMenuItemBorder
|
||||
Menu.arrowIcon=com.formdev.flatlaf.icons.FlatMenuArrowIcon
|
||||
Menu.margin=2,2,2,2
|
||||
Menu.margin=@menuItemMargin
|
||||
Menu.submenuPopupOffsetX={scaledInteger}-4
|
||||
Menu.submenuPopupOffsetY={scaledInteger}-4
|
||||
Menu.opaque=false
|
||||
Menu.background=@menuBackground
|
||||
|
||||
|
||||
#---- MenuBar ----
|
||||
|
||||
MenuBar.border=com.formdev.flatlaf.ui.FlatMenuBarBorder
|
||||
MenuBar.background=@menuBackground
|
||||
MenuBar.itemMargins=3,3,3,3
|
||||
|
||||
|
||||
#---- MenuItem ----
|
||||
|
||||
MenuItem.border=com.formdev.flatlaf.ui.FlatMarginBorder
|
||||
MenuItem.border=com.formdev.flatlaf.ui.FlatMenuItemBorder
|
||||
MenuItem.arrowIcon=com.formdev.flatlaf.icons.FlatMenuItemArrowIcon
|
||||
MenuItem.margin=2,2,2,2
|
||||
MenuItem.margin=@menuItemMargin
|
||||
MenuItem.opaque=false
|
||||
MenuItem.background=@menuBackground
|
||||
|
||||
|
||||
#---- OptionPane ----
|
||||
@@ -263,7 +274,8 @@ PasswordField.placeholderForeground=@disabledText
|
||||
#---- PopupMenu ----
|
||||
|
||||
PopupMenu.border=com.formdev.flatlaf.ui.FlatPopupMenuBorder
|
||||
PopupMenu.borderInsets=1,1,1,1
|
||||
PopupMenu.borderInsets=4,1,4,1
|
||||
PopupMenu.background=@menuBackground
|
||||
|
||||
|
||||
#---- PopupMenuSeparator ----
|
||||
@@ -279,6 +291,8 @@ ProgressBar.border=com.formdev.flatlaf.ui.FlatEmptyBorder
|
||||
ProgressBar.arc=4
|
||||
ProgressBar.horizontalSize=146,4
|
||||
ProgressBar.verticalSize=4,146
|
||||
ProgressBar.cycleTime=4000
|
||||
ProgressBar.repaintInterval=15
|
||||
|
||||
|
||||
#---- RadioButton ----
|
||||
@@ -293,10 +307,12 @@ RadioButton.rollover=true
|
||||
|
||||
#---- RadioButtonMenuItem ----
|
||||
|
||||
RadioButtonMenuItem.border=com.formdev.flatlaf.ui.FlatMarginBorder
|
||||
RadioButtonMenuItem.border=com.formdev.flatlaf.ui.FlatMenuItemBorder
|
||||
RadioButtonMenuItem.checkIcon=com.formdev.flatlaf.icons.FlatRadioButtonMenuItemIcon
|
||||
RadioButtonMenuItem.arrowIcon=com.formdev.flatlaf.icons.FlatMenuItemArrowIcon
|
||||
RadioButtonMenuItem.margin=2,2,2,2
|
||||
RadioButtonMenuItem.margin=@menuItemMargin
|
||||
RadioButtonMenuItem.opaque=false
|
||||
RadioButtonMenuItem.background=@menuBackground
|
||||
|
||||
|
||||
#---- ScrollBar ----
|
||||
@@ -366,7 +382,7 @@ TabbedPane.tabAreaInsets=0,0,0,0
|
||||
TabbedPane.selectedTabPadInsets=0,0,0,0
|
||||
TabbedPane.tabRunOverlay=0
|
||||
TabbedPane.tabsOverlapBorder=true
|
||||
TabbedPane.shadow=$ComboBox.buttonArrowColor
|
||||
TabbedPane.shadow=@background
|
||||
|
||||
|
||||
#---- Table ----
|
||||
@@ -405,6 +421,12 @@ TextArea.margin=@textComponentMargin
|
||||
TextArea.background=@textComponentBackground
|
||||
|
||||
|
||||
#---- TextComponent ----
|
||||
|
||||
# allowed values: "never", "once" (default) or "always"
|
||||
TextComponent.selectAllOnFocusPolicy=once
|
||||
|
||||
|
||||
#---- TextField ----
|
||||
|
||||
TextField.border=com.formdev.flatlaf.ui.FlatBorder
|
||||
@@ -439,13 +461,13 @@ ToggleButton.pressedBackground=$Button.pressedBackground
|
||||
ToggleButton.toolbar.hoverBackground=$Button.toolbar.hoverBackground
|
||||
ToggleButton.toolbar.pressedBackground=$Button.toolbar.pressedBackground
|
||||
|
||||
# button type "underline"
|
||||
ToggleButton.underline.underlineHeight=2
|
||||
ToggleButton.underline.underlineColor=$TabbedPane.underlineColor
|
||||
ToggleButton.underline.disabledUnderlineColor=$TabbedPane.disabledUnderlineColor
|
||||
ToggleButton.underline.selectedBackground=$?TabbedPane.selectedBackground
|
||||
ToggleButton.underline.hoverBackground=$TabbedPane.hoverColor
|
||||
ToggleButton.underline.focusBackground=$TabbedPane.focusColor
|
||||
# button type "tab"
|
||||
ToggleButton.tab.underlineHeight=2
|
||||
ToggleButton.tab.underlineColor=$TabbedPane.underlineColor
|
||||
ToggleButton.tab.disabledUnderlineColor=$TabbedPane.disabledUnderlineColor
|
||||
ToggleButton.tab.selectedBackground=$?TabbedPane.selectedBackground
|
||||
ToggleButton.tab.hoverBackground=$TabbedPane.hoverColor
|
||||
ToggleButton.tab.focusBackground=$TabbedPane.focusColor
|
||||
|
||||
|
||||
#---- ToolBar ----
|
||||
@@ -475,11 +497,12 @@ ToolTip.foregroundInactive=@disabledText
|
||||
Tree.border=1,1,1,1
|
||||
Tree.selectionInactiveBackground=@selectionInactiveBackground
|
||||
Tree.selectionInactiveForeground=@selectionInactiveForeground
|
||||
Tree.textBackground=null
|
||||
Tree.textBackground=$Tree.background
|
||||
Tree.selectionBorderColor=@cellFocusColor
|
||||
Tree.dropCellBackground=@dropCellBackground
|
||||
Tree.dropCellForeground=@dropCellForeground
|
||||
Tree.dropLineColor=@dropLineColor
|
||||
Tree.rendererFillBackground=false
|
||||
Tree.rendererMargins=1,2,1,2
|
||||
Tree.wideSelection=true
|
||||
Tree.paintLines=false
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
@selectionInactiveForeground=@foreground
|
||||
@disabledText=#8C8C8C
|
||||
@textComponentBackground=#ffffff
|
||||
@menuBackground=#fff
|
||||
@cellFocusColor=#000000
|
||||
@icon=#afafaf
|
||||
|
||||
@@ -151,6 +152,7 @@ Menu.icon.disabledArrowColor=#ABABAB
|
||||
#---- MenuBar ----
|
||||
|
||||
MenuBar.borderColor=#cdcdcd
|
||||
MenuBar.hoverBackground=darken($MenuBar.background,10%)
|
||||
|
||||
|
||||
#---- MenuItemCheckBox ----
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.formdev.flatlaf.demo;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.DefaultEditorKit;
|
||||
import net.miginfocom.swing.*;
|
||||
|
||||
/**
|
||||
@@ -113,6 +114,10 @@ class BasicComponentsPanel
|
||||
JScrollPane scrollPane12 = new JScrollPane();
|
||||
JTextPane textPane4 = new JTextPane();
|
||||
JTextPane textPane5 = new JTextPane();
|
||||
JPopupMenu popupMenu1 = new JPopupMenu();
|
||||
JMenuItem cutMenuItem = new JMenuItem();
|
||||
JMenuItem copyMenuItem = new JMenuItem();
|
||||
JMenuItem pasteMenuItem = new JMenuItem();
|
||||
|
||||
//======== this ========
|
||||
setLayout(new MigLayout(
|
||||
@@ -260,6 +265,8 @@ class BasicComponentsPanel
|
||||
|
||||
//---- comboBoxLabel ----
|
||||
comboBoxLabel.setText("JComboBox:");
|
||||
comboBoxLabel.setDisplayedMnemonic('C');
|
||||
comboBoxLabel.setLabelFor(comboBox1);
|
||||
add(comboBoxLabel, "cell 0 4");
|
||||
|
||||
//---- comboBox1 ----
|
||||
@@ -314,6 +321,8 @@ class BasicComponentsPanel
|
||||
|
||||
//---- spinnerLabel ----
|
||||
spinnerLabel.setText("JSpinner:");
|
||||
spinnerLabel.setLabelFor(spinner1);
|
||||
spinnerLabel.setDisplayedMnemonic('S');
|
||||
add(spinnerLabel, "cell 0 5");
|
||||
add(spinner1, "cell 1 5,growx");
|
||||
|
||||
@@ -328,10 +337,13 @@ class BasicComponentsPanel
|
||||
|
||||
//---- textFieldLabel ----
|
||||
textFieldLabel.setText("JTextField:");
|
||||
textFieldLabel.setDisplayedMnemonic('T');
|
||||
textFieldLabel.setLabelFor(textField1);
|
||||
add(textFieldLabel, "cell 0 6");
|
||||
|
||||
//---- textField1 ----
|
||||
textField1.setText("editable");
|
||||
textField1.setComponentPopupMenu(popupMenu1);
|
||||
add(textField1, "cell 1 6,growx");
|
||||
|
||||
//---- textField2 ----
|
||||
@@ -356,10 +368,13 @@ class BasicComponentsPanel
|
||||
|
||||
//---- formattedTextFieldLabel ----
|
||||
formattedTextFieldLabel.setText("JFormattedTextField:");
|
||||
formattedTextFieldLabel.setLabelFor(formattedTextField1);
|
||||
formattedTextFieldLabel.setDisplayedMnemonic('O');
|
||||
add(formattedTextFieldLabel, "cell 0 7");
|
||||
|
||||
//---- formattedTextField1 ----
|
||||
formattedTextField1.setText("editable");
|
||||
formattedTextField1.setComponentPopupMenu(popupMenu1);
|
||||
add(formattedTextField1, "cell 1 7,growx");
|
||||
|
||||
//---- formattedTextField2 ----
|
||||
@@ -582,7 +597,27 @@ class BasicComponentsPanel
|
||||
//---- textPane5 ----
|
||||
textPane5.setText("no scroll pane");
|
||||
add(textPane5, "cell 5 11,growx");
|
||||
|
||||
//======== popupMenu1 ========
|
||||
{
|
||||
|
||||
//---- cutMenuItem ----
|
||||
cutMenuItem.setText("Cut");
|
||||
popupMenu1.add(cutMenuItem);
|
||||
|
||||
//---- copyMenuItem ----
|
||||
copyMenuItem.setText("Copy");
|
||||
popupMenu1.add(copyMenuItem);
|
||||
|
||||
//---- pasteMenuItem ----
|
||||
pasteMenuItem.setText("Paste");
|
||||
popupMenu1.add(pasteMenuItem);
|
||||
}
|
||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||
|
||||
cutMenuItem.addActionListener( new DefaultEditorKit.CutAction() );
|
||||
copyMenuItem.addActionListener( new DefaultEditorKit.CopyAction() );
|
||||
pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() );
|
||||
}
|
||||
|
||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||
|
||||
@@ -183,6 +183,8 @@ new FormModel {
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "comboBoxLabel"
|
||||
"text": "JComboBox:"
|
||||
"displayedMnemonic": 67
|
||||
"labelFor": new FormReference( "comboBox1" )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 4"
|
||||
} )
|
||||
@@ -254,6 +256,8 @@ new FormModel {
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "spinnerLabel"
|
||||
"text": "JSpinner:"
|
||||
"labelFor": new FormReference( "spinner1" )
|
||||
"displayedMnemonic": 83
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 5"
|
||||
} )
|
||||
@@ -281,12 +285,15 @@ new FormModel {
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "textFieldLabel"
|
||||
"text": "JTextField:"
|
||||
"displayedMnemonic": 84
|
||||
"labelFor": new FormReference( "textField1" )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 6"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JTextField" ) {
|
||||
name: "textField1"
|
||||
"text": "editable"
|
||||
"componentPopupMenu": &FormReference0 new FormReference( "popupMenu1" )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 6,growx"
|
||||
} )
|
||||
@@ -321,12 +328,15 @@ new FormModel {
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "formattedTextFieldLabel"
|
||||
"text": "JFormattedTextField:"
|
||||
"labelFor": new FormReference( "formattedTextField1" )
|
||||
"displayedMnemonic": 79
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 7"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JFormattedTextField" ) {
|
||||
name: "formattedTextField1"
|
||||
"text": "editable"
|
||||
"componentPopupMenu": #FormReference0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 7,growx"
|
||||
} )
|
||||
@@ -585,7 +595,25 @@ new FormModel {
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 0 )
|
||||
"size": new java.awt.Dimension( 790, 715 )
|
||||
"size": new java.awt.Dimension( 790, 440 )
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JPopupMenu", new FormLayoutManager( class javax.swing.JPopupMenu ) ) {
|
||||
name: "popupMenu1"
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "cutMenuItem"
|
||||
"text": "Cut"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "copyMenuItem"
|
||||
"text": "Copy"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "pasteMenuItem"
|
||||
"text": "Paste"
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 500 )
|
||||
"size": new java.awt.Dimension( 91, 87 )
|
||||
} )
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.formdev.flatlaf.demo;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.DefaultEditorKit;
|
||||
import com.formdev.flatlaf.demo.intellijthemes.*;
|
||||
import com.formdev.flatlaf.extras.FlatSVGIcon;
|
||||
import net.miginfocom.swing.*;
|
||||
@@ -51,6 +52,12 @@ class DemoFrame
|
||||
DemoPrefs.getState().putInt( FlatLafDemo.KEY_TAB, tabbedPane.getSelectedIndex() );
|
||||
}
|
||||
|
||||
private void menuItemActionPerformed(ActionEvent e) {
|
||||
SwingUtilities.invokeLater( () -> {
|
||||
JOptionPane.showMessageDialog( this, e.getActionCommand(), "Menu Item", JOptionPane.PLAIN_MESSAGE );
|
||||
} );
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
||||
JMenuBar menuBar1 = new JMenuBar();
|
||||
@@ -68,6 +75,14 @@ class DemoFrame
|
||||
JMenuItem deleteMenuItem = new JMenuItem();
|
||||
JMenu viewMenu = new JMenu();
|
||||
JCheckBoxMenuItem checkBoxMenuItem1 = new JCheckBoxMenuItem();
|
||||
JMenu menu1 = new JMenu();
|
||||
JMenu subViewsMenu = new JMenu();
|
||||
JMenu subSubViewsMenu = new JMenu();
|
||||
JMenuItem errorLogViewMenuItem = new JMenuItem();
|
||||
JMenuItem searchViewMenuItem = new JMenuItem();
|
||||
JMenuItem projectViewMenuItem = new JMenuItem();
|
||||
JMenuItem structureViewMenuItem = new JMenuItem();
|
||||
JMenuItem propertiesViewMenuItem = new JMenuItem();
|
||||
JRadioButtonMenuItem radioButtonMenuItem1 = new JRadioButtonMenuItem();
|
||||
JRadioButtonMenuItem radioButtonMenuItem2 = new JRadioButtonMenuItem();
|
||||
JRadioButtonMenuItem radioButtonMenuItem3 = new JRadioButtonMenuItem();
|
||||
@@ -103,27 +118,35 @@ class DemoFrame
|
||||
//======== fileMenu ========
|
||||
{
|
||||
fileMenu.setText("File");
|
||||
fileMenu.setMnemonic('F');
|
||||
|
||||
//---- newMenuItem ----
|
||||
newMenuItem.setText("New");
|
||||
newMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||
newMenuItem.setMnemonic('N');
|
||||
newMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
fileMenu.add(newMenuItem);
|
||||
|
||||
//---- openMenuItem ----
|
||||
openMenuItem.setText("Open");
|
||||
openMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||
openMenuItem.setMnemonic('O');
|
||||
openMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
fileMenu.add(openMenuItem);
|
||||
fileMenu.addSeparator();
|
||||
|
||||
//---- closeMenuItem ----
|
||||
closeMenuItem.setText("Close");
|
||||
closeMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||
closeMenuItem.setMnemonic('C');
|
||||
closeMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
fileMenu.add(closeMenuItem);
|
||||
fileMenu.addSeparator();
|
||||
|
||||
//---- exitMenuItem ----
|
||||
exitMenuItem.setText("Exit");
|
||||
exitMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||
exitMenuItem.setMnemonic('X');
|
||||
exitMenuItem.addActionListener(e -> exitActionPerformed());
|
||||
fileMenu.add(exitMenuItem);
|
||||
}
|
||||
@@ -132,37 +155,47 @@ class DemoFrame
|
||||
//======== editMenu ========
|
||||
{
|
||||
editMenu.setText("Edit");
|
||||
editMenu.setMnemonic('E');
|
||||
|
||||
//---- undoMenuItem ----
|
||||
undoMenuItem.setText("Undo");
|
||||
undoMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||
undoMenuItem.setMnemonic('U');
|
||||
undoMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
editMenu.add(undoMenuItem);
|
||||
|
||||
//---- redoMenuItem ----
|
||||
redoMenuItem.setText("Redo");
|
||||
redoMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||
redoMenuItem.setMnemonic('R');
|
||||
redoMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
editMenu.add(redoMenuItem);
|
||||
editMenu.addSeparator();
|
||||
|
||||
//---- cutMenuItem ----
|
||||
cutMenuItem.setText("Cut");
|
||||
cutMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||
cutMenuItem.setMnemonic('C');
|
||||
editMenu.add(cutMenuItem);
|
||||
|
||||
//---- copyMenuItem ----
|
||||
copyMenuItem.setText("Copy");
|
||||
copyMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||
copyMenuItem.setMnemonic('O');
|
||||
editMenu.add(copyMenuItem);
|
||||
|
||||
//---- pasteMenuItem ----
|
||||
pasteMenuItem.setText("Paste");
|
||||
pasteMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||
pasteMenuItem.setMnemonic('P');
|
||||
editMenu.add(pasteMenuItem);
|
||||
editMenu.addSeparator();
|
||||
|
||||
//---- deleteMenuItem ----
|
||||
deleteMenuItem.setText("Delete");
|
||||
deleteMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0));
|
||||
deleteMenuItem.setMnemonic('D');
|
||||
deleteMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
editMenu.add(deleteMenuItem);
|
||||
}
|
||||
menuBar1.add(editMenu);
|
||||
@@ -170,24 +203,84 @@ class DemoFrame
|
||||
//======== viewMenu ========
|
||||
{
|
||||
viewMenu.setText("View");
|
||||
viewMenu.setMnemonic('V');
|
||||
|
||||
//---- checkBoxMenuItem1 ----
|
||||
checkBoxMenuItem1.setText("Show Toolbar");
|
||||
checkBoxMenuItem1.setSelected(true);
|
||||
checkBoxMenuItem1.setMnemonic('T');
|
||||
checkBoxMenuItem1.addActionListener(e -> menuItemActionPerformed(e));
|
||||
viewMenu.add(checkBoxMenuItem1);
|
||||
|
||||
//======== menu1 ========
|
||||
{
|
||||
menu1.setText("Show View");
|
||||
menu1.setMnemonic('V');
|
||||
|
||||
//======== subViewsMenu ========
|
||||
{
|
||||
subViewsMenu.setText("Sub Views");
|
||||
subViewsMenu.setMnemonic('S');
|
||||
|
||||
//======== subSubViewsMenu ========
|
||||
{
|
||||
subSubViewsMenu.setText("Sub sub Views");
|
||||
subSubViewsMenu.setMnemonic('U');
|
||||
|
||||
//---- errorLogViewMenuItem ----
|
||||
errorLogViewMenuItem.setText("Error Log");
|
||||
errorLogViewMenuItem.setMnemonic('E');
|
||||
errorLogViewMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
subSubViewsMenu.add(errorLogViewMenuItem);
|
||||
}
|
||||
subViewsMenu.add(subSubViewsMenu);
|
||||
|
||||
//---- searchViewMenuItem ----
|
||||
searchViewMenuItem.setText("Search");
|
||||
searchViewMenuItem.setMnemonic('S');
|
||||
searchViewMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
subViewsMenu.add(searchViewMenuItem);
|
||||
}
|
||||
menu1.add(subViewsMenu);
|
||||
|
||||
//---- projectViewMenuItem ----
|
||||
projectViewMenuItem.setText("Project");
|
||||
projectViewMenuItem.setMnemonic('P');
|
||||
projectViewMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
menu1.add(projectViewMenuItem);
|
||||
|
||||
//---- structureViewMenuItem ----
|
||||
structureViewMenuItem.setText("Structure");
|
||||
structureViewMenuItem.setMnemonic('T');
|
||||
structureViewMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
menu1.add(structureViewMenuItem);
|
||||
|
||||
//---- propertiesViewMenuItem ----
|
||||
propertiesViewMenuItem.setText("Properties");
|
||||
propertiesViewMenuItem.setMnemonic('O');
|
||||
propertiesViewMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
menu1.add(propertiesViewMenuItem);
|
||||
}
|
||||
viewMenu.add(menu1);
|
||||
viewMenu.addSeparator();
|
||||
|
||||
//---- radioButtonMenuItem1 ----
|
||||
radioButtonMenuItem1.setText("Details");
|
||||
radioButtonMenuItem1.setSelected(true);
|
||||
radioButtonMenuItem1.setMnemonic('D');
|
||||
radioButtonMenuItem1.addActionListener(e -> menuItemActionPerformed(e));
|
||||
viewMenu.add(radioButtonMenuItem1);
|
||||
|
||||
//---- radioButtonMenuItem2 ----
|
||||
radioButtonMenuItem2.setText("Small Icons");
|
||||
radioButtonMenuItem2.setMnemonic('S');
|
||||
radioButtonMenuItem2.addActionListener(e -> menuItemActionPerformed(e));
|
||||
viewMenu.add(radioButtonMenuItem2);
|
||||
|
||||
//---- radioButtonMenuItem3 ----
|
||||
radioButtonMenuItem3.setText("Large Icons");
|
||||
radioButtonMenuItem3.setMnemonic('L');
|
||||
radioButtonMenuItem3.addActionListener(e -> menuItemActionPerformed(e));
|
||||
viewMenu.add(radioButtonMenuItem3);
|
||||
}
|
||||
menuBar1.add(viewMenu);
|
||||
@@ -195,9 +288,11 @@ class DemoFrame
|
||||
//======== helpMenu ========
|
||||
{
|
||||
helpMenu.setText("Help");
|
||||
helpMenu.setMnemonic('H');
|
||||
|
||||
//---- aboutMenuItem ----
|
||||
aboutMenuItem.setText("About");
|
||||
aboutMenuItem.setMnemonic('A');
|
||||
aboutMenuItem.addActionListener(e -> aboutActionPerformed());
|
||||
helpMenu.add(aboutMenuItem);
|
||||
}
|
||||
@@ -288,6 +383,10 @@ class DemoFrame
|
||||
pasteButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/menu-paste.svg" ) );
|
||||
refreshButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/refresh.svg" ) );
|
||||
showToggleButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/show.svg" ) );
|
||||
|
||||
cutMenuItem.addActionListener( new DefaultEditorKit.CutAction() );
|
||||
copyMenuItem.addActionListener( new DefaultEditorKit.CopyAction() );
|
||||
pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() );
|
||||
}
|
||||
|
||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8"
|
||||
JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
@@ -117,15 +117,20 @@ new FormModel {
|
||||
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||
name: "fileMenu"
|
||||
"text": "File"
|
||||
"mnemonic": 70
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "newMenuItem"
|
||||
"text": "New"
|
||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 78, 4226, false )
|
||||
"mnemonic": 78
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "openMenuItem"
|
||||
"text": "Open"
|
||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 79, 4226, false )
|
||||
"mnemonic": 79
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
|
||||
name: "separator2"
|
||||
@@ -134,6 +139,8 @@ new FormModel {
|
||||
name: "closeMenuItem"
|
||||
"text": "Close"
|
||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 87, 4226, false )
|
||||
"mnemonic": 67
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
|
||||
name: "separator1"
|
||||
@@ -142,21 +149,27 @@ new FormModel {
|
||||
name: "exitMenuItem"
|
||||
"text": "Exit"
|
||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 81, 4226, false )
|
||||
"mnemonic": 88
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "exitActionPerformed", false ) )
|
||||
} )
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||
name: "editMenu"
|
||||
"text": "Edit"
|
||||
"mnemonic": 69
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "undoMenuItem"
|
||||
"text": "Undo"
|
||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 90, 4226, false )
|
||||
"mnemonic": 85
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "redoMenuItem"
|
||||
"text": "Redo"
|
||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 89, 4226, false )
|
||||
"mnemonic": 82
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
|
||||
name: "separator4"
|
||||
@@ -165,16 +178,19 @@ new FormModel {
|
||||
name: "cutMenuItem"
|
||||
"text": "Cut"
|
||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 88, 4226, false )
|
||||
"mnemonic": 67
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "copyMenuItem"
|
||||
"text": "Copy"
|
||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 67, 4226, false )
|
||||
"mnemonic": 79
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "pasteMenuItem"
|
||||
"text": "Paste"
|
||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 86, 4226, false )
|
||||
"mnemonic": 80
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
|
||||
name: "separator3"
|
||||
@@ -183,15 +199,65 @@ new FormModel {
|
||||
name: "deleteMenuItem"
|
||||
"text": "Delete"
|
||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 127, 0, false )
|
||||
"mnemonic": 68
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||
name: "viewMenu"
|
||||
"text": "View"
|
||||
"mnemonic": 86
|
||||
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
|
||||
name: "checkBoxMenuItem1"
|
||||
"text": "Show Toolbar"
|
||||
"selected": true
|
||||
"mnemonic": 84
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||
name: "menu1"
|
||||
"text": "Show View"
|
||||
"mnemonic": 86
|
||||
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||
name: "subViewsMenu"
|
||||
"text": "Sub Views"
|
||||
"mnemonic": 83
|
||||
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||
name: "subSubViewsMenu"
|
||||
"text": "Sub sub Views"
|
||||
"mnemonic": 85
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "errorLogViewMenuItem"
|
||||
"text": "Error Log"
|
||||
"mnemonic": 69
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "searchViewMenuItem"
|
||||
"text": "Search"
|
||||
"mnemonic": 83
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "projectViewMenuItem"
|
||||
"text": "Project"
|
||||
"mnemonic": 80
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "structureViewMenuItem"
|
||||
"text": "Structure"
|
||||
"mnemonic": 84
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "propertiesViewMenuItem"
|
||||
"text": "Properties"
|
||||
"mnemonic": 79
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
|
||||
name: "separator8"
|
||||
@@ -201,24 +267,32 @@ new FormModel {
|
||||
"text": "Details"
|
||||
"selected": true
|
||||
"$buttonGroup": new FormReference( "buttonGroup1" )
|
||||
"mnemonic": 68
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) {
|
||||
name: "radioButtonMenuItem2"
|
||||
"text": "Small Icons"
|
||||
"$buttonGroup": new FormReference( "buttonGroup1" )
|
||||
"mnemonic": 83
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) {
|
||||
name: "radioButtonMenuItem3"
|
||||
"text": "Large Icons"
|
||||
"$buttonGroup": new FormReference( "buttonGroup1" )
|
||||
"mnemonic": 76
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||
name: "helpMenu"
|
||||
"text": "Help"
|
||||
"mnemonic": 72
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "aboutMenuItem"
|
||||
"text": "About"
|
||||
"mnemonic": 65
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "aboutActionPerformed", false ) )
|
||||
} )
|
||||
} )
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"selectionForeground": "#ffffff",
|
||||
"selectionInactiveBackground": "#C36200",
|
||||
"selectionBackgroundInactive": "#c36200",
|
||||
"background" : "#F5F5F5"
|
||||
"background" : "#FFFFFF",
|
||||
"focusColor" : "#f57900"
|
||||
},
|
||||
|
||||
"Borders": {
|
||||
@@ -23,6 +24,7 @@
|
||||
"startBorderColor": "#C4C4C4",
|
||||
"endBorderColor": "#C4C4C4",
|
||||
"focusedBorderColor" : "#f57900",
|
||||
"background" : "#F5F5F5",
|
||||
"default": {
|
||||
"foreground": "#FFFFFF",
|
||||
"startBackground": "#f57900",
|
||||
@@ -40,8 +42,6 @@
|
||||
"WelcomeScreen.background" : "#F5F5F5",
|
||||
"WelcomeScreen.Projects.background" : "#ffffff",
|
||||
|
||||
"List.background" : "#ffffff",
|
||||
|
||||
"MenuBar.foreground" : "#5c616c",
|
||||
"Menu.background" : "#ffffff",
|
||||
"Menu.separatorColor" : "#F5F5F5",
|
||||
@@ -49,8 +49,10 @@
|
||||
"MenuItem.foreground" : "#5c616c",
|
||||
"MenuItem.background" : "#ffffff",
|
||||
"PopupMenuSeparator.height" : "1",
|
||||
"Separator.separatorColor" : "#9ba2ab",
|
||||
|
||||
"Tree.background" : "#ffffff",
|
||||
"Tree.rowHeight": "23",
|
||||
|
||||
"ProgressBar.background" : "#f57900",
|
||||
"ProgressBar.foreground" : "#f57900",
|
||||
@@ -69,9 +71,11 @@
|
||||
"ParameterInfo.background" : "#fffae3",
|
||||
"ParameterInfo.currentOverloadBackground" : "#fffae3",
|
||||
|
||||
"List.background" : "#ffffff",
|
||||
"List.dropLineColor" : "#f57900",
|
||||
"List.selectionBackground": "#f57900",
|
||||
"List.selectionForeground": "#ffffff",
|
||||
"List.selectionInactiveBackground": "#C36200",
|
||||
|
||||
"Table.background" : "#ffffff",
|
||||
"Table.selectionBackground" : "#f57900",
|
||||
@@ -83,6 +87,7 @@
|
||||
|
||||
"TabbedPane.underlineColor" : "#f57900",
|
||||
"TabbedPane.tabSelectionHeight" : 2,
|
||||
"TabbedPane.background" : "#F5F5F5",
|
||||
|
||||
"Link.hoverForeground" : "#f57900",
|
||||
"Link.activeForeground" : "#f57900",
|
||||
@@ -98,8 +103,22 @@
|
||||
"TextArea.background" : "#ffffff",
|
||||
"TextPane.background" : "#ffffff",
|
||||
"PasswordField.background" : "#ffffff",
|
||||
"FormattedTextField.background" : "#ffffff",
|
||||
"Editor.background" : "#f5f5f5",
|
||||
"EditorPane.background" : "#ffffff",
|
||||
|
||||
"CompletionPopup.background" : "#ffffff",
|
||||
"CheckBox.background" : "#F5F5F5",
|
||||
"RadioButton.background" : "#F5F5F5",
|
||||
"Slider.background" : "#F5F5F5",
|
||||
"Spinner.background" : "#F5F5F5",
|
||||
"OptionPane.background" : "#F5F5F5",
|
||||
|
||||
"CompletionPopup": {
|
||||
"selectionBackground" : "#F5790055",
|
||||
"nonFocusedMask": false,
|
||||
"matchForeground": "#F57900",
|
||||
"selectionInactiveBackground": "#C36200"
|
||||
},
|
||||
|
||||
"Plugins.lightSelectionBackground" : "#dddee1",
|
||||
"Plugins.SearchField.background" : "#ffffff",
|
||||
@@ -116,8 +135,10 @@
|
||||
"Counter.foreground" : "#ffffff",
|
||||
|
||||
"SearchEverywhere.SearchField.background" : "#ffffff",
|
||||
"SearchEverywhere.Header.background" : "#F5F5F5",
|
||||
|
||||
"ToolTip.background" : "#fffae3",
|
||||
"ToolTip.background" : "#F5F5F5",
|
||||
"ToolTip.Actions.background" : "#F5F5F5",
|
||||
|
||||
"ToolWindow.Header.background" : "#e7e8eb",
|
||||
"ToolWindow.HeaderTab.selectedBackground" : "#dddee1",
|
||||
@@ -128,8 +149,12 @@
|
||||
"ToolWindow.HeaderTab.underlineColor" : "#f57900",
|
||||
"DefaultTabs.underlineHeight" : 2,
|
||||
"DefaultTabs.underlineColor" : "#f57900",
|
||||
"DefaultTabs.background" : "#F5F5F5",
|
||||
"EditorTabs.underlineHeight" : 2,
|
||||
"EditorTabs.underlineColor" : "#f57900"
|
||||
"EditorTabs.underlineColor" : "#f57900",
|
||||
"EditorTabs.background" : "#F5F5F5",
|
||||
|
||||
"Notification.background" : "#F5F5F5"
|
||||
|
||||
},
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"selectionForeground": "#ffffff",
|
||||
"selectionInactiveBackground": "#1e61b0",
|
||||
"selectionBackgroundInactive": "#1e61b0",
|
||||
"background" : "#F5F5F5"
|
||||
"background" : "#FFFFFF",
|
||||
"focusColor" : "#2679db"
|
||||
},
|
||||
|
||||
"Borders": {
|
||||
@@ -23,6 +24,7 @@
|
||||
"startBorderColor": "#C4C4C4",
|
||||
"endBorderColor": "#C4C4C4",
|
||||
"focusedBorderColor" : "#2679db",
|
||||
"background" : "#F5F5F5",
|
||||
"default": {
|
||||
"foreground": "#FFFFFF",
|
||||
"startBackground": "#2679db",
|
||||
@@ -40,8 +42,6 @@
|
||||
"WelcomeScreen.background" : "#F5F5F5",
|
||||
"WelcomeScreen.Projects.background" : "#ffffff",
|
||||
|
||||
"List.background" : "#ffffff",
|
||||
|
||||
"MenuBar.foreground" : "#5c616c",
|
||||
"Menu.background" : "#ffffff",
|
||||
"Menu.separatorColor" : "#F5F5F5",
|
||||
@@ -49,8 +49,10 @@
|
||||
"MenuItem.foreground" : "#5c616c",
|
||||
"MenuItem.background" : "#ffffff",
|
||||
"PopupMenuSeparator.height" : "1",
|
||||
"Separator.separatorColor" : "#9ba2ab",
|
||||
|
||||
"Tree.background" : "#ffffff",
|
||||
"Tree.rowHeight": "23",
|
||||
|
||||
"ProgressBar.background" : "#2679db",
|
||||
"ProgressBar.foreground" : "#2679db",
|
||||
@@ -69,9 +71,11 @@
|
||||
"ParameterInfo.background" : "#fffae3",
|
||||
"ParameterInfo.currentOverloadBackground" : "#fffae3",
|
||||
|
||||
"List.background" : "#ffffff",
|
||||
"List.dropLineColor" : "#2679db",
|
||||
"List.selectionBackground": "#2679db",
|
||||
"List.selectionForeground": "#ffffff",
|
||||
"List.selectionInactiveBackground": "#1e61b0",
|
||||
|
||||
"Table.background" : "#ffffff",
|
||||
"Table.selectionBackground" : "#2679db",
|
||||
@@ -83,6 +87,7 @@
|
||||
|
||||
"TabbedPane.underlineColor" : "#2679db",
|
||||
"TabbedPane.tabSelectionHeight" : 2,
|
||||
"TabbedPane.background" : "#F5F5F5",
|
||||
|
||||
"Link.hoverForeground" : "#2679db",
|
||||
"Link.activeForeground" : "#2679db",
|
||||
@@ -98,8 +103,22 @@
|
||||
"TextArea.background" : "#ffffff",
|
||||
"TextPane.background" : "#ffffff",
|
||||
"PasswordField.background" : "#ffffff",
|
||||
"FormattedTextField.background" : "#ffffff",
|
||||
"Editor.background" : "#f5f5f5",
|
||||
"EditorPane.background" : "#ffffff",
|
||||
|
||||
"CompletionPopup.background" : "#ffffff",
|
||||
"CheckBox.background" : "#F5F5F5",
|
||||
"RadioButton.background" : "#F5F5F5",
|
||||
"Slider.background" : "#F5F5F5",
|
||||
"Spinner.background" : "#F5F5F5",
|
||||
"OptionPane.background" : "#F5F5F5",
|
||||
|
||||
"CompletionPopup": {
|
||||
"selectionBackground" : "#2679db55",
|
||||
"nonFocusedMask": false,
|
||||
"matchForeground": "#2679db",
|
||||
"selectionInactiveBackground": "#1e61b0"
|
||||
},
|
||||
|
||||
"Plugins.lightSelectionBackground" : "#dddee1",
|
||||
"Plugins.SearchField.background" : "#ffffff",
|
||||
@@ -116,8 +135,10 @@
|
||||
"Counter.foreground" : "#ffffff",
|
||||
|
||||
"SearchEverywhere.SearchField.background" : "#ffffff",
|
||||
"SearchEverywhere.Header.background" : "#F5F5F5",
|
||||
|
||||
"ToolTip.background" : "#fffae3",
|
||||
"ToolTip.background" : "#F5F5F5",
|
||||
"ToolTip.Actions.background" : "#F5F5F5",
|
||||
|
||||
"ToolWindow.Header.background" : "#e7e8eb",
|
||||
"ToolWindow.HeaderTab.selectedBackground" : "#dddee1",
|
||||
@@ -128,8 +149,12 @@
|
||||
"ToolWindow.HeaderTab.underlineColor" : "#2679db",
|
||||
"DefaultTabs.underlineHeight" : 2,
|
||||
"DefaultTabs.underlineColor" : "#2679db",
|
||||
"DefaultTabs.background" : "#F5F5F5",
|
||||
"EditorTabs.underlineHeight" : 2,
|
||||
"EditorTabs.underlineColor" : "#2679db"
|
||||
"EditorTabs.underlineColor" : "#2679db",
|
||||
"EditorTabs.background" : "#F5F5F5",
|
||||
|
||||
"Notification.background" : "#F5F5F5"
|
||||
|
||||
},
|
||||
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#42A5F5",
|
||||
"Checkbox.Foreground.Disabled": "#D3DAE3",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#D3DAE3",
|
||||
"Checkbox.Background.Selected": "#2f343f",
|
||||
"Checkbox.Background.Selected": "#42A5F5",
|
||||
"Checkbox.Background.Selected.Dark": "#2f343f",
|
||||
"Checkbox.Border.Selected": "#42A5F5",
|
||||
"Checkbox.Border.Selected.Dark": "#42A5F5",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#42A5F5",
|
||||
"Checkbox.Foreground.Disabled": "#D3DAE3",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#D3DAE3",
|
||||
"Checkbox.Background.Selected": "#2f343f",
|
||||
"Checkbox.Background.Selected": "#42A5F5",
|
||||
"Checkbox.Background.Selected.Dark": "#2f343f",
|
||||
"Checkbox.Border.Selected": "#42A5F5",
|
||||
"Checkbox.Border.Selected.Dark": "#42A5F5",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#2979ff",
|
||||
"Checkbox.Foreground.Disabled": "#6B727D",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#6B727D",
|
||||
"Checkbox.Background.Selected": "#282C34",
|
||||
"Checkbox.Background.Selected": "#2979ff",
|
||||
"Checkbox.Background.Selected.Dark": "#282C34",
|
||||
"Checkbox.Border.Selected": "#2979ff",
|
||||
"Checkbox.Border.Selected.Dark": "#2979ff",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#2979ff",
|
||||
"Checkbox.Foreground.Disabled": "#6B727D",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#6B727D",
|
||||
"Checkbox.Background.Selected": "#282C34",
|
||||
"Checkbox.Background.Selected": "#2979ff",
|
||||
"Checkbox.Background.Selected.Dark": "#282C34",
|
||||
"Checkbox.Border.Selected": "#2979ff",
|
||||
"Checkbox.Border.Selected.Dark": "#2979ff",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#2979ff",
|
||||
"Checkbox.Foreground.Disabled": "#b8b8b9",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#b8b8b9",
|
||||
"Checkbox.Background.Selected": "#F4F4F4",
|
||||
"Checkbox.Background.Selected": "#2979ff",
|
||||
"Checkbox.Background.Selected.Dark": "#F4F4F4",
|
||||
"Checkbox.Border.Selected": "#2979ff",
|
||||
"Checkbox.Border.Selected.Dark": "#2979ff",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#2979ff",
|
||||
"Checkbox.Foreground.Disabled": "#b8b8b9",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#b8b8b9",
|
||||
"Checkbox.Background.Selected": "#F4F4F4",
|
||||
"Checkbox.Background.Selected": "#2979ff",
|
||||
"Checkbox.Background.Selected.Dark": "#F4F4F4",
|
||||
"Checkbox.Border.Selected": "#2979ff",
|
||||
"Checkbox.Border.Selected.Dark": "#2979ff",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#FF79C5",
|
||||
"Checkbox.Foreground.Disabled": "#6272A4",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#6272A4",
|
||||
"Checkbox.Background.Selected": "#282A36",
|
||||
"Checkbox.Background.Selected": "#FF79C5",
|
||||
"Checkbox.Background.Selected.Dark": "#282A36",
|
||||
"Checkbox.Border.Selected": "#FF79C5",
|
||||
"Checkbox.Border.Selected.Dark": "#FF79C5",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#FF79C5",
|
||||
"Checkbox.Foreground.Disabled": "#6272A4",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#6272A4",
|
||||
"Checkbox.Background.Selected": "#282A36",
|
||||
"Checkbox.Background.Selected": "#FF79C5",
|
||||
"Checkbox.Background.Selected.Dark": "#282A36",
|
||||
"Checkbox.Border.Selected": "#FF79C5",
|
||||
"Checkbox.Border.Selected.Dark": "#FF79C5",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#79CB60",
|
||||
"Checkbox.Foreground.Disabled": "#9ba0a3",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#9ba0a3",
|
||||
"Checkbox.Background.Selected": "#F7F8FA",
|
||||
"Checkbox.Background.Selected": "#79CB60",
|
||||
"Checkbox.Background.Selected.Dark": "#F7F8FA",
|
||||
"Checkbox.Border.Selected": "#79CB60",
|
||||
"Checkbox.Border.Selected.Dark": "#79CB60",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#79CB60",
|
||||
"Checkbox.Foreground.Disabled": "#9ba0a3",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#9ba0a3",
|
||||
"Checkbox.Background.Selected": "#F7F8FA",
|
||||
"Checkbox.Background.Selected": "#79CB60",
|
||||
"Checkbox.Background.Selected.Dark": "#F7F8FA",
|
||||
"Checkbox.Border.Selected": "#79CB60",
|
||||
"Checkbox.Border.Selected.Dark": "#79CB60",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#2AA298",
|
||||
"Checkbox.Foreground.Disabled": "#93A1A1",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#93A1A1",
|
||||
"Checkbox.Background.Selected": "#F0F0F0",
|
||||
"Checkbox.Background.Selected": "#2AA298",
|
||||
"Checkbox.Background.Selected.Dark": "#F0F0F0",
|
||||
"Checkbox.Border.Selected": "#2AA298",
|
||||
"Checkbox.Border.Selected.Dark": "#2AA298",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#2AA298",
|
||||
"Checkbox.Foreground.Disabled": "#93A1A1",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#93A1A1",
|
||||
"Checkbox.Background.Selected": "#F0F0F0",
|
||||
"Checkbox.Background.Selected": "#2AA298",
|
||||
"Checkbox.Background.Selected.Dark": "#F0F0F0",
|
||||
"Checkbox.Border.Selected": "#2AA298",
|
||||
"Checkbox.Border.Selected.Dark": "#2AA298",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#FF9800",
|
||||
"Checkbox.Foreground.Disabled": "#474747",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#474747",
|
||||
"Checkbox.Background.Selected": "#212121",
|
||||
"Checkbox.Background.Selected": "#FF9800",
|
||||
"Checkbox.Background.Selected.Dark": "#212121",
|
||||
"Checkbox.Border.Selected": "#FF9800",
|
||||
"Checkbox.Border.Selected.Dark": "#FF9800",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#FF9800",
|
||||
"Checkbox.Foreground.Disabled": "#474747",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#474747",
|
||||
"Checkbox.Background.Selected": "#212121",
|
||||
"Checkbox.Background.Selected": "#FF9800",
|
||||
"Checkbox.Background.Selected.Dark": "#212121",
|
||||
"Checkbox.Border.Selected": "#FF9800",
|
||||
"Checkbox.Border.Selected.Dark": "#FF9800",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#84ffff",
|
||||
"Checkbox.Foreground.Disabled": "#464B5D",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#464B5D",
|
||||
"Checkbox.Background.Selected": "#0F111A",
|
||||
"Checkbox.Background.Selected": "#84ffff",
|
||||
"Checkbox.Background.Selected.Dark": "#0F111A",
|
||||
"Checkbox.Border.Selected": "#84ffff",
|
||||
"Checkbox.Border.Selected.Dark": "#84ffff",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#84ffff",
|
||||
"Checkbox.Foreground.Disabled": "#464B5D",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#464B5D",
|
||||
"Checkbox.Background.Selected": "#0F111A",
|
||||
"Checkbox.Background.Selected": "#84ffff",
|
||||
"Checkbox.Background.Selected.Dark": "#0F111A",
|
||||
"Checkbox.Border.Selected": "#84ffff",
|
||||
"Checkbox.Border.Selected.Dark": "#84ffff",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#00BCD4",
|
||||
"Checkbox.Foreground.Disabled": "#D2D4D5",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#D2D4D5",
|
||||
"Checkbox.Background.Selected": "#FAFAFA",
|
||||
"Checkbox.Background.Selected": "#00BCD4",
|
||||
"Checkbox.Background.Selected.Dark": "#FAFAFA",
|
||||
"Checkbox.Border.Selected": "#00BCD4",
|
||||
"Checkbox.Border.Selected.Dark": "#00BCD4",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#00BCD4",
|
||||
"Checkbox.Foreground.Disabled": "#D2D4D5",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#D2D4D5",
|
||||
"Checkbox.Background.Selected": "#FAFAFA",
|
||||
"Checkbox.Background.Selected": "#00BCD4",
|
||||
"Checkbox.Background.Selected.Dark": "#FAFAFA",
|
||||
"Checkbox.Border.Selected": "#00BCD4",
|
||||
"Checkbox.Border.Selected.Dark": "#00BCD4",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#009688",
|
||||
"Checkbox.Foreground.Disabled": "#415967",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#415967",
|
||||
"Checkbox.Background.Selected": "#263238",
|
||||
"Checkbox.Background.Selected": "#009688",
|
||||
"Checkbox.Background.Selected.Dark": "#263238",
|
||||
"Checkbox.Border.Selected": "#009688",
|
||||
"Checkbox.Border.Selected.Dark": "#009688",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#009688",
|
||||
"Checkbox.Foreground.Disabled": "#415967",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#415967",
|
||||
"Checkbox.Background.Selected": "#263238",
|
||||
"Checkbox.Background.Selected": "#009688",
|
||||
"Checkbox.Background.Selected.Dark": "#263238",
|
||||
"Checkbox.Border.Selected": "#009688",
|
||||
"Checkbox.Border.Selected.Dark": "#009688",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#ab47bc",
|
||||
"Checkbox.Foreground.Disabled": "#515772",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#515772",
|
||||
"Checkbox.Background.Selected": "#292D3E",
|
||||
"Checkbox.Background.Selected": "#ab47bc",
|
||||
"Checkbox.Background.Selected.Dark": "#292D3E",
|
||||
"Checkbox.Border.Selected": "#ab47bc",
|
||||
"Checkbox.Border.Selected.Dark": "#ab47bc",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#ab47bc",
|
||||
"Checkbox.Foreground.Disabled": "#515772",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#515772",
|
||||
"Checkbox.Background.Selected": "#292D3E",
|
||||
"Checkbox.Background.Selected": "#ab47bc",
|
||||
"Checkbox.Background.Selected.Dark": "#292D3E",
|
||||
"Checkbox.Border.Selected": "#ab47bc",
|
||||
"Checkbox.Border.Selected.Dark": "#ab47bc",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#ffd866",
|
||||
"Checkbox.Foreground.Disabled": "#5b595c",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#5b595c",
|
||||
"Checkbox.Background.Selected": "#2D2A2E",
|
||||
"Checkbox.Background.Selected": "#ffd866",
|
||||
"Checkbox.Background.Selected.Dark": "#2D2A2E",
|
||||
"Checkbox.Border.Selected": "#ffd866",
|
||||
"Checkbox.Border.Selected.Dark": "#ffd866",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#ffd866",
|
||||
"Checkbox.Foreground.Disabled": "#5b595c",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#5b595c",
|
||||
"Checkbox.Background.Selected": "#2D2A2E",
|
||||
"Checkbox.Background.Selected": "#ffd866",
|
||||
"Checkbox.Background.Selected.Dark": "#2D2A2E",
|
||||
"Checkbox.Border.Selected": "#ffd866",
|
||||
"Checkbox.Border.Selected.Dark": "#ffd866",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#7e57c2",
|
||||
"Checkbox.Foreground.Disabled": "#697098",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#697098",
|
||||
"Checkbox.Background.Selected": "#011627",
|
||||
"Checkbox.Background.Selected": "#7e57c2",
|
||||
"Checkbox.Background.Selected.Dark": "#011627",
|
||||
"Checkbox.Border.Selected": "#7e57c2",
|
||||
"Checkbox.Border.Selected.Dark": "#7e57c2",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#7e57c2",
|
||||
"Checkbox.Foreground.Disabled": "#697098",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#697098",
|
||||
"Checkbox.Background.Selected": "#011627",
|
||||
"Checkbox.Background.Selected": "#7e57c2",
|
||||
"Checkbox.Background.Selected.Dark": "#011627",
|
||||
"Checkbox.Border.Selected": "#7e57c2",
|
||||
"Checkbox.Border.Selected.Dark": "#7e57c2",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#d33682",
|
||||
"Checkbox.Foreground.Disabled": "#2E5861",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#2E5861",
|
||||
"Checkbox.Background.Selected": "#002B36",
|
||||
"Checkbox.Background.Selected": "#d33682",
|
||||
"Checkbox.Background.Selected.Dark": "#002B36",
|
||||
"Checkbox.Border.Selected": "#d33682",
|
||||
"Checkbox.Border.Selected.Dark": "#d33682",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#d33682",
|
||||
"Checkbox.Foreground.Disabled": "#2E5861",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#2E5861",
|
||||
"Checkbox.Background.Selected": "#002B36",
|
||||
"Checkbox.Background.Selected": "#d33682",
|
||||
"Checkbox.Background.Selected.Dark": "#002B36",
|
||||
"Checkbox.Border.Selected": "#d33682",
|
||||
"Checkbox.Border.Selected.Dark": "#d33682",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#d33682",
|
||||
"Checkbox.Foreground.Disabled": "#C9CCC3",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#C9CCC3",
|
||||
"Checkbox.Background.Selected": "#fdf6e3",
|
||||
"Checkbox.Background.Selected": "#d33682",
|
||||
"Checkbox.Background.Selected.Dark": "#fdf6e3",
|
||||
"Checkbox.Border.Selected": "#d33682",
|
||||
"Checkbox.Border.Selected.Dark": "#d33682",
|
||||
|
||||
@@ -850,7 +850,7 @@
|
||||
"Checkbox.Focus.Wide.Dark": "#d33682",
|
||||
"Checkbox.Foreground.Disabled": "#C9CCC3",
|
||||
"Checkbox.Foreground.Disabled.Dark": "#C9CCC3",
|
||||
"Checkbox.Background.Selected": "#fdf6e3",
|
||||
"Checkbox.Background.Selected": "#d33682",
|
||||
"Checkbox.Background.Selected.Dark": "#fdf6e3",
|
||||
"Checkbox.Border.Selected": "#d33682",
|
||||
"Checkbox.Border.Selected.Dark": "#d33682",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
||||
@@ -26,7 +26,7 @@ build script:
|
||||
|
||||
groupId: com.formdev
|
||||
artifactId: flatlaf-jide-oss
|
||||
version: 0.24
|
||||
version: (see button below)
|
||||
|
||||
Otherwise download `flatlaf-jide-oss-<version>.jar` here:
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -80,7 +80,7 @@ publishing {
|
||||
licenses {
|
||||
license {
|
||||
name.set( "The Apache License, Version 2.0" )
|
||||
url.set( "http://www.apache.org/licenses/LICENSE-2.0.txt" )
|
||||
url.set( "https://www.apache.org/licenses/LICENSE-2.0.txt" )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ build script:
|
||||
|
||||
groupId: com.formdev
|
||||
artifactId: flatlaf-swingx
|
||||
version: 0.24
|
||||
version: (see button below)
|
||||
|
||||
Otherwise download `flatlaf-swingx-<version>.jar` here:
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -80,7 +80,7 @@ publishing {
|
||||
licenses {
|
||||
license {
|
||||
name.set( "The Apache License, Version 2.0" )
|
||||
url.set( "http://www.apache.org/licenses/LICENSE-2.0.txt" )
|
||||
url.set( "https://www.apache.org/licenses/LICENSE-2.0.txt" )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -33,6 +33,10 @@ dependencies {
|
||||
implementation( "org.swinglabs.swingx:swingx-beaninfo:1.6.5-1" )
|
||||
implementation( "com.jidesoft:jide-oss:3.6.18" )
|
||||
implementation( "org.netbeans.api:org-openide-awt:RELEASE112" )
|
||||
|
||||
// implementation( "org.pushing-pixels:radiance-substance:2.5.1" )
|
||||
// implementation( "com.weblookandfeel:weblaf-ui:1.2.12" )
|
||||
// implementation( "com.jgoodies:jgoodies-looks:2.7.0" )
|
||||
}
|
||||
|
||||
java {
|
||||
|
||||
@@ -344,14 +344,14 @@ public class FlatComponentsTest
|
||||
add(toggleButton4, "cell 4 2");
|
||||
|
||||
//---- toggleButton5 ----
|
||||
toggleButton5.setText("underline");
|
||||
toggleButton5.putClientProperty("JButton.buttonType", "underline");
|
||||
toggleButton5.setText("tab");
|
||||
toggleButton5.putClientProperty("JButton.buttonType", "tab");
|
||||
toggleButton5.setSelected(true);
|
||||
add(toggleButton5, "cell 5 2");
|
||||
|
||||
//---- toggleButton8 ----
|
||||
toggleButton8.setText("underline");
|
||||
toggleButton8.putClientProperty("JButton.buttonType", "underline");
|
||||
toggleButton8.setText("tab");
|
||||
toggleButton8.putClientProperty("JButton.buttonType", "tab");
|
||||
toggleButton8.setEnabled(false);
|
||||
toggleButton8.setSelected(true);
|
||||
add(toggleButton8, "cell 5 2");
|
||||
|
||||
@@ -171,16 +171,16 @@ new FormModel {
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "toggleButton5"
|
||||
"text": "underline"
|
||||
"$client.JButton.buttonType": "underline"
|
||||
"text": "tab"
|
||||
"$client.JButton.buttonType": "tab"
|
||||
"selected": true
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 5 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "toggleButton8"
|
||||
"text": "underline"
|
||||
"$client.JButton.buttonType": "underline"
|
||||
"text": "tab"
|
||||
"$client.JButton.buttonType": "tab"
|
||||
"enabled": false
|
||||
"selected": true
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
|
||||
@@ -71,7 +71,7 @@ public class FlatInspector
|
||||
private Component lastComponent;
|
||||
private int lastX;
|
||||
private int lastY;
|
||||
private boolean inspectParent;
|
||||
private int inspectParentLevel;
|
||||
|
||||
private JComponent highlightFigure;
|
||||
private JToolTip tip;
|
||||
@@ -112,7 +112,9 @@ public class FlatInspector
|
||||
public void mouseMoved( MouseEvent e ) {
|
||||
lastX = e.getX();
|
||||
lastY = e.getY();
|
||||
inspectParent = e.isShiftDown();
|
||||
inspectParentLevel = (e.isControlDown() ? 1 : 0)
|
||||
+ (e.isShiftDown() ? 2 : 0)
|
||||
+ (e.isAltDown() ? 4 : 0);
|
||||
inspect( lastX, lastY );
|
||||
}
|
||||
};
|
||||
@@ -157,10 +159,9 @@ public class FlatInspector
|
||||
Container contentPane = rootPane.getContentPane();
|
||||
Point pt = SwingUtilities.convertPoint( rootPane.getGlassPane(), x, y, contentPane );
|
||||
Component c = SwingUtilities.getDeepestComponentAt( contentPane, pt.x, pt.y );
|
||||
if( inspectParent && c != null && c != contentPane )
|
||||
for( int i = 0; i < inspectParentLevel && c != null; i++ ) {
|
||||
c = c.getParent();
|
||||
if( c == contentPane || (c != null && c.getParent() == contentPane) )
|
||||
c = null;
|
||||
}
|
||||
|
||||
if( c == lastComponent )
|
||||
return;
|
||||
@@ -300,6 +301,9 @@ public class FlatInspector
|
||||
text += "Left-to-right: " + c.getComponentOrientation().isLeftToRight() + '\n';
|
||||
text += "Parent: " + c.getParent().getClass().getName();
|
||||
|
||||
if( inspectParentLevel > 0 )
|
||||
text += "\n\nParent level: " + inspectParentLevel;
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,13 +126,16 @@ public class FlatMenusTest
|
||||
//======== menu5 ========
|
||||
{
|
||||
menu5.setText("text");
|
||||
menu5.setMnemonic('T');
|
||||
|
||||
//---- menuItem7 ----
|
||||
menuItem7.setText("text");
|
||||
menuItem7.setMnemonic('X');
|
||||
menu5.add(menuItem7);
|
||||
|
||||
//---- menuItem8 ----
|
||||
menuItem8.setText("text");
|
||||
menuItem8.setMnemonic('E');
|
||||
menu5.add(menuItem8);
|
||||
}
|
||||
menuBar1.add(menu5);
|
||||
@@ -175,6 +178,7 @@ public class FlatMenusTest
|
||||
//======== menu1 ========
|
||||
{
|
||||
menu1.setText("enabled");
|
||||
menu1.setMnemonic('E');
|
||||
}
|
||||
panel1.add(menu1, "cell 1 0");
|
||||
|
||||
@@ -185,6 +189,7 @@ public class FlatMenusTest
|
||||
//---- menuItem1 ----
|
||||
menuItem1.setText("enabled");
|
||||
menuItem1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_MASK));
|
||||
menuItem1.setMnemonic('N');
|
||||
panel1.add(menuItem1, "cell 1 1");
|
||||
|
||||
//---- checkBoxMenuItemLabel ----
|
||||
@@ -194,6 +199,7 @@ public class FlatMenusTest
|
||||
//---- checkBoxMenuItem1 ----
|
||||
checkBoxMenuItem1.setText("enabled");
|
||||
checkBoxMenuItem1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
|
||||
checkBoxMenuItem1.setMnemonic('A');
|
||||
panel1.add(checkBoxMenuItem1, "cell 1 2");
|
||||
|
||||
//---- radioButtonMenuItemLabel ----
|
||||
@@ -203,6 +209,7 @@ public class FlatMenusTest
|
||||
//---- radioButtonMenuItem1 ----
|
||||
radioButtonMenuItem1.setText("enabled");
|
||||
radioButtonMenuItem1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
|
||||
radioButtonMenuItem1.setMnemonic('B');
|
||||
panel1.add(radioButtonMenuItem1, "cell 1 3");
|
||||
|
||||
//---- popupMenuSeparatorLabel ----
|
||||
@@ -230,6 +237,7 @@ public class FlatMenusTest
|
||||
{
|
||||
menu2.setText("disabled");
|
||||
menu2.setEnabled(false);
|
||||
menu2.setMnemonic('D');
|
||||
}
|
||||
panel2.add(menu2, "cell 0 0");
|
||||
|
||||
@@ -237,18 +245,21 @@ public class FlatMenusTest
|
||||
menuItem2.setText("disabled");
|
||||
menuItem2.setEnabled(false);
|
||||
menuItem2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, KeyEvent.ALT_MASK|KeyEvent.SHIFT_MASK));
|
||||
menuItem2.setMnemonic('I');
|
||||
panel2.add(menuItem2, "cell 0 1");
|
||||
|
||||
//---- checkBoxMenuItem2 ----
|
||||
checkBoxMenuItem2.setText("disabled");
|
||||
checkBoxMenuItem2.setEnabled(false);
|
||||
checkBoxMenuItem2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
|
||||
checkBoxMenuItem2.setMnemonic('S');
|
||||
panel2.add(checkBoxMenuItem2, "cell 0 2");
|
||||
|
||||
//---- radioButtonMenuItem2 ----
|
||||
radioButtonMenuItem2.setText("disabled");
|
||||
radioButtonMenuItem2.setEnabled(false);
|
||||
radioButtonMenuItem2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
|
||||
radioButtonMenuItem2.setMnemonic('L');
|
||||
panel2.add(radioButtonMenuItem2, "cell 0 3");
|
||||
}
|
||||
add(panel2, "cell 2 1");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8"
|
||||
JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
@@ -23,13 +23,16 @@ new FormModel {
|
||||
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||
name: "menu5"
|
||||
"text": "text"
|
||||
"mnemonic": 84
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "menuItem7"
|
||||
"text": "text"
|
||||
"mnemonic": 88
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "menuItem8"
|
||||
"text": "text"
|
||||
"mnemonic": 69
|
||||
} )
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||
@@ -63,6 +66,7 @@ new FormModel {
|
||||
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||
name: "menu1"
|
||||
"text": "enabled"
|
||||
"mnemonic": 69
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 0"
|
||||
} )
|
||||
@@ -76,6 +80,7 @@ new FormModel {
|
||||
name: "menuItem1"
|
||||
"text": "enabled"
|
||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 65, 130, false )
|
||||
"mnemonic": 78
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 1"
|
||||
} )
|
||||
@@ -89,6 +94,7 @@ new FormModel {
|
||||
name: "checkBoxMenuItem1"
|
||||
"text": "enabled"
|
||||
"accelerator": &KeyStroke0 static javax.swing.KeyStroke getKeyStroke( 112, 0, false )
|
||||
"mnemonic": 65
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 2"
|
||||
} )
|
||||
@@ -102,6 +108,7 @@ new FormModel {
|
||||
name: "radioButtonMenuItem1"
|
||||
"text": "enabled"
|
||||
"accelerator": #KeyStroke0
|
||||
"mnemonic": 66
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 3"
|
||||
} )
|
||||
@@ -130,6 +137,7 @@ new FormModel {
|
||||
name: "menu2"
|
||||
"text": "disabled"
|
||||
"enabled": false
|
||||
"mnemonic": 68
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 0"
|
||||
} )
|
||||
@@ -138,6 +146,7 @@ new FormModel {
|
||||
"text": "disabled"
|
||||
"enabled": false
|
||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 68, 585, false )
|
||||
"mnemonic": 73
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 1"
|
||||
} )
|
||||
@@ -146,6 +155,7 @@ new FormModel {
|
||||
"text": "disabled"
|
||||
"enabled": false
|
||||
"accelerator": #KeyStroke0
|
||||
"mnemonic": 83
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 2"
|
||||
} )
|
||||
@@ -154,6 +164,7 @@ new FormModel {
|
||||
"text": "disabled"
|
||||
"enabled": false
|
||||
"accelerator": #KeyStroke0
|
||||
"mnemonic": 76
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 3"
|
||||
} )
|
||||
|
||||
@@ -111,6 +111,30 @@ public class FlatTestFrame
|
||||
lafModel.addElement( new LookAndFeelInfo( name, className ) );
|
||||
}
|
||||
|
||||
String substanceClassName = "org.pushingpixels.substance.api.skin.SubstanceGraphiteAquaLookAndFeel";
|
||||
if( SystemInfo.IS_JAVA_9_OR_LATER && isClassAvailable( substanceClassName ) ) {
|
||||
lafModel.addElement( new LookAndFeelInfo( "Substance (F5)", substanceClassName ) );
|
||||
registerSwitchToLookAndFeel( KeyEvent.VK_F5, substanceClassName );
|
||||
}
|
||||
|
||||
String webLafClassName = "com.alee.laf.WebLookAndFeel";
|
||||
if( isClassAvailable( webLafClassName ) ) {
|
||||
lafModel.addElement( new LookAndFeelInfo( "WebLaf (F12)", webLafClassName ) );
|
||||
registerSwitchToLookAndFeel( KeyEvent.VK_F12, webLafClassName );
|
||||
}
|
||||
|
||||
String looksPlasticClassName = "com.jgoodies.looks.plastic.PlasticLookAndFeel";
|
||||
if( isClassAvailable( looksPlasticClassName ) ) {
|
||||
lafModel.addElement( new LookAndFeelInfo( "JGoodies Looks Plastic (F6)", looksPlasticClassName ) );
|
||||
registerSwitchToLookAndFeel( KeyEvent.VK_F6, looksPlasticClassName );
|
||||
}
|
||||
|
||||
String looksWindowsClassName = "com.jgoodies.looks.windows.WindowsLookAndFeel";
|
||||
if( isClassAvailable( looksWindowsClassName ) ) {
|
||||
lafModel.addElement( new LookAndFeelInfo( "JGoodies Looks Windows (F7)", looksWindowsClassName ) );
|
||||
registerSwitchToLookAndFeel( KeyEvent.VK_F7, looksWindowsClassName );
|
||||
}
|
||||
|
||||
lookAndFeelComboBox.setModel( lafModel );
|
||||
|
||||
updateScaleFactorComboBox();
|
||||
@@ -203,6 +227,15 @@ public class FlatTestFrame
|
||||
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );
|
||||
}
|
||||
|
||||
private boolean isClassAvailable( String className ) {
|
||||
try {
|
||||
Class.forName( className );
|
||||
return true;
|
||||
} catch( ClassNotFoundException ex ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void showFrame( Supplier<JComponent> contentFactory ) {
|
||||
this.contentFactory = contentFactory;
|
||||
this.content = contentFactory.get();
|
||||
@@ -481,6 +514,7 @@ public class FlatTestFrame
|
||||
null));
|
||||
|
||||
//---- lookAndFeelComboBox ----
|
||||
lookAndFeelComboBox.setMaximumRowCount(20);
|
||||
lookAndFeelComboBox.addActionListener(e -> lookAndFeelChanged());
|
||||
buttonBar.add(lookAndFeelComboBox, "cell 0 0");
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8"
|
||||
JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
@@ -27,6 +27,7 @@ new FormModel {
|
||||
name: "buttonBar"
|
||||
add( new FormComponent( "com.formdev.flatlaf.demo.LookAndFeelsComboBox" ) {
|
||||
name: "lookAndFeelComboBox"
|
||||
"maximumRowCount": 20
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "lookAndFeelChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 0"
|
||||
|
||||
@@ -0,0 +1,339 @@
|
||||
/*
|
||||
* Copyright 2020 FormDev Software GmbH
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.formdev.flatlaf.testing;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.DefaultEditorKit;
|
||||
import net.miginfocom.swing.*;
|
||||
|
||||
/**
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class FlatTextComponentsTest
|
||||
extends FlatTestPanel
|
||||
{
|
||||
public static void main( String[] args ) {
|
||||
SwingUtilities.invokeLater( () -> {
|
||||
FlatTestFrame frame = FlatTestFrame.create( args, "FlatTextComponentsTest" );
|
||||
frame.showFrame( FlatTextComponentsTest::new );
|
||||
} );
|
||||
}
|
||||
|
||||
FlatTextComponentsTest() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void changeText() {
|
||||
textField1.setText( "new text" );
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
||||
JLabel textFieldLabel = new JLabel();
|
||||
textField1 = new JTextField();
|
||||
JTextField textField3 = new JTextField();
|
||||
JTextField textField2 = new JTextField();
|
||||
JButton button1 = new JButton();
|
||||
JLabel formattedTextFieldLabel = new JLabel();
|
||||
JFormattedTextField formattedTextField1 = new JFormattedTextField();
|
||||
JFormattedTextField formattedTextField3 = new JFormattedTextField();
|
||||
JLabel passwordFieldLabel = new JLabel();
|
||||
JPasswordField passwordField1 = new JPasswordField();
|
||||
JPasswordField passwordField3 = new JPasswordField();
|
||||
JLabel textAreaLabel = new JLabel();
|
||||
JScrollPane scrollPane1 = new JScrollPane();
|
||||
JTextArea textArea1 = new JTextArea();
|
||||
JScrollPane scrollPane3 = new JScrollPane();
|
||||
JTextArea textArea3 = new JTextArea();
|
||||
JLabel editorPaneLabel = new JLabel();
|
||||
JScrollPane scrollPane5 = new JScrollPane();
|
||||
JEditorPane editorPane1 = new JEditorPane();
|
||||
JScrollPane scrollPane7 = new JScrollPane();
|
||||
JEditorPane editorPane3 = new JEditorPane();
|
||||
JLabel textPaneLabel = new JLabel();
|
||||
JScrollPane scrollPane9 = new JScrollPane();
|
||||
JTextPane textPane1 = new JTextPane();
|
||||
JScrollPane scrollPane11 = new JScrollPane();
|
||||
JTextPane textPane3 = new JTextPane();
|
||||
JLabel comboBoxLabel = new JLabel();
|
||||
JComboBox<String> comboBox1 = new JComboBox<>();
|
||||
JComboBox<String> comboBox3 = new JComboBox<>();
|
||||
JLabel spinnerLabel = new JLabel();
|
||||
JSpinner spinner1 = new JSpinner();
|
||||
JPopupMenu popupMenu1 = new JPopupMenu();
|
||||
JMenuItem cutMenuItem = new JMenuItem();
|
||||
JMenuItem copyMenuItem = new JMenuItem();
|
||||
JMenuItem pasteMenuItem = new JMenuItem();
|
||||
|
||||
//======== this ========
|
||||
setName("this");
|
||||
setLayout(new MigLayout(
|
||||
"ltr,insets dialog,hidemode 3",
|
||||
// columns
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[::100]" +
|
||||
"[100,fill]" +
|
||||
"[fill]",
|
||||
// rows
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[50,fill]" +
|
||||
"[50,fill]" +
|
||||
"[50,fill]" +
|
||||
"[]" +
|
||||
"[]"));
|
||||
|
||||
//---- textFieldLabel ----
|
||||
textFieldLabel.setText("JTextField:");
|
||||
textFieldLabel.setDisplayedMnemonic('T');
|
||||
textFieldLabel.setLabelFor(textField1);
|
||||
textFieldLabel.setName("textFieldLabel");
|
||||
add(textFieldLabel, "cell 0 0");
|
||||
|
||||
//---- textField1 ----
|
||||
textField1.setText("editable");
|
||||
textField1.setComponentPopupMenu(popupMenu1);
|
||||
textField1.setName("textField1");
|
||||
add(textField1, "cell 1 0,growx");
|
||||
|
||||
//---- textField3 ----
|
||||
textField3.setText("longer text for testing horizontal scrolling");
|
||||
textField3.setComponentPopupMenu(popupMenu1);
|
||||
textField3.setName("textField3");
|
||||
add(textField3, "cell 2 0,growx");
|
||||
|
||||
//---- textField2 ----
|
||||
textField2.setText("partly selected");
|
||||
textField2.setSelectionStart(1);
|
||||
textField2.setSelectionEnd(4);
|
||||
textField2.setComponentPopupMenu(popupMenu1);
|
||||
textField2.setName("textField2");
|
||||
add(textField2, "cell 3 0");
|
||||
|
||||
//---- button1 ----
|
||||
button1.setText("change text");
|
||||
button1.setName("button1");
|
||||
button1.addActionListener(e -> changeText());
|
||||
add(button1, "cell 4 0");
|
||||
|
||||
//---- formattedTextFieldLabel ----
|
||||
formattedTextFieldLabel.setText("JFormattedTextField:");
|
||||
formattedTextFieldLabel.setDisplayedMnemonic('F');
|
||||
formattedTextFieldLabel.setLabelFor(formattedTextField1);
|
||||
formattedTextFieldLabel.setName("formattedTextFieldLabel");
|
||||
add(formattedTextFieldLabel, "cell 0 1");
|
||||
|
||||
//---- formattedTextField1 ----
|
||||
formattedTextField1.setText("editable");
|
||||
formattedTextField1.setComponentPopupMenu(popupMenu1);
|
||||
formattedTextField1.setName("formattedTextField1");
|
||||
add(formattedTextField1, "cell 1 1,growx");
|
||||
|
||||
//---- formattedTextField3 ----
|
||||
formattedTextField3.setText("longer text for testing horizontal scrolling");
|
||||
formattedTextField3.setComponentPopupMenu(popupMenu1);
|
||||
formattedTextField3.setName("formattedTextField3");
|
||||
add(formattedTextField3, "cell 2 1,growx");
|
||||
|
||||
//---- passwordFieldLabel ----
|
||||
passwordFieldLabel.setText("JPasswordField:");
|
||||
passwordFieldLabel.setDisplayedMnemonic('P');
|
||||
passwordFieldLabel.setLabelFor(passwordField1);
|
||||
passwordFieldLabel.setName("passwordFieldLabel");
|
||||
add(passwordFieldLabel, "cell 0 2");
|
||||
|
||||
//---- passwordField1 ----
|
||||
passwordField1.setText("editable");
|
||||
passwordField1.setComponentPopupMenu(popupMenu1);
|
||||
passwordField1.setName("passwordField1");
|
||||
add(passwordField1, "cell 1 2,growx");
|
||||
|
||||
//---- passwordField3 ----
|
||||
passwordField3.setText("longer text for testing horizontal scrolling");
|
||||
passwordField3.setComponentPopupMenu(popupMenu1);
|
||||
passwordField3.setName("passwordField3");
|
||||
add(passwordField3, "cell 2 2,growx");
|
||||
|
||||
//---- textAreaLabel ----
|
||||
textAreaLabel.setText("JTextArea:");
|
||||
textAreaLabel.setDisplayedMnemonic('A');
|
||||
textAreaLabel.setLabelFor(textArea1);
|
||||
textAreaLabel.setName("textAreaLabel");
|
||||
add(textAreaLabel, "cell 0 3");
|
||||
|
||||
//======== scrollPane1 ========
|
||||
{
|
||||
scrollPane1.setName("scrollPane1");
|
||||
|
||||
//---- textArea1 ----
|
||||
textArea1.setText("editable");
|
||||
textArea1.setComponentPopupMenu(popupMenu1);
|
||||
textArea1.setName("textArea1");
|
||||
scrollPane1.setViewportView(textArea1);
|
||||
}
|
||||
add(scrollPane1, "cell 1 3,growx");
|
||||
|
||||
//======== scrollPane3 ========
|
||||
{
|
||||
scrollPane3.setName("scrollPane3");
|
||||
|
||||
//---- textArea3 ----
|
||||
textArea3.setText("longer text for testing horizontal scrolling");
|
||||
textArea3.setComponentPopupMenu(popupMenu1);
|
||||
textArea3.setName("textArea3");
|
||||
scrollPane3.setViewportView(textArea3);
|
||||
}
|
||||
add(scrollPane3, "cell 2 3,growx");
|
||||
|
||||
//---- editorPaneLabel ----
|
||||
editorPaneLabel.setText("JEditorPane");
|
||||
editorPaneLabel.setDisplayedMnemonic('J');
|
||||
editorPaneLabel.setLabelFor(editorPane1);
|
||||
editorPaneLabel.setName("editorPaneLabel");
|
||||
add(editorPaneLabel, "cell 0 4");
|
||||
|
||||
//======== scrollPane5 ========
|
||||
{
|
||||
scrollPane5.setName("scrollPane5");
|
||||
|
||||
//---- editorPane1 ----
|
||||
editorPane1.setText("editable");
|
||||
editorPane1.setComponentPopupMenu(popupMenu1);
|
||||
editorPane1.setName("editorPane1");
|
||||
scrollPane5.setViewportView(editorPane1);
|
||||
}
|
||||
add(scrollPane5, "cell 1 4,growx");
|
||||
|
||||
//======== scrollPane7 ========
|
||||
{
|
||||
scrollPane7.setName("scrollPane7");
|
||||
|
||||
//---- editorPane3 ----
|
||||
editorPane3.setText("longer text for testing horizontal scrolling");
|
||||
editorPane3.setComponentPopupMenu(popupMenu1);
|
||||
editorPane3.setName("editorPane3");
|
||||
scrollPane7.setViewportView(editorPane3);
|
||||
}
|
||||
add(scrollPane7, "cell 2 4,growx");
|
||||
|
||||
//---- textPaneLabel ----
|
||||
textPaneLabel.setText("JTextPane:");
|
||||
textPaneLabel.setDisplayedMnemonic('N');
|
||||
textPaneLabel.setLabelFor(textPane1);
|
||||
textPaneLabel.setName("textPaneLabel");
|
||||
add(textPaneLabel, "cell 0 5");
|
||||
|
||||
//======== scrollPane9 ========
|
||||
{
|
||||
scrollPane9.setName("scrollPane9");
|
||||
|
||||
//---- textPane1 ----
|
||||
textPane1.setText("editable");
|
||||
textPane1.setComponentPopupMenu(popupMenu1);
|
||||
textPane1.setName("textPane1");
|
||||
scrollPane9.setViewportView(textPane1);
|
||||
}
|
||||
add(scrollPane9, "cell 1 5,growx");
|
||||
|
||||
//======== scrollPane11 ========
|
||||
{
|
||||
scrollPane11.setName("scrollPane11");
|
||||
|
||||
//---- textPane3 ----
|
||||
textPane3.setText("longer text for testing horizontal scrolling");
|
||||
textPane3.setComponentPopupMenu(popupMenu1);
|
||||
textPane3.setName("textPane3");
|
||||
scrollPane11.setViewportView(textPane3);
|
||||
}
|
||||
add(scrollPane11, "cell 2 5,growx");
|
||||
|
||||
//---- comboBoxLabel ----
|
||||
comboBoxLabel.setText("JComboBox:");
|
||||
comboBoxLabel.setDisplayedMnemonic('C');
|
||||
comboBoxLabel.setLabelFor(comboBox1);
|
||||
comboBoxLabel.setName("comboBoxLabel");
|
||||
add(comboBoxLabel, "cell 0 6");
|
||||
|
||||
//---- comboBox1 ----
|
||||
comboBox1.setEditable(true);
|
||||
comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
|
||||
"editable",
|
||||
"a",
|
||||
"bb",
|
||||
"ccc"
|
||||
}));
|
||||
comboBox1.setComponentPopupMenu(popupMenu1);
|
||||
comboBox1.setName("comboBox1");
|
||||
add(comboBox1, "cell 1 6,growx");
|
||||
|
||||
//---- comboBox3 ----
|
||||
comboBox3.setModel(new DefaultComboBoxModel<>(new String[] {
|
||||
"longer text for testing horizontal scrolling",
|
||||
"a",
|
||||
"bb",
|
||||
"ccc"
|
||||
}));
|
||||
comboBox3.setEditable(true);
|
||||
comboBox3.setPrototypeDisplayValue("12345");
|
||||
comboBox3.setComponentPopupMenu(popupMenu1);
|
||||
comboBox3.setName("comboBox3");
|
||||
add(comboBox3, "cell 2 6,growx");
|
||||
|
||||
//---- spinnerLabel ----
|
||||
spinnerLabel.setText("JSpinner:");
|
||||
spinnerLabel.setDisplayedMnemonic('S');
|
||||
spinnerLabel.setLabelFor(spinner1);
|
||||
spinnerLabel.setName("spinnerLabel");
|
||||
add(spinnerLabel, "cell 0 7");
|
||||
|
||||
//---- spinner1 ----
|
||||
spinner1.setComponentPopupMenu(popupMenu1);
|
||||
spinner1.setName("spinner1");
|
||||
add(spinner1, "cell 1 7,growx");
|
||||
|
||||
//======== popupMenu1 ========
|
||||
{
|
||||
popupMenu1.setName("popupMenu1");
|
||||
|
||||
//---- cutMenuItem ----
|
||||
cutMenuItem.setText("Cut");
|
||||
cutMenuItem.setName("cutMenuItem");
|
||||
popupMenu1.add(cutMenuItem);
|
||||
|
||||
//---- copyMenuItem ----
|
||||
copyMenuItem.setText("Copy");
|
||||
copyMenuItem.setName("copyMenuItem");
|
||||
popupMenu1.add(copyMenuItem);
|
||||
|
||||
//---- pasteMenuItem ----
|
||||
pasteMenuItem.setText("Paste");
|
||||
pasteMenuItem.setName("pasteMenuItem");
|
||||
popupMenu1.add(pasteMenuItem);
|
||||
}
|
||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||
|
||||
cutMenuItem.addActionListener( new DefaultEditorKit.CutAction() );
|
||||
copyMenuItem.addActionListener( new DefaultEditorKit.CopyAction() );
|
||||
pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() );
|
||||
}
|
||||
|
||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||
private JTextField textField1;
|
||||
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||
}
|
||||
@@ -0,0 +1,259 @@
|
||||
JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
root: new FormRoot {
|
||||
"$setComponentNames": true
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.defaultVariableLocal": true
|
||||
}
|
||||
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||
"$layoutConstraints": "ltr,insets dialog,hidemode 3"
|
||||
"$columnConstraints": "[][][::100][100,fill][fill]"
|
||||
"$rowConstraints": "[][][][50,fill][50,fill][50,fill][][]"
|
||||
} ) {
|
||||
name: "this"
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "textFieldLabel"
|
||||
"text": "JTextField:"
|
||||
"displayedMnemonic": 84
|
||||
"labelFor": new FormReference( "textField1" )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JTextField" ) {
|
||||
name: "textField1"
|
||||
"text": "editable"
|
||||
"componentPopupMenu": &FormReference0 new FormReference( "popupMenu1" )
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 0,growx"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JTextField" ) {
|
||||
name: "textField3"
|
||||
"text": "longer text for testing horizontal scrolling"
|
||||
"componentPopupMenu": #FormReference0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 0,growx"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JTextField" ) {
|
||||
name: "textField2"
|
||||
"text": "partly selected"
|
||||
"selectionStart": 1
|
||||
"selectionEnd": 4
|
||||
"componentPopupMenu": #FormReference0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "button1"
|
||||
"text": "change text"
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "changeText", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "formattedTextFieldLabel"
|
||||
"text": "JFormattedTextField:"
|
||||
"displayedMnemonic": 70
|
||||
"labelFor": new FormReference( "formattedTextField1" )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JFormattedTextField" ) {
|
||||
name: "formattedTextField1"
|
||||
"text": "editable"
|
||||
"componentPopupMenu": #FormReference0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 1,growx"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JFormattedTextField" ) {
|
||||
name: "formattedTextField3"
|
||||
"text": "longer text for testing horizontal scrolling"
|
||||
"componentPopupMenu": #FormReference0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 1,growx"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "passwordFieldLabel"
|
||||
"text": "JPasswordField:"
|
||||
"displayedMnemonic": 80
|
||||
"labelFor": new FormReference( "passwordField1" )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JPasswordField" ) {
|
||||
name: "passwordField1"
|
||||
"text": "editable"
|
||||
"componentPopupMenu": #FormReference0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 2,growx"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JPasswordField" ) {
|
||||
name: "passwordField3"
|
||||
"text": "longer text for testing horizontal scrolling"
|
||||
"componentPopupMenu": #FormReference0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 2,growx"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "textAreaLabel"
|
||||
"text": "JTextArea:"
|
||||
"displayedMnemonic": 65
|
||||
"labelFor": new FormReference( "textArea1" )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 3"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||
name: "scrollPane1"
|
||||
add( new FormComponent( "javax.swing.JTextArea" ) {
|
||||
name: "textArea1"
|
||||
"text": "editable"
|
||||
"componentPopupMenu": #FormReference0
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 3,growx"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||
name: "scrollPane3"
|
||||
add( new FormComponent( "javax.swing.JTextArea" ) {
|
||||
name: "textArea3"
|
||||
"text": "longer text for testing horizontal scrolling"
|
||||
"componentPopupMenu": #FormReference0
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 3,growx"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "editorPaneLabel"
|
||||
"text": "JEditorPane"
|
||||
"displayedMnemonic": 74
|
||||
"labelFor": new FormReference( "editorPane1" )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 4"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||
name: "scrollPane5"
|
||||
add( new FormComponent( "javax.swing.JEditorPane" ) {
|
||||
name: "editorPane1"
|
||||
"text": "editable"
|
||||
"componentPopupMenu": #FormReference0
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 4,growx"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||
name: "scrollPane7"
|
||||
add( new FormComponent( "javax.swing.JEditorPane" ) {
|
||||
name: "editorPane3"
|
||||
"text": "longer text for testing horizontal scrolling"
|
||||
"componentPopupMenu": #FormReference0
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 4,growx"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "textPaneLabel"
|
||||
"text": "JTextPane:"
|
||||
"displayedMnemonic": 78
|
||||
"labelFor": new FormReference( "textPane1" )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 5"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||
name: "scrollPane9"
|
||||
add( new FormComponent( "javax.swing.JTextPane" ) {
|
||||
name: "textPane1"
|
||||
"text": "editable"
|
||||
"componentPopupMenu": #FormReference0
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 5,growx"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||
name: "scrollPane11"
|
||||
add( new FormComponent( "javax.swing.JTextPane" ) {
|
||||
name: "textPane3"
|
||||
"text": "longer text for testing horizontal scrolling"
|
||||
"componentPopupMenu": #FormReference0
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 5,growx"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "comboBoxLabel"
|
||||
"text": "JComboBox:"
|
||||
"displayedMnemonic": 67
|
||||
"labelFor": new FormReference( "comboBox1" )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 6"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JComboBox" ) {
|
||||
name: "comboBox1"
|
||||
"editable": true
|
||||
"model": new javax.swing.DefaultComboBoxModel {
|
||||
selectedItem: "editable"
|
||||
addElement( "editable" )
|
||||
addElement( "a" )
|
||||
addElement( "bb" )
|
||||
addElement( "ccc" )
|
||||
}
|
||||
"componentPopupMenu": #FormReference0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 6,growx"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JComboBox" ) {
|
||||
name: "comboBox3"
|
||||
"model": new javax.swing.DefaultComboBoxModel {
|
||||
selectedItem: "longer text for testing horizontal scrolling"
|
||||
addElement( "longer text for testing horizontal scrolling" )
|
||||
addElement( "a" )
|
||||
addElement( "bb" )
|
||||
addElement( "ccc" )
|
||||
}
|
||||
"editable": true
|
||||
"prototypeDisplayValue": "12345"
|
||||
"componentPopupMenu": #FormReference0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 6,growx"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "spinnerLabel"
|
||||
"text": "JSpinner:"
|
||||
"displayedMnemonic": 83
|
||||
"labelFor": new FormReference( "spinner1" )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 7"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JSpinner" ) {
|
||||
name: "spinner1"
|
||||
"componentPopupMenu": #FormReference0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 7,growx"
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 0 )
|
||||
"size": new java.awt.Dimension( 530, 340 )
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JPopupMenu", new FormLayoutManager( class javax.swing.JPopupMenu ) ) {
|
||||
name: "popupMenu1"
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "cutMenuItem"
|
||||
"text": "Cut"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "copyMenuItem"
|
||||
"text": "Copy"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "pasteMenuItem"
|
||||
"text": "Paste"
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 390 )
|
||||
"size": new java.awt.Dimension( 91, 87 )
|
||||
} )
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@
|
||||
@selectionInactiveForeground=#ffffff
|
||||
@disabledText=#000088
|
||||
@textComponentBackground=#ffffff
|
||||
@menuBackground=#fff
|
||||
@cellFocusColor=#ff0000
|
||||
@icon=#afafaf
|
||||
|
||||
@@ -157,6 +158,7 @@ Menu.icon.disabledArrowColor=#ABABAB
|
||||
#---- MenuBar ----
|
||||
|
||||
MenuBar.borderColor=#4444ff
|
||||
MenuBar.hoverBackground=#fdd
|
||||
|
||||
|
||||
#---- MenuItemCheckBox ----
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
29
gradlew
vendored
29
gradlew
vendored
@@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -175,14 +175,9 @@ save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
||||
Reference in New Issue
Block a user