public class UserDefinedColours extends GUserDefinedColours implements
ChangeListener
{
- AlignmentPanel ap;
+ private static final int MY_FRAME_HEIGHT = 420;
+ private static final int MY_FRAME_WIDTH = 810;
+ private static final int MY_FRAME_WIDTH_CASE_SENSITIVE = 970;
+
+AlignmentPanel ap;
SequenceGroup seqGroup;
colorChooser.getSelectionModel().addChangeListener(this);
frame = new JInternalFrame();
frame.setContentPane(this);
- Desktop.addInternalFrame(frame,
- MessageManager.getString("label.user_defined_colours"), 720,
- 370, true);
+ Desktop.addInternalFrame(frame,
+ MessageManager.getString("label.user_defined_colours"), MY_FRAME_WIDTH,
+ MY_FRAME_HEIGHT, true);
if (seqGroup != null)
{
frame.setTitle(frame.getTitle() + " (" + seqGroup.getName() + ")");
}
-
- if (new jalview.util.Platform().isAMac())
- {
- frame.setSize(760, 370);
- }
}
void resetButtonPanel(boolean caseSensitive)
buttonPanel.add(makeButton("x", "x", lowerCaseButtons, 22));
}
+ // JAL-1360 widen the frame dynamically to accommodate case-sensitive AA codes
+ if (this.frame != null) {
+ int newWidth = caseSensitive ? MY_FRAME_WIDTH_CASE_SENSITIVE : MY_FRAME_WIDTH;
+ this.frame.setSize(newWidth, this.frame.getHeight());
+ }
+
buttonPanel.validate();
validate();
}
button.setMargin(new java.awt.Insets(2, 14, 2, 14));
}
+ button.setOpaque(true); // required for the next line to have effect
button.setBackground(col);
button.setText(label);
button.setForeground(col.darker().darker().darker());
import java.awt.*;
import java.awt.event.*;
+
import javax.swing.*;
+import javax.swing.colorchooser.AbstractColorChooserPanel;
/**
* DOCUMENT ME!
jPanel4.add(panel1, java.awt.BorderLayout.CENTER);
this.add(jPanel4, java.awt.BorderLayout.CENTER);
this.add(colorChooser, java.awt.BorderLayout.EAST);
+
+ AbstractColorChooserPanel[] choosers = colorChooser.getChooserPanels();
+ // JAL-1360 larger JColorChooser in Java 7 overwrites AA panel; restrict to swatch picker only
+ if (choosers.length > 3) {
+ // Java 7 default has 5 options rather than 3 for choosing colours; keep the first only
+ colorChooser.setChooserPanels(new AbstractColorChooserPanel[]{choosers[0]});
+ }
}
/**