public class CameraPortal extends Portal
Modifier and Type | Field and Description |
---|---|
protected float |
borderWidth
For internal use.
|
protected float |
halfBorderWidth
For internal use.
|
protected BasicStroke |
stroke
For internal use.
|
Constructor and Description |
---|
CameraPortal(int x,
int y,
int w,
int h,
Camera cam)
Builds a new portal displaying what is seen through a camera
|
CameraPortal(int x,
int y,
int w,
int h,
Camera[] cams,
float a)
Builds a new possibly translucent portal displaying what is seen through a camera
|
CameraPortal(int x,
int y,
int w,
int h,
Camera cam,
float a)
Builds a new possibly translucent portal displaying what is seen through a camera
|
Modifier and Type | Method and Description |
---|---|
Location |
centerOnRegion(double x1,
double y1,
double x2,
double y2)
Get the location from which this portal's camera will focus on a specific rectangular region.
|
Location |
centerOnRegion(double x1,
double y1,
double x2,
double y2,
Camera c)
Get the location from which this portal's camera will focus on a specific rectangular region.
|
Location |
centerOnRegion(int d,
double x1,
double y1,
double x2,
double y2)
Translates and (un)zooms this portal's camera in order to focus on a specific rectangular region
|
Location |
centerOnRegion(int d,
double x1,
double y1,
double x2,
double y2,
Camera c)
Translates and (un)zooms this portal's camera in order to focus on a specific rectangular region
|
boolean |
coordInside(int cx,
int cy)
detects whether the given point is inside this portal or not
|
boolean |
coordInsideBorder(int cx,
int cy) |
Color |
getBackgroundColor()
Get the color used to fill the background.
|
Color |
getBorder()
Get the color used to draw the border delimiting this portal.
|
float |
getBorderWidth()
get the border width of the portal
|
Camera |
getCamera()
Get the main camera (at index 0).
|
Camera[] |
getCameras()
Get all cameras through which this portal is observing.
|
Location |
getGlobalView()
Get the location from which the Camera in this Portal will see all glyphs visible in the associated virtual space.
|
Location |
getGlobalView(Camera c)
Get the location from which a Camera in this Portal will see all glyphs visible in the associated virtual space.
|
Location |
getGlobalView(int d)
Translates and (un)zooms this portal's camera in order to see everything visible in the associated virtual space.
|
Location |
getGlobalView(int d,
Camera c)
Translates and (un)zooms this portal's camera in order to see everything visible in the associated virtual space.
|
Picker |
getPicker()
Get picker associated with this camera portal.
|
Location |
getSeamlessView(Camera contextCam)
Position one of this portal's cameras so that it seamlessly integrates with the surrounding context.
|
float |
getTranslucencyValue()
Get alpha channel value (translucency).
|
double[] |
getVisibleRegion()
Get bounds of rectangular region of the VirtualSpace seen through this camera portal.
|
double[] |
getVisibleRegion(double[] res)
Get bounds of rectangular region of the VirtualSpace seen through this camera portal.
|
double[] |
getVisibleRegion(double[] res,
Camera c)
Get bounds of rectangular region of the VirtualSpace seen through this camera portal.
|
Point2D.Double |
getVSCoordinates(int cx,
int cy)
Get the (unprojected) coordinates of point (jpx,jpy) in the virtual space
to which the first camera associated with this portal belongs.
|
Point2D.Double |
getVSCoordinates(int cx,
int cy,
Camera c)
Get the (unprojected) coordinates of point (jpx,jpy) in the virtual space
to which the indicated camera associated with this portal belongs.
|
void |
paint(Graphics2D g2d,
int viewWidth,
int viewHeight) |
void |
pick(int cx,
int cy) |
void |
setBackgroundColor(Color bc)
Fill background with a color.
|
void |
setBorder(Color bc)
Draw a border delimiting the portal.
|
void |
setBorderWidth(float bw)
Set the border width of the portal (use SetBorder to draw the border)
|
void |
setOwningView(View v)
CALLED INTERNALLY - NOT FOR PUBLIC USE
|
void |
setTranslucencyValue(float alpha)
Set alpha channel value (translucency).
|
cursorInOut, getDimensions, getDistanceFromBorders, getOwningView, getPortalListener, isVisible, move, moveTo, resize, setPortalListener, setVisible, sizeTo, updateDimensions
protected BasicStroke stroke
protected float halfBorderWidth
protected float borderWidth
public CameraPortal(int x, int y, int w, int h, Camera cam)
x
- top-left horizontal coordinate of portal, in parent's JPanel coordinatesy
- top-left vertical coordinate of portal, in parent's JPanel coordinatesw
- portal widthh
- portal heightcam
- camera associated with the portalpublic CameraPortal(int x, int y, int w, int h, Camera cam, float a)
x
- top-left horizontal coordinate of portal, in parent's JPanel coordinatesy
- top-left vertical coordinate of portal, in parent's JPanel coordinatesw
- portal widthh
- portal heightcam
- camera associated with the portala
- alpha channel value (translucency). alpha ranges between 0.0 (fully transparent) and 1.0 (fully opaque)public CameraPortal(int x, int y, int w, int h, Camera[] cams, float a)
x
- top-left horizontal coordinate of portal, in parent's JPanel coordinatesy
- top-left vertical coordinate of portal, in parent's JPanel coordinatesw
- portal widthh
- portal heightcams
- cameras associated with the portala
- alpha channel value (translucency). alpha ranges between 0.0 (fully transparent) and 1.0 (fully opaque)public void setTranslucencyValue(float alpha)
alpha
- in [0;1.0]. 0 is fully transparent, 1 is opaquepublic float getTranslucencyValue()
public Camera getCamera()
public Camera[] getCameras()
public Picker getPicker()
public void setOwningView(View v)
setOwningView
in class Portal
public void setBorder(Color bc)
bc
- color of the portal's border (pass null if none)public Color getBorder()
public void setBorderWidth(float bw)
bw
- portal border widthpublic float getBorderWidth()
public void setBackgroundColor(Color bc)
bc
- color of the border (pass null if none)public Color getBackgroundColor()
public Point2D.Double getVSCoordinates(int cx, int cy)
cx
- cursor x-coordinate (JPanel coordinates system)cy
- cursor y-coordinate (JPanel coordinates system)public Point2D.Double getVSCoordinates(int cx, int cy, Camera c)
cx
- cursor x-coordinate (JPanel coordinates system)cy
- cursor y-coordinate (JPanel coordinates system)c
- camera to be consideredpublic double[] getVisibleRegion(double[] res, Camera c)
res
- array which will contain the resultc
- camera to be consideredpublic double[] getVisibleRegion(double[] res)
res
- array which will contain the resultpublic double[] getVisibleRegion()
public Location getGlobalView(Camera c)
public Location getGlobalView()
public Location getGlobalView(int d)
d
- duration of the animation in mspublic Location getGlobalView(int d, Camera c)
d
- duration of the animation in mspublic Location getSeamlessView(Camera contextCam)
contextCam
- camera observing the context (associated with the View containing the portal)public Location centerOnRegion(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 Location centerOnRegion(double x1, double y1, double x2, double y2, Camera c)
x1
- x coord of first pointy1
- y coord of first pointx2
- x coord of opposite pointy2
- y coord of opposite pointc
- camera to be consideredpublic Location centerOnRegion(int d, double x1, double y1, double x2, double y2)
d
- duration of the animation in ms (pass 0 to go there instantanesouly)x1
- x coord of first pointy1
- y coord of first pointx2
- x coord of opposite pointy2
- y coord of opposite pointpublic Location centerOnRegion(int d, double x1, double y1, double x2, double y2, Camera c)
d
- duration of the animation in ms (pass 0 to go there instantanesouly)x1
- x coord of first pointy1
- y coord of first pointx2
- x coord of opposite pointy2
- y coord of opposite pointpublic boolean coordInside(int cx, int cy)
Portal
coordInside
in class Portal
cx
- cursor x-coordinate (JPanel coordinates system)cy
- cursor y-coordinate (JPanel coordinates system)public boolean coordInsideBorder(int cx, int cy)
public void paint(Graphics2D g2d, int viewWidth, int viewHeight)
public void pick(int cx, int cy)
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.