1    import javax.swing.*;
2    import java.awt.event.*;
3    import java.awt.*;
4    import java.util.*;
5    
6    public class PrefComp extends PrefEditor implements java.io.Serializable {
7    
8      private static final long serialVersionUID = Version.getSUID();
9    
10     public double margin = 0.1;
11     public boolean removeunmorphed = false;
12     public boolean allVector = false;
13     public boolean overideVector = true;
14     public Color backc = Color.WHITE;
15   
16     public Color alignerc = Comp.alignercolor;
17     public Color alignlinkc = Comp.alignlinkcolor;
18     public Color passc = Comp.passagecolor;
19     public Color passlinkc = Comp.passagelinkcolor;
20   
21     public PrefComp() {
22       name = "Composite";
23     }
24   
25     public void newPane() throws NoSuchFieldException {
26       pane = new javax.swing.Box(BoxLayout.Y_AXIS);
27   //    pane.setLayout(new GridLayout(4,1));
28       setParm("backc","Background Color");
29       setParm("alignerc","Aligner Color");
30       setParm("alignlinkc","Alignment Link Color");
31       setParm("passc","Passage Color");
32       setParm("passlinkc","Passage Link Color");
33   
34       setParm("margin","Margin");
35       setParm("allVector","Use vector fills");
36       setParm("overideVector","Determine fill method globally");
37       setParm("removeunmorphed","Remove unmorphable segments");
38     }
39   
40     public void save() {
41       if (pane==null) return;
42       super.save();
43       apply();
44     }
45   
46     public void apply() {
47       CompPane.margin = margin;
48       Fill.allVector = allVector;
49       Fill.overideVector = overideVector;
50       Segment.removeunmorphed = removeunmorphed;
51       Comp.defbackground = backc;
52   
53       Comp.passagecolor = passc;
54       Comp.passagelinkcolor = passlinkc;
55   
56       Comp.alignercolor = alignerc;
57       Comp.alignlinkcolor = alignlinkc;
58     }
59   
60     private void readObject(java.io.ObjectInputStream stream)
61       throws java.io.IOException,java.lang.ClassNotFoundException {
62       stream.defaultReadObject();
63       if (backc==null) backc = Color.WHITE;
64   
65       if (passc==null) passc = Comp.passagecolor;
66       if (passlinkc==null) passlinkc = Comp.passagelinkcolor;
67       if (alignerc==null) alignerc = Comp.alignercolor;
68       if (alignlinkc==null) alignlinkc = Comp.alignlinkcolor;
69     }
70   }
71   
72