Brought code in line with changes to Samskivert. I have not started to

genericize Narya data structures, nor make the existing code type safe. That's
going to be an extremely large project.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4007 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2006-04-10 08:59:30 +00:00
parent 02b59f33c9
commit 5a2583470c
24 changed files with 49 additions and 48 deletions
+1
View File
@@ -143,6 +143,7 @@
<exclude name="**/ModPlayer.java"/>
<exclude name="**/MidiPlayer.java"/>
<exclude name="**/Mp3Player.java"/>
<!--<compilerarg value="-Xlint:unchecked"/>-->
</javac>
</target>
@@ -1,5 +1,5 @@
//
// $Id: DSetEditor.java,v 1.10 2004/11/06 01:59:24 ray Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -36,8 +36,8 @@ import com.samskivert.swing.ObjectEditorTable;
import com.samskivert.swing.event.CommandEvent;
import com.samskivert.util.ClassUtil;
import com.samskivert.util.ComparableArrayList;
import com.samskivert.util.ListUtil;
import com.samskivert.util.SortableArrayList;
import com.threerings.media.SafeScrollPane;
@@ -205,7 +205,7 @@ public class DSetEditor extends JPanel
protected void refreshData ()
{
_keys = new SortableArrayList();
_keys = new ComparableArrayList();
DSet.Entry[] entries = new DSet.Entry[_set.size()];
_set.toArray(entries);
for (int ii=0; ii < entries.length; ii++) {
@@ -224,7 +224,7 @@ public class DSetEditor extends JPanel
protected DSet _set;
/** An array we use to track our entries' positions by key. */
protected SortableArrayList _keys;
protected ComparableArrayList _keys;
/** The table used to edit. */
protected ObjectEditorTable _table;
@@ -101,10 +101,10 @@ public class ConfigRepository extends JORARepository
// documentation inherited
protected void createTables (Session session)
{
_ctable = new Table(
ConfigDatum.class.getName(), "CONFIG", session,
_ctable = new Table<ConfigDatum>(
ConfigDatum.class, "CONFIG", session,
new String[] { "OBJECT", "FIELD" }, true);
}
protected Table _ctable;
protected Table<ConfigDatum> _ctable;
}
@@ -26,8 +26,8 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import com.samskivert.swing.RuntimeAdjust;
import com.samskivert.util.LRUHashMap;
import com.samskivert.util.RuntimeAdjust;
import com.samskivert.util.StringUtil;
import com.samskivert.util.Throttle;
import com.samskivert.util.Tuple;
@@ -25,7 +25,7 @@ import java.awt.Color;
import java.io.Serializable;
import com.samskivert.util.ArrayIntSet;
import com.samskivert.util.SortableArrayList;
import com.samskivert.util.ComparableArrayList;
import com.samskivert.util.StringUtil;
/**
@@ -166,7 +166,7 @@ public class ComponentClass implements Serializable
public void addPriorityOverride (PriorityOverride override)
{
if (_overrides == null) {
_overrides = new SortableArrayList();
_overrides = new ComparableArrayList();
}
_overrides.insertSorted(override);
}
@@ -233,7 +233,7 @@ public class ComponentClass implements Serializable
}
/** A list of render priority overrides. */
protected SortableArrayList _overrides;
protected ComparableArrayList _overrides;
/** Increase this value when object's serialized state is impacted by
* a class change (modification of fields, inheritance). */
@@ -47,9 +47,9 @@ import java.util.zip.Deflater;
import org.apache.commons.digester.Digester;
import com.samskivert.io.PersistenceException;
import com.samskivert.util.ComparableArrayList;
import com.samskivert.util.FileUtil;
import com.samskivert.util.HashIntMap;
import com.samskivert.util.SortableArrayList;
import com.samskivert.util.Tuple;
import org.apache.tools.ant.BuildException;
@@ -530,7 +530,7 @@ public class ComponentBundlerTask extends Task
bout.newLine();
// write out the keys and values
SortableArrayList lines = new SortableArrayList();
ComparableArrayList lines = new ComparableArrayList();
Iterator keys = keySet().iterator();
while (keys.hasNext()) {
Tuple key = (Tuple)keys.next();
@@ -45,9 +45,9 @@ import javax.swing.RepaintManager;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import com.samskivert.swing.RuntimeAdjust;
import com.samskivert.util.ListUtil;
import com.samskivert.util.RunAnywhere;
import com.samskivert.util.RuntimeAdjust;
import com.samskivert.util.StringUtil;
import com.threerings.media.timer.MediaTimer;
@@ -43,10 +43,10 @@ import java.util.ArrayList;
import com.samskivert.swing.Controller;
import com.samskivert.swing.Label;
import com.samskivert.swing.RuntimeAdjust;
import com.samskivert.swing.event.AncestorAdapter;
import com.samskivert.swing.event.CommandEvent;
import com.samskivert.util.IntListUtil;
import com.samskivert.util.RuntimeAdjust;
import com.samskivert.util.StringUtil;
import com.threerings.media.timer.MediaTimer;
@@ -39,8 +39,8 @@ import java.util.Iterator;
import javax.imageio.ImageIO;
import javax.imageio.stream.ImageInputStream;
import com.samskivert.swing.RuntimeAdjust;
import com.samskivert.util.LRUHashMap;
import com.samskivert.util.RuntimeAdjust;
import com.samskivert.util.StringUtil;
import com.samskivert.util.Throttle;
import com.samskivert.util.Tuple;
@@ -46,12 +46,12 @@ import javax.sound.sampled.UnsupportedAudioFileException;
import org.apache.commons.io.IOUtils;
import com.samskivert.swing.RuntimeAdjust;
import com.samskivert.util.Config;
import com.samskivert.util.ConfigUtil;
import com.samskivert.util.Interval;
import com.samskivert.util.LRUHashMap;
import com.samskivert.util.Queue;
import com.samskivert.util.RuntimeAdjust;
import com.samskivert.util.StringUtil;
import com.threerings.resource.ResourceManager;
@@ -118,9 +118,9 @@ public class TileSetBundle extends HashIntMap
{
out.writeInt(size());
Iterator entries = entrySet().iterator();
Iterator entries = intEntrySet().iterator();
while (entries.hasNext()) {
Entry entry = (Entry)entries.next();
IntEntry entry = (IntEntry)entries.next();
out.writeInt(entry.getIntKey());
out.writeObject(entry.getValue());
}
@@ -53,9 +53,9 @@ import java.util.List;
import com.samskivert.swing.Controller;
import com.samskivert.swing.RadialMenu;
import com.samskivert.swing.RuntimeAdjust;
import com.samskivert.swing.event.CommandEvent;
import com.samskivert.util.HashIntMap;
import com.samskivert.util.RuntimeAdjust;
import com.samskivert.util.StringUtil;
import com.threerings.media.VirtualMediaPanel;
@@ -1,5 +1,5 @@
//
// $Id: SceneObject.java,v 1.12 2004/10/28 17:49:02 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -29,7 +29,7 @@ import java.awt.Point;
import java.awt.Polygon;
import java.awt.Rectangle;
import com.samskivert.util.RuntimeAdjust;
import com.samskivert.swing.RuntimeAdjust;
import com.samskivert.util.StringUtil;
import com.threerings.media.tile.NoSuchTileSetException;
@@ -1,5 +1,5 @@
//
// $Id: SceneObjectTip.java,v 1.6 2004/08/27 02:20:06 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -35,8 +35,8 @@ import javax.swing.UIManager;
import com.samskivert.swing.Label;
import com.samskivert.swing.LabelSausage;
import com.samskivert.util.ComparableArrayList;
import com.samskivert.util.StringUtil;
import com.samskivert.util.SortableArrayList;
/**
* A lightweight tooltip used by the {@link MisoScenePanel}. The tip
@@ -192,7 +192,7 @@ public class SceneObjectTip extends LabelSausage
}
/** Contains a sorted list of layout registrations. */
protected static SortableArrayList _layouts = new SortableArrayList();
protected static ComparableArrayList _layouts = new ComparableArrayList();
/** The number of pixels to pad around the icon. */
protected static final int ICON_PAD = 4;
@@ -30,9 +30,9 @@ import java.nio.channels.SocketChannel;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import com.samskivert.swing.RuntimeAdjust;
import com.samskivert.util.LoopingThread;
import com.samskivert.util.Queue;
import com.samskivert.util.RuntimeAdjust;
import com.samskivert.util.StringUtil;
import com.threerings.io.FramedInputStream;
@@ -35,7 +35,7 @@ import java.util.List;
import org.apache.velocity.VelocityContext;
import com.samskivert.util.CollectionUtil;
import com.samskivert.util.SortableArrayList;
import com.samskivert.util.ComparableArrayList;
import com.samskivert.util.StringUtil;
import com.threerings.presents.client.InvocationDecoder;
@@ -69,7 +69,7 @@ public class GenReceiverTask extends InvocationTask
}
HashMap imports = new HashMap();
SortableArrayList methods = new SortableArrayList();
ComparableArrayList methods = new ComparableArrayList();
// we need to import the receiver itself
imports.put(importify(receiver.getName()), Boolean.TRUE);
@@ -101,7 +101,7 @@ public class GenReceiverTask extends InvocationTask
String spackage = StringUtil.replace(rpackage, ".client", ".server");
// construct our imports list
SortableArrayList implist = new SortableArrayList();
ComparableArrayList implist = new ComparableArrayList();
CollectionUtil.addAll(implist, imports);
checkedAdd(implist, ClientObject.class.getName());
checkedAdd(implist, InvocationSender.class.getName());
@@ -140,7 +140,7 @@ public class GenReceiverTask extends InvocationTask
String dname = StringUtil.replace(rname, "Receiver", "Decoder");
// construct our imports list
SortableArrayList implist = new SortableArrayList();
ComparableArrayList implist = new ComparableArrayList();
CollectionUtil.addAll(implist, imports);
checkedAdd(implist, InvocationDecoder.class.getName());
implist.sort();
@@ -18,7 +18,7 @@ import java.util.List;
import org.apache.velocity.VelocityContext;
import com.samskivert.util.CollectionUtil;
import com.samskivert.util.SortableArrayList;
import com.samskivert.util.ComparableArrayList;
import com.samskivert.util.StringUtil;
import com.threerings.presents.client.Client;
@@ -41,7 +41,7 @@ public class GenServiceTask extends InvocationTask
{
public Class listener;
public SortableArrayList methods = new SortableArrayList();
public ComparableArrayList methods = new ComparableArrayList();
public ServiceListener (Class service, Class listener, HashMap imports)
{
@@ -116,8 +116,8 @@ public class GenServiceTask extends InvocationTask
}
HashMap imports = new HashMap();
SortableArrayList methods = new SortableArrayList();
SortableArrayList listeners = new SortableArrayList();
ComparableArrayList methods = new ComparableArrayList();
ComparableArrayList listeners = new ComparableArrayList();
// we need to import the service itself
imports.put(importify(service.getName()), Boolean.TRUE);
@@ -165,7 +165,7 @@ public class GenServiceTask extends InvocationTask
String mpackage = StringUtil.replace(spackage, ".client", ".data");
// construct our imports list
SortableArrayList implist = new SortableArrayList();
ComparableArrayList implist = new ComparableArrayList();
CollectionUtil.addAll(implist, imports);
checkedAdd(implist, Client.class.getName());
checkedAdd(implist, InvocationMarshaller.class.getName());
@@ -205,7 +205,7 @@ public class GenServiceTask extends InvocationTask
String dpackage = StringUtil.replace(spackage, ".client", ".server");
// construct our imports list
SortableArrayList implist = new SortableArrayList();
ComparableArrayList implist = new ComparableArrayList();
CollectionUtil.addAll(implist, imports);
checkedAdd(implist, ClientObject.class.getName());
checkedAdd(implist, InvocationMarshaller.class.getName());
@@ -248,7 +248,7 @@ public class GenServiceTask extends InvocationTask
String mpackage = StringUtil.replace(spackage, ".client", ".server");
// construct our imports list
SortableArrayList implist = new SortableArrayList();
ComparableArrayList implist = new ComparableArrayList();
CollectionUtil.addAll(implist, imports);
checkedAdd(implist, ClientObject.class.getName());
checkedAdd(implist, InvocationProvider.class.getName());
@@ -26,8 +26,8 @@ import javax.swing.JPanel;
import com.samskivert.swing.Controller;
import com.samskivert.swing.ControllerProvider;
import com.samskivert.swing.RuntimeAdjust;
import com.samskivert.swing.util.SwingUtil;
import com.samskivert.util.RuntimeAdjust;
import com.threerings.util.KeyTranslator;
import com.threerings.util.RobotPlayer;
@@ -26,8 +26,8 @@ import java.util.Iterator;
import com.samskivert.swing.Controller;
import com.samskivert.swing.ControllerProvider;
import com.samskivert.swing.RuntimeAdjust;
import com.samskivert.swing.util.SwingUtil;
import com.samskivert.util.RuntimeAdjust;
import com.samskivert.util.Tuple;
import com.threerings.util.StreamableArrayList;
@@ -22,9 +22,9 @@ import java.io.IOException;
import java.io.PrintStream;
import java.util.List;
import com.samskivert.swing.RuntimeAdjust;
import com.samskivert.swing.util.SwingUtil;
import com.samskivert.util.DebugChords;
import com.samskivert.util.RuntimeAdjust;
import com.samskivert.util.StringUtil;
import com.threerings.util.KeyDispatcher;
@@ -25,9 +25,9 @@ import javax.swing.event.PopupMenuListener;
import com.samskivert.swing.GroupLayout;
import com.samskivert.swing.HGroupLayout;
import com.samskivert.util.Collections;
import com.samskivert.util.CollectionUtil;
import com.samskivert.util.SortableArrayList;
import com.samskivert.util.Collections;
import com.samskivert.util.ComparableArrayList;
import com.threerings.miso.data.ObjectInfo;
import com.threerings.miso.data.SparseMisoSceneModel.ObjectVisitor;
@@ -81,7 +81,7 @@ public class SceneInfoPanel extends JPanel
});
// create a drop-down for selecting the scene type
SortableArrayList types = new SortableArrayList();
ComparableArrayList types = new ComparableArrayList();
ctx.enumerateSceneTypes(types);
types.sort();
types.add(0, "");
@@ -219,7 +219,7 @@ public class SceneInfoPanel extends JPanel
int pick = _scene.getDefaultColor(classRec.classId);
ColorPository.ColorRecord[] colors = cpos.enumerateColors(cclass);
SortableArrayList list = new SortableArrayList();
ComparableArrayList list = new ComparableArrayList();
for (int ii=0; ii < colors.length; ii++) {
list.insertSorted(colors[ii].name);
if (colors[ii].colorId == pick) {
@@ -12,8 +12,8 @@ import java.awt.GraphicsEnvironment;
import java.io.File;
import java.io.IOException;
import com.samskivert.swing.RuntimeAdjust;
import com.samskivert.swing.util.SwingUtil;
import com.samskivert.util.RuntimeAdjust;
import com.threerings.resource.ResourceManager;
import com.threerings.util.KeyDispatcher;
@@ -65,8 +65,8 @@ public class StreamableHashIntMap extends HashIntMap
{
int ecount = size();
out.writeInt(ecount);
for (Iterator iter = entrySet().iterator(); iter.hasNext(); ) {
HashIntMap.Entry entry = (HashIntMap.Entry) iter.next();
for (Iterator iter = intEntrySet().iterator(); iter.hasNext(); ) {
IntEntry entry = (IntEntry) iter.next();
out.writeInt(entry.getIntKey());
out.writeObject(entry.getValue());
}
@@ -66,7 +66,7 @@ public class StreamableIntIntMap extends IntIntMap
int ecount = size();
out.writeInt(ecount);
for (Iterator itr = entrySet().iterator(); itr.hasNext(); ) {
Entry entry = (Entry) itr.next();
IntIntEntry entry = (IntIntEntry) itr.next();
out.writeInt(entry.getIntKey());
out.writeInt(entry.getIntValue());
}