From: Jim Procter Date: Fri, 6 Feb 2015 10:44:04 +0000 (+0000) Subject: JAL-1551 formatting X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=bb0c38e3467efca1a61e296a110ff9bee62ceaa9;p=jalview.git JAL-1551 formatting --- diff --git a/src/jalview/appletgui/SliderPanel.java b/src/jalview/appletgui/SliderPanel.java index 2a4d582..3739b3c 100644 --- a/src/jalview/appletgui/SliderPanel.java +++ b/src/jalview/appletgui/SliderPanel.java @@ -20,15 +20,30 @@ */ package jalview.appletgui; -import java.util.*; - -import java.awt.*; -import java.awt.event.*; - -import jalview.datamodel.*; -import jalview.schemes.*; +import jalview.datamodel.SequenceGroup; +import jalview.schemes.ColourSchemeI; import jalview.util.MessageManager; +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Checkbox; +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Label; +import java.awt.Panel; +import java.awt.Scrollbar; +import java.awt.TextField; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.AdjustmentEvent; +import java.awt.event.AdjustmentListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.Iterator; + public class SliderPanel extends Panel implements ActionListener, AdjustmentListener, MouseListener { @@ -221,7 +236,9 @@ public class SliderPanel extends Panel implements ActionListener, { while ((toChange = allGroups.next().cs) == null && allGroups.hasNext()) + { ; + } } else { diff --git a/src/jalview/appletgui/TreeCanvas.java b/src/jalview/appletgui/TreeCanvas.java index da8f91e..e8d8363 100755 --- a/src/jalview/appletgui/TreeCanvas.java +++ b/src/jalview/appletgui/TreeCanvas.java @@ -20,15 +20,33 @@ */ package jalview.appletgui; -import java.util.*; - -import java.awt.*; -import java.awt.event.*; - -import jalview.analysis.*; -import jalview.datamodel.*; -import jalview.schemes.*; -import jalview.util.*; +import jalview.analysis.Conservation; +import jalview.analysis.NJTree; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; +import jalview.datamodel.SequenceNode; +import jalview.schemes.ColourSchemeI; +import jalview.schemes.ColourSchemeProperty; +import jalview.schemes.ResidueProperties; +import jalview.schemes.UserColourScheme; +import jalview.util.Format; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.ScrollPane; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; public class TreeCanvas extends Panel implements MouseListener, MouseMotionListener diff --git a/src/jalview/gui/IdwidthAdjuster.java b/src/jalview/gui/IdwidthAdjuster.java index 6c9c400..a6e6c8d 100755 --- a/src/jalview/gui/IdwidthAdjuster.java +++ b/src/jalview/gui/IdwidthAdjuster.java @@ -20,9 +20,14 @@ */ package jalview.gui; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; + +import javax.swing.JPanel; /** * DOCUMENT ME! diff --git a/src/jalview/gui/SliderPanel.java b/src/jalview/gui/SliderPanel.java index f536efc..970ca3f 100755 --- a/src/jalview/gui/SliderPanel.java +++ b/src/jalview/gui/SliderPanel.java @@ -20,16 +20,20 @@ */ package jalview.gui; -import java.util.*; +import jalview.datamodel.SequenceGroup; +import jalview.jbgui.GSliderPanel; +import jalview.schemes.ColourSchemeI; +import jalview.util.MessageManager; -import java.awt.event.*; -import javax.swing.*; -import javax.swing.event.*; +import java.awt.event.ActionEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.Iterator; -import jalview.datamodel.*; -import jalview.jbgui.*; -import jalview.schemes.*; -import jalview.util.MessageManager; +import javax.swing.JInternalFrame; +import javax.swing.JLayeredPane; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; /** * DOCUMENT ME! diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index d921ba4..61d7d7e 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -20,17 +20,44 @@ */ package jalview.gui; -import java.util.*; - -import java.awt.*; -import java.awt.event.*; -import java.awt.print.*; -import javax.swing.*; - -import jalview.analysis.*; -import jalview.datamodel.*; -import jalview.schemes.*; -import jalview.util.*; +import jalview.analysis.Conservation; +import jalview.analysis.NJTree; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; +import jalview.datamodel.SequenceNode; +import jalview.schemes.ColourSchemeI; +import jalview.schemes.ColourSchemeProperty; +import jalview.schemes.ResidueProperties; +import jalview.schemes.UserColourScheme; +import jalview.util.Format; +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.Graphics2D; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.print.PageFormat; +import java.awt.print.Printable; +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; + +import javax.swing.JColorChooser; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; +import javax.swing.ToolTipManager; /** * DOCUMENT ME! @@ -208,7 +235,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, if (node.element() instanceof SequenceI) { - SequenceI seq = (SequenceI) ((SequenceNode) node).element(); + SequenceI seq = (SequenceI) node.element(); if (av.getSequenceColour(seq) == Color.white) { @@ -258,14 +285,14 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, Rectangle rect = new Rectangle(xend + 10, ypos - charHeight / 2, charWidth, charHeight); - nameHash.put((SequenceI) node.element(), rect); + nameHash.put(node.element(), rect); // Colour selected leaves differently SequenceGroup selected = av.getSelectionGroup(); if ((selected != null) && selected.getSequences(null).contains( - (SequenceI) node.element())) + node.element())) { g.setColor(Color.gray); @@ -290,7 +317,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, int xend = (int) (height * scale) + offx; int ypos = (int) (node.ycount * chunk) + offy; - g.setColor(((SequenceNode) node).color.darker()); + g.setColor(node.color.darker()); // Draw horizontal line g.drawLine(xstart, ypos, xend, ypos); @@ -682,7 +709,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, labelLength = fm.stringWidth(longestName) + 20; // 20 allows for scrollbar - float wscale = (float) (width - labelLength - (offx * 2)) + float wscale = (width - labelLength - (offx * 2)) / tree.getMaxHeight(); SequenceNode top = tree.getTopNode(); @@ -708,7 +735,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, g2.setColor(Color.gray); } - int x = (int) ((threshold * (float) (getWidth() - labelLength - (2 * offx))) + offx); + int x = (int) ((threshold * (getWidth() - labelLength - (2 * offx))) + offx); g2.drawLine(x, 0, x, getHeight()); }