fr.inria.zvtm.glyphs
Class ZPDFPage

java.lang.Object
  extended by fr.inria.zvtm.glyphs.Glyph
      extended by fr.inria.zvtm.glyphs.ClosedShape
          extended by fr.inria.zvtm.glyphs.ZPDFPage
All Implemented Interfaces:
RectangularShape, Translucent, Cloneable
Direct Known Subclasses:
IcePDFPageImg

public abstract class ZPDFPage
extends ClosedShape
implements RectangularShape

Glyph encapsulating a PDF Page.

Author:
Emmanuel Pietriga

Field Summary
 double ar
          Aspect ratio: width divided by height (read-only).
 fr.inria.zvtm.glyphs.projection.RProjectedCoordsP[] pc
           
 double scaleFactor
           
 boolean zoomSensitive
           
 
Fields inherited from class fr.inria.zvtm.glyphs.ClosedShape
bColor, borderColor, cursorInsideFColor, HSVb
 
Fields inherited from class fr.inria.zvtm.glyphs.Glyph
alphaC, coef, color, cursorInsideColor, ENTERED_GLYPH, EXITED_GLYPH, fColor, HSV, NO_CURSOR_EVENT, orient, sensit, size, stickedTo, stroke, visible, vx, vy, vz
 
Fields inherited from interface fr.inria.zvtm.glyphs.Translucent
acO
 
Constructor Summary
ZPDFPage()
           
 
Method Summary
 void addCamera(int verifIndex)
          Create new projected coordinates.
 boolean coordInside(int jpx, int jpy, int camIndex, double cvx, double cvy)
          Detect whether the given point is inside this glyph or not.
 boolean fillsView(double w, double h, int camIndex)
          Find out if this glyph completely fills a view.
abstract  void flush()
          Flush any resource used.
 double getHeight()
          Get width in virtual space.
 Shape getJava2DShape()
          Get the Java2D Shape corresponding to this Glyph.
 double getOrient()
          Get the glyph's orientation.
 double getSize()
          Get glyph's size (diameter of bounding circle).
 double getWidth()
          Get width in virtual space.
 void highlight(boolean b, Color selectedColor)
          Highlight this glyph to give visual feedback when the cursor is inside it.
 void initCams(int nbCam)
          Initialize projected coordinates.
 boolean isZoomSensitive()
          Indicates whether the image is scaled according to camera's altitude.
 short mouseInOut(int jpx, int jpy, int camIndex, double cvx, double cvy)
          Method used internally for firing picking-related events.
 void orientTo(double angle)
          Set the glyph's absolute orientation.
 void project(Camera c, Dimension d)
          Project glyph w.r.t a given camera's coordinate system, prior to actual painting.
 void projectForLens(Camera c, int lensWidth, int lensHeight, float lensMag, double lensx, double lensy)
          Project glyph w.r.t a given camera's coordinate system, prior to actual painting through a lens.
 void removeCamera(int index)
          Dispose of projected coordinates.
 void resetMouseIn()
          Reset memory of cursor being inside the glyph.
 void resetMouseIn(int i)
          Reset memory of cursor being inside the glyph for projected coordinates associated with camera at index i.
 void reSize(double factor)
          Set glyph's size by multiplying its bounding circle diameter by a factor.
 void setHeight(double h)
          Set height in virtual space.
 void setWidth(double w)
          Set width in virtual space.
 void setZoomSensitive(boolean b)
          Set to false if the image should not be scaled according to camera's altitude.
 void sizeTo(double s)
          Set glyph's size by setting its bounding circle's diameter.
 boolean visibleInDisc(double dvx, double dvy, double dvr, Shape dvs, int camIndex, int jpx, int jpy, int dpr)
          Find out if a glyph is visible in a circular area.
 boolean visibleInRegion(double wb, double nb, double eb, double sb, int i)
          Method used internally to find out if it is necessary to project and draw this glyph for a given camera.
 
Methods inherited from class fr.inria.zvtm.glyphs.ClosedShape
addHSVbColor, getBorderColor, getDefaultBorderColor, getHSVbColor, isBorderDrawn, isFilled, setBorderColor, setCursorInsideFillColor, setDrawBorder, setFilled, setHSVbColor
 
Methods inherited from class fr.inria.zvtm.glyphs.Glyph
addHSVColor, clone, containedInRegion, draw, drawForLens, getBounds, getColor, getDefaultColor, getDefaultCursorInsideHighlightColor, getHSVColor, getLocation, getOwner, getStickedGlyphArray, getStroke, getTranslucencyValue, getType, getZindex, isSelected, isSensitive, isVisible, isVisibleThroughLens, move, moveTo, propagateMove, select, setColor, setCursorInsideHighlightColor, setDefaultCursorInsideHighlightColor, setHSVColor, setOwner, setSensitivity, setStroke, setTranslucencyValue, setType, setVisible, setZindex, stick, stickToGlyph, toString, unstick, unstickAllGlyphs, unstickAllGlyphs, unstickFromGlyph, visibleInViewport
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ar

public double ar
Aspect ratio: width divided by height (read-only).


pc

public fr.inria.zvtm.glyphs.projection.RProjectedCoordsP[] pc

zoomSensitive

public boolean zoomSensitive

scaleFactor

public double scaleFactor
Constructor Detail

ZPDFPage

public ZPDFPage()
Method Detail

initCams

public void initCams(int nbCam)
Description copied from class: Glyph
Initialize projected coordinates. Called internally when glyph is created in order to create the initial set of projected coordinates w.r.t the number of cameras in the virtual space.

Specified by:
initCams in class Glyph
Parameters:
nbCam - current number of cameras in the virtual space
See Also:
Glyph.addCamera(int verifIndex), Glyph.removeCamera(int index)

addCamera

public void addCamera(int verifIndex)
Description copied from class: Glyph
Create new projected coordinates. Called internally to create new projected coordinates to use with the new camera.

Specified by:
addCamera in class Glyph
Parameters:
verifIndex - camera index, just to be sure that the number of projected coordinates is consistent with the number of cameras.
See Also:
Glyph.initCams(int nbCam), Glyph.removeCamera(int index)

removeCamera

public void removeCamera(int index)
Description copied from class: Glyph
Dispose of projected coordinates. If a camera is removed from the virtual space to which this glyphs belongs, the corresponding projected coordinates should be deleted. the array of projected coordinates should not be modified however, because other cameras' index remain the same. The corresponding index in the array should just be set to null.

Specified by:
removeCamera in class Glyph
See Also:
Glyph.initCams(int nbCam), Glyph.addCamera(int verifIndex)

getSize

public double getSize()
Description copied from class: Glyph
Get glyph's size (diameter of bounding circle).

Specified by:
getSize in class Glyph

sizeTo

public void sizeTo(double s)
Description copied from class: Glyph
Set glyph's size by setting its bounding circle's diameter.

Specified by:
sizeTo in class Glyph
See Also:
Glyph.reSize(double factor)

reSize

public void reSize(double factor)
Description copied from class: Glyph
Set glyph's size by multiplying its bounding circle diameter by a factor.

Specified by:
reSize in class Glyph
See Also:
Glyph.sizeTo(double s)

getOrient

public double getOrient()
Description copied from class: Glyph
Get the glyph's orientation.

Specified by:
getOrient in class Glyph

orientTo

public void orientTo(double angle)
Description copied from class: Glyph
Set the glyph's absolute orientation.

Specified by:
orientTo in class Glyph
Parameters:
angle - in [0:2Pi[

highlight

public void highlight(boolean b,
                      Color selectedColor)
Description copied from class: ClosedShape
Highlight this glyph to give visual feedback when the cursor is inside it.

Overrides:
highlight in class ClosedShape

setWidth

public void setWidth(double w)
Description copied from interface: RectangularShape
Set width in virtual space.

Specified by:
setWidth in interface RectangularShape

setHeight

public void setHeight(double h)
Description copied from interface: RectangularShape
Set height in virtual space.

Specified by:
setHeight in interface RectangularShape

getWidth

public double getWidth()
Description copied from interface: RectangularShape
Get width in virtual space.

Specified by:
getWidth in interface RectangularShape

getHeight

public double getHeight()
Description copied from interface: RectangularShape
Get width in virtual space.

Specified by:
getHeight in interface RectangularShape

setZoomSensitive

public void setZoomSensitive(boolean b)
Set to false if the image should not be scaled according to camera's altitude. Its size can still be changed, but its apparent size will always be the same, no matter the camera's altitude.

See Also:
isZoomSensitive()

isZoomSensitive

public boolean isZoomSensitive()
Indicates whether the image is scaled according to camera's altitude.

See Also:
setZoomSensitive(boolean b)

fillsView

public boolean fillsView(double w,
                         double h,
                         int camIndex)
Description copied from class: Glyph
Find out if this glyph completely fills a view. (In which case it is not necessary to repaint objects below it in the drawing stack). If implemented, this method should be very efficient, as it is used by an optional top-down clipping algorithm. Otherwise it might cost more time than it can potentially save. Until now it has only been implemented for non-reorientable rectangles and was activated only for treemap-like representations in which a lot of rectangles can potentially overlap each other.

Specified by:
fillsView in class Glyph

coordInside

public boolean coordInside(int jpx,
                           int jpy,
                           int camIndex,
                           double cvx,
                           double cvy)
Description copied from class: Glyph
Detect whether the given point is inside this glyph or not.

Specified by:
coordInside in class Glyph
Parameters:
jpx - provide projected JPanel coordinates of the associated view, not virtual space coordinates
jpy - provide projected JPanel coordinates of the associated view, not virtual space coordinates
cvx - virtual space coordinates
cvy - virtual space coordinates

visibleInRegion

public boolean visibleInRegion(double wb,
                               double nb,
                               double eb,
                               double sb,
                               int i)
Description copied from class: Glyph
Method used internally to find out if it is necessary to project and draw this glyph for a given camera.

Overrides:
visibleInRegion in class Glyph
Parameters:
wb - west region boundary (virtual space coordinates)
nb - north region boundary (virtual space coordinates)
eb - east region boundary (virtual space coordinates)
sb - south region boundary (virtual space coordinates)
i - camera index (useuful only for some glyph classes redefining this method)
Returns:
true if the glyph is currently visible in the region delimited by wb, nb, eb, sb, symbolising the region seen through a camera

visibleInDisc

public boolean visibleInDisc(double dvx,
                             double dvy,
                             double dvr,
                             Shape dvs,
                             int camIndex,
                             int jpx,
                             int jpy,
                             int dpr)
Description copied from class: Glyph
Find out if a glyph is visible in a circular area. Not implemented yet for most glyph classes. Used for instance to implement DynaSpot picking.

Overrides:
visibleInDisc in class Glyph

mouseInOut

public short mouseInOut(int jpx,
                        int jpy,
                        int camIndex,
                        double cvx,
                        double cvy)
Description copied from class: Glyph
Method used internally for firing picking-related events.

Specified by:
mouseInOut in class Glyph
Parameters:
jpx - provide projected JPanel coordinates of the associated view, not virtual space coordinates
jpy - provide projected JPanel coordinates of the associated view, not virtual space coordinates
cvx - virtual space coordinates
cvy - virtual space coordinates
Returns:
VCursor.ENTERED_GLYPH if cursor has entered the glyph, VCursor.EXITED_GLYPH if it has exited the glyph, VCursor.NO_CURSOR_EVENT if nothing has changed (meaning the cursor was already inside or outside it)

resetMouseIn

public void resetMouseIn()
Description copied from class: Glyph
Reset memory of cursor being inside the glyph.

Specified by:
resetMouseIn in class Glyph

resetMouseIn

public void resetMouseIn(int i)
Description copied from class: Glyph
Reset memory of cursor being inside the glyph for projected coordinates associated with camera at index i.

Specified by:
resetMouseIn in class Glyph

project

public void project(Camera c,
                    Dimension d)
Description copied from class: Glyph
Project glyph w.r.t a given camera's coordinate system, prior to actual painting. Called internally.

Specified by:
project in class Glyph
Parameters:
c - camera
d - dimension of View using camera c

projectForLens

public void projectForLens(Camera c,
                           int lensWidth,
                           int lensHeight,
                           float lensMag,
                           double lensx,
                           double lensy)
Description copied from class: Glyph
Project glyph w.r.t a given camera's coordinate system, prior to actual painting through a lens. Called internally.

Specified by:
projectForLens in class Glyph
Parameters:
c - camera
lensWidth - width of lens activated in View using this camera
lensHeight - height of lens activated in View using this camera
lensMag - magnification factor of lens activated in View using this camera
lensx - horizontal coordinateof lens activated in View using this camera
lensy - vertical coordinate of lens activated in View using this camera

flush

public abstract void flush()
Flush any resource used.


getJava2DShape

public Shape getJava2DShape()
Description copied from class: Glyph
Get the Java2D Shape corresponding to this Glyph. Virtual Space coordinates.

Specified by:
getJava2DShape in class Glyph


Copyright © 2000-2002 Xerox Corporation. All Rights Reserved
Copyright © 2003 World Wide Web Consortium. All Rights Reserved
Copyright © 2004-2011 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.