mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
Demo: moved SVG icons to JFormDesigner forms
This commit is contained in:
@@ -70,13 +70,6 @@ class FlatFindReplaceBar
|
||||
actionMap.put( "editorPageUp", new ConsumerAction( e -> notifyEditorAction( "page-up" ) ) );
|
||||
actionMap.put( "editorPageDown", new ConsumerAction( e -> notifyEditorAction( "page-down" ) ) );
|
||||
|
||||
findPreviousButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/findAndShowPrevMatches.svg" ) );
|
||||
findNextButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/findAndShowNextMatches.svg" ) );
|
||||
matchCaseToggleButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/matchCase.svg" ) );
|
||||
matchWholeWordToggleButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/words.svg" ) );
|
||||
regexToggleButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/regex.svg" ) );
|
||||
closeButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/close.svg" ) );
|
||||
|
||||
registerKeyboardAction( e -> close(),
|
||||
KeyStroke.getKeyStroke( KeyEvent.VK_ESCAPE, 0, false ),
|
||||
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );
|
||||
@@ -335,27 +328,32 @@ class FlatFindReplaceBar
|
||||
|
||||
//---- findPreviousButton ----
|
||||
findPreviousButton.setToolTipText("Previous Occurrence");
|
||||
findPreviousButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/themeeditor/icons/findAndShowPrevMatches.svg"));
|
||||
findPreviousButton.addActionListener(e -> findPrevious());
|
||||
findToolBar.add(findPreviousButton);
|
||||
|
||||
//---- findNextButton ----
|
||||
findNextButton.setToolTipText("Next Occurrence");
|
||||
findNextButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/themeeditor/icons/findAndShowNextMatches.svg"));
|
||||
findNextButton.addActionListener(e -> findNext());
|
||||
findToolBar.add(findNextButton);
|
||||
findToolBar.addSeparator();
|
||||
|
||||
//---- matchCaseToggleButton ----
|
||||
matchCaseToggleButton.setToolTipText("Match Case");
|
||||
matchCaseToggleButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/themeeditor/icons/matchCase.svg"));
|
||||
matchCaseToggleButton.addActionListener(e -> matchCaseChanged());
|
||||
findToolBar.add(matchCaseToggleButton);
|
||||
|
||||
//---- matchWholeWordToggleButton ----
|
||||
matchWholeWordToggleButton.setToolTipText("Match Whole Word");
|
||||
matchWholeWordToggleButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/themeeditor/icons/words.svg"));
|
||||
matchWholeWordToggleButton.addActionListener(e -> matchWholeWordChanged());
|
||||
findToolBar.add(matchWholeWordToggleButton);
|
||||
|
||||
//---- regexToggleButton ----
|
||||
regexToggleButton.setToolTipText("Regex");
|
||||
regexToggleButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/themeeditor/icons/regex.svg"));
|
||||
regexToggleButton.addActionListener(e -> regexChanged());
|
||||
findToolBar.add(regexToggleButton);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JFDML JFormDesigner: "7.0.4.0.360" Java: "16" encoding: "UTF-8"
|
||||
JFDML JFormDesigner: "8.1.0.0.283" Java: "19.0.2" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
@@ -34,11 +34,13 @@ new FormModel {
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "findPreviousButton"
|
||||
"toolTipText": "Previous Occurrence"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/themeeditor/icons/findAndShowPrevMatches.svg" )
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "findPrevious", false ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "findNextButton"
|
||||
"toolTipText": "Next Occurrence"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/themeeditor/icons/findAndShowNextMatches.svg" )
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "findNext", false ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
||||
@@ -47,16 +49,19 @@ new FormModel {
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "matchCaseToggleButton"
|
||||
"toolTipText": "Match Case"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/themeeditor/icons/matchCase.svg" )
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "matchCaseChanged", false ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "matchWholeWordToggleButton"
|
||||
"toolTipText": "Match Whole Word"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/themeeditor/icons/words.svg" )
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "matchWholeWordChanged", false ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "regexToggleButton"
|
||||
"toolTipText": "Regex"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/themeeditor/icons/regex.svg" )
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "regexChanged", false ) )
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
|
||||
@@ -140,7 +140,6 @@ class FlatThemeFileEditor
|
||||
|
||||
directoryField.setRenderer( new DirectoryRenderer( directoryField ) );
|
||||
|
||||
openDirectoryButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/menu-open.svg" ) );
|
||||
if( UIManager.getLookAndFeel() instanceof FlatDarkLaf )
|
||||
darkLafMenuItem.setSelected( true );
|
||||
|
||||
@@ -1045,6 +1044,7 @@ class FlatThemeFileEditor
|
||||
openDirectoryMenuItem.setText("Open Directory...");
|
||||
openDirectoryMenuItem.setMnemonic('O');
|
||||
openDirectoryMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||
openDirectoryMenuItem.setIcon(new FlatSVGIcon("com/formdev/flatlaf/themeeditor/icons/menu-open.svg"));
|
||||
openDirectoryMenuItem.addActionListener(e -> openDirectory());
|
||||
fileMenu.add(openDirectoryMenuItem);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JFDML JFormDesigner: "7.0.5.0.382" Java: "16" encoding: "UTF-8"
|
||||
JFDML JFormDesigner: "8.1.0.0.283" Java: "19.0.2" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
@@ -65,6 +65,7 @@ new FormModel {
|
||||
"text": "Open Directory..."
|
||||
"mnemonic": 79
|
||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 79, 4226, false )
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/themeeditor/icons/menu-open.svg" )
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "openDirectory", false ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
|
||||
Reference in New Issue
Block a user