From 9eace25dceb7681fef7a9b414318450e66baf2f4 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 21 Mar 2005 18:46:44 +0000 Subject: [PATCH] add outline colour --- src/jalview/gui/PopupMenu.java | 41 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index abd5093..166ab73 100755 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -3,6 +3,7 @@ package jalview.gui; import jalview.datamodel.*; import jalview.analysis.*; import jalview.schemes.*; +import java.awt.*; import javax.swing.*; import java.awt.event.*; import jalview.io.*; @@ -40,6 +41,7 @@ public class PopupMenu extends JPopupMenu Sequence sequence; JMenuItem unGroupMenuItem = new JMenuItem(); JMenuItem pdbMenuItem = new JMenuItem(); + JMenuItem outline = new JMenuItem(); public PopupMenu(AlignmentPanel ap, Sequence seq) { @@ -133,6 +135,7 @@ public class PopupMenu extends JPopupMenu groupName_actionPerformed(e); } }); + groupAnnotation.setEnabled(false); groupAnnotation.setText("Annotation"); groupAnnotation.addActionListener(new java.awt.event.ActionListener() { @@ -151,6 +154,8 @@ public class PopupMenu extends JPopupMenu } }); residueMenu.setText("Residue"); + annotateResidue.setEnabled(false); + annotateResidue.setActionCommand("annotate residue"); annotateResidue.setText("annotate residue???"); PIDColour.setFocusPainted(false); unGroupMenuItem.setText("Remove Group"); @@ -169,6 +174,14 @@ public class PopupMenu extends JPopupMenu pdbMenuItem_actionPerformed(e); } }); + outline.setText("Border colour"); + outline.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(ActionEvent e) + { + outline_actionPerformed(e); + } + }); add(groupMenu); this.add(sequenceMenu); this.add(residueMenu); @@ -179,6 +192,8 @@ public class PopupMenu extends JPopupMenu defineMenu.add(groupName); defineMenu.add(groupAnnotation); defineMenu.addSeparator(); + defineMenu.add(outline); + defineMenu.addSeparator(); defineMenu.add(noColourmenuItem); defineMenu.add(clustalColour); defineMenu.add(zappoColour); @@ -381,7 +396,23 @@ public class PopupMenu extends JPopupMenu protected void abovePIDColour_actionPerformed(ActionEvent e) { - Desktop.setPIDSliderSource(ap, getGroup().cs, getGroup().getName()); + if(abovePIDColour.isSelected()) +{ + + Desktop.setPIDSliderSource(ap, getGroup().cs, getGroup().getName()); + refresh(); +} +else // remove PIDColouring +{ + ColourSchemeI cs = getGroup().cs; + ResidueColourScheme rcs = (ResidueColourScheme)cs; + rcs.setThreshold(0); + getGroup().cs = rcs; + refresh(); +} + + + } @@ -550,4 +581,12 @@ public class PopupMenu extends JPopupMenu } } + protected void outline_actionPerformed(ActionEvent e) + { + SequenceGroup sg = getGroup(); + Color col = JColorChooser.showDialog(this, "Select Outline Colour", Color.BLUE); + if(col!=null) + sg.setOutlineColour(col); + } + } -- 1.7.10.2