|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.inria.zuist.engine.SceneManager
public class SceneManager
Multi-scale scene manager: main ZUIST class instantiated by client application. Used to parse XML descriptions of multi-scale scene configurations and manage them once instantiated.
| Constructor Summary | |
|---|---|
SceneManager(VirtualSpace[] vss,
Camera[] cs)
Scene Manager: Main ZUIST class instantiated by client application. |
|
| Method Summary | |
|---|---|
void |
cameraMoved(Camera cam,
Point2D.Double loc,
double alt)
Called back when a Camera is moved. |
ClosedShapeDescription |
createClosedShapeDescription(ClosedShape g,
String id,
int zindex,
Region region,
boolean sensitivity)
|
fr.inria.zuist.engine.GlyphDescription |
createGlyphDescription(Glyph g,
String id,
int zindex,
Region region,
boolean sensitivity)
|
ImageDescription |
createImageDescription(double x,
double y,
double w,
double h,
String id,
int zindex,
Region region,
URL imageURL,
boolean sensitivity,
Color stroke,
float alpha,
String params)
Creates an image and adds it to a region. |
Level |
createLevel(int depth,
double calt,
double falt)
Create a new level in the scene. |
Region |
createRegion(double x,
double y,
double w,
double h,
int highestLevel,
int lowestLevel,
String id,
String title,
int li,
short[] transitions,
short requestOrdering,
boolean sensitivity,
Color fill,
Color stroke)
Create a new region. |
ResourceDescription |
createResourceDescription(double x,
double y,
String id,
int zindex,
Region region,
URL resourceURL,
String type,
boolean sensitivity,
Color stroke,
String params)
Creates a resource and adds it to a region. |
SceneFragmentDescription |
createSceneFragmentDescription(double x,
double y,
String id,
Region region,
URL resourceURL)
|
TextDescription |
createTextDescription(double x,
double y,
String id,
int zindex,
Region region,
float scale,
String text,
short anchor,
Color fill,
float alpha,
String family,
int style,
int size,
boolean sensitivity)
Creates a text object and adds it to a region. |
void |
destroyRegion(Region r)
Destroy a region. |
void |
destroyRegionsAtLevel(int l)
Destroy all regions at a given level. |
void |
destroySceneFragment(SceneFragmentDescription sd)
|
void |
enableRegionUpdater(boolean b)
|
double[] |
findFarmostRegionCoords()
Get the bounding box of all regions in this scene. |
static URL |
getAbsoluteURL(String src,
File sceneFileDir)
|
Region |
getClosestRegionAtCurrentLevel(Point2D.Double lp)
Get region whose center is closest to a given location at the current level. |
int |
getCurrentLevel()
Get the current level. |
static boolean |
getDebugMode()
|
static int |
getFontStyle(String style)
|
double[] |
getGlobalView(Camera c,
int d,
EndAction ea)
Get a global view of the scene. |
Level |
getLevel(int index)
Get a level. |
int |
getLevelCount()
Get the total number of levels in the scene. |
LevelListener |
getLevelListener()
|
ObjectDescription |
getObject(String id)
Get an object knowing its ID. |
int |
getObjectCount()
Get the total number of objects (at any level and in any region) in the scene. |
Collection<ObjectDescription> |
getObjectDescriptions()
Gets an unmodifiable view of every ObjectDescription known to this SceneManager |
Enumeration |
getObjectIDs()
Get a list of all object IDs, at any level and in any region. |
ObjectListener |
getObjectListener()
|
Point2D.Double |
getOrigin()
Is set to something else than 0,0 when translating a scene to another location than that defined originally. |
int |
getPendingRequestQueueSize()
|
Region |
getRegion(String id)
Get a region knowing its ID. |
int |
getRegionCount()
Get the total number of regions (at any level) in the scene. |
Enumeration |
getRegionIDs()
|
RegionListener |
getRegionListener()
|
Region[] |
getRegionsAtLevel(int level)
Get all regions that belong to a given level. |
ResourceHandler |
getResourceHandler(String rType)
Get the class handling a given type of resource. |
HashMap |
getSceneAttributes()
|
VirtualSpace |
getSpaceByIndex(int layerIndex)
|
Region[] |
loadScene(Document scene,
File sceneFileDirectory,
boolean reset)
Load a multi-scale scene configuration described in an XML document. |
Region[] |
loadScene(Document scene,
File sceneFileDirectory,
boolean reset,
ProgressListener pl)
Load a multi-scale scene configuration described in an XML document. |
void |
objectCreated(ObjectDescription od)
For internal use. |
void |
objectDestroyed(ObjectDescription od)
For internal use. |
protected static Object |
parseInterpolation(String im)
|
static Point2D.Double[] |
parseVertexCoordinates(String s,
Point2D.Double orig)
|
static Document |
parseXML(File f)
|
void |
reset()
|
static void |
setDebugMode(boolean b)
|
void |
setFadeInDuration(int d)
|
void |
setFadeOutDuration(int d)
|
void |
setLevelListener(LevelListener ll)
|
void |
setObjectListener(ObjectListener ol)
|
void |
setOrigin(Point2D.Double p)
Set to something else than 0,0 to translate a scene to another location than that defined originally. |
void |
setRegionListener(RegionListener rl)
|
void |
setRegionUpdatePeriod(int period)
Sets the RegionUpdater period. |
void |
setResourceHandler(String rType,
ResourceHandler rh)
Declare a ResourceHandler for a given type of resource. |
void |
setUpdateLevel(boolean b)
Enable/disable level updating. |
void |
shutdown()
Shuts down this SceneManager. |
void |
updateVisibleRegions()
Update visible regions for all cameras. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String _none
public static final String _level
public static final String _region
public static final String _object
public static final String _id
public static final String _title
public static final String _containedIn
public static final String _resource
public static final String _type
public static final String _text
public static final String _rect
public static final String _polygon
public static final String _include
public static final String _x
public static final String _y
public static final String _w
public static final String _h
public static final String _points
public static final String _alpha
public static final String _fill
public static final String _stroke
public static final String _background
public static final String _scale
public static final String _src
public static final String _onClick
public static final String _focusOnObject
public static final String _tful
public static final String _tfll
public static final String _ttul
public static final String _ttll
public static final String _appear
public static final String _diappear
public static final String _fadein
public static final String _fadeout
public static final String _levels
public static final String _depth
public static final String _ceiling
public static final String _floor
public static final String _ro
public static final String _takesToR
public static final String _takesToO
public static final String _sensitive
public static final String _anchor
public static final String _layer
public static final String _zindex
public static final String _params
public static final String _im
public static final String _nearestNeighbor
public static final String _bilinear
public static final String _bicubic
public static final String _fontFamily
public static final String _fontStyle
public static final String _fontSize
public static final String _plain
public static final String _italic
public static final String _bold
public static final String _boldItalic
public static final String PARAM_SEPARATOR
public static final String COORD_SEPARATOR
public static final short TAKES_TO_OBJECT
public static final short TAKES_TO_REGION
| Constructor Detail |
|---|
public SceneManager(VirtualSpace[] vss,
Camera[] cs)
vss - virtual spaces in which the scene will be loadedcs - cameras associated to those virtual spaces, through which the scene will be observed| Method Detail |
|---|
public void setRegionUpdatePeriod(int period)
period
milliseconds.
period - the new period, in milliseconds.public void shutdown()
public void setResourceHandler(String rType,
ResourceHandler rh)
rType - type of resource to be handled, e.g., "pdf", "img", ...rh - class implementing ResourceHandler for that type of resourcepublic ResourceHandler getResourceHandler(String rType)
rType - type of resource to handled, e.g., "pdf", "img", ...
public Collection<ObjectDescription> getObjectDescriptions()
public void setOrigin(Point2D.Double p)
public Point2D.Double getOrigin()
public HashMap getSceneAttributes()
public Enumeration getRegionIDs()
public Region getRegion(String id)
public Enumeration getObjectIDs()
public ObjectDescription getObject(String id)
public int getObjectCount()
public int getRegionCount()
public int getLevelCount()
public Level getLevel(int index)
index - index of level.
public Region[] getRegionsAtLevel(int level)
level - index of level.
public void setLevelListener(LevelListener ll)
public LevelListener getLevelListener()
public void setRegionListener(RegionListener rl)
public RegionListener getRegionListener()
public int getPendingRequestQueueSize()
public void setObjectListener(ObjectListener ol)
public ObjectListener getObjectListener()
public void objectCreated(ObjectDescription od)
public void objectDestroyed(ObjectDescription od)
public void reset()
public Region[] loadScene(Document scene,
File sceneFileDirectory,
boolean reset)
scene - XML document (DOM) containing the scene descriptionsceneFileDirectory - absolute or relative (w.r.t exec dir) path to the directory containing that XML file (required only if the scene contains image objects whose location is indicated as relative paths to the bitmap files)reset - reset scene (default is true) ; if false, append regions and objects to existing scene, new levels are ignored (as they would most likely conflict).
public Region[] loadScene(Document scene,
File sceneFileDirectory,
boolean reset,
ProgressListener pl)
scene - XML document (DOM) containing the scene descriptionsceneFileDirectory - absolute or relative (w.r.t exec dir) path to the directory containing that XML file (required only if the scene contains image objects whose location is indicated as relative paths to the bitmap files)reset - reset scene (default is true) ; if false, append regions and objects to existing scene, new levels are ignored (as they would most likely conflict).
public SceneFragmentDescription createSceneFragmentDescription(double x,
double y,
String id,
Region region,
URL resourceURL)
public void destroySceneFragment(SceneFragmentDescription sd)
public Level createLevel(int depth,
double calt,
double falt)
depth - of this level (0 corresponds to the highest level in terms of altitude range)calt - ceiling altitudefalt - floor altitude
public Region createRegion(double x,
double y,
double w,
double h,
int highestLevel,
int lowestLevel,
String id,
String title,
int li,
short[] transitions,
short requestOrdering,
boolean sensitivity,
Color fill,
Color stroke)
x - center of regiony - center of regionw - width of regionh - height of regionhighestLevel - index of highest level in level span for this region (highestLevel <= lowestLevel)lowestLevel - index of lowest level in level span for this region (highestLevel <= lowestLevel)id - region IDtitle - region's title (metadata)li - layer index (information layer/space in which objects will be put)transitions - a 4-element array with values in Region.{FADE_IN, FADE_OUT, APPEAR, DISAPPEAR}, corresponding to
transitions from upper level, from lower level, to upper level, to lower level.requestOrdering - how requests for loading / unloading objects should be ordered when
entering / leaving this region; one of Region.{ORDERING_ARRAY, ORDERING_DISTANCE}.sensitivity - should the rectangle symbolizing the region itself be sensitive to mouse events or not.fill - fill color of the rectangle symbolizing the region itselfstroke - border color of the rectangle symbolizing the region itselfRegion.setContainingRegion(Region r),
Region.addContainedRegion(Region r)public void destroyRegionsAtLevel(int l)
l - level indexpublic void destroyRegion(Region r)
r - region to be destroyed
public ResourceDescription createResourceDescription(double x,
double y,
String id,
int zindex,
Region region,
URL resourceURL,
String type,
boolean sensitivity,
Color stroke,
String params)
id - ID of object in scenex - x-coordinate in sceney - y-coordinate in scenezindex - z-index (layer)resourceURL - path to resource (should be absolute)type - resource type ("img", "pdf", ...)sensitivity - should the object be sensitive to mouse events or not.stroke - border colorregion - parent Region in sceneparams - custom parameters for a given type of resource
public ImageDescription createImageDescription(double x,
double y,
double w,
double h,
String id,
int zindex,
Region region,
URL imageURL,
boolean sensitivity,
Color stroke,
float alpha,
String params)
id - ID of object in scenex - x-coordinate in sceney - y-coordinate in scenezindex - z-index (layer)w - width in sceneh - height in sceneimageURL - path to bitmap resource (should be absolute)stroke - border colorsensitivity - should the object be sensitive to mouse events or not.params - allowed parameters: "im=nearestNeighbor", "im=bilinear", "im=bicubic"region - parent Region in sceneprotected static Object parseInterpolation(String im)
public ClosedShapeDescription createClosedShapeDescription(ClosedShape g,
String id,
int zindex,
Region region,
boolean sensitivity)
g - any ClosedShape. It must implement fr.inria.zvtm.glyphs.Translucent if fade in/out transitions are used in the parent region.
public fr.inria.zuist.engine.GlyphDescription createGlyphDescription(Glyph g,
String id,
int zindex,
Region region,
boolean sensitivity)
public static Point2D.Double[] parseVertexCoordinates(String s,
Point2D.Double orig)
public static int getFontStyle(String style)
public TextDescription createTextDescription(double x,
double y,
String id,
int zindex,
Region region,
float scale,
String text,
short anchor,
Color fill,
float alpha,
String family,
int style,
int size,
boolean sensitivity)
public void enableRegionUpdater(boolean b)
public void setUpdateLevel(boolean b)
updateLevel(int layerIndex, double[] cameraBounds, double altitude)public int getCurrentLevel()
public Region getClosestRegionAtCurrentLevel(Point2D.Double lp)
public void updateVisibleRegions()
public void setFadeInDuration(int d)
public void setFadeOutDuration(int d)
public VirtualSpace getSpaceByIndex(int layerIndex)
public double[] findFarmostRegionCoords()
public double[] getGlobalView(Camera c,
int d,
EndAction ea)
c - camera that should show a global viewd - duration of animation from current location to global viewea - action to be perfomed after camera has reached its new position (can be null)
public static Document parseXML(File f)
public static URL getAbsoluteURL(String src,
File sceneFileDir)
public void cameraMoved(Camera cam,
Point2D.Double loc,
double alt)
CameraListener
cameraMoved in interface CameraListenercam - camera which was movedloc - camera xy coordinates after the movealt - camera altitude after the moveCamera.addListener(fr.inria.zvtm.event.CameraListener),
Camera.removeListener(fr.inria.zvtm.event.CameraListener)public static void setDebugMode(boolean b)
public static boolean getDebugMode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||