Style fixes and import pruning. Beware, CheckStyle is (finally) coming to town.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5240 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -38,11 +38,11 @@ public interface AdminService extends InvocationService
|
||||
* Delivers a successful response to a {@link #getConfigInfo}
|
||||
* request.
|
||||
*/
|
||||
public void gotConfigInfo (String[] keys, int[] oids);
|
||||
void gotConfigInfo (String[] keys, int[] oids);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests the list of config objects.
|
||||
*/
|
||||
public void getConfigInfo (Client client, ConfigInfoListener listener);
|
||||
void getConfigInfo (Client client, ConfigInfoListener listener);
|
||||
}
|
||||
|
||||
@@ -78,13 +78,13 @@ public class AsStringFieldEditor extends FieldEditor
|
||||
|
||||
} else if (_field.getType().equals(int[].class)) {
|
||||
return StringUtil.parseIntArray(_value.getText());
|
||||
|
||||
|
||||
} else if (_field.getType().equals(float[].class)) {
|
||||
return StringUtil.parseFloatArray(_value.getText());
|
||||
|
||||
} else if (_field.getType().equals(long[].class)) {
|
||||
return StringUtil.parseLongArray(_value.getText());
|
||||
|
||||
|
||||
} else if (_field.getType().equals(Boolean.TYPE)) {
|
||||
return new Boolean(_value.getText().equalsIgnoreCase("true"));
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.util.PresentsContext;
|
||||
|
||||
/**
|
||||
* Provides "editing" of boolean fields
|
||||
* Provides "editing" of boolean fields.
|
||||
*/
|
||||
public class BooleanFieldEditor extends FieldEditor
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ConfigEditorPanel extends JPanel
|
||||
_defaultPane = defaultPane;
|
||||
|
||||
setLayout(new VGroupLayout(VGroupLayout.STRETCH, VGroupLayout.STRETCH,
|
||||
5, VGroupLayout.CENTER));
|
||||
VGroupLayout.DEFAULT_GAP, VGroupLayout.CENTER));
|
||||
|
||||
// create our objects tabbed pane
|
||||
add(_oeditors = new JTabbedPane(JTabbedPane.LEFT));
|
||||
|
||||
@@ -39,9 +39,9 @@ import static com.threerings.admin.Log.log;
|
||||
*/
|
||||
public class ConfigObjectManager implements AdminService.ConfigInfoListener
|
||||
{
|
||||
public ConfigObjectManager(Client client)
|
||||
public ConfigObjectManager (Client client)
|
||||
{
|
||||
_serverconfig = new HashMap<String,ConfigObject>();
|
||||
_serverconfig = new HashMap<String, ConfigObject>();
|
||||
_client = client;
|
||||
_client.addClientObserver(new ClientAdapter() {
|
||||
public void clientWillLogon (Client client) {
|
||||
@@ -62,7 +62,7 @@ public class ConfigObjectManager implements AdminService.ConfigInfoListener
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ConfigObject identified by the given key
|
||||
* Returns the ConfigObject identified by the given key.
|
||||
*/
|
||||
public ConfigObject getServerConfig (String key)
|
||||
{
|
||||
@@ -87,16 +87,16 @@ public class ConfigObjectManager implements AdminService.ConfigInfoListener
|
||||
|
||||
/**
|
||||
* Convenience: generate a getConfigInfo request to the AdminService from the external class,
|
||||
* instead from within the anonymous inner class
|
||||
* instead from within the anonymous inner class.
|
||||
*/
|
||||
protected void getConfigInfo()
|
||||
protected void getConfigInfo ()
|
||||
{
|
||||
_service.getConfigInfo(_client, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* This class takes care of the details of subscribing to and placing an individual
|
||||
* ConfigObject that the server knows about into a HashMap
|
||||
* ConfigObject that the server knows about into a HashMap.
|
||||
*/
|
||||
protected class ConfigObjectSubscriber implements Subscriber<ConfigObject>
|
||||
{
|
||||
@@ -133,28 +133,28 @@ public class ConfigObjectManager implements AdminService.ConfigInfoListener
|
||||
_serverconfig.remove(_key);
|
||||
}
|
||||
|
||||
/** The object that we are tracking */
|
||||
/** The object that we are tracking. */
|
||||
protected ConfigObject _cobj;
|
||||
|
||||
/** The name of the config object that we are subscribing to */
|
||||
/** The name of the config object to which we are subscribing. */
|
||||
protected String _key;
|
||||
|
||||
/** The oid of the object that we're tracking */
|
||||
/** The oid of the object that we're tracking. */
|
||||
protected int _oid;
|
||||
}
|
||||
|
||||
/** An array of handlers that each subscribe to a single ConfigObject */
|
||||
/** An array of handlers that each subscribe to a single ConfigObject. */
|
||||
protected ConfigObjectSubscriber[] _csubscribers;
|
||||
|
||||
/** Our local copy of the server-side runtime configuration */
|
||||
protected HashMap<String,ConfigObject> _serverconfig;
|
||||
/** Our local copy of the server-side runtime configuration. */
|
||||
protected HashMap<String, ConfigObject> _serverconfig;
|
||||
|
||||
/** Our distributed object manager */
|
||||
/** Our distributed object manager. */
|
||||
protected DObjectManager _dobjmgr;
|
||||
|
||||
/** Our admin service that we're using to fetch data */
|
||||
/** Our admin service that we're using to fetch data. */
|
||||
protected AdminService _service;
|
||||
|
||||
/** Our client object */
|
||||
/** Our client object. */
|
||||
protected Client _client;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public class DSetEditor extends JPanel
|
||||
public Dimension getPreferredSize ()
|
||||
{
|
||||
Dimension d = super.getPreferredSize();
|
||||
d.height = Math.min(d.height, 200);
|
||||
d.height = Math.min(d.height, MIN_HEIGHT);
|
||||
return d;
|
||||
}
|
||||
|
||||
@@ -193,8 +193,8 @@ public class DSetEditor extends JPanel
|
||||
// documentation inherited from interface ActionListener
|
||||
public void actionPerformed (ActionEvent event)
|
||||
{
|
||||
CommandEvent ce = (CommandEvent) event;
|
||||
_setter.updateSet(_setName, (DSet.Entry) ce.getArgument());
|
||||
CommandEvent ce = (CommandEvent)event;
|
||||
_setter.updateSet(_setName, (DSet.Entry)ce.getArgument());
|
||||
}
|
||||
|
||||
protected void refreshData ()
|
||||
@@ -223,4 +223,7 @@ public class DSetEditor extends JPanel
|
||||
|
||||
/** The table used to edit. */
|
||||
protected ObjectEditorTable _table;
|
||||
|
||||
/** The minimum height for our editor UI. */
|
||||
protected static final int MIN_HEIGHT = 200;
|
||||
}
|
||||
|
||||
@@ -105,8 +105,7 @@ public abstract class FieldEditor extends JPanel
|
||||
try {
|
||||
_object.changeAttribute(_field.getName(), value);
|
||||
} catch (ObjectAccessException oae) {
|
||||
log.warning("Failed to update field " + _field.getName() +
|
||||
": "+ oae);
|
||||
log.warning("Failed to update field " + _field.getName() + ": " + oae);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.samskivert.swing.ScrollablePanel;
|
||||
import com.samskivert.swing.VGroupLayout;
|
||||
import com.samskivert.swing.util.SwingUtil;
|
||||
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.dobj.ObjectAccessException;
|
||||
import com.threerings.presents.dobj.Subscriber;
|
||||
import com.threerings.presents.util.PresentsContext;
|
||||
@@ -60,8 +59,8 @@ public class ObjectEditorPanel extends ScrollablePanel
|
||||
public ObjectEditorPanel (PresentsContext ctx, String key, int oid)
|
||||
{
|
||||
super(new VGroupLayout(VGroupLayout.NONE, VGroupLayout.STRETCH,
|
||||
5, VGroupLayout.TOP));
|
||||
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
||||
VGroupLayout.DEFAULT_GAP, VGroupLayout.TOP));
|
||||
setBorder(BorderFactory.createEmptyBorder(BORDER, BORDER, BORDER, BORDER));
|
||||
|
||||
// keep this business around
|
||||
_ctx = ctx;
|
||||
@@ -127,4 +126,6 @@ public class ObjectEditorPanel extends ScrollablePanel
|
||||
protected String _key;
|
||||
protected SafeSubscriber<ConfigObject> _safesub;
|
||||
protected ConfigObject _object;
|
||||
|
||||
protected static final int BORDER = 5;
|
||||
}
|
||||
|
||||
@@ -48,13 +48,13 @@ public class PulldownFieldEditor extends FieldEditor
|
||||
/**
|
||||
* Construct a pulldown choice.
|
||||
*/
|
||||
public Choice (String displayName, Object value)
|
||||
public Choice (String displayName, Object val)
|
||||
{
|
||||
if (displayName == null) {
|
||||
throw new NullPointerException("displayName cannot be null.");
|
||||
}
|
||||
_name = displayName;
|
||||
this.value = value;
|
||||
value = val;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -117,14 +117,14 @@ public class PulldownFieldEditor extends FieldEditor
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
return ((Choice) obj).value;
|
||||
return ((Choice)obj).value;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
protected void displayValue (Object value)
|
||||
{
|
||||
for (int ii = _value.getItemCount() - 1; ii >= 0; ii--) {
|
||||
Choice choice = (Choice) _value.getItemAt(ii);
|
||||
Choice choice = (Choice)_value.getItemAt(ii);
|
||||
if (ObjectUtil.equals(value, choice.value)) {
|
||||
_value.setSelectedIndex(ii);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user