Whitespace

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@1031 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Dave Hoover
2010-10-15 20:16:01 +00:00
parent b443c0e48c
commit 082bd4399b
28 changed files with 233 additions and 324 deletions
@@ -47,8 +47,8 @@ import com.threerings.cast.bundle.BundledComponentRepository;
import static com.threerings.miso.Log.log;
/**
* The ViewerApp is a scene viewing application that allows for trying
* out game scenes in a pseudo-runtime environment.
* The ViewerApp is a scene viewing application that allows for trying out game scenes in a
* pseudo-runtime environment.
*/
public class ViewerApp
{
@@ -64,38 +64,33 @@ public class ViewerApp
}
// get the graphics environment
GraphicsEnvironment env =
GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
// get the target graphics device
GraphicsDevice gd = env.getDefaultScreenDevice();
log.info("Graphics device [dev=" + gd +
", mem=" + gd.getAvailableAcceleratedMemory() +
", displayChange=" + gd.isDisplayChangeSupported() +
", fullScreen=" + gd.isFullScreenSupported() + "].");
log.info("Graphics device", "dev", gd, "mem", gd.getAvailableAcceleratedMemory(),
"displayChange", gd.isDisplayChangeSupported(),
"fullScreen", gd.isFullScreenSupported());
// get the graphics configuration and display mode information
GraphicsConfiguration gc = gd.getDefaultConfiguration();
DisplayMode dm = gd.getDisplayMode();
log.info("Display mode [bits=" + dm.getBitDepth() +
", wid=" + dm.getWidth() + ", hei=" + dm.getHeight() +
", refresh=" + dm.getRefreshRate() + "].");
log.info("Display mode", "bits", dm.getBitDepth(), "wid", dm.getWidth(),
"hei", dm.getHeight(), "refresh", dm.getRefreshRate());
// create the window
_frame = new ViewerFrame(gc);
_frame = new ViewerFrame(gc);
_framemgr = FrameManager.newInstance(_frame);
// we don't need to configure anything
ResourceManager rmgr = new ResourceManager("rsrc");
rmgr.initBundles(
null, "config/resource/manager.properties", null);
rmgr.initBundles(null, "config/resource/manager.properties", null);
ClientImageManager imgr = new ClientImageManager(rmgr, _frame);
_tilemgr = new MisoTileManager(rmgr, imgr);
_tilemgr.setTileSetRepository(
new BundledTileSetRepository(rmgr, imgr, "tilesets"));
_tilemgr = new MisoTileManager(rmgr, imgr);
_tilemgr.setTileSetRepository(new BundledTileSetRepository(rmgr, imgr, "tilesets"));
// create the context object
MisoContext ctx = new ContextImpl();
// create the context object
MisoContext ctx = new ContextImpl();
// create the various managers
BundledComponentRepository crepo =
@@ -111,14 +106,13 @@ public class ViewerApp
SimpleMisoSceneParser parser = new SimpleMisoSceneParser("");
SimpleMisoSceneModel model = parser.parseScene(args[0]);
if (model == null) {
log.warning("No miso scene found in scene file " +
"[path=" + args[0] + "].");
log.warning("No miso scene found in scene file", "path", args[0]);
System.exit(-1);
}
_panel.setSceneModel(model);
} catch (Exception e) {
log.warning("Unable to parse scene [path=" + args[0] + "].", e);
log.warning("Unable to parse scene", "path", args[0], e);
System.exit(-1);
}
@@ -143,13 +137,11 @@ public class ViewerApp
*/
protected class ContextImpl implements MisoContext
{
public MisoTileManager getTileManager ()
{
return _tilemgr;
}
public MisoTileManager getTileManager () {
return _tilemgr;
}
public FrameManager getFrameManager ()
{
public FrameManager getFrameManager () {
return _framemgr;
}
}
@@ -44,7 +44,7 @@ public class ViewerFrame extends ManagedJFrame
*/
public ViewerFrame (GraphicsConfiguration gc)
{
super(gc);
super(gc);
// set up the frame options
setTitle("Scene Viewer");
@@ -57,8 +57,7 @@ public class ViewerFrame extends ManagedJFrame
// create the "Settings" menu
JMenu menuSettings = new JMenu("Settings");
MenuUtil.addMenuItem(
menuSettings, "Preferences", this, "handlePreferences");
MenuUtil.addMenuItem(menuSettings, "Preferences", this, "handlePreferences");
// create the menu bar
JMenuBar bar = new JMenuBar();
@@ -80,7 +79,7 @@ public class ViewerFrame extends ManagedJFrame
// now add the new one
_panel = panel;
getContentPane().add(_panel, BorderLayout.CENTER);
getContentPane().add(_panel, BorderLayout.CENTER);
}
/**
@@ -58,7 +58,7 @@ public class ViewerSceneViewPanel extends MisoScenePanel
CharacterManager charmgr,
ComponentRepository crepo)
{
super(ctx, MisoConfig.getSceneMetrics());
super(ctx, MisoConfig.getSceneMetrics());
// create the character descriptors
_descUser = CastUtil.getRandomDescriptor("female", crepo);
@@ -71,7 +71,7 @@ public class ViewerSceneViewPanel extends MisoScenePanel
// create the decoy sprites
createDecoys(_spritemgr, charmgr);
PerformanceMonitor.register(this, "paint", 1000);
PerformanceMonitor.register(this, "paint", 1000);
}
@Override
@@ -137,8 +137,8 @@ public class ViewerSceneViewPanel extends MisoScenePanel
@Override
public void paint (Graphics g)
{
super.paint(g);
PerformanceMonitor.tick(this, "paint");
super.paint(g);
PerformanceMonitor.tick(this, "paint");
}
// documentation inherited
@@ -177,14 +177,14 @@ public class ViewerSceneViewPanel extends MisoScenePanel
{
// get the path from here to there
LineSegmentPath path = (LineSegmentPath)getPath(s, x, y, true);
if (path == null) {
s.cancelMove();
return false;
}
if (path == null) {
s.cancelMove();
return false;
}
// start the sprite moving along the path
path.setVelocity(100f/1000f);
s.move(path);
path.setVelocity(100f/1000f);
s.move(path);
return true;
}