ActionListener, AdjustmentListener, ItemListener, MouseListener
{
JVDialog frame;
-
+ Frame owner;
FeatureRenderer fr;
FeatureSettings fs = null;
// AlignmentPanel ap;
colourFromLabel.addItemListener(this);
slider.addAdjustmentListener(this);
slider.addMouseListener(this);
- Frame owner = (af!=null) ? af : fs.frame;
+ owner = (af!=null) ? af : fs.frame;
frame = new JVDialog(owner,"Graduated Feature Colour for "+type,true,480,248);
frame.setMainPanel(this);
validate();
{
if (newCol == null)
{
- UserDefinedColours udc = new UserDefinedColours(this,minColour.getBackground(), frame, "Select Colour for Minimum Value");
+ UserDefinedColours udc = new UserDefinedColours(this,minColour.getBackground(),owner, "Select Colour for Minimum Value"); // frame.owner,
} else {
minColour.setBackground(newCol);
minColour.repaint();
{
if (newCol == null)
{
- UserDefinedColours udc = new UserDefinedColours(this,maxColour.getBackground(), frame, "Select Colour for Maximum Value");// this, "Select Colour for Maximum Value", maxColour.getBackground());
+
+ // UserDefinedColours udc = new UserDefinedColours(this, "Select Colour for Maximum Value",maxColour.getBackground(),true);
+ UserDefinedColours udc = new UserDefinedColours(this, maxColour.getBackground(), owner, "Select Colour for Maximum Value");
} else {
maxColour.setBackground(newCol);
maxColour.repaint();
{
this(caller, col1, alignframe, "Select Colour");
}
- public UserDefinedColours(Component caller, Color col1, Container alignframe, String title)
+ /**
+ * Makes a dialog to choose the colour
+ * @param caller - handles events
+ * @param col1 - original colour
+ * @param alignframe - the parent Frame for the dialog
+ * @param title - window title
+ */
+ public UserDefinedColours(Component caller, Color col1, Frame alignframe, String title)
{
this.caller = caller;
originalColour = col1;
okcancelPanel.setBounds(new Rectangle(0, 113, 400, 35));
frame.setTitle("User Defined Colours - " + label);
frame.setSize(420, 200);
- }
-
+ }
+
void setForDialog(String title, Container alignframe)
{
init();
{
dialog = new Dialog((Frame)alignframe, title, true);
}
- else
- if (alignframe instanceof JVDialog){
- dialog = new Dialog(((JVDialog)alignframe), title, true);
- } else {
+ else {
+// if (alignframe instanceof JVDialog){
+// // not 1.1 compatible!
+// dialog = new Dialog(((JVDialog)alignframe), title, true);
+// } else {
throw new Error("Unsupported owner for User Colour scheme dialog.");
}