Added row-based tile width, image offset, and image row/column gap

distance parameters to tile sets.  Removed constant tile width/height
references except, for now, for isometric tile rendering which still
requires tiles that are 32x16.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@130 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2001-07-28 01:31:51 +00:00
parent e9ab0b343b
commit 92e46c6eae
8 changed files with 175 additions and 118 deletions
@@ -1,16 +1,16 @@
//
// $Id: ViewerFrame.java,v 1.1 2001/07/25 17:38:15 shaper Exp $
// $Id: ViewerFrame.java,v 1.2 2001/07/28 01:31:51 shaper Exp $
package com.threerings.miso.viewer;
import com.samskivert.swing.*;
import com.samskivert.swing.util.MenuUtil;
import com.threerings.miso.Log;
import com.threerings.miso.viewer.util.ViewerContext;
import com.threerings.miso.scene.Scene;
import com.threerings.miso.sprite.AnimationManager;
import com.threerings.miso.sprite.SpriteManager;
import com.threerings.miso.viewer.util.ViewerContext;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
@@ -19,7 +19,7 @@ import javax.swing.*;
* contains the application menu bar and panels and responds to menu
* events.
*/
class ViewerFrame extends JFrame implements ActionListener
class ViewerFrame extends JFrame
{
public ViewerFrame ()
{
@@ -33,58 +33,20 @@ class ViewerFrame extends JFrame implements ActionListener
{
_ctx = ctx;
// set up the menu bar
createMenuBar();
// create a top-level panel to manage everything
JPanel top = new JPanel();
GroupLayout gl = new HGroupLayout(GroupLayout.STRETCH);
gl.setOffAxisPolicy(GroupLayout.STRETCH);
top.setLayout(gl);
// set up the scene view panel with a default scene
SceneViewPanel svpanel = new SceneViewPanel(_ctx);
// setScene(new Scene(_tilemgr, Scene.SID_INVALID));
top.add(svpanel);
// now add our top-level panel
getContentPane().add(top, BorderLayout.CENTER);
// create the animation manager for the panel
SpriteManager spritemgr = new SpriteManager();
AnimationManager animmgr = new AnimationManager(spritemgr, svpanel);
// add the scene view panel
getContentPane().add(svpanel, BorderLayout.CENTER);
}
/**
* Create the menu bar and menu items and add them to the frame.
*/
public void createMenuBar ()
{
KeyStroke accel = null;
// create the "File" menu
JMenu menuFile = new JMenu("File");
accel = KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.ALT_MASK);
MenuUtil.addMenuItem(this, menuFile, "Quit", KeyEvent.VK_Q, accel);
// create the menu bar
JMenuBar bar = new JMenuBar();
bar.add(menuFile);
// add the menu bar to the frame
setJMenuBar(bar);
}
/**
* Handle menu item selections.
*/
public void actionPerformed (ActionEvent e)
{
String cmd = e.getActionCommand();
if (cmd.equals("Quit")) {
System.exit(0);
} else {
Log.warning("Unknown action command [cmd=" + cmd + "].");
}
}
/** The panel displaying the scene. */
SceneViewPanel _svpanel;
/** The context object. */
protected ViewerContext _ctx;