From d429962a1e4d2413e0c18fd88227cffee8bfa502 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 2 Nov 2005 16:06:05 +0000 Subject: [PATCH] Add jvsuffix and dbref to menu --- src/jalview/appletgui/AlignFrame.java | 17 ++++++++--- src/jalview/jbappletgui/GAlignFrame.java | 48 +++++++++++++++++++++--------- 2 files changed, 47 insertions(+), 18 deletions(-) diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 4fc6208..6e2d32b 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -241,8 +241,9 @@ public class AlignFrame "Alignment output - " + e.getActionCommand(), 600, 500); cap.setText(new AppletFormatAdapter().formatSequences(e.getActionCommand(), - viewport.getAlignment(). - getSequences())); + viewport.getAlignment().getSequences(), + viewport.showDBPrefix, + viewport.showJVSuffix)); } public void closeMenuItem_actionPerformed(ActionEvent e) @@ -863,13 +864,21 @@ public class AlignFrame new FontChooser(alignPanel); } - protected void fullSeqId_actionPerformed(ActionEvent e) + public void dbref_actionPerformed(ItemEvent e) { - viewport.setShowJVSuffix(fullSeqId.getState()); + viewport.showDBPrefix = dbref.getState(); alignPanel.fontChanged(); alignPanel.repaint(); } + public void seqLimits_itemStateChanged(ItemEvent e) + { + viewport.setShowJVSuffix(seqLimits.getState()); + alignPanel.fontChanged(); + alignPanel.repaint(); + } + + protected void colourTextMenuItem_actionPerformed(ActionEvent e) { viewport.setColourText(colourTextMenuItem.getState()); diff --git a/src/jalview/jbappletgui/GAlignFrame.java b/src/jalview/jbappletgui/GAlignFrame.java index 5123317..6eb72d9 100755 --- a/src/jalview/jbappletgui/GAlignFrame.java +++ b/src/jalview/jbappletgui/GAlignFrame.java @@ -85,7 +85,7 @@ public class GAlignFrame extends Frame { MenuItem pasteThis = new MenuItem(); protected CheckboxMenuItem applyToAllGroups = new CheckboxMenuItem(); protected MenuItem font = new MenuItem(); - protected CheckboxMenuItem fullSeqId = new CheckboxMenuItem(); + protected CheckboxMenuItem dbref = new CheckboxMenuItem(); protected CheckboxMenuItem scaleAbove = new CheckboxMenuItem(); protected CheckboxMenuItem scaleLeft = new CheckboxMenuItem(); protected CheckboxMenuItem scaleRight = new CheckboxMenuItem(); @@ -98,8 +98,9 @@ public class GAlignFrame extends Frame { Menu helpMenu = new Menu(); MenuItem documentation = new MenuItem(); MenuItem about = new MenuItem(); + protected CheckboxMenuItem seqLimits = new CheckboxMenuItem(); - public GAlignFrame() { + public GAlignFrame() { try { jbInit(); setMenuBar(alignFrameMenuBar); @@ -462,12 +463,13 @@ public class GAlignFrame extends Frame { font_actionPerformed(e); } }); - fullSeqId.setLabel("Show Full Sequence ID"); - fullSeqId.setState(true); - fullSeqId.addItemListener(new java.awt.event.ItemListener() { + dbref.setLabel("ShowSequence DB Refs"); + dbref.setActionCommand(""); + dbref.setState(true); + dbref.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { - fullSeqId_actionPerformed(null); - } + dbref_actionPerformed(e); + } }); scaleAbove.setLabel("Scale Above"); scaleAbove.setState(true); @@ -528,8 +530,17 @@ public class GAlignFrame extends Frame { about_actionPerformed(e); } }); + seqLimits.setState(true); + seqLimits.setLabel("Show Sequence Limits"); + seqLimits.addItemListener(new ItemListener() + { + public void itemStateChanged(ItemEvent e) + { + seqLimits_itemStateChanged(e); + } + }); - alignFrameMenuBar.add(fileMenu); + alignFrameMenuBar.add(fileMenu); alignFrameMenuBar.add(editMenu); alignFrameMenuBar.add(searchMenu); alignFrameMenuBar.add(viewMenu); @@ -560,13 +571,15 @@ public class GAlignFrame extends Frame { searchMenu.add(findMenuItem); viewMenu.add(font); viewMenu.addSeparator(); - viewMenu.add(wrapMenuItem); + viewMenu.add(dbref); + viewMenu.add(seqLimits); + viewMenu.addSeparator(); + viewMenu.add(wrapMenuItem); viewMenu.add(scaleAbove); viewMenu.add(scaleLeft); viewMenu.add(scaleRight); viewMenu.addSeparator(); - viewMenu.add(fullSeqId); - viewMenu.add(viewBoxesMenuItem); + viewMenu.add(viewBoxesMenuItem); viewMenu.add(viewTextMenuItem); viewMenu.add(colourTextMenuItem); viewMenu.add(renderGapsMenuItem); @@ -787,9 +800,6 @@ public class GAlignFrame extends Frame { protected void font_actionPerformed(ActionEvent e) { } - protected void fullSeqId_actionPerformed(ActionEvent e) { - } - protected void epsFile_actionPerformed(ActionEvent e) { } @@ -828,4 +838,14 @@ public class GAlignFrame extends Frame { protected void about_actionPerformed(ActionEvent e) { } + + public void dbref_actionPerformed(ItemEvent e) + { + + } + + public void seqLimits_itemStateChanged(ItemEvent e) + { + + } } -- 1.7.10.2