import java.awt.Color;
import java.awt.Font;
+import java.awt.Rectangle;
import java.awt.event.ActionListener;
import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
import javax.swing.JMenu;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
import javax.swing.SwingConstants;
/**
}
+ /**
+ *
+ * @param panel
+ * @param tooltip
+ * @param label
+ * @param valBox
+ * @return the GUI element created that was added to the layout so it's attributes can be changed.
+ */
+ public static JPanel addtoLayout(JPanel panel, String tooltip, JComponent label, JComponent valBox)
+ {
+ JPanel laypanel = new JPanel(),labPanel=new JPanel(), valPanel=new JPanel();
+ // laypanel.setSize(panel.getPreferredSize());
+ // laypanel.setLayout(null);
+ labPanel.setBounds(new Rectangle(7, 7, 158, 23));
+ valPanel.setBounds(new Rectangle(172, 7, 270,23));
+ //labPanel.setLayout(new GridLayout(1,1));
+ //valPanel.setLayout(new GridLayout(1,1));
+ labPanel.add(label);
+ valPanel.add(valBox);
+ laypanel.add(labPanel);
+ laypanel.add(valPanel);
+ valPanel.setToolTipText(tooltip);
+ labPanel.setToolTipText(tooltip);
+ valBox.setToolTipText(tooltip);
+ panel.add(laypanel);
+ panel.validate();
+ return laypanel;
+ }
+
+ public static void mgAddtoLayout(JPanel cpanel, String tooltip,
+ JLabel jLabel, JComponent name)
+ {
+ mgAddtoLayout(cpanel, tooltip, jLabel, name,null);
+ }
+ public static void mgAddtoLayout(JPanel cpanel, String tooltip,
+ JLabel jLabel, JComponent name, String params)
+ {
+ cpanel.add(jLabel);
+ if (params==null) {
+ cpanel.add(name);
+ } else {cpanel.add(name, params);
+ }
+ name.setToolTipText(tooltip);
+ jLabel.setToolTipText(tooltip);
+ }
+
}
*/
package jalview.jbgui;
+import jalview.gui.JvSwingUtils;
+
import java.awt.*;
import java.awt.event.*;
protected JCheckBox followHighlight = new JCheckBox();
- public void addtoLayout(JPanel panel, String tooltip, JComponent label, JComponent valBox)
- {
- JPanel laypanel = new JPanel(),labPanel=new JPanel(), valPanel=new JPanel();
- // laypanel.setSize(panel.getPreferredSize());
- // laypanel.setLayout(null);
- labPanel.setBounds(new Rectangle(7, 7, 158, 23));
- valPanel.setBounds(new Rectangle(172, 7, 270,23));
- //labPanel.setLayout(new GridLayout(1,1));
- //valPanel.setLayout(new GridLayout(1,1));
- labPanel.add(label);
- valPanel.add(valBox);
- laypanel.add(labPanel);
- laypanel.add(valPanel);
- valPanel.setToolTipText(tooltip);
- labPanel.setToolTipText(tooltip);
- valBox.setToolTipText(tooltip);
- panel.add(laypanel);
- panel.validate();
-
- }
/**
* Creates a new GPreferences object.
*/
tooltipSettings.add(showNpTooltip);
visualTab.add(tooltipSettings);
visualTab.add(jPanel2);
- addtoLayout(visual2Tab, "Default Colourscheme for alignment", colourLabel, colour);
+ JvSwingUtils.addtoLayout(visual2Tab, "Default Colourscheme for alignment", colourLabel, colour);
JPanel annotationShding=new JPanel();
annotationShding.setBorder(new TitledBorder("Annotation Shading Default"));
annotationShding.setLayout(new GridLayout(1,2));
- addtoLayout(annotationShding, "Default Minimum Colour for annotation shading", mincolourLabel,minColour);
- addtoLayout(annotationShding,"Default Maximum Colour for annotation shading", maxcolourLabel, maxColour);
+ JvSwingUtils.addtoLayout(annotationShding, "Default Minimum Colour for annotation shading", mincolourLabel,minColour);
+ JvSwingUtils.addtoLayout(annotationShding,"Default Maximum Colour for annotation shading", maxcolourLabel, maxColour);
visual2Tab.add(annotationShding); // , FlowLayout.LEFT);
// visual2panel.add(minColour);