Work on dirty-tile rendering optimization. Added placeholder panels

to the viewer.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@187 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2001-08-07 18:29:18 +00:00
parent c09986bab0
commit b3e7f12f08
10 changed files with 264 additions and 44 deletions
@@ -0,0 +1,28 @@
//
// $Id: ChatPanel.java,v 1.1 2001/08/07 18:29:18 shaper Exp $
package com.threerings.miso.viewer;
import java.awt.*;
import javax.swing.*;
import com.threerings.miso.Log;
public class ChatPanel extends JPanel
{
public void paintComponent (Graphics g)
{
super.paintComponent(g);
g.setColor(Color.blue);
Rectangle bounds = getBounds();
g.fillRect(0, 0, bounds.width, bounds.height);
Log.info("chat panel [bounds=" + bounds + "].");
}
public Dimension getPreferredSize ()
{
return new Dimension(200, 150);
}
}
@@ -0,0 +1,28 @@
//
// $Id: ManagementPanel.java,v 1.1 2001/08/07 18:29:18 shaper Exp $
package com.threerings.miso.viewer;
import java.awt.*;
import javax.swing.*;
import com.threerings.miso.Log;
public class ManagementPanel extends JPanel
{
public void paintComponent (Graphics g)
{
super.paintComponent(g);
g.setColor(Color.red);
Rectangle bounds = getBounds();
g.fillRect(0, 0, bounds.width, bounds.height);
Log.info("mgmt panel [bounds=" + bounds + "].");
}
public Dimension getPreferredSize ()
{
return new Dimension(200, 300);
}
}
@@ -0,0 +1,28 @@
//
// $Id: StatusPanel.java,v 1.1 2001/08/07 18:29:18 shaper Exp $
package com.threerings.miso.viewer;
import java.awt.*;
import javax.swing.*;
import com.threerings.miso.Log;
public class StatusPanel extends JPanel
{
public void paintComponent (Graphics g)
{
super.paintComponent(g);
g.setColor(Color.yellow);
Rectangle bounds = getBounds();
g.fillRect(0, 0, bounds.width, bounds.height);
Log.info("status panel [bounds=" + bounds + "].");
}
public Dimension getPreferredSize ()
{
return new Dimension(200, 150);
}
}
@@ -1,5 +1,5 @@
//
// $Id: ViewerFrame.java,v 1.8 2001/08/06 18:57:39 shaper Exp $
// $Id: ViewerFrame.java,v 1.9 2001/08/07 18:29:18 shaper Exp $
package com.threerings.miso.viewer;
@@ -55,9 +55,24 @@ class ViewerFrame extends JFrame implements WindowListener
// set up the scene view panel with a default scene
ViewerSceneViewPanel svpanel =
new ViewerSceneViewPanel(_ctx, spritemgr, sprite);
top.add(svpanel);
top.add(svpanel, GroupLayout.FIXED);
// add the scene view panel
// create a sub-panel to hold the side panels
JPanel sub = new JPanel();
gl = new VGroupLayout(GroupLayout.STRETCH);
gl.setOffAxisPolicy(GroupLayout.STRETCH);
gl.setJustification(GroupLayout.TOP);
sub.setLayout(gl);
// add the various side-panels
sub.add(new StatusPanel(), GroupLayout.FIXED);
sub.add(new ManagementPanel());
sub.add(new ChatPanel());
// add the sub-panel to the main panel
top.add(sub);
// add the main panel to the frame
getContentPane().add(top, BorderLayout.CENTER);
}
@@ -1,5 +1,5 @@
//
// $Id: ViewerSceneViewPanel.java,v 1.2 2001/08/06 18:57:39 shaper Exp $
// $Id: ViewerSceneViewPanel.java,v 1.3 2001/08/07 18:29:18 shaper Exp $
package com.threerings.miso.viewer;
@@ -39,6 +39,10 @@ public class ViewerSceneViewPanel extends SceneViewPanel
// load up the initial scene
prepareStartingScene();
((EditableSceneView)_view).setShowCoordinates(true);
PerformanceMonitor.register(this, "paint", 1000);
}
/**
@@ -63,6 +67,12 @@ public class ViewerSceneViewPanel extends SceneViewPanel
}
}
public void paintComponent (Graphics g)
{
super.paintComponent(g);
PerformanceMonitor.tick(this, "paint");
}
public void checkpoint (String name, int ticks)
{
Log.info(name + " [ticks=" + ticks + "].");