1    import javax.swing.*;
2    import java.awt.event.*;
3    import java.awt.*;
4    import java.util.*;
5    
6    public class PrefSeg extends PrefEditor implements java.io.Serializable {
7    
8      private static final long serialVersionUID = Version.getSUID();
9    
10     public Color borderc = Color.blue;
11     public Color stationc = Color.green;
12     public Color surveyc = Color.yellow;
13     public Color selectc = Color.red;
14       //  public double density = Segment.defdensity;
15     public double scale = Segment.defscale;
16     public boolean transparent = Segment.deftransparent;
17     public boolean openscaled = Segment.openscaled;
18     public Color backc = Color.white;
19   
20     public PrefSeg() {
21       name = "Segment";
22     }
23   
24     private void readObject(java.io.ObjectInputStream stream)
25       throws java.io.IOException,java.lang.ClassNotFoundException {
26       stream.defaultReadObject();
27       if (backc==null) backc = Color.white;
28     }
29   
30   
31     public void newPane() throws NoSuchFieldException {
32       pane = new javax.swing.Box(BoxLayout.Y_AXIS);
33       
34       setParm("borderc","Border Color");
35       setParm("stationc","Station Color");
36       setParm("selectc","Selected Color");
37       setParm("surveyc","Survey Color");
38       setParm("openscaled","Scale to fit window");
39       setParm("backc","Background Color");
40   //    setParm("density","Def. Density");
41       setParm("scale","Def. Scale (pixels/world unit)");
42       setParm("transparent","Def. transparent");
43     }
44   
45     public void save() {
46       if (pane==null) return;
47       super.save();
48       apply();
49     }
50   
51     public void apply() {
52       Segment.borderc = borderc;
53       Segment.backc = backc;
54       Segment.stationc = stationc;
55       Segment.selectc = selectc;
56       Segment.surveyc = surveyc;
57       Segment.deftransparent = transparent;
58       //    Segment.defdensity = density;
59       Segment.defscale = scale;
60       Segment.openscaled = openscaled;
61     }
62   }
63   
64