mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 06:57:13 -06:00
TODO - move window - resize window - window icon - window border
This commit is contained in:
@@ -0,0 +1,467 @@
|
||||
/*
|
||||
* 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 java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import javax.swing.*;
|
||||
import net.miginfocom.swing.*;
|
||||
|
||||
/**
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class FlatWindowDecorationsTest
|
||||
extends FlatTestPanel
|
||||
{
|
||||
public static void main( String[] args ) {
|
||||
SwingUtilities.invokeLater( () -> {
|
||||
// enable custom window decoration (if LaF supports it)
|
||||
JFrame.setDefaultLookAndFeelDecorated( true );
|
||||
JDialog.setDefaultLookAndFeelDecorated( true );
|
||||
|
||||
FlatTestFrame frame = FlatTestFrame.create( args, "FlatWindowDecorationsTest" );
|
||||
|
||||
// WARNING: Do not this in real-world programs.
|
||||
// frame.setUndecorated( true );
|
||||
// frame.getRootPane().setWindowDecorationStyle( JRootPane.FRAME );
|
||||
|
||||
frame.showFrame( FlatWindowDecorationsTest::new, panel -> ((FlatWindowDecorationsTest)panel).menuBar );
|
||||
} );
|
||||
}
|
||||
|
||||
FlatWindowDecorationsTest() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNotify() {
|
||||
super.addNotify();
|
||||
|
||||
JRootPane rootPane = getWindowRootPane();
|
||||
if( rootPane != null ) {
|
||||
int style = rootPane.getWindowDecorationStyle();
|
||||
if( style == JRootPane.NONE )
|
||||
styleNoneRadioButton.setSelected( true );
|
||||
else if( style == JRootPane.FRAME )
|
||||
styleFrameRadioButton.setSelected( true );
|
||||
else if( style == JRootPane.PLAIN_DIALOG )
|
||||
stylePlainRadioButton.setSelected( true );
|
||||
else if( style == JRootPane.INFORMATION_DIALOG )
|
||||
styleInfoRadioButton.setSelected( true );
|
||||
else
|
||||
throw new RuntimeException(); // not used
|
||||
}
|
||||
}
|
||||
|
||||
private void menuBarChanged() {
|
||||
Window window = SwingUtilities.windowForComponent( this );
|
||||
if( window instanceof JFrame ) {
|
||||
((JFrame)window).setJMenuBar( menuBarCheckBox.isSelected() ? menuBar : null );
|
||||
window.revalidate();
|
||||
window.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
private void resizableChanged() {
|
||||
Window window = SwingUtilities.windowForComponent( this );
|
||||
if( window instanceof Frame )
|
||||
((Frame)window).setResizable( resizableCheckBox.isSelected() );
|
||||
}
|
||||
|
||||
private void menuItemActionPerformed(ActionEvent e) {
|
||||
SwingUtilities.invokeLater( () -> {
|
||||
JOptionPane.showMessageDialog( this, e.getActionCommand(), "Menu Item", JOptionPane.PLAIN_MESSAGE );
|
||||
} );
|
||||
}
|
||||
|
||||
private void openDialog() {
|
||||
JOptionPane.showMessageDialog( this, new FlatWindowDecorationsTest() );
|
||||
}
|
||||
|
||||
private void decorationStyleChanged() {
|
||||
int style;
|
||||
if( styleFrameRadioButton.isSelected() )
|
||||
style = JRootPane.FRAME;
|
||||
else if( stylePlainRadioButton.isSelected() )
|
||||
style = JRootPane.PLAIN_DIALOG;
|
||||
else if( styleInfoRadioButton.isSelected() )
|
||||
style = JRootPane.INFORMATION_DIALOG;
|
||||
else if( styleErrorRadioButton.isSelected() )
|
||||
style = JRootPane.ERROR_DIALOG;
|
||||
else if( styleQuestionRadioButton.isSelected() )
|
||||
style = JRootPane.QUESTION_DIALOG;
|
||||
else if( styleWarningRadioButton.isSelected() )
|
||||
style = JRootPane.WARNING_DIALOG;
|
||||
else if( styleColorChooserRadioButton.isSelected() )
|
||||
style = JRootPane.COLOR_CHOOSER_DIALOG;
|
||||
else if( styleFileChooserRadioButton.isSelected() )
|
||||
style = JRootPane.FILE_CHOOSER_DIALOG;
|
||||
else
|
||||
style = JRootPane.NONE;
|
||||
|
||||
JRootPane rootPane = getWindowRootPane();
|
||||
if( rootPane != null )
|
||||
rootPane.setWindowDecorationStyle( style );
|
||||
}
|
||||
|
||||
private JRootPane getWindowRootPane() {
|
||||
Window window = SwingUtilities.windowForComponent( this );
|
||||
if( window instanceof JFrame )
|
||||
return ((JFrame)window).getRootPane();
|
||||
else if( window instanceof JDialog )
|
||||
return ((JDialog)window).getRootPane();
|
||||
return null;
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
||||
menuBarCheckBox = new JCheckBox();
|
||||
resizableCheckBox = new JCheckBox();
|
||||
JLabel label1 = new JLabel();
|
||||
JPanel panel1 = new JPanel();
|
||||
styleNoneRadioButton = new JRadioButton();
|
||||
styleFrameRadioButton = new JRadioButton();
|
||||
stylePlainRadioButton = new JRadioButton();
|
||||
styleInfoRadioButton = new JRadioButton();
|
||||
styleErrorRadioButton = new JRadioButton();
|
||||
styleQuestionRadioButton = new JRadioButton();
|
||||
styleWarningRadioButton = new JRadioButton();
|
||||
styleColorChooserRadioButton = new JRadioButton();
|
||||
styleFileChooserRadioButton = new JRadioButton();
|
||||
JButton openDialogButton = new JButton();
|
||||
menuBar = new JMenuBar();
|
||||
JMenu fileMenu = new JMenu();
|
||||
JMenuItem newMenuItem = new JMenuItem();
|
||||
JMenuItem openMenuItem = new JMenuItem();
|
||||
JMenuItem closeMenuItem = new JMenuItem();
|
||||
JMenuItem closeMenuItem2 = new JMenuItem();
|
||||
JMenuItem exitMenuItem = new JMenuItem();
|
||||
JMenu editMenu = new JMenu();
|
||||
JMenuItem undoMenuItem = new JMenuItem();
|
||||
JMenuItem redoMenuItem = new JMenuItem();
|
||||
JMenuItem cutMenuItem = new JMenuItem();
|
||||
JMenuItem copyMenuItem = new JMenuItem();
|
||||
JMenuItem pasteMenuItem = new JMenuItem();
|
||||
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();
|
||||
JMenu helpMenu = new JMenu();
|
||||
JMenuItem aboutMenuItem = new JMenuItem();
|
||||
|
||||
//======== this ========
|
||||
setLayout(new MigLayout(
|
||||
"ltr,insets dialog,hidemode 3",
|
||||
// columns
|
||||
"[left]para",
|
||||
// rows
|
||||
"para[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]"));
|
||||
|
||||
//---- menuBarCheckBox ----
|
||||
menuBarCheckBox.setText("menu bar");
|
||||
menuBarCheckBox.setSelected(true);
|
||||
menuBarCheckBox.addActionListener(e -> menuBarChanged());
|
||||
add(menuBarCheckBox, "cell 0 0");
|
||||
|
||||
//---- resizableCheckBox ----
|
||||
resizableCheckBox.setText("resizable");
|
||||
resizableCheckBox.setSelected(true);
|
||||
resizableCheckBox.addActionListener(e -> resizableChanged());
|
||||
add(resizableCheckBox, "cell 0 1");
|
||||
|
||||
//---- label1 ----
|
||||
label1.setText("Style:");
|
||||
add(label1, "cell 0 2");
|
||||
|
||||
//======== panel1 ========
|
||||
{
|
||||
panel1.setLayout(new MigLayout(
|
||||
"ltr,insets 0,hidemode 3,gap 0 0",
|
||||
// columns
|
||||
"[fill]",
|
||||
// rows
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]"));
|
||||
|
||||
//---- styleNoneRadioButton ----
|
||||
styleNoneRadioButton.setText("none");
|
||||
styleNoneRadioButton.addActionListener(e -> decorationStyleChanged());
|
||||
panel1.add(styleNoneRadioButton, "cell 0 0");
|
||||
|
||||
//---- styleFrameRadioButton ----
|
||||
styleFrameRadioButton.setText("frame");
|
||||
styleFrameRadioButton.setSelected(true);
|
||||
styleFrameRadioButton.addActionListener(e -> decorationStyleChanged());
|
||||
panel1.add(styleFrameRadioButton, "cell 0 1");
|
||||
|
||||
//---- stylePlainRadioButton ----
|
||||
stylePlainRadioButton.setText("plain dialog");
|
||||
stylePlainRadioButton.addActionListener(e -> decorationStyleChanged());
|
||||
panel1.add(stylePlainRadioButton, "cell 0 2");
|
||||
|
||||
//---- styleInfoRadioButton ----
|
||||
styleInfoRadioButton.setText("info dialog");
|
||||
styleInfoRadioButton.addActionListener(e -> decorationStyleChanged());
|
||||
panel1.add(styleInfoRadioButton, "cell 0 3");
|
||||
|
||||
//---- styleErrorRadioButton ----
|
||||
styleErrorRadioButton.setText("error dialog");
|
||||
styleErrorRadioButton.addActionListener(e -> decorationStyleChanged());
|
||||
panel1.add(styleErrorRadioButton, "cell 0 4");
|
||||
|
||||
//---- styleQuestionRadioButton ----
|
||||
styleQuestionRadioButton.setText("question dialog");
|
||||
styleQuestionRadioButton.addActionListener(e -> decorationStyleChanged());
|
||||
panel1.add(styleQuestionRadioButton, "cell 0 5");
|
||||
|
||||
//---- styleWarningRadioButton ----
|
||||
styleWarningRadioButton.setText("warning dialog");
|
||||
styleWarningRadioButton.addActionListener(e -> decorationStyleChanged());
|
||||
panel1.add(styleWarningRadioButton, "cell 0 6");
|
||||
|
||||
//---- styleColorChooserRadioButton ----
|
||||
styleColorChooserRadioButton.setText("color chooser dialog");
|
||||
styleColorChooserRadioButton.addActionListener(e -> decorationStyleChanged());
|
||||
panel1.add(styleColorChooserRadioButton, "cell 0 7");
|
||||
|
||||
//---- styleFileChooserRadioButton ----
|
||||
styleFileChooserRadioButton.setText("file chooser dialog");
|
||||
styleFileChooserRadioButton.addActionListener(e -> decorationStyleChanged());
|
||||
panel1.add(styleFileChooserRadioButton, "cell 0 8");
|
||||
}
|
||||
add(panel1, "cell 0 3");
|
||||
|
||||
//---- openDialogButton ----
|
||||
openDialogButton.setText("Open Dialog");
|
||||
openDialogButton.addActionListener(e -> openDialog());
|
||||
add(openDialogButton, "cell 0 4");
|
||||
|
||||
//======== menuBar ========
|
||||
{
|
||||
|
||||
//======== fileMenu ========
|
||||
{
|
||||
fileMenu.setText("File");
|
||||
fileMenu.setMnemonic('F');
|
||||
|
||||
//---- newMenuItem ----
|
||||
newMenuItem.setText("New");
|
||||
newMenuItem.setMnemonic('N');
|
||||
newMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
fileMenu.add(newMenuItem);
|
||||
|
||||
//---- openMenuItem ----
|
||||
openMenuItem.setText("Open");
|
||||
openMenuItem.setMnemonic('O');
|
||||
openMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
fileMenu.add(openMenuItem);
|
||||
fileMenu.addSeparator();
|
||||
|
||||
//---- closeMenuItem ----
|
||||
closeMenuItem.setText("Close");
|
||||
closeMenuItem.setMnemonic('C');
|
||||
closeMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
fileMenu.add(closeMenuItem);
|
||||
|
||||
//---- closeMenuItem2 ----
|
||||
closeMenuItem2.setText("Close All");
|
||||
closeMenuItem2.addActionListener(e -> menuItemActionPerformed(e));
|
||||
fileMenu.add(closeMenuItem2);
|
||||
fileMenu.addSeparator();
|
||||
|
||||
//---- exitMenuItem ----
|
||||
exitMenuItem.setText("Exit");
|
||||
exitMenuItem.setMnemonic('X');
|
||||
exitMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
fileMenu.add(exitMenuItem);
|
||||
}
|
||||
menuBar.add(fileMenu);
|
||||
|
||||
//======== 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);
|
||||
}
|
||||
menuBar.add(editMenu);
|
||||
|
||||
//======== 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);
|
||||
}
|
||||
menuBar.add(viewMenu);
|
||||
|
||||
//======== helpMenu ========
|
||||
{
|
||||
helpMenu.setText("Help");
|
||||
helpMenu.setMnemonic('H');
|
||||
|
||||
//---- aboutMenuItem ----
|
||||
aboutMenuItem.setText("About");
|
||||
aboutMenuItem.setMnemonic('A');
|
||||
aboutMenuItem.addActionListener(e -> menuItemActionPerformed(e));
|
||||
helpMenu.add(aboutMenuItem);
|
||||
}
|
||||
menuBar.add(helpMenu);
|
||||
}
|
||||
|
||||
//---- styleButtonGroup ----
|
||||
ButtonGroup styleButtonGroup = new ButtonGroup();
|
||||
styleButtonGroup.add(styleNoneRadioButton);
|
||||
styleButtonGroup.add(styleFrameRadioButton);
|
||||
styleButtonGroup.add(stylePlainRadioButton);
|
||||
styleButtonGroup.add(styleInfoRadioButton);
|
||||
styleButtonGroup.add(styleErrorRadioButton);
|
||||
styleButtonGroup.add(styleQuestionRadioButton);
|
||||
styleButtonGroup.add(styleWarningRadioButton);
|
||||
styleButtonGroup.add(styleColorChooserRadioButton);
|
||||
styleButtonGroup.add(styleFileChooserRadioButton);
|
||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||
}
|
||||
|
||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||
private JCheckBox menuBarCheckBox;
|
||||
private JCheckBox resizableCheckBox;
|
||||
private JRadioButton styleNoneRadioButton;
|
||||
private JRadioButton styleFrameRadioButton;
|
||||
private JRadioButton stylePlainRadioButton;
|
||||
private JRadioButton styleInfoRadioButton;
|
||||
private JRadioButton styleErrorRadioButton;
|
||||
private JRadioButton styleQuestionRadioButton;
|
||||
private JRadioButton styleWarningRadioButton;
|
||||
private JRadioButton styleColorChooserRadioButton;
|
||||
private JRadioButton styleFileChooserRadioButton;
|
||||
private JMenuBar menuBar;
|
||||
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||
}
|
||||
@@ -0,0 +1,336 @@
|
||||
JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.2" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
root: new FormRoot {
|
||||
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": "[left]para"
|
||||
"$rowConstraints": "para[][][][][]"
|
||||
} ) {
|
||||
name: "this"
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "menuBarCheckBox"
|
||||
"text": "menu bar"
|
||||
"selected": true
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuBarChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "resizableCheckBox"
|
||||
"text": "resizable"
|
||||
"selected": true
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "resizableChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label1"
|
||||
"text": "Style:"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 2"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||
"$columnConstraints": "[fill]"
|
||||
"$rowConstraints": "[][][][][][][][][]"
|
||||
"$layoutConstraints": "ltr,insets 0,hidemode 3,gap 0 0"
|
||||
} ) {
|
||||
name: "panel1"
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "styleNoneRadioButton"
|
||||
"text": "none"
|
||||
"$buttonGroup": new FormReference( "styleButtonGroup" )
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "styleFrameRadioButton"
|
||||
"text": "frame"
|
||||
"$buttonGroup": new FormReference( "styleButtonGroup" )
|
||||
"selected": true
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "stylePlainRadioButton"
|
||||
"text": "plain dialog"
|
||||
"$buttonGroup": new FormReference( "styleButtonGroup" )
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "styleInfoRadioButton"
|
||||
"text": "info dialog"
|
||||
"$buttonGroup": new FormReference( "styleButtonGroup" )
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 3"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "styleErrorRadioButton"
|
||||
"text": "error dialog"
|
||||
"$buttonGroup": new FormReference( "styleButtonGroup" )
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 4"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "styleQuestionRadioButton"
|
||||
"text": "question dialog"
|
||||
"$buttonGroup": new FormReference( "styleButtonGroup" )
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 5"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "styleWarningRadioButton"
|
||||
"text": "warning dialog"
|
||||
"$buttonGroup": new FormReference( "styleButtonGroup" )
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 6"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "styleColorChooserRadioButton"
|
||||
"text": "color chooser dialog"
|
||||
"$buttonGroup": new FormReference( "styleButtonGroup" )
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 7"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "styleFileChooserRadioButton"
|
||||
"text": "file chooser dialog"
|
||||
"$buttonGroup": new FormReference( "styleButtonGroup" )
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 8"
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 3"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "openDialogButton"
|
||||
"text": "Open Dialog"
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "openDialog", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 4"
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 0 )
|
||||
"size": new java.awt.Dimension( 450, 380 )
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JMenuBar", new FormLayoutManager( class javax.swing.JMenuBar ) ) {
|
||||
name: "menuBar"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
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"
|
||||
"mnemonic": 78
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "openMenuItem"
|
||||
"text": "Open"
|
||||
"mnemonic": 79
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
|
||||
name: "separator2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "closeMenuItem"
|
||||
"text": "Close"
|
||||
"mnemonic": 67
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "closeMenuItem2"
|
||||
"text": "Close All"
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
|
||||
name: "separator1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "exitMenuItem"
|
||||
"text": "Exit"
|
||||
"mnemonic": 88
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
} )
|
||||
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"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
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"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
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 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", "menuItemActionPerformed", true ) )
|
||||
} )
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 410 )
|
||||
"size": new java.awt.Dimension( 255, 30 )
|
||||
} )
|
||||
add( new FormNonVisual( "javax.swing.ButtonGroup" ) {
|
||||
name: "styleButtonGroup"
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 450 )
|
||||
} )
|
||||
}
|
||||
}
|
||||
@@ -307,6 +307,14 @@ TitledBorder.titleColor=#ff00ff
|
||||
TitledBorder.border=1,1,1,1,#ff00ff
|
||||
|
||||
|
||||
#---- TitlePane ----
|
||||
|
||||
TitlePane.background=#0f0
|
||||
TitlePane.inactiveBackground=#080
|
||||
TitlePane.foreground=#00f
|
||||
TitlePane.inactiveForeground=#fff
|
||||
|
||||
|
||||
#---- ToggleButton ----
|
||||
|
||||
ToggleButton.background=#ddddff
|
||||
|
||||
Reference in New Issue
Block a user