mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 06:20:53 +03:00
Demo: moved SVG icons to JFormDesigner forms
This commit is contained in:
@@ -591,6 +591,7 @@ class DemoFrame
|
|||||||
undoMenuItem.setText("Undo");
|
undoMenuItem.setText("Undo");
|
||||||
undoMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
undoMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||||
undoMenuItem.setMnemonic('U');
|
undoMenuItem.setMnemonic('U');
|
||||||
|
undoMenuItem.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/undo.svg"));
|
||||||
undoMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
undoMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||||
editMenu.add(undoMenuItem);
|
editMenu.add(undoMenuItem);
|
||||||
|
|
||||||
@@ -598,6 +599,7 @@ class DemoFrame
|
|||||||
redoMenuItem.setText("Redo");
|
redoMenuItem.setText("Redo");
|
||||||
redoMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
redoMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||||
redoMenuItem.setMnemonic('R');
|
redoMenuItem.setMnemonic('R');
|
||||||
|
redoMenuItem.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/redo.svg"));
|
||||||
redoMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
redoMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||||
editMenu.add(redoMenuItem);
|
editMenu.add(redoMenuItem);
|
||||||
editMenu.addSeparator();
|
editMenu.addSeparator();
|
||||||
@@ -606,18 +608,21 @@ class DemoFrame
|
|||||||
cutMenuItem.setText("Cut");
|
cutMenuItem.setText("Cut");
|
||||||
cutMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
cutMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||||
cutMenuItem.setMnemonic('C');
|
cutMenuItem.setMnemonic('C');
|
||||||
|
cutMenuItem.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/menu-cut.svg"));
|
||||||
editMenu.add(cutMenuItem);
|
editMenu.add(cutMenuItem);
|
||||||
|
|
||||||
//---- copyMenuItem ----
|
//---- copyMenuItem ----
|
||||||
copyMenuItem.setText("Copy");
|
copyMenuItem.setText("Copy");
|
||||||
copyMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
copyMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||||
copyMenuItem.setMnemonic('O');
|
copyMenuItem.setMnemonic('O');
|
||||||
|
copyMenuItem.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/copy.svg"));
|
||||||
editMenu.add(copyMenuItem);
|
editMenu.add(copyMenuItem);
|
||||||
|
|
||||||
//---- pasteMenuItem ----
|
//---- pasteMenuItem ----
|
||||||
pasteMenuItem.setText("Paste");
|
pasteMenuItem.setText("Paste");
|
||||||
pasteMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
pasteMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
||||||
pasteMenuItem.setMnemonic('P');
|
pasteMenuItem.setMnemonic('P');
|
||||||
|
pasteMenuItem.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/menu-paste.svg"));
|
||||||
editMenu.add(pasteMenuItem);
|
editMenu.add(pasteMenuItem);
|
||||||
editMenu.addSeparator();
|
editMenu.addSeparator();
|
||||||
|
|
||||||
@@ -827,34 +832,41 @@ class DemoFrame
|
|||||||
|
|
||||||
//---- backButton ----
|
//---- backButton ----
|
||||||
backButton.setToolTipText("Back");
|
backButton.setToolTipText("Back");
|
||||||
|
backButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/back.svg"));
|
||||||
toolBar.add(backButton);
|
toolBar.add(backButton);
|
||||||
|
|
||||||
//---- forwardButton ----
|
//---- forwardButton ----
|
||||||
forwardButton.setToolTipText("Forward");
|
forwardButton.setToolTipText("Forward");
|
||||||
|
forwardButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/forward.svg"));
|
||||||
toolBar.add(forwardButton);
|
toolBar.add(forwardButton);
|
||||||
toolBar.addSeparator();
|
toolBar.addSeparator();
|
||||||
|
|
||||||
//---- cutButton ----
|
//---- cutButton ----
|
||||||
cutButton.setToolTipText("Cut");
|
cutButton.setToolTipText("Cut");
|
||||||
|
cutButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/menu-cut.svg"));
|
||||||
toolBar.add(cutButton);
|
toolBar.add(cutButton);
|
||||||
|
|
||||||
//---- copyButton ----
|
//---- copyButton ----
|
||||||
copyButton.setToolTipText("Copy");
|
copyButton.setToolTipText("Copy");
|
||||||
|
copyButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/copy.svg"));
|
||||||
toolBar.add(copyButton);
|
toolBar.add(copyButton);
|
||||||
|
|
||||||
//---- pasteButton ----
|
//---- pasteButton ----
|
||||||
pasteButton.setToolTipText("Paste");
|
pasteButton.setToolTipText("Paste");
|
||||||
|
pasteButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/menu-paste.svg"));
|
||||||
toolBar.add(pasteButton);
|
toolBar.add(pasteButton);
|
||||||
toolBar.addSeparator();
|
toolBar.addSeparator();
|
||||||
|
|
||||||
//---- refreshButton ----
|
//---- refreshButton ----
|
||||||
refreshButton.setToolTipText("Refresh");
|
refreshButton.setToolTipText("Refresh");
|
||||||
|
refreshButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/refresh.svg"));
|
||||||
toolBar.add(refreshButton);
|
toolBar.add(refreshButton);
|
||||||
toolBar.addSeparator();
|
toolBar.addSeparator();
|
||||||
|
|
||||||
//---- showToggleButton ----
|
//---- showToggleButton ----
|
||||||
showToggleButton.setSelected(true);
|
showToggleButton.setSelected(true);
|
||||||
showToggleButton.setToolTipText("Show Details");
|
showToggleButton.setToolTipText("Show Details");
|
||||||
|
showToggleButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/show.svg"));
|
||||||
toolBar.add(showToggleButton);
|
toolBar.add(showToggleButton);
|
||||||
}
|
}
|
||||||
contentPane.add(toolBar, BorderLayout.NORTH);
|
contentPane.add(toolBar, BorderLayout.NORTH);
|
||||||
@@ -901,21 +913,6 @@ class DemoFrame
|
|||||||
menuBar1.add( Box.createGlue() );
|
menuBar1.add( Box.createGlue() );
|
||||||
menuBar1.add( usersButton );
|
menuBar1.add( usersButton );
|
||||||
|
|
||||||
undoMenuItem.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/undo.svg" ) );
|
|
||||||
redoMenuItem.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/redo.svg" ) );
|
|
||||||
|
|
||||||
cutMenuItem.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/menu-cut.svg" ) );
|
|
||||||
copyMenuItem.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/copy.svg" ) );
|
|
||||||
pasteMenuItem.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/menu-paste.svg" ) );
|
|
||||||
|
|
||||||
backButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/back.svg" ) );
|
|
||||||
forwardButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/forward.svg" ) );
|
|
||||||
cutButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/menu-cut.svg" ) );
|
|
||||||
copyButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/copy.svg" ) );
|
|
||||||
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() );
|
cutMenuItem.addActionListener( new DefaultEditorKit.CutAction() );
|
||||||
copyMenuItem.addActionListener( new DefaultEditorKit.CopyAction() );
|
copyMenuItem.addActionListener( new DefaultEditorKit.CopyAction() );
|
||||||
pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() );
|
pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() );
|
||||||
@@ -950,6 +947,9 @@ class DemoFrame
|
|||||||
if( SystemInfo.isMacOS )
|
if( SystemInfo.isMacOS )
|
||||||
unsupported( underlineMenuSelectionMenuItem );
|
unsupported( underlineMenuSelectionMenuItem );
|
||||||
|
|
||||||
|
if( "false".equals( System.getProperty( "flatlaf.animatedLafChange" ) ) )
|
||||||
|
animatedLafChangeMenuItem.setSelected( false );
|
||||||
|
|
||||||
// remove contentPanel bottom insets
|
// remove contentPanel bottom insets
|
||||||
MigLayout layout = (MigLayout) contentPanel.getLayout();
|
MigLayout layout = (MigLayout) contentPanel.getLayout();
|
||||||
LC lc = ConstraintParser.parseLayoutConstraint( (String) layout.getLayoutConstraints() );
|
LC lc = ConstraintParser.parseLayoutConstraint( (String) layout.getLayoutConstraints() );
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
JFDML JFormDesigner: "7.0.4.0.360" Java: "17" encoding: "UTF-8"
|
JFDML JFormDesigner: "8.1.0.0.283" Java: "19.0.2" encoding: "UTF-8"
|
||||||
|
|
||||||
new FormModel {
|
new FormModel {
|
||||||
contentType: "form/swing"
|
contentType: "form/swing"
|
||||||
@@ -21,10 +21,12 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "backButton"
|
name: "backButton"
|
||||||
"toolTipText": "Back"
|
"toolTipText": "Back"
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/back.svg" )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "forwardButton"
|
name: "forwardButton"
|
||||||
"toolTipText": "Forward"
|
"toolTipText": "Forward"
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/forward.svg" )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
||||||
name: "separator5"
|
name: "separator5"
|
||||||
@@ -32,14 +34,17 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "cutButton"
|
name: "cutButton"
|
||||||
"toolTipText": "Cut"
|
"toolTipText": "Cut"
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/menu-cut.svg" )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "copyButton"
|
name: "copyButton"
|
||||||
"toolTipText": "Copy"
|
"toolTipText": "Copy"
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/copy.svg" )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "pasteButton"
|
name: "pasteButton"
|
||||||
"toolTipText": "Paste"
|
"toolTipText": "Paste"
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/menu-paste.svg" )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
||||||
name: "separator6"
|
name: "separator6"
|
||||||
@@ -47,6 +52,7 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "refreshButton"
|
name: "refreshButton"
|
||||||
"toolTipText": "Refresh"
|
"toolTipText": "Refresh"
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/refresh.svg" )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
||||||
name: "separator7"
|
name: "separator7"
|
||||||
@@ -55,6 +61,7 @@ new FormModel {
|
|||||||
name: "showToggleButton"
|
name: "showToggleButton"
|
||||||
"selected": true
|
"selected": true
|
||||||
"toolTipText": "Show Details"
|
"toolTipText": "Show Details"
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/show.svg" )
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( class java.lang.String ) {
|
}, new FormLayoutConstraints( class java.lang.String ) {
|
||||||
"value": "North"
|
"value": "North"
|
||||||
@@ -185,6 +192,7 @@ new FormModel {
|
|||||||
"text": "Undo"
|
"text": "Undo"
|
||||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 90, 4226, false )
|
"accelerator": static javax.swing.KeyStroke getKeyStroke( 90, 4226, false )
|
||||||
"mnemonic": 85
|
"mnemonic": 85
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/undo.svg" )
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||||
@@ -192,6 +200,7 @@ new FormModel {
|
|||||||
"text": "Redo"
|
"text": "Redo"
|
||||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 89, 4226, false )
|
"accelerator": static javax.swing.KeyStroke getKeyStroke( 89, 4226, false )
|
||||||
"mnemonic": 82
|
"mnemonic": 82
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/redo.svg" )
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
|
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
|
||||||
@@ -202,18 +211,21 @@ new FormModel {
|
|||||||
"text": "Cut"
|
"text": "Cut"
|
||||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 88, 4226, false )
|
"accelerator": static javax.swing.KeyStroke getKeyStroke( 88, 4226, false )
|
||||||
"mnemonic": 67
|
"mnemonic": 67
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/menu-cut.svg" )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||||
name: "copyMenuItem"
|
name: "copyMenuItem"
|
||||||
"text": "Copy"
|
"text": "Copy"
|
||||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 67, 4226, false )
|
"accelerator": static javax.swing.KeyStroke getKeyStroke( 67, 4226, false )
|
||||||
"mnemonic": 79
|
"mnemonic": 79
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/copy.svg" )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||||
name: "pasteMenuItem"
|
name: "pasteMenuItem"
|
||||||
"text": "Paste"
|
"text": "Paste"
|
||||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 86, 4226, false )
|
"accelerator": static javax.swing.KeyStroke getKeyStroke( 86, 4226, false )
|
||||||
"mnemonic": 80
|
"mnemonic": 80
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/menu-paste.svg" )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
|
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
|
||||||
name: "separator3"
|
name: "separator3"
|
||||||
|
|||||||
@@ -88,8 +88,6 @@ public class IJThemesPanel
|
|||||||
|
|
||||||
saveButton.setEnabled( false );
|
saveButton.setEnabled( false );
|
||||||
sourceCodeButton.setEnabled( false );
|
sourceCodeButton.setEnabled( false );
|
||||||
saveButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/download.svg" ) );
|
|
||||||
sourceCodeButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/github.svg" ) );
|
|
||||||
|
|
||||||
// create renderer
|
// create renderer
|
||||||
themesList.setCellRenderer( new DefaultListCellRenderer() {
|
themesList.setCellRenderer( new DefaultListCellRenderer() {
|
||||||
@@ -491,11 +489,13 @@ public class IJThemesPanel
|
|||||||
|
|
||||||
//---- saveButton ----
|
//---- saveButton ----
|
||||||
saveButton.setToolTipText("Save .theme.json of selected IntelliJ theme to file.");
|
saveButton.setToolTipText("Save .theme.json of selected IntelliJ theme to file.");
|
||||||
|
saveButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/download.svg"));
|
||||||
saveButton.addActionListener(e -> saveTheme());
|
saveButton.addActionListener(e -> saveTheme());
|
||||||
toolBar.add(saveButton);
|
toolBar.add(saveButton);
|
||||||
|
|
||||||
//---- sourceCodeButton ----
|
//---- sourceCodeButton ----
|
||||||
sourceCodeButton.setToolTipText("Opens the source code repository of selected IntelliJ theme in the browser.");
|
sourceCodeButton.setToolTipText("Opens the source code repository of selected IntelliJ theme in the browser.");
|
||||||
|
sourceCodeButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/github.svg"));
|
||||||
sourceCodeButton.addActionListener(e -> browseSourceCode());
|
sourceCodeButton.addActionListener(e -> browseSourceCode());
|
||||||
toolBar.add(sourceCodeButton);
|
toolBar.add(sourceCodeButton);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8"
|
JFDML JFormDesigner: "8.1.0.0.283" Java: "19.0.2" encoding: "UTF-8"
|
||||||
|
|
||||||
new FormModel {
|
new FormModel {
|
||||||
contentType: "form/swing"
|
contentType: "form/swing"
|
||||||
@@ -24,11 +24,13 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "saveButton"
|
name: "saveButton"
|
||||||
"toolTipText": "Save .theme.json of selected IntelliJ theme to file."
|
"toolTipText": "Save .theme.json of selected IntelliJ theme to file."
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/download.svg" )
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "saveTheme", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "saveTheme", false ) )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "sourceCodeButton"
|
name: "sourceCodeButton"
|
||||||
"toolTipText": "Opens the source code repository of selected IntelliJ theme in the browser."
|
"toolTipText": "Opens the source code repository of selected IntelliJ theme in the browser."
|
||||||
|
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/github.svg" )
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "browseSourceCode", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "browseSourceCode", false ) )
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
|||||||
@@ -70,13 +70,6 @@ class FlatFindReplaceBar
|
|||||||
actionMap.put( "editorPageUp", new ConsumerAction( e -> notifyEditorAction( "page-up" ) ) );
|
actionMap.put( "editorPageUp", new ConsumerAction( e -> notifyEditorAction( "page-up" ) ) );
|
||||||
actionMap.put( "editorPageDown", new ConsumerAction( e -> notifyEditorAction( "page-down" ) ) );
|
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(),
|
registerKeyboardAction( e -> close(),
|
||||||
KeyStroke.getKeyStroke( KeyEvent.VK_ESCAPE, 0, false ),
|
KeyStroke.getKeyStroke( KeyEvent.VK_ESCAPE, 0, false ),
|
||||||
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );
|
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );
|
||||||
@@ -335,27 +328,32 @@ class FlatFindReplaceBar
|
|||||||
|
|
||||||
//---- findPreviousButton ----
|
//---- findPreviousButton ----
|
||||||
findPreviousButton.setToolTipText("Previous Occurrence");
|
findPreviousButton.setToolTipText("Previous Occurrence");
|
||||||
|
findPreviousButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/themeeditor/icons/findAndShowPrevMatches.svg"));
|
||||||
findPreviousButton.addActionListener(e -> findPrevious());
|
findPreviousButton.addActionListener(e -> findPrevious());
|
||||||
findToolBar.add(findPreviousButton);
|
findToolBar.add(findPreviousButton);
|
||||||
|
|
||||||
//---- findNextButton ----
|
//---- findNextButton ----
|
||||||
findNextButton.setToolTipText("Next Occurrence");
|
findNextButton.setToolTipText("Next Occurrence");
|
||||||
|
findNextButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/themeeditor/icons/findAndShowNextMatches.svg"));
|
||||||
findNextButton.addActionListener(e -> findNext());
|
findNextButton.addActionListener(e -> findNext());
|
||||||
findToolBar.add(findNextButton);
|
findToolBar.add(findNextButton);
|
||||||
findToolBar.addSeparator();
|
findToolBar.addSeparator();
|
||||||
|
|
||||||
//---- matchCaseToggleButton ----
|
//---- matchCaseToggleButton ----
|
||||||
matchCaseToggleButton.setToolTipText("Match Case");
|
matchCaseToggleButton.setToolTipText("Match Case");
|
||||||
|
matchCaseToggleButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/themeeditor/icons/matchCase.svg"));
|
||||||
matchCaseToggleButton.addActionListener(e -> matchCaseChanged());
|
matchCaseToggleButton.addActionListener(e -> matchCaseChanged());
|
||||||
findToolBar.add(matchCaseToggleButton);
|
findToolBar.add(matchCaseToggleButton);
|
||||||
|
|
||||||
//---- matchWholeWordToggleButton ----
|
//---- matchWholeWordToggleButton ----
|
||||||
matchWholeWordToggleButton.setToolTipText("Match Whole Word");
|
matchWholeWordToggleButton.setToolTipText("Match Whole Word");
|
||||||
|
matchWholeWordToggleButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/themeeditor/icons/words.svg"));
|
||||||
matchWholeWordToggleButton.addActionListener(e -> matchWholeWordChanged());
|
matchWholeWordToggleButton.addActionListener(e -> matchWholeWordChanged());
|
||||||
findToolBar.add(matchWholeWordToggleButton);
|
findToolBar.add(matchWholeWordToggleButton);
|
||||||
|
|
||||||
//---- regexToggleButton ----
|
//---- regexToggleButton ----
|
||||||
regexToggleButton.setToolTipText("Regex");
|
regexToggleButton.setToolTipText("Regex");
|
||||||
|
regexToggleButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/themeeditor/icons/regex.svg"));
|
||||||
regexToggleButton.addActionListener(e -> regexChanged());
|
regexToggleButton.addActionListener(e -> regexChanged());
|
||||||
findToolBar.add(regexToggleButton);
|
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 {
|
new FormModel {
|
||||||
contentType: "form/swing"
|
contentType: "form/swing"
|
||||||
@@ -34,11 +34,13 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "findPreviousButton"
|
name: "findPreviousButton"
|
||||||
"toolTipText": "Previous Occurrence"
|
"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 ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "findPrevious", false ) )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "findNextButton"
|
name: "findNextButton"
|
||||||
"toolTipText": "Next Occurrence"
|
"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 ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "findNext", false ) )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
||||||
@@ -47,16 +49,19 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||||
name: "matchCaseToggleButton"
|
name: "matchCaseToggleButton"
|
||||||
"toolTipText": "Match Case"
|
"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 ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "matchCaseChanged", false ) )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||||
name: "matchWholeWordToggleButton"
|
name: "matchWholeWordToggleButton"
|
||||||
"toolTipText": "Match Whole Word"
|
"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 ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "matchWholeWordChanged", false ) )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||||
name: "regexToggleButton"
|
name: "regexToggleButton"
|
||||||
"toolTipText": "Regex"
|
"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 ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "regexChanged", false ) )
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
|||||||
@@ -140,7 +140,6 @@ class FlatThemeFileEditor
|
|||||||
|
|
||||||
directoryField.setRenderer( new DirectoryRenderer( directoryField ) );
|
directoryField.setRenderer( new DirectoryRenderer( directoryField ) );
|
||||||
|
|
||||||
openDirectoryButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/menu-open.svg" ) );
|
|
||||||
if( UIManager.getLookAndFeel() instanceof FlatDarkLaf )
|
if( UIManager.getLookAndFeel() instanceof FlatDarkLaf )
|
||||||
darkLafMenuItem.setSelected( true );
|
darkLafMenuItem.setSelected( true );
|
||||||
|
|
||||||
@@ -1045,6 +1044,7 @@ class FlatThemeFileEditor
|
|||||||
openDirectoryMenuItem.setText("Open Directory...");
|
openDirectoryMenuItem.setText("Open Directory...");
|
||||||
openDirectoryMenuItem.setMnemonic('O');
|
openDirectoryMenuItem.setMnemonic('O');
|
||||||
openDirectoryMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
|
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());
|
openDirectoryMenuItem.addActionListener(e -> openDirectory());
|
||||||
fileMenu.add(openDirectoryMenuItem);
|
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 {
|
new FormModel {
|
||||||
contentType: "form/swing"
|
contentType: "form/swing"
|
||||||
@@ -65,6 +65,7 @@ new FormModel {
|
|||||||
"text": "Open Directory..."
|
"text": "Open Directory..."
|
||||||
"mnemonic": 79
|
"mnemonic": 79
|
||||||
"accelerator": static javax.swing.KeyStroke getKeyStroke( 79, 4226, false )
|
"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 ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "openDirectory", false ) )
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user