public class VirtualSpaceManager extends Object implements AWTEventListener
Modifier and Type | Field and Description |
---|---|
protected int |
activeViewIndex |
static short |
ALL_GLYPHS
Select all glyphs in the region.
|
protected View[] |
allViews
All views managed by this VSM
|
protected Hashtable<String,VirtualSpace> |
allVirtualSpaces
key is space name (String)
|
static VirtualSpaceManager |
INSTANCE |
protected Hashtable<String,Integer> |
name2viewIndex
used to quickly retrieve a view by its name (gives its index position in the list of views)
|
static short |
SENSITIVE_GLYPHS
Select only glyphs that are sensitive to the cursor.
|
static short |
VIS_AND_SENS_GLYPHS
Select only glyphs that are visible and sensitive to the cursor.
|
static short |
VISIBLE_GLYPHS
Select only glyphs that are visible.
|
Modifier and Type | Method and Description |
---|---|
EView |
addFrameView(List<Camera> c,
String name,
String viewType,
int w,
int h,
boolean visible)
Create a new External View.
|
EView |
addFrameView(List<Camera> c,
String name,
String viewType,
int w,
int h,
boolean bar,
boolean visible,
boolean decorated,
JMenuBar mnb)
Create a new external view.
The use of OPENGL_VIEW requires the following Java property: -Dsun.java2d.opengl=true |
PView |
addPanelView(List<Camera> c,
String name,
String viewType,
int w,
int h)
Create a new view embedded in a JPanel, suitable for inclusion in any Swing component hierarchy, including a JApplet.
|
Portal |
addPortal(Portal p,
View v)
Add a portal to a View.
|
protected void |
addView(View v)
Adds a newly created view to the list of existing views
Side-effect: attempts to start the animation manager
|
VirtualSpace |
addVirtualSpace(String name)
Create a new virtual space.
|
static boolean |
debugModeON()
get debug mode state (ON or OFF)
|
void |
destroyPortal(Portal p)
Destroy a portal (remove it from the View).
|
protected void |
destroyView(int i)
Destroy a View identified by its index in the list of views.
|
protected void |
destroyView(String viewName)
Destroy a view.
|
protected void |
destroyView(View v)
Destroy a view.
|
void |
destroyVirtualSpace(String name)
Destroy a virtual space.
|
void |
destroyVirtualSpace(VirtualSpace vs)
Destroy a virtual space.
|
void |
eventDispatched(AWTEvent e) |
Camera |
getActiveCamera()
Get active camera (in focused view).
|
VirtualSpace |
getActiveSpace()
Get active virtual space, i.e., the space owning the camera currently active.
|
View |
getActiveView()
Get currently active view.
|
AnimationManager |
getAnimationManager()
Returns a reference to the AnimationManager associated
with this VirtualSpaceManager.
|
boolean |
getDefaultDetectMultiFills()
Tells whether detection of multiple full fills in one view repaint for this View is enabled or disabled.
|
VirtualSpace |
getOwningSpace(Glyph g)
Get the virtual space owning Glyph g.
|
View |
getView(String n)
Get View whose name is n.
|
protected int |
getViewIndex(String n)
Get index of View whose name is n (-1 if view does not exist) .
|
VirtualSpace |
getVirtualSpace(String n)
Get virtual space named n.
|
List<VirtualSpace> |
getVirtualSpaces()
Get all virtual spaces.
|
void |
onMainFontUpdated()
Called by VText to update default font.
|
void |
repaint()
Ask for all Views to be repainted.
|
void |
repaint(View v)
Ask for View v to be repainted.
|
void |
repaint(View v,
RepaintListener rl)
Ask for View v to be repainted.
|
void |
setActiveView(View v)
Manually set what view is active.
|
static void |
setDebug(boolean b)
set debug mode ON or OFF
|
void |
setDefaultDetectMultiFills(boolean b)
Enable/disable detection of multiple full fills in one view repaint for this View.
|
protected void |
updateViewIndex()
Update mapping between view name and view index in the list of views when
complex changes are made to the list of views (like removing a view).
|
public static short VIS_AND_SENS_GLYPHS
public static short VISIBLE_GLYPHS
public static short SENSITIVE_GLYPHS
public static short ALL_GLYPHS
protected Hashtable<String,VirtualSpace> allVirtualSpaces
protected View[] allViews
protected Hashtable<String,Integer> name2viewIndex
protected int activeViewIndex
public static final VirtualSpaceManager INSTANCE
public void onMainFontUpdated()
public static void setDebug(boolean b)
public static boolean debugModeON()
public AnimationManager getAnimationManager()
public void setDefaultDetectMultiFills(boolean b)
getDefaultDetectMultiFills()
public boolean getDefaultDetectMultiFills()
setDefaultDetectMultiFills(boolean b)
public void eventDispatched(AWTEvent e)
eventDispatched
in interface AWTEventListener
public void setActiveView(View v)
public View getActiveView()
public Camera getActiveCamera()
public Portal addPortal(Portal p, View v)
p
- Portal to be addedv
- owning Viewpublic void destroyPortal(Portal p)
public EView addFrameView(List<Camera> c, String name, String viewType, int w, int h, boolean visible)
c
- vector of cameras making this view (if more than one camera, cameras will be superimposed on different layers)name
- view name - pass View.ANONYMOUS to generate a unique, random name.viewType
- one of View.STD_VIEW, View.OPENGL_VIEW - determines the type of view and acceleration method.The use of OPENGL_VIEW requires the following Java property: -Dsun.java2d.opengl=truew
- width of window in pixelsh
- height of window in pixelsvisible
- should the view be made visible automatically or notaddFrameView(List c, String name, String viewType, int w, int h, boolean bar, boolean visible, boolean decorated, JMenuBar mnb)
public EView addFrameView(List<Camera> c, String name, String viewType, int w, int h, boolean bar, boolean visible, boolean decorated, JMenuBar mnb)
c
- vector of cameras making this view (if more than one camera, cameras will be superimposed on different layers)name
- view name - pass View.ANONYMOUS to generate a unique, random name.viewType
- one of View.STD_VIEW, View.OPENGL_VIEW - determines the type of view and acceleration methodw
- width of window in pixelsh
- height of window in pixelsbar
- true -> add a status bar to this view (below main panel)visible
- should the view be made visible automatically or notdecorated
- should the view be decorated with the underlying window manager's window frame or notmnb
- a menu bar (null if none), already configured with ActionListeners already attached to items (it is just added to the view)addFrameView(List c, String name, String viewType, int w, int h, boolean visible)
public PView addPanelView(List<Camera> c, String name, String viewType, int w, int h)
c
- vector of cameras superimposed in this viewname
- view name - pass View.ANONYMOUS to generate a unique, random name.viewType
- one of View.STD_VIEW, View.OPENGL_VIEW - determines the type of view and acceleration method.The use of OPENGL_VIEW requires the following Java property: -Dsun.java2d.opengl=truew
- width of window in pixelsh
- height of window in pixelsprotected void addView(View v)
protected int getViewIndex(String n)
protected void destroyView(int i)
protected void updateViewIndex()
protected void destroyView(View v)
protected void destroyView(String viewName)
public void repaint()
public void repaint(View v)
repaint()
,
repaint(View v, RepaintListener rl)
public void repaint(View v, RepaintListener rl)
v
- the view to repaintrl
- a repaint listener to be notified when this repaint cycle is completed (it must be removed manually if you are not interested in being notified about following repaint cycles)repaint(View v)
,
View.removeRepaintListener()
public VirtualSpace addVirtualSpace(String name)
name
- name of this virtual space. Pass VirtualSpace.ANONYMOUS to generate a name randomly (guaranteed to be unique).public void destroyVirtualSpace(String name)
name
- name of this virtual spacepublic void destroyVirtualSpace(VirtualSpace vs)
vs
- virtual space to destroypublic VirtualSpace getOwningSpace(Glyph g)
public VirtualSpace getVirtualSpace(String n)
public List<VirtualSpace> getVirtualSpaces()
public VirtualSpace getActiveSpace()
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.