Beginnings of support for the scene view to track the object (sprite or
object tile) over which the mouse is hovering. The iso scene view will also support highlighting the object tile over which the mouse is hovering as well as base tile highlighting to make the editor's life easier. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@900 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: SceneViewPanel.java,v 1.25 2002/01/23 17:10:41 shaper Exp $
|
||||
// $Id: SceneViewPanel.java,v 1.26 2002/01/31 01:07:02 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
@@ -7,6 +7,10 @@ import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseMotionAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.samskivert.util.Config;
|
||||
@@ -44,6 +48,28 @@ public class SceneViewPanel extends AnimatedPanel
|
||||
|
||||
// create the scene view
|
||||
_view = newSceneView(_animmgr, spritemgr, _viewmodel);
|
||||
|
||||
// listen to mouse...
|
||||
addMouseListener(new MouseAdapter() {
|
||||
public void mouseExited (MouseEvent e) {
|
||||
_view.mouseExited(e);
|
||||
repaint();
|
||||
}
|
||||
});
|
||||
|
||||
// ...and mouse motion events
|
||||
addMouseMotionListener(new MouseMotionAdapter() {
|
||||
public void mouseMoved (MouseEvent e) {
|
||||
if (_view.mouseMoved(e)) {
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
public void mouseDragged (MouseEvent e) {
|
||||
if (_view.mouseMoved(e)) {
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,7 +83,7 @@ public class SceneViewPanel extends AnimatedPanel
|
||||
/**
|
||||
* Constructs the underlying scene view implementation.
|
||||
*/
|
||||
protected IsoSceneView newSceneView (
|
||||
protected SceneView newSceneView (
|
||||
AnimationManager amgr, SpriteManager smgr, IsoSceneViewModel model)
|
||||
{
|
||||
return new IsoSceneView(amgr, smgr, model);
|
||||
|
||||
Reference in New Issue
Block a user