\r
min = res;\r
max = res;\r
- if (reveal != null\r
- && (evt.getModifiers() & InputEvent.BUTTON3_MASK)\r
+ if ((evt.getModifiers() & InputEvent.BUTTON3_MASK)\r
== InputEvent.BUTTON3_MASK)\r
{\r
-\r
- MenuItem item = new MenuItem("Reveal");\r
- item.addActionListener(new ActionListener()\r
- {\r
- public void actionPerformed(ActionEvent e)\r
- {\r
- av.showColumn(reveal[0]);\r
- reveal = null;\r
- ap.repaint();\r
- if (ap.overviewPanel != null)\r
- ap.overviewPanel.updateOverviewImage();\r
- }\r
- });\r
PopupMenu pop = new PopupMenu();\r
- pop.add(item);\r
-\r
- if (av.getColumnSelection().getHiddenColumns().size() > 1)\r
+ if (reveal != null)\r
{\r
- item = new MenuItem("Reveal All");\r
+ MenuItem item = new MenuItem("Reveal");\r
item.addActionListener(new ActionListener()\r
{\r
public void actionPerformed(ActionEvent e)\r
{\r
- av.showAllHiddenColumns();\r
+ av.showColumn(reveal[0]);\r
reveal = null;\r
ap.repaint();\r
if (ap.overviewPanel != null)\r
}\r
});\r
pop.add(item);\r
- }\r
\r
- this.add(pop);\r
- pop.show(this, evt.getX(), evt.getY());\r
-\r
- }\r
- else if (av.getColumnSelection().contains(res))\r
- {\r
- if ( (evt.getModifiers() & InputEvent.BUTTON3_MASK)\r
- == InputEvent.BUTTON3_MASK)\r
+ if (av.getColumnSelection().getHiddenColumns().size() > 1)\r
+ {\r
+ item = new MenuItem("Reveal All");\r
+ item.addActionListener(new ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent e)\r
+ {\r
+ av.showAllHiddenColumns();\r
+ reveal = null;\r
+ ap.repaint();\r
+ if (ap.overviewPanel != null)\r
+ ap.overviewPanel.updateOverviewImage();\r
+ }\r
+ });\r
+ pop.add(item);\r
+ }\r
+ pop.show(this, evt.getX(), evt.getY());\r
+ }\r
+ else if (av.getColumnSelection().contains(res))\r
{\r
MenuItem item = new MenuItem("Hide Columns");\r
item.addActionListener(new ActionListener()\r
ap.overviewPanel.updateOverviewImage();\r
}\r
});\r
- PopupMenu pop = new PopupMenu();\r
pop.add(item);\r
- this.add(pop);\r
pop.show(this, evt.getX(), evt.getY());\r
}\r
- else\r
- {\r
- av.getColumnSelection().removeElement(res);\r
- av.setSelectionGroup(null);\r
- }\r
}\r
- else\r
+ else // LEFT MOUSE TO SELECT\r
{\r
+ if (!evt.isControlDown() && !evt.isShiftDown())\r
+ {\r
+ av.getColumnSelection().clear();\r
+ }\r
+\r
av.getColumnSelection().addElement(res);\r
SequenceGroup sg = new SequenceGroup();\r
-\r
for (int i = 0; i < av.alignment.getSequences().size(); i++)\r
{\r
sg.addSequence(av.alignment.getSequenceAt(i), false);\r
sg.setStartRes(res);\r
sg.setEndRes(res);\r
av.setSelectionGroup(sg);\r
+\r
+ if(evt.isShiftDown())\r
+ {\r
+ int min = Math.min(av.getColumnSelection().getMin(), res);\r
+ int max = Math.max(av.getColumnSelection().getMax(), res);\r
+ for (int i = min; i<max; i++)\r
+ {\r
+ av.getColumnSelection().addElement(i);\r
+ }\r
+ sg.setStartRes(min);\r
+ sg.setEndRes(max);\r
+ }\r
}\r
+\r
ap.repaint();\r
}\r
\r
min = res;\r
max = res;\r
\r
- if(reveal != null && SwingUtilities.isRightMouseButton(evt))\r
+ if (SwingUtilities.isRightMouseButton(evt))\r
+ {\r
+ JPopupMenu pop = new JPopupMenu();\r
+ if (reveal != null)\r
{\r
- JPopupMenu pop = new JPopupMenu();\r
JMenuItem item = new JMenuItem("Reveal");\r
item.addActionListener(new ActionListener()\r
{\r
av.showColumn(reveal[0]);\r
reveal = null;\r
ap.repaint();\r
- if(ap.overviewPanel != null)\r
- ap.overviewPanel.updateOverviewImage();\r
+ if (ap.overviewPanel != null)\r
+ ap.overviewPanel.updateOverviewImage();\r
}\r
});\r
pop.add(item);\r
\r
- if(av.getColumnSelection().getHiddenColumns().size()>1)\r
+ if (av.getColumnSelection().getHiddenColumns().size() > 1)\r
{\r
item = new JMenuItem("Reveal All");\r
item.addActionListener(new ActionListener()\r
av.showAllHiddenColumns();\r
reveal = null;\r
ap.repaint();\r
- if(ap.overviewPanel != null)\r
+ if (ap.overviewPanel != null)\r
ap.overviewPanel.updateOverviewImage();\r
}\r
});\r
pop.add(item);\r
}\r
-\r
pop.show(this, evt.getX(), evt.getY());\r
-\r
}\r
- else\r
- if (av.getColumnSelection().contains(res))\r
- {\r
- if( SwingUtilities.isRightMouseButton(evt))\r
+ else if (av.getColumnSelection().contains(res))\r
{\r
- JPopupMenu pop = new JPopupMenu();\r
JMenuItem item = new JMenuItem("Hide Columns");\r
item.addActionListener(new ActionListener()\r
{\r
{\r
av.hideColumns(res, res);\r
ap.repaint();\r
- if(ap.overviewPanel != null)\r
+ if (ap.overviewPanel != null)\r
ap.overviewPanel.updateOverviewImage();\r
}\r
});\r
pop.add(item);\r
pop.show(this, evt.getX(), evt.getY());\r
-\r
- }\r
- else\r
- {\r
- av.getColumnSelection().removeElement(res);\r
- av.setSelectionGroup(null);\r
}\r
}\r
- else\r
+ else // LEFT MOUSE TO SELECT\r
{\r
- av.getColumnSelection().addElement(res);\r
- SequenceGroup sg = new SequenceGroup();\r
+ if (!evt.isControlDown() && !evt.isShiftDown())\r
+ {\r
+ av.getColumnSelection().clear();\r
+ }\r
+\r
+ av.getColumnSelection().addElement(res);\r
+ SequenceGroup sg = new SequenceGroup();\r
+ for (int i = 0; i < av.alignment.getSequences().size(); i++)\r
+ {\r
+ sg.addSequence(av.alignment.getSequenceAt(i), false);\r
+ }\r
+\r
+ sg.setStartRes(res);\r
+ sg.setEndRes(res);\r
+ av.setSelectionGroup(sg);\r
\r
- for (int i = 0; i < av.alignment.getSequences().size(); i++)\r
+ if(evt.isShiftDown())\r
+ {\r
+ int min = Math.min(av.getColumnSelection().getMin(), res);\r
+ int max = Math.max(av.getColumnSelection().getMax(), res);\r
+ for (int i = min; i<max; i++)\r
{\r
- sg.addSequence(av.alignment.getSequenceAt(i), false);\r
+ av.getColumnSelection().addElement(i);\r
}\r
+ sg.setStartRes(min);\r
+ sg.setEndRes(max);\r
+ }\r
+\r
\r
- sg.setStartRes(res);\r
- sg.setEndRes(res);\r
- av.setSelectionGroup(sg);\r
}\r
\r
\r