public class VirtualSpace extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ANONYMOUS
Anonymous virtual space.
|
Modifier and Type | Method and Description |
---|---|
void |
above(Glyph g1,
Glyph g2)
Put glyph g1 just above glyph g2 in the drawing list (g1 painted after g2).
|
Camera |
addCamera()
Add a new camera to this virtual space.
|
void |
addGlyph(Glyph g)
Add glyph g to this virtual space.
|
void |
addGlyph(Glyph g,
boolean repaint)
Add glyph g to this virtual space.
|
void |
addGlyph(Glyph g,
boolean initColors,
boolean repaint)
Add glyph g to this virtual space.
|
void |
addGlyphs(Glyph[] glyphs)
Add a list of glyphs to this virtual space.
|
void |
addGlyphs(Glyph[] glyphs,
boolean repaint)
Add a list of glyphs to this virtual space.
|
protected void |
addGlyphsToDrawingList(Glyph[] glyphs) |
protected void |
addGlyphToDrawingList(Glyph g) |
void |
atBottom(Glyph g)
Put this glyph at bottom of the drawing list (will be drawn first).
|
void |
atBottom(Glyph g,
int z)
Put this glyph before the first glyph that has z-index z, but after any glyph that has a z-index lower than z (if any).
|
void |
below(Glyph g1,
Glyph g2)
Put glyph g1 just below glyph g2 in the drawing list (g1 painted before g2).
|
boolean |
contains(Glyph g)
Tests whether a glyph belongs to this virtual space or not.
|
protected void |
destroy()
Destroy this virtual space.
|
void |
drewGlyph(Glyph gl,
int cameraIndex) |
double[] |
findFarmostGlyphCoords()
Get the bounding box of all glyphs visible in this virtual space.
|
double[] |
findFarmostGlyphCoords(double[] res)
Get the bounding box of all glyphs visible in this virtual space.
|
double[] |
findFarmostGlyphCoords(Glyph[] gl,
double[] res)
Get the bounding box of a set of glyphs visible in this virtual space.
|
Vector<Glyph> |
getAllGlyphs()
Get all glyphs in this virtual space, visible or not, sensitive or not.
|
Camera |
getCamera(int i)
Get the i-th camera added to this virtual space.
|
Camera[] |
getCameraListAsArray()
Get a list of all cameras in this virtual space.
|
Glyph[] |
getDrawingList()
Get all visible glyphs (not cloned).
|
Vector<Glyph> |
getDrawnGlyphs(int cameraIndex)
Get all glyphs actually drawn for a given camera in this virtual space.
|
static Point2D.Double |
getGlyphSetGeometricalCenter(Glyph[] gl)
Compute the geometrical center of a set of glyphs (takes glyph sizes into account)
|
Glyph[] |
getGlyphsInRegion(double x1,
double y1,
double x2,
double y2)
Get glyphs whose hotspot is in region delimited by rectangle (x1,y1,x2,y2) in this VirtualSpace.
|
Vector<Glyph> |
getGlyphsOfType(String t)
get all glyphs of type t - if t=="" then select all glyphs (means ANY type)
|
String |
getName()
Get name of this virtual space.
|
Vector<Glyph> |
getSelectedGlyphs()
Get selected glyphs.
|
Glyph[] |
getVisibleGlyphsList()
Get all visible glyphs (clone).
|
protected int |
glyphIndexInDrawingList(Glyph g) |
void |
hide(Glyph g)
hide Glyph g
- use show() and hide() to change both the visibility and sensitivity of glyphs - use Glyph.setVisible() to only change the glyph's visibility, but not its sensitivity. |
protected void |
insertGlyphInDrawingList(Glyph g,
int index) |
void |
onTop(Glyph g)
Put this glyph on top of the drawing list (will be drawn last).
|
void |
onTop(Glyph g,
int z)
Put this glyph after the last glyph that has z-index z, but before any glyph that has a z-index higher than z (if any).
|
boolean |
registerPicker(PickerVS p)
Register an external picker with this view.
|
void |
removeAllGlyphs()
Remove all glyphs from this virtual space.
|
void |
removeAllGlyphs(boolean repaint)
Remove all glyphs from this virtual space.
|
void |
removeCamera(int i)
Rremove camera at index i from this virtual space.
|
void |
removeGlyph(Glyph g)
Remove glyph g from this virtual space.
|
void |
removeGlyph(Glyph g,
boolean repaint)
Remove this glyph from this virtual space.
|
protected void |
removeGlyphFromDrawingList(Glyph g) |
void |
removeGlyphs(Glyph[] gs)
Remove a set of glyphs from this virtual space.
|
void |
removeGlyphs(Glyph[] gs,
boolean repaint)
Remove a set of glyphs from this virtual space.
|
protected void |
removeGlyphsFromDrawingList(Glyph[] glyphs) |
void |
selectAllGlyphs()
Select all glyphs
|
void |
show(Glyph g)
show Glyph g
- use show() and hide() to change both the visibility and sensitivity of glyphs - use Glyph.setVisible() to only change the glyph's visibility, but not its sensitivity. |
boolean |
unregisterPicker(PickerVS p)
Unregister an external picker from this view.
|
void |
unselectAllGlyphs()
unselect all glyphs
|
public static final String ANONYMOUS
public static Point2D.Double getGlyphSetGeometricalCenter(Glyph[] gl)
gl
- a list of Glyph instancespublic String getName()
public Camera getCamera(int i)
public Camera[] getCameraListAsArray()
public Camera addCamera()
public void removeCamera(int i)
i
- index of camera in virtual spaceprotected void destroy()
public void addGlyph(Glyph g, boolean initColors, boolean repaint)
public void addGlyph(Glyph g)
public void addGlyph(Glyph g, boolean repaint)
repaint
- pass false if views should not be repainted as a consequence of this addition (default is true).public void addGlyphs(Glyph[] glyphs, boolean repaint)
repaint
- pass false if views should not be repainted as a consequence of this addition (default is true).public void addGlyphs(Glyph[] glyphs)
public Vector<Glyph> getAllGlyphs()
public boolean contains(Glyph g)
public Glyph[] getDrawingList()
getVisibleGlyphsList()
public Glyph[] getVisibleGlyphsList()
getDrawingList()
public Vector<Glyph> getDrawnGlyphs(int cameraIndex)
public void drewGlyph(Glyph gl, int cameraIndex)
public void selectAllGlyphs()
public void unselectAllGlyphs()
public Vector<Glyph> getGlyphsOfType(String t)
public void removeAllGlyphs()
public void removeAllGlyphs(boolean repaint)
repaint
- true to repaint all views afterwards, false otherwisepublic void removeGlyph(Glyph g)
g
- glyph to be removedremoveGlyph(Glyph g, boolean repaint)
,
removeGlyphs(Glyph[] gs)
,
removeGlyphs(Glyph[] gs, boolean repaint)
public void removeGlyph(Glyph g, boolean repaint)
g
- glyph to be removedrepaint
- should the view be updated automatically or not once the glyph has been removed. Default is true.removeGlyphs(Glyph[] gs, boolean repaint)
,
removeGlyphs(Glyph[] gs)
,
removeGlyph(Glyph g)
public void removeGlyphs(Glyph[] gs, boolean repaint)
gs
- glyphs to be removedrepaint
- should the view be updated automatically or not once the glyphs have been removed. Default is true.removeGlyph(Glyph g, boolean repaint)
,
removeGlyph(Glyph g)
,
removeGlyphs(Glyph[] gs)
public void removeGlyphs(Glyph[] gs)
gs
- glyphs to be removedremoveGlyph(Glyph g, boolean repaint)
,
removeGlyph(Glyph g)
,
removeGlyphs(Glyph[] gs, boolean repaint)
public void show(Glyph g)
hide(Glyph g)
public void hide(Glyph g)
show(Glyph g)
public void onTop(Glyph g)
public void atBottom(Glyph g)
public void onTop(Glyph g, int z)
z
- the considered z-indexpublic void atBottom(Glyph g, int z)
z
- the considered z-indexpublic void above(Glyph g1, Glyph g2)
public void below(Glyph g1, Glyph g2)
public Glyph[] getGlyphsInRegion(double x1, double y1, double x2, double y2)
x1
- x coord of first pointy1
- y coord of first pointx2
- x coord of opposite pointy2
- y coord of opposite pointpublic double[] findFarmostGlyphCoords()
public double[] findFarmostGlyphCoords(double[] res)
res
- array which will contain the resultpublic double[] findFarmostGlyphCoords(Glyph[] gl, double[] res)
gl
- list of glyphs to iterate upon (will typically be a subset of all glyphs in the virtual space)res
- array which will contain the resultpublic boolean registerPicker(PickerVS p)
public boolean unregisterPicker(PickerVS p)
protected void addGlyphToDrawingList(Glyph g)
protected void addGlyphsToDrawingList(Glyph[] glyphs)
protected void insertGlyphInDrawingList(Glyph g, int index)
protected void removeGlyphFromDrawingList(Glyph g)
protected void removeGlyphsFromDrawingList(Glyph[] glyphs)
protected int glyphIndexInDrawingList(Glyph g)
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.