From: jprocter Date: Fri, 23 Apr 2010 10:53:24 +0000 (+0000) Subject: 1.1 compatibility X-Git-Tag: Release_2_5~59 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=fa831484132498a5c7f9092a2066a730cbbd16ec;p=jalview.git 1.1 compatibility --- diff --git a/src/jalview/appletgui/FeatureColourChooser.java b/src/jalview/appletgui/FeatureColourChooser.java index e3ab8eb..6569186 100644 --- a/src/jalview/appletgui/FeatureColourChooser.java +++ b/src/jalview/appletgui/FeatureColourChooser.java @@ -31,7 +31,7 @@ public class FeatureColourChooser extends Panel implements ActionListener, AdjustmentListener, ItemListener, MouseListener { JVDialog frame; - + Frame owner; FeatureRenderer fr; FeatureSettings fs = null; // AlignmentPanel ap; @@ -96,7 +96,7 @@ public class FeatureColourChooser extends Panel implements 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(); @@ -255,7 +255,7 @@ public class FeatureColourChooser extends Panel implements { 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(); @@ -268,7 +268,9 @@ public class FeatureColourChooser extends Panel implements { 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(); diff --git a/src/jalview/appletgui/UserDefinedColours.java b/src/jalview/appletgui/UserDefinedColours.java index 5da1fbf..4f1ac38 100755 --- a/src/jalview/appletgui/UserDefinedColours.java +++ b/src/jalview/appletgui/UserDefinedColours.java @@ -104,7 +104,14 @@ public class UserDefinedColours extends Panel implements ActionListener, { 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; @@ -127,8 +134,8 @@ public class UserDefinedColours extends Panel implements ActionListener, 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(); @@ -138,10 +145,11 @@ public class UserDefinedColours extends Panel implements ActionListener, { 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."); }