1 import javax.swing.*;
2 import java.awt.event.*;
3 import java.awt.*;
4 import java.util.*;
5
6 public class PrefGeneral extends PrefEditor implements java.io.Serializable {
7
8 private static final long serialVersionUID = Version.getSUID();
9
10 public boolean lastopen = false;
11 public boolean restoreplace = false;
12 public boolean saveplace = false;
13 public boolean makenames = Symbol.makenames;
14 public boolean openmaximized = false;
15 public boolean openeditormaximized = false;
16 public int width = 800;
17 public int height = 700;
18 public int editwidth = 600;
19 public int editheight = 500;
20 public int x = 0;
21 public int y = 100;
22
23 public PrefGeneral() {
24 name = "General";
25 }
26
27 public void newPane() throws NoSuchFieldException {
28 pane = new javax.swing.Box(BoxLayout.Y_AXIS);
29 if (editwidth==0) editwidth = 600;
30 if (editheight==0) editheight = 600;
31
32 setParm("lastopen","Reopen last file at startup");
33 setParm("restoreplace","Restore editors on open");
34 setParm("saveplace","Save state of editors (when saving file)");
35 setParm("openeditormaximized","Start editors Maximized");
36 setParm("editwidth","Editor width");
37 setParm("editheight","Editor height");
38 setParm("makenames","Generate names");
39 setParm("x","Initial x");
40 setParm("y","Initial y");
41 setParm("width","Initial width");
42 setParm("height","Initial height");
43 }
44
45 public void save() {
46 if (pane==null) return;
47 super.save();
48 apply();
49 }
50
51 public void apply() {
52 Symbol.makenames = makenames;
53 CartoFrame.lastopen = lastopen;
54 CartoFrame.saveplace = saveplace;
55 CartoFrame.restoreplace = restoreplace;
56 CartoFrame.openmaximized = openmaximized;
57 CartoFrame.openeditormaximized = openeditormaximized;
58 CartoFrame.initialwidth = width;
59 CartoFrame.initialheight = height;
60 CartoFrame.initialx = x;
61 CartoFrame.initialy = y;
62 EditFrame.defaultsize = new Dimension(editwidth,editheight);
63 }
64 }
65
66