- cancel.addActionListener(this);
- this.setBackground(Color.white);
- panel1.setLayout(borderLayout1);
- panel2.setLayout(borderLayout3);
- panel3.setLayout(borderLayout2);
- panel5.setBackground(Color.white);
- panel4.setBackground(Color.white);
- panel1.setBackground(Color.white);
- panel2.setBackground(Color.white);
- panel3.setBackground(Color.white);
- panel1.add(label1, BorderLayout.WEST);
- panel1.add(fontName, BorderLayout.CENTER);
- panel5.add(panel1, null);
- panel5.add(panel3, null);
- panel5.add(panel2, null);
- panel2.add(label3, BorderLayout.WEST);
- panel2.add(fontStyle, BorderLayout.CENTER);
- panel3.add(label2, BorderLayout.WEST);
- panel3.add(fontSize, BorderLayout.CENTER);
- this.add(panel4, BorderLayout.SOUTH);
- panel4.add(ok, null);
- panel4.add(cancel, null);
- this.add(panel5, BorderLayout.CENTER);
+ cancel.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ cancel_actionPerformed();
+ }
+ });
+
+ Panel fontPanel = new Panel();
+ fontPanel.setLayout(new BorderLayout());
+ Panel stylePanel = new Panel();
+ stylePanel.setLayout(new BorderLayout());
+ Panel sizePanel = new Panel();
+ sizePanel.setLayout(new BorderLayout());
+ Panel scalePanel = new Panel();
+ scalePanel.setLayout(new BorderLayout());
+ Panel okCancelPanel = new Panel();
+ Panel optionsPanel = new Panel();
+
+ fontPanel.setBackground(Color.white);
+ stylePanel.setBackground(Color.white);
+ sizePanel.setBackground(Color.white);
+ okCancelPanel.setBackground(Color.white);
+ optionsPanel.setBackground(Color.white);
+
+ fontPanel.add(fontLabel, BorderLayout.WEST);
+ fontPanel.add(fontName, BorderLayout.CENTER);
+ stylePanel.add(styleLabel, BorderLayout.WEST);
+ stylePanel.add(fontStyle, BorderLayout.CENTER);
+ sizePanel.add(sizeLabel, BorderLayout.WEST);
+ sizePanel.add(fontSize, BorderLayout.CENTER);
+ scalePanel.add(scaleAsCdna, BorderLayout.NORTH);
+ scalePanel.add(fontAsCdna, BorderLayout.SOUTH);
+ okCancelPanel.add(ok, null);
+ okCancelPanel.add(cancel, null);
+
+ optionsPanel.add(fontPanel, null);
+ optionsPanel.add(sizePanel, null);
+ optionsPanel.add(stylePanel, null);
+
+ /*
+ * Only show 'scale protein as cDNA' in a SplitFrame
+ */
+ this.add(optionsPanel, BorderLayout.NORTH);
+ if (ap.alignFrame.getSplitFrame() != null)
+ {
+ inSplitFrame = true;
+ oldComplementFont = ((AlignViewport) ap.av.getCodingComplement())
+ .getFont();
+ this.add(scalePanel, BorderLayout.CENTER);
+ }
+ this.add(okCancelPanel, BorderLayout.SOUTH);
+ }
+
+ /**
+ * Turn on/off scaling of protein characters to 3 times the width of cDNA
+ * characters
+ */
+ protected void scaleAsCdna_actionPerformed()
+ {
+ ap.av.setScaleProteinAsCdna(scaleAsCdna.getState());
+ ap.av.getCodingComplement()
+ .setScaleProteinAsCdna(scaleAsCdna.getState());
+ changeFont();