Commit a33e9b36 authored by Daniel Dreibrodt's avatar Daniel Dreibrodt

Save some resources by diposing window handles and resources after closing the window

parent 7ea61332
......@@ -213,7 +213,7 @@ public class Layout implements ActionListener{
s.updateWindows();
s.expandLayout(id);
created = true;
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
s.m.hist.addEvent(lae);
}
else {
......
......@@ -369,7 +369,7 @@ public class Skin implements ActionListener{
theme_frame = new JFrame(Language.get("WIN_THEME_TITLE"));
theme_frame.setResizable(false);
theme_frame.setLayout(new FlowLayout());
theme_frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
theme_frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
JLabel themeinfo_name_l = new JLabel(Language.get("WIN_THEME_NAME"));
themeinfo_name_tf = new JTextField();
......@@ -393,13 +393,12 @@ public class Skin implements ActionListener{
theme_alpha_tf.setToolTipText(Language.get("WIN_THEME_MOVEALPHA_TIP"));
theme_ok_btn = new JButton(Language.get("BUTTON_OK"));
theme_ok_btn.addActionListener(this);
theme_ok_btn.setPreferredSize(new Dimension(70,25));
theme_cancel_btn = new JButton(Language.get("BUTTON_CANCEL"));
theme_cancel_btn.addActionListener(this);
theme_cancel_btn.setPreferredSize(new Dimension(70,25));
theme_help_btn = new JButton(Language.get("BUTTON_HELP"));
theme_help_btn.addActionListener(this);
theme_help_btn.setPreferredSize(new Dimension(70,25));
//TODO new layout!!!
JPanel themeinfo_p = new JPanel(null);
themeinfo_p.add(themeinfo_name_l);
......
......@@ -135,7 +135,7 @@ public class Window implements ActionListener{
playondrop=Boolean.parseBoolean(playondrop_tf.getText());
s.updateWindows();
created = true;
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
s.m.hist.addEvent(wae);
}
else {
......
......@@ -129,7 +129,7 @@ public class Anchor extends Item implements ActionListener{
updateBezier();
s.updateItems();
s.expandItem(id);
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
created = true;
ItemAddEvent aae = new ItemAddEvent(s.getParentListOf(id),this);
s.m.hist.addEvent(aae);
......
......@@ -148,7 +148,7 @@ public class Button extends Item implements ActionListener{
s.updateItems();
s.expandItem(id);
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
created = true;
}
else {
......
......@@ -187,7 +187,7 @@ public class Checkbox extends Item implements ActionListener{
s.updateItems();
s.expandItem(id);
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
created = true;
}
else {
......
......@@ -142,7 +142,7 @@ public class Group extends Item implements ActionListener{
}
s.updateItems();
s.expandItem(id);
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
created = true;
ItemAddEvent gaa = new ItemAddEvent(s.getParentListOf(id),this);
......
......@@ -139,7 +139,7 @@ public class Image extends Item implements ActionListener{
s.updateItems();
s.expandItem(id);
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
created = true;
ItemAddEvent iae = new ItemAddEvent(s.getParentListOf(id),this);
......
......@@ -169,7 +169,7 @@ public class Panel extends Item implements ActionListener{
for(Item i:items) {
i.setOffset(x,y);
}
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
created = true;
ItemAddEvent paa = new ItemAddEvent(s.getParentListOf(id),this);
......
......@@ -242,7 +242,7 @@ public class Playtree extends Item implements ActionListener{
s.updateItems();
s.expandItem(id);
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
created=true;
ItemAddEvent paa = new ItemAddEvent(s.getParentListOf(id),this);
......
......@@ -255,7 +255,7 @@ public class Slider extends Item implements ActionListener{
s.updateItems();
s.expandItem(id);
created=true;
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
ItemAddEvent sae = new ItemAddEvent(s.getParentListOf(id),this);
s.m.hist.addEvent(sae);
......@@ -591,7 +591,6 @@ public class Slider extends Item implements ActionListener{
frame.setLayout(layout);
frame.pack();
frame.getRootPane().setDefaultButton(ok_btn);
......
......@@ -164,13 +164,10 @@ public class SliderBackground extends Item implements ActionListener{
JLabel attr_l = new JLabel(Language.get("NOTE_STARRED"));
ok_btn = new JButton(Language.get("BUTTON_OK"));
ok_btn.addActionListener(this);
ok_btn.setPreferredSize(new Dimension(70,25));
cancel_btn = new JButton(Language.get("BUTTON_CANCEL"));
cancel_btn.addActionListener(this);
cancel_btn.setPreferredSize(new Dimension(70,25));
help_btn = new JButton(Language.get("BUTTON_HELP"));
help_btn.addActionListener(this);
help_btn.setPreferredSize(new Dimension(70,25));
JPanel general = new JPanel(null);
......
......@@ -137,7 +137,7 @@ public class Text extends Item implements ActionListener{
s.updateItems();
s.expandItem(id);
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
created = true;
ItemAddEvent tae = new ItemAddEvent(s.getParentListOf(id),this);
......@@ -230,13 +230,10 @@ public class Text extends Item implements ActionListener{
JLabel attr_l = new JLabel(Language.get("NOTE_STARRED"));
ok_btn = new JButton(Language.get("BUTTON_OK"));
ok_btn.addActionListener(this);
ok_btn.setPreferredSize(new Dimension(70,25));
cancel_btn = new JButton(Language.get("BUTTON_CANCEL"));
cancel_btn.addActionListener(this);
cancel_btn.setPreferredSize(new Dimension(70,25));
help_btn = new JButton(Language.get("BUTTON_HELP"));
help_btn.addActionListener(this);
help_btn.setPreferredSize(new Dimension(70,25));
JPanel general = new JPanel(null);
general.add(id_l);
......
......@@ -122,7 +122,7 @@ public class Video extends Item implements ActionListener{
s.updateItems();
s.expandItem(id);
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
created = true;
ItemAddEvent vae = new ItemAddEvent(s.getParentListOf(id), this);
......@@ -204,13 +204,10 @@ public class Video extends Item implements ActionListener{
JLabel attr_l = new JLabel(Language.get("NOTE_STARRED"));
ok_btn = new JButton(Language.get("BUTTON_OK"));
ok_btn.addActionListener(this);
ok_btn.setPreferredSize(new Dimension(70,25));
cancel_btn = new JButton(Language.get("BUTTON_CANCEL"));
cancel_btn.addActionListener(this);
cancel_btn.setPreferredSize(new Dimension(70,25));
help_btn = new JButton(Language.get("BUTTON_HELP"));
help_btn.addActionListener(this);
help_btn.setPreferredSize(new Dimension(70,25));
JPanel general = new JPanel(null);
general.add(id_l);
......
......@@ -126,7 +126,7 @@ public class SubBitmap extends ImageResource implements ActionListener{
height=Integer.parseInt(height_tf.getText());
nbframes=Integer.parseInt(nbframes_tf.getText());
fps=Integer.parseInt(fps_tf.getText());
//frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
//frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
updateImage();
s.updateResources();
s.expandResource(id);
......@@ -142,7 +142,7 @@ public class SubBitmap extends ImageResource implements ActionListener{
height=Integer.parseInt(height_tf.getText());
nbframes=Integer.parseInt(nbframes_tf.getText());
fps=Integer.parseInt(fps_tf.getText());
//frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
//frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
updateImage();
s.updateResources();
s.expandResource(id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment