public class SceneBuilder extends Object
SceneManager.getSceneBuilder()
Modifier and Type | Method and Description |
---|---|
ClosedShapeDescription |
createClosedShapeDescription(ClosedShape g,
String id,
int zindex,
Region region,
boolean sensitivity) |
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,
String[] tags,
short[] transitions,
short requestOrdering)
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) |
static URL |
getAbsoluteURL(String src,
File sceneFileDir) |
static int |
getFontStyle(String style) |
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.
|
protected static Object |
parseInterpolation(String im) |
static Point2D.Double[] |
parseVertexCoordinates(String s,
Point2D.Double orig) |
static Document |
parseXML(File f) |
Region |
processRegion(Element regionEL,
HashMap<String,String> rn2crn,
File sceneFileDirectory) |
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 _tags
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 String TAG_SEPARATOR
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 altitudepublic Region createRegion(double x, double y, double w, double h, int highestLevel, int lowestLevel, String id, String title, String[] tags, short[] transitions, short requestOrdering)
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)tags
- tags associated with region (can be used to filter regions in SceneObservers)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}.Region.setContainingRegion(Region r)
,
Region.addContainedRegion(Region r)
public Region processRegion(Element regionEL, HashMap<String,String> rn2crn, File sceneFileDirectory)
public void destroyRegionsAtLevel(int l)
l
- level indexpublic void destroyRegion(Region r)
r
- region to be destroyedpublic 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-indexresourceURL
- 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 resourcepublic 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-indexw
- 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 scenepublic 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 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)
Copyright © 2000-2002 Xerox Corporation. All Rights Reserved
Copyright © 2003 World Wide Web Consortium. All Rights Reserved
Copyright © 2004-2015 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.