Sfoglia il codice sorgente

Style fixes

Change-Id: Ia02568300be35a94ed7ae338dfe02343de10fff2
Reviewed-on: http://gerrit.dmdirc.com/822
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
Automatic-Compile: Shane Mc Cormack <shane@dmdirc.com>
tags/0.6.3
Chris Smith 14 anni fa
parent
commit
743d541c02

+ 10
- 1
src/com/dmdirc/addons/ui_swing/SwingController.java Vedi File

@@ -82,6 +82,7 @@ import java.awt.Font;
82 82
 import java.awt.GraphicsEnvironment;
83 83
 import java.awt.KeyboardFocusManager;
84 84
 import java.awt.Toolkit;
85
+import java.io.Serializable;
85 86
 import java.net.URI;
86 87
 import java.util.ArrayList;
87 88
 import java.util.HashMap;
@@ -100,7 +101,15 @@ import net.miginfocom.layout.PlatformDefaults;
100 101
 /**
101 102
  * Controls the main swing UI.
102 103
  */
103
-public final class SwingController extends Plugin implements UIController {
104
+public final class SwingController extends Plugin implements Serializable,
105
+        UIController {
106
+
107
+    /**
108
+     * A version number for this class. It should be changed whenever the class
109
+     * structure is changed (or anything else that would prevent serialized
110
+     * objects being unserialized with the new class).
111
+     */
112
+    private static final long serialVersionUID = 1;
104 113
 
105 114
     /** Logger to use. */
106 115
     private static final java.util.logging.Logger LOGGER =

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/statusbar/ErrorPanel.java Vedi File

@@ -68,7 +68,7 @@ public class ErrorPanel extends StatusbarPopupPanel implements ErrorListener, Ac
68 68
     /** Swing status bar. */
69 69
     private SwingStatusBar statusBar;
70 70
     /** Error manager. */
71
-    private final ErrorManager errorManager = ErrorManager.getErrorManager();
71
+    private transient final ErrorManager errorManager = ErrorManager.getErrorManager();
72 72
     /** Dismiss menu. */
73 73
     private final JPopupMenu menu;
74 74
     /** Dismiss menu item. */

+ 8
- 7
src/com/dmdirc/addons/ui_swing/components/substitutions/SubstitutionLabel.java Vedi File

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.addons.ui_swing.components.substitutions;
24 24
 
25 25
 import com.dmdirc.addons.ui_swing.dialogs.actioneditor.StringTransferable;
26
+
26 27
 import java.awt.Color;
27 28
 import java.awt.Component;
28 29
 import java.awt.Cursor;
@@ -57,19 +58,19 @@ public class SubstitutionLabel extends JButton implements MouseListener,
57 58
     /** Drag source. */
58 59
     private DragSource dragSource;
59 60
     /** Substitution. */
60
-    private Substitution substition;
61
+    private transient final Substitution substitution;
61 62
     /** Previously selected component. */
62 63
     private Component previousComponent;
63 64
 
64 65
     /** 
65 66
      * Instantiates the panel.
66 67
      * 
67
-     * @param substition Action substitition
68
+     * @param substitution Action substitition
68 69
      */
69
-    public SubstitutionLabel(final Substitution substition) {
70
+    public SubstitutionLabel(final Substitution substitution) {
70 71
         super();
71 72
 
72
-        this.substition = substition;
73
+        this.substitution = substitution;
73 74
 
74 75
         initComponents();
75 76
         addListeners();
@@ -82,7 +83,7 @@ public class SubstitutionLabel extends JButton implements MouseListener,
82 83
         dragSource.createDefaultDragGestureRecognizer(this,
83 84
                 DnDConstants.ACTION_COPY, this);
84 85
 
85
-        setText(substition.getName());
86
+        setText(substitution.getName());
86 87
         setFont(getFont().deriveFont(getFont().getSize() - 2f));
87 88
         
88 89
         setBorder(
@@ -159,7 +160,7 @@ public class SubstitutionLabel extends JButton implements MouseListener,
159 160
     @Override
160 161
     public void dragGestureRecognized(final DragGestureEvent dge) {
161 162
         dragSource.startDrag(dge, Cursor.getPredefinedCursor(Cursor.HAND_CURSOR),
162
-                new StringTransferable(substition.toString()), null);
163
+                new StringTransferable(substitution.toString()), null);
163 164
     }
164 165
 
165 166
     /** 
@@ -170,7 +171,7 @@ public class SubstitutionLabel extends JButton implements MouseListener,
170 171
     @Override
171 172
     public void actionPerformed(ActionEvent e) {
172 173
         if (previousComponent instanceof JTextComponent) {
173
-            ((JTextComponent) previousComponent).replaceSelection(substition.toString());
174
+            ((JTextComponent) previousComponent).replaceSelection(substitution.toString());
174 175
         }
175 176
     }
176 177
 

+ 12
- 11
src/com/dmdirc/addons/ui_swing/dialogs/profiles/ProfileListModel.java Vedi File

@@ -62,7 +62,7 @@ public class ProfileListModel extends DefaultListModel implements Iterable<Profi
62 62
 
63 63
     /** {@inheritDoc} */
64 64
     @Override
65
-    public Profile getElementAt(int index) {
65
+    public Profile getElementAt(final int index) {
66 66
         return profiles.get(index);
67 67
     }
68 68
 
@@ -74,7 +74,7 @@ public class ProfileListModel extends DefaultListModel implements Iterable<Profi
74 74
      * @return the profile that was removed
75 75
      */
76 76
     @Override
77
-    public Profile remove(int index) {
77
+    public Profile remove(final int index) {
78 78
         final Profile returnValue = profiles.remove(index);
79 79
 
80 80
         fireIntervalRemoved(this, index, index);
@@ -89,7 +89,7 @@ public class ProfileListModel extends DefaultListModel implements Iterable<Profi
89 89
      *
90 90
      * @return true if the object was removed
91 91
      */
92
-    public boolean remove(Profile p) {
92
+    public boolean remove(final Profile p) {
93 93
         final int index = profiles.indexOf(p);
94 94
         final boolean returnValue = profiles.remove(p);
95 95
 
@@ -115,7 +115,7 @@ public class ProfileListModel extends DefaultListModel implements Iterable<Profi
115 115
      *
116 116
      * @return index of the specified object
117 117
      */
118
-    public int indexOf(Profile p) {
118
+    public int indexOf(final Profile p) {
119 119
         return profiles.indexOf(p);
120 120
     }
121 121
 
@@ -127,7 +127,7 @@ public class ProfileListModel extends DefaultListModel implements Iterable<Profi
127 127
      * @return the profile that was removed
128 128
      */
129 129
     @Override
130
-    public Profile get(int index) {
130
+    public Profile get(final int index) {
131 131
         return profiles.get(index);
132 132
     }
133 133
     
@@ -148,7 +148,7 @@ public class ProfileListModel extends DefaultListModel implements Iterable<Profi
148 148
      *
149 149
      * @return true if the model contains the profile
150 150
      */
151
-    public boolean contains(Profile p) {
151
+    public boolean contains(final Profile p) {
152 152
         return profiles.contains(p);
153 153
     }
154 154
 
@@ -160,7 +160,7 @@ public class ProfileListModel extends DefaultListModel implements Iterable<Profi
160 160
      *
161 161
      * @return true if the model contains a profile with the specified name
162 162
      */
163
-    public boolean contains(String name) {
163
+    public boolean contains(final String name) {
164 164
         synchronized (profiles) {
165 165
             for (Profile profile : profiles) {
166 166
                 if (profile.getName().equals(name)) {
@@ -188,7 +188,7 @@ public class ProfileListModel extends DefaultListModel implements Iterable<Profi
188 188
      * @param index index to add the profile
189 189
      * @param element profile to add
190 190
      */
191
-    public void add(int index, Profile element) {
191
+    public void add(final int index, final Profile element) {
192 192
         profiles.add(index, element);
193 193
 
194 194
         fireIntervalAdded(this, index, index);
@@ -201,7 +201,7 @@ public class ProfileListModel extends DefaultListModel implements Iterable<Profi
201 201
      *
202 202
      * @return true if the item was added
203 203
      */
204
-    public boolean add(Profile p) {
204
+    public boolean add(final Profile p) {
205 205
         final boolean returnValue = profiles.add(p);
206 206
         final int index = profiles.indexOf(p);
207 207
 
@@ -222,8 +222,9 @@ public class ProfileListModel extends DefaultListModel implements Iterable<Profi
222 222
 
223 223
     /** {@inheritDoc} */
224 224
     @Override
225
-    public boolean equals(Object obj) {
226
-        return profiles.equals(obj);
225
+    public boolean equals(final Object obj) {
226
+        return obj instanceof ProfileListModel
227
+                && profiles.equals(((ProfileListModel) obj).getProfiles());
227 228
     }
228 229
 
229 230
     /** {@inheritDoc} */

+ 2
- 2
src/com/dmdirc/addons/ui_swing/textpane/IRCDocument.java Vedi File

@@ -52,9 +52,9 @@ public final class IRCDocument implements Serializable, ConfigChangeListener {
52 52
     /** Listener list. */
53 53
     private final EventListenerList listeners;
54 54
     /** Cached lines. */
55
-    private RollingList<Line> cachedLines;
55
+    private transient RollingList<Line> cachedLines;
56 56
     /** Cached attributed strings. */
57
-    private RollingList<AttributedString> cachedStrings;
57
+    private transient RollingList<AttributedString> cachedStrings;
58 58
     /** Container that owns this document. */
59 59
     private final FrameContainer container;
60 60
     /** Font size. */

Loading…
Annulla
Salva