From 53388b5334d29627d4384d6fe3edda35303d88ee Mon Sep 17 00:00:00 2001 From: gmungoc Date: Sat, 21 Nov 2015 19:33:37 +0000 Subject: [PATCH] JAL-1968 remove feature links --- src/jalview/appletgui/FeatureRenderer.java | 6 --- src/jalview/appletgui/FeatureSettings.java | 56 ++++++++++++---------------- 2 files changed, 23 insertions(+), 39 deletions(-) diff --git a/src/jalview/appletgui/FeatureRenderer.java b/src/jalview/appletgui/FeatureRenderer.java index 8318ee3..4391fa2 100644 --- a/src/jalview/appletgui/FeatureRenderer.java +++ b/src/jalview/appletgui/FeatureRenderer.java @@ -43,7 +43,6 @@ import java.awt.TextArea; import java.awt.TextField; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.Map; /** * DOCUMENT ME! @@ -54,11 +53,6 @@ import java.util.Map; public class FeatureRenderer extends jalview.renderer.seqfeatures.FeatureRenderer { - - // Holds web links for feature groups and feature types - // in the form label|link - Map featureLinks = null; - /** * Creates a new FeatureRenderer object. * diff --git a/src/jalview/appletgui/FeatureSettings.java b/src/jalview/appletgui/FeatureSettings.java index 1c156dc..23ca5ae 100755 --- a/src/jalview/appletgui/FeatureSettings.java +++ b/src/jalview/appletgui/FeatureSettings.java @@ -165,6 +165,7 @@ public class FeatureSettings extends Panel implements ItemListener, final FeatureSettings me = this; frame.addWindowListener(new WindowAdapter() { + @Override public void windowClosing(WindowEvent e) { if (me.av.featureSettings == me) @@ -185,6 +186,7 @@ public class FeatureSettings extends Panel implements ItemListener, width, height); } + @Override public void paint(Graphics g) { g.setColor(Color.black); @@ -212,6 +214,7 @@ public class FeatureSettings extends Panel implements ItemListener, scr.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { me.ap.alignFrame.avc @@ -224,6 +227,7 @@ public class FeatureSettings extends Panel implements ItemListener, dens.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { me.ap.alignFrame.avc @@ -258,6 +262,7 @@ public class FeatureSettings extends Panel implements ItemListener, mxcol.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (typeCol instanceof Color) @@ -312,9 +317,7 @@ public class FeatureSettings extends Panel implements ItemListener, for (String group : fr.getFeatureGroups()) { boolean vis = fr.checkGroupVisibility(group, false); - Checkbox check = new MyCheckbox(group, vis, - (fr.featureLinks != null && fr.featureLinks - .containsKey(group))); + Checkbox check = new MyCheckbox(group, vis, false); check.addMouseListener(this); check.setFont(new Font("Serif", Font.BOLD, 12)); check.addItemListener(groupItemListener); @@ -452,10 +455,7 @@ public class FeatureSettings extends Panel implements ItemListener, selected = true; } - check = new MyCheckbox( - type, - selected, - (fr.featureLinks != null && fr.featureLinks.containsKey(type)), + check = new MyCheckbox(type, selected, false, fr.getFeatureStyle(type)); check.addMouseListener(this); @@ -474,6 +474,7 @@ public class FeatureSettings extends Panel implements ItemListener, } } + @Override public void actionPerformed(ActionEvent evt) { for (int i = 0; i < featurePanel.getComponentCount(); i++) @@ -486,6 +487,7 @@ public class FeatureSettings extends Panel implements ItemListener, private ItemListener groupItemListener = new ItemListener() { + @Override public void itemStateChanged(ItemEvent evt) { Checkbox source = (Checkbox) evt.getSource(); @@ -500,6 +502,7 @@ public class FeatureSettings extends Panel implements ItemListener, }; }; + @Override public void itemStateChanged(ItemEvent evt) { selectionChanged(); @@ -533,22 +536,7 @@ public class FeatureSettings extends Panel implements ItemListener, boolean dragging = false; - public void mousePressed(MouseEvent evt) - { - - selectedCheck = (MyCheckbox) evt.getSource(); - - if (fr.featureLinks != null - && fr.featureLinks.containsKey(selectedCheck.type)) - { - if (evt.getX() > selectedCheck.stringWidth + 20) - { - evt.consume(); - } - } - - } - + @Override public void mouseDragged(MouseEvent evt) { if (((Component) evt.getSource()).getParent() != featurePanel) @@ -558,6 +546,7 @@ public class FeatureSettings extends Panel implements ItemListener, dragging = true; } + @Override public void mouseReleased(MouseEvent evt) { if (((Component) evt.getSource()).getParent() != featurePanel) @@ -633,14 +622,17 @@ public class FeatureSettings extends Panel implements ItemListener, ap.paintAlignment(true); } + @Override public void mouseEntered(MouseEvent evt) { } + @Override public void mouseExited(MouseEvent evt) { } + @Override public void mouseClicked(MouseEvent evt) { MyCheckbox check = (MyCheckbox) evt.getSource(); @@ -648,16 +640,6 @@ public class FeatureSettings extends Panel implements ItemListener, { this.popupSort(check, fr.getMinMax(), evt.getX(), evt.getY()); } - if (fr.featureLinks != null && fr.featureLinks.containsKey(check.type)) - { - if (evt.getX() > check.stringWidth + 20) - { - evt.consume(); - String link = fr.featureLinks.get(check.type).toString(); - ap.alignFrame.showURL(link.substring(link.indexOf("|") + 1), - link.substring(0, link.indexOf("|"))); - } - } if (check.getParent() != featurePanel) { @@ -680,10 +662,12 @@ public class FeatureSettings extends Panel implements ItemListener, } } + @Override public void mouseMoved(MouseEvent evt) { } + @Override public void adjustmentValueChanged(AdjustmentEvent evt) { fr.setTransparency((100 - transparency.getValue()) / 100f); @@ -764,6 +748,7 @@ public class FeatureSettings extends Panel implements ItemListener, updateColor(featureStyle); } + @Override public void paint(Graphics g) { Dimension d = getSize(); @@ -802,4 +787,9 @@ public class FeatureSettings extends Panel implements ItemListener, } } + @Override + public void mousePressed(MouseEvent e) + { + } + } -- 1.7.10.2