From f6c34ddf9113415d9a062e57767cae7ac345f573 Mon Sep 17 00:00:00 2001 From: samskivert Date: Tue, 15 Sep 2009 04:53:39 +0000 Subject: [PATCH] More Galileo hygiene. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2639 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../com/samskivert/jdbc/HsqldbLiaison.java | 2 +- src/java/com/samskivert/jdbc/JDBCUtil.java | 2 +- .../com/samskivert/swing/RadialMenuItem.java | 54 +++++++++---------- .../com/samskivert/swing/RuntimeAdjust.java | 6 +++ src/java/com/samskivert/util/Lifecycle.java | 2 +- .../com/samskivert/util/ResultListener.java | 2 +- src/java/com/samskivert/util/SignalUtil.java | 2 +- 7 files changed, 38 insertions(+), 32 deletions(-) diff --git a/src/java/com/samskivert/jdbc/HsqldbLiaison.java b/src/java/com/samskivert/jdbc/HsqldbLiaison.java index 3448475a..d24eb82b 100644 --- a/src/java/com/samskivert/jdbc/HsqldbLiaison.java +++ b/src/java/com/samskivert/jdbc/HsqldbLiaison.java @@ -155,7 +155,7 @@ public class HsqldbLiaison extends BaseLiaison } else { newDefinitions[ii] = def; } - }; + } // now call the real implementation with our modified data return super.createTableIfMissing( diff --git a/src/java/com/samskivert/jdbc/JDBCUtil.java b/src/java/com/samskivert/jdbc/JDBCUtil.java index 66a78649..e61089f9 100644 --- a/src/java/com/samskivert/jdbc/JDBCUtil.java +++ b/src/java/com/samskivert/jdbc/JDBCUtil.java @@ -53,7 +53,7 @@ public class JDBCUtil */ public void process (ResultSet row) throws SQLException; - }; + } /** * Closes the supplied JDBC statement and gracefully handles being passed null (by doing diff --git a/src/java/com/samskivert/swing/RadialMenuItem.java b/src/java/com/samskivert/swing/RadialMenuItem.java index 710bcde1..efbb1dac 100644 --- a/src/java/com/samskivert/swing/RadialMenuItem.java +++ b/src/java/com/samskivert/swing/RadialMenuItem.java @@ -34,20 +34,18 @@ public class RadialMenuItem extends RadialLabelSausage /** The command to issue if this item is selected. */ public String command; - /** A special argument to be used when this menu item is selected, - * rather than the argument provided to the radial menu when it was - * activated. */ + /** A special argument to be used when this menu item is selected, rather than the argument + * provided to the radial menu when it was activated. */ public Object argument; - /** Used to determine whether or not this menu item should be included - * in a menu and whether or not it should be enabled. If no predicate - * is available, a menu item is assumed always to be included and - * enabled. */ + /** Used to determine whether or not this menu item should be included in a menu and whether or + * not it should be enabled. If no predicate is available, a menu item is assumed always to be + * included and enabled. */ public RadialMenu.Predicate predicate; /** - * Constructs a radial menu item with the specified command and label. - * No icon or menu predicate will be used. + * Constructs a radial menu item with the specified command and label. No icon or menu + * predicate will be used. */ public RadialMenuItem (String command, String label) { @@ -55,8 +53,8 @@ public class RadialMenuItem extends RadialLabelSausage } /** - * Constructs a radial menu item with the specified command, label and - * icon. No menu predicate will be used. + * Constructs a radial menu item with the specified command, label and icon. No menu predicate + * will be used. */ public RadialMenuItem (String command, String label, Icon icon) { @@ -64,8 +62,7 @@ public class RadialMenuItem extends RadialLabelSausage } /** - * Constructs a radial menu item with the specified command, label and - * icon. + * Constructs a radial menu item with the specified command, label and icon. */ public RadialMenuItem (String command, String label, Icon icon, RadialMenu.Predicate predicate) @@ -79,9 +76,8 @@ public class RadialMenuItem extends RadialLabelSausage } /** - * Returns true if this menu item should be included in a menu when it - * is displayed. Calls through to the {@link RadialMenu.Predicate} if - * we have one. + * Returns true if this menu item should be included in a menu when it is displayed. Calls + * through to the {@link RadialMenu.Predicate} if we have one. */ public boolean isIncluded (RadialMenu menu) { @@ -89,9 +85,16 @@ public class RadialMenuItem extends RadialLabelSausage } /** - * Returns true if this menu item should be enabled when it is - * displayed. Calls through to the {@link RadialMenu.Predicate} if we - * have one. + * Renders this menu item at the specified location. + */ + public void render (Component host, RadialMenu menu, Graphics2D gfx, int x, int y) + { + paint(gfx, x, y, menu); + } + + /** + * Returns true if this menu item should be enabled when it is displayed. Calls through to the + * {@link RadialMenu.Predicate} if we have one. */ @Override public boolean isEnabled (RadialMenu menu) @@ -100,9 +103,8 @@ public class RadialMenuItem extends RadialLabelSausage } /** - * Menu items are equal if their commands are equal. We also - * declare ourselves to be equal to a string with the same value - * as our command. + * Menu items are equal if their commands are equal. We also declare ourselves to be equal to a + * string with the same value as our command. */ @Override public boolean equals (Object other) @@ -116,12 +118,10 @@ public class RadialMenuItem extends RadialLabelSausage } } - /** - * Renders this menu item at the specified location. - */ - public void render (Component host, RadialMenu menu, Graphics2D gfx, int x, int y) + @Override + public int hashCode () { - paint(gfx, x, y, menu); + return command.hashCode(); } @Override diff --git a/src/java/com/samskivert/swing/RuntimeAdjust.java b/src/java/com/samskivert/swing/RuntimeAdjust.java index 5b150d1a..2da32a06 100644 --- a/src/java/com/samskivert/swing/RuntimeAdjust.java +++ b/src/java/com/samskivert/swing/RuntimeAdjust.java @@ -506,6 +506,12 @@ public class RuntimeAdjust return _name.equals(((Adjust)other)._name); } + @Override public int hashCode () + { + return _name.hashCode(); + } + + // from Comparable public int compareTo (Adjust other) { return _name.compareTo(other._name); diff --git a/src/java/com/samskivert/util/Lifecycle.java b/src/java/com/samskivert/util/Lifecycle.java index e5335e27..d7f054cb 100644 --- a/src/java/com/samskivert/util/Lifecycle.java +++ b/src/java/com/samskivert/util/Lifecycle.java @@ -52,7 +52,7 @@ public class Lifecycle } /** Constraints for use with {@link #addInitConstraint} and {@link #addShutdownConstraint}. */ - public static enum Constraint { RUNS_BEFORE, RUNS_AFTER }; + public static enum Constraint { RUNS_BEFORE, RUNS_AFTER } /** * Registers a component with the lifecycle. This should be done during dependency resolution diff --git a/src/java/com/samskivert/util/ResultListener.java b/src/java/com/samskivert/util/ResultListener.java index 4a194a99..5f0d9e94 100644 --- a/src/java/com/samskivert/util/ResultListener.java +++ b/src/java/com/samskivert/util/ResultListener.java @@ -60,7 +60,7 @@ public interface ResultListener } public void requestFailed (Exception cause) { } - }; + } /** * Called to communicate that the request succeeded and that the diff --git a/src/java/com/samskivert/util/SignalUtil.java b/src/java/com/samskivert/util/SignalUtil.java index 4be7498b..003350c8 100644 --- a/src/java/com/samskivert/util/SignalUtil.java +++ b/src/java/com/samskivert/util/SignalUtil.java @@ -75,7 +75,7 @@ public class SignalUtil } protected int _signo; - }; + } public static interface Handler { public void signalReceived (Number number);