48
48
import javax .swing .SwingUtilities ;
49
49
import javax .swing .SwingWorker ;
50
50
import javax .swing .UIManager ;
51
+ import javax .swing .WindowConstants ;
51
52
import javax .swing .filechooser .FileNameExtensionFilter ;
52
53
53
54
import net .miginfocom .swing .MigLayout ;
@@ -76,7 +77,7 @@ public static void main(String[] args) throws Exception {
76
77
JFrame frame = new JFrame (APPNAME );
77
78
SVGApplication app = new SVGApplication (frame );
78
79
frame .getContentPane ().add (app .createComponents ());
79
- frame .setDefaultCloseOperation (JFrame .EXIT_ON_CLOSE );
80
+ frame .setDefaultCloseOperation (WindowConstants .EXIT_ON_CLOSE );
80
81
frame .setSize (640 , 480 );
81
82
Dimension screen = Toolkit .getDefaultToolkit ().getScreenSize ();
82
83
frame .setLocation ((int ) (screen .getWidth () - frame .getWidth ()) / 2 , (int ) (screen .getHeight () - frame .getHeight ()) / 2 );
@@ -100,8 +101,8 @@ private static List<Image> getApplicationIcons() {
100
101
private JLabel label = new JLabel ();
101
102
private JSVGCanvas svgCanvas = new JSVGCanvas ();
102
103
private String lastDir ;
103
- private JComboBox <Template > comboTemplates = new JComboBox <Template >();
104
- private JComboBox <NamingStrategy > comboNaming = new JComboBox <NamingStrategy >();
104
+ private JComboBox <Template > comboTemplates = new JComboBox <>();
105
+ private JComboBox <NamingStrategy > comboNaming = new JComboBox <>();
105
106
106
107
public SVGApplication (JFrame frame ) {
107
108
this .frame = frame ;
@@ -124,13 +125,13 @@ public JComponent createToolbar() {
124
125
new Template ("plain.template" ),
125
126
new Template ("resizable.template" )
126
127
};
127
- comboTemplates .setModel (new DefaultComboBoxModel <Template >(templates ));
128
+ comboTemplates .setModel (new DefaultComboBoxModel <>(templates ));
128
129
} catch (IOException e ) {
129
130
e .printStackTrace ();
130
131
}
131
132
comboTemplates .setRenderer (new TemplateListCellRenderer ());
132
133
133
- comboNaming .setModel (new DefaultComboBoxModel <NamingStrategy >(new NamingStrategy [] {
134
+ comboNaming .setModel (new DefaultComboBoxModel <>(new NamingStrategy [] {
134
135
new CamelCaseNamingStrategy (),
135
136
new IconSuffixNamingStrategy (new CamelCaseNamingStrategy ()),
136
137
new DefaultNamingStrategy ()
0 commit comments