From: Jim Procter Date: Mon, 2 Feb 2015 11:56:54 +0000 (+0000) Subject: JAL-1640 JAL-1551 formatting/imports/remove dead code X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ca7085375682ec0d84b9c5fcd42913410d47abbb;p=jalview.git JAL-1640 JAL-1551 formatting/imports/remove dead code --- diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index 167dd09..1b4c8c4 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -20,16 +20,30 @@ */ package jalview.appletgui; -import java.util.*; - -import java.awt.*; -import java.awt.event.*; - -import jalview.datamodel.*; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.Annotation; import jalview.renderer.AnnotationRenderer; import jalview.renderer.AwtRenderPanelI; import jalview.util.MessageManager; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.MenuItem; +import java.awt.Panel; +import java.awt.PopupMenu; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.AdjustmentEvent; +import java.awt.event.AdjustmentListener; +import java.awt.event.InputEvent; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; + public class AnnotationPanel extends Panel implements AwtRenderPanelI, AdjustmentListener, ActionListener, MouseListener, MouseMotionListener @@ -40,8 +54,6 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, int activeRow = -1; - Vector activeRes; - final String HELIX = "Helix"; final String SHEET = "Sheet"; @@ -140,7 +152,9 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, if (av.getColumnSelection() != null && av.getColumnSelection().size() > 0 && anot[av.getColumnSelection().getMin()] != null) + { label = anot[av.getColumnSelection().getMin()].displayCharacter; + } if (evt.getActionCommand().equals(REMOVE)) { @@ -168,7 +182,9 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, int index = av.getColumnSelection().columnAt(i); if (!av.getColumnSelection().isVisible(index)) + { continue; + } if (anot[index] == null) { @@ -190,7 +206,9 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, int index = av.getColumnSelection().columnAt(i); if (!av.getColumnSelection().isVisible(index)) + { continue; + } if (anot[index] == null) { @@ -249,14 +267,15 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, int index = av.getColumnSelection().columnAt(i); if (!av.getColumnSelection().isVisible(index)) + { continue; + } if (anot[index] == null) { anot[index] = new Annotation(label, "", type, 0); } - anot[index].secondaryStructure = type != 'S' ? type : label .length() == 0 ? ' ' : label.charAt(0); anot[index].displayCharacter = label; @@ -278,9 +297,13 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, ap.alignFrame, "Enter Label", 400, 200, true); if (dialog.accept) + { return dialog.getName(); + } else + { return null; + } } @Override @@ -363,11 +386,6 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, return; } - if (aa == null) - { - return; - } - ap.scalePanel.mousePressed(evt); } @@ -513,15 +531,6 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, } } } - - if (activeRes == null) - { - activeRes = new Vector(); - activeRes.addElement(String.valueOf(i)); - return; - } - - activeRes.addElement(String.valueOf(i)); } @Override @@ -684,6 +693,8 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, return bounds; } else + { return null; + } } } diff --git a/src/jalview/appletgui/IdCanvas.java b/src/jalview/appletgui/IdCanvas.java index 83b69eb..9e7373c 100755 --- a/src/jalview/appletgui/IdCanvas.java +++ b/src/jalview/appletgui/IdCanvas.java @@ -20,10 +20,14 @@ */ package jalview.appletgui; -import java.awt.*; -import java.util.List; +import jalview.datamodel.SequenceI; -import jalview.datamodel.*; +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.Panel; +import java.util.List; public class IdCanvas extends Panel { diff --git a/src/jalview/appletgui/IdPanel.java b/src/jalview/appletgui/IdPanel.java index 547a4f9..958f49a 100755 --- a/src/jalview/appletgui/IdPanel.java +++ b/src/jalview/appletgui/IdPanel.java @@ -20,14 +20,21 @@ */ package jalview.appletgui; -import java.awt.*; -import java.awt.event.*; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceFeature; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; +import jalview.util.UrlLink; + +import java.awt.BorderLayout; +import java.awt.Panel; +import java.awt.event.InputEvent; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; import java.util.List; import java.util.Vector; -import jalview.datamodel.*; -import jalview.util.UrlLink; - public class IdPanel extends Panel implements MouseListener, MouseMotionListener { diff --git a/src/jalview/appletgui/ScalePanel.java b/src/jalview/appletgui/ScalePanel.java index a8090a1..b5241a6 100755 --- a/src/jalview/appletgui/ScalePanel.java +++ b/src/jalview/appletgui/ScalePanel.java @@ -362,7 +362,6 @@ public class ScalePanel extends Panel implements MouseMotionListener, int height) { gg.setFont(av.getFont()); - // Fill in the background gg.setColor(Color.white); gg.fillRect(0, 0, width, height); diff --git a/src/jalview/appletgui/SequenceRenderer.java b/src/jalview/appletgui/SequenceRenderer.java index d9a0d2a..19b038a 100755 --- a/src/jalview/appletgui/SequenceRenderer.java +++ b/src/jalview/appletgui/SequenceRenderer.java @@ -21,7 +21,6 @@ package jalview.appletgui; import jalview.api.FeatureRenderer; -import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.schemes.ColourSchemeI; diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 0508f44..add0460 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -1015,7 +1015,6 @@ public class AlignmentPanel extends GAlignmentPanel implements public int printWrappedAlignment(Graphics pg, int pwidth, int pheight, int pi) throws PrinterException { - int annotationHeight = 0; AnnotationLabels labels = null; if (av.isShowAnnotation()) diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index 5801423..c174a0e 100755 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@ -20,13 +20,19 @@ */ package jalview.gui; -import java.awt.*; -import java.awt.image.*; +import jalview.datamodel.SequenceI; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; import java.util.List; -import javax.swing.*; - -import jalview.datamodel.*; +import javax.swing.JPanel; /** * DOCUMENT ME! diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index c30fcd6..3ae3cb0 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -22,10 +22,17 @@ package jalview.gui; import jalview.renderer.AnnotationRenderer; -import java.awt.*; -import java.awt.event.*; -import java.awt.image.*; -import javax.swing.*; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; +import java.awt.image.BufferedImage; + +import javax.swing.JPanel; /** * DOCUMENT ME! diff --git a/src/jalview/gui/SequenceRenderer.java b/src/jalview/gui/SequenceRenderer.java index 767858d..be02717 100755 --- a/src/jalview/gui/SequenceRenderer.java +++ b/src/jalview/gui/SequenceRenderer.java @@ -21,7 +21,6 @@ package jalview.gui; import jalview.api.FeatureRenderer; -import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.schemes.ColourSchemeI; diff --git a/src/jalview/gui/TextColourChooser.java b/src/jalview/gui/TextColourChooser.java index 75b4c67..f88ef5b 100644 --- a/src/jalview/gui/TextColourChooser.java +++ b/src/jalview/gui/TextColourChooser.java @@ -20,14 +20,24 @@ */ package jalview.gui; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import javax.swing.event.*; - -import jalview.datamodel.*; +import jalview.datamodel.SequenceGroup; import jalview.util.MessageManager; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.BorderFactory; +import javax.swing.JColorChooser; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JSlider; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + public class TextColourChooser { AlignmentPanel ap;