Files
narya/src/java/com/threerings/miso/client/SceneView.java
T
Michael Bayne e6796b2d55 The amazing revamp four hundred billion. Let's see:
- Reworked colorization repository such that we now have arbitrary named
  "colorization classes" which can be used by various and sundry entities
  to colorize themselves.

- Added support for individual object colorizations as well as "spots"
  that go along with objects (will be used to automatically create portals
  into buildings and automatically position users properly when at a
  "station").

- Repackaged things in miso to more closely mimic what we do everywhere
  else (no more miso.scene, now we have miso.data and miso.client).

- Fixed up miso scene XML representation so that objects can more easily
  be expanded to have yet more stuff if we think of more stuff that they
  might aught to have in the future. Structured the miso scene model so
  that "uninteresting" objects (those that simply sit somewhere and don't
  do anything) take up a lot less memory than "interesting" objects (those
  that have action strings, "spots", colorizations and the works). I may
  want to roll colorizations into the "uninteresting" realm, but that
  remains to be seen.

- Made it possible for object tilesets to specify default render
  priorities for objects in that tileset. This will hopefully allow us to
  get by without any "custom" render priorities that are specified on
  scene objects, instead relying on the default priorities to resolve
  common conflicts.

There are surely other cleanups in there, but I think that was the major
thrust of it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2228 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-31 23:10:46 +00:00

88 lines
2.5 KiB
Java

//
// $Id: SceneView.java,v 1.33 2003/01/31 23:10:45 mdb Exp $
package com.threerings.miso.client;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import com.threerings.media.sprite.Sprite;
import com.threerings.media.util.Path;
/**
* The scene view interface provides an interface to be implemented by
* classes that provide a view of a given scene by drawing the scene
* contents onto a particular GUI component.
*/
public interface SceneView
{
/**
* Renders an invalid porition of the scene to the given graphics
* context.
*
* @param gfx the graphics context.
* @param invalidRect the invalid region to be repainted.
*/
public void paint (Graphics2D gfx, Rectangle invalidRect);
/**
* Sets the scene that we're rendering.
*
* @param scene the scene to render in the view.
*/
public void setScene (DisplayMisoScene scene);
/**
* Returns the scene being rendered.
*/
public DisplayMisoScene getScene ();
/**
* Returns a {@link Path} object detailing a valid path for the
* given sprite to take in the scene to get from its current
* position to the destination position.
*
* @param sprite the sprite to move.
* @param x the destination x-position in pixel coordinates.
* @param y the destination y-position in pixel coordinates.
*
* @return the sprite's path, or null if no valid path exists.
*/
public Path getPath (Sprite sprite, int x, int y);
/**
* Returns screen coordinates given the specified full coordinates.
*/
public Point getScreenCoords (int x, int y);
/**
* Returns full coordinates given the specified screen coordinates.
*/
public Point getFullCoords (int x, int y);
/**
* Must be called by the containing panel when the mouse moves over
* the view.
*
* @return true if a repaint is required, false if not.
*/
public boolean mouseMoved (MouseEvent e);
/**
* Must be called by the containing panel when the mouse exits the
* view.
*/
public void mouseExited (MouseEvent e);
/**
* Returns information about the object over which the mouse is
* currently hovering (either a {@link DisplayObjectInfo} or a {@link
* Sprite}), or null if the mouse is not hovering over anything of
* interest.
*/
public Object getHoverObject ();
}