Modifier and Type | Field and Description |
---|---|
protected boolean |
boundingBox
Whether bounding box is visible.
|
static double |
DEFAULT_ROTATION
Default rotation factor for 3D displays.
|
static double |
DEFAULT_ZOOM_2D
Default zoom factor for 2D displays.
|
static double |
DEFAULT_ZOOM_3D
Default zoom factor for 3D displays.
|
protected double[] |
matrix
Matrix representing current display projection.
|
static double |
PAN_AMOUNT
How far display pans each time.
|
protected ViewPanel |
panel
GUI controls for view handler.
|
protected boolean |
parallel
Whether display is in parallel projection mode.
|
static double |
ROTATION_AMOUNT
How far display rotates each time.
|
protected boolean |
showScale
Whether scale is visible.
|
protected DisplayWindow |
window
Associated display window.
|
protected double |
xasp
Aspect ratio of the display.
|
protected double |
yasp
Aspect ratio of the display.
|
protected double |
zasp
Aspect ratio of the display.
|
static double |
ZOOM_AMOUNT
How far display zooms in or out each time.
|
Constructor and Description |
---|
ViewHandler(DisplayWindow dw)
Creates a display view handler.
|
Modifier and Type | Method and Description |
---|---|
void |
applyMatrix(double[] m)
Applies the given matrix transform to the display.
|
protected void |
doAspect(double x,
double y,
double z)
Adjusts the aspect ratio.
|
double |
getAspectX()
Gets aspect ratio X component.
|
double |
getAspectY()
Gets aspect ratio Y component.
|
double |
getAspectZ()
Gets aspect ratio Z component.
|
double[] |
getMatrix()
Gets the display's current matrix transform.
|
ViewPanel |
getPanel()
Gets GUI controls for this view handler.
|
DisplayWindow |
getWindow()
Gets associated display window.
|
void |
guessAspect()
Guesses aspect ratio based on first linked data transform.
|
void |
initState(ViewHandler handler)
Modifies this object's state to match that of the given object.
|
boolean |
isBoundingBox()
Gets visibility of the display's bounding box.
|
boolean |
isParallel()
Gets whether 3D display uses a parallel projection.
|
boolean |
isScale()
Gets visibility of scale.
|
protected double[] |
makeDefaultMatrix()
Creates a matrix at the default orientation for the display.
|
boolean |
matches(ViewHandler handler)
Tests whether two objects are in equivalent states.
|
void |
pan(double panx,
double pany,
double panz)
Pans the display in the given direction.
|
void |
panDown()
Slides the display downward.
|
void |
panLeft()
Slides the display to the left.
|
void |
panRight()
Slides the display to the right.
|
void |
panUp()
Slides the display upward.
|
void |
reset()
Restores the display's zoom and orientation to the original values.
|
void |
restoreState(Element el)
Restores the current state from the given DOM element ("Display").
|
void |
rotate(double rotx,
double roty,
double rotz)
Rotates the display in the given direction.
|
void |
rotateClockwise()
Rotates the display clockwise (2D and 3D).
|
void |
rotateCounterclockwise()
Rotates the display counterclockwise (2D and 3D).
|
void |
rotateDown()
Rotates the display downward (3D only).
|
void |
rotateLeft()
Rotates the display to the left (3D only).
|
void |
rotateRight()
Rotates the display to the right (3D only).
|
void |
rotateUp()
Rotates the display upward (3D only).
|
void |
saveState(Element el)
Writes the current state to the given DOM element ("Display").
|
void |
setAspect(double x,
double y,
double z)
Adjusts the aspect ratio.
|
protected void |
setMatrix(double[] m)
Sets the display's projection matrix to match the given one.
|
void |
toggleBoundingBox(boolean value)
Toggles visibility of the display's bounding box.
|
void |
toggleParallel(boolean value)
Toggles whether 3D display uses a parallel projection.
|
void |
toggleScale(boolean value)
Toggles visibility of scale.
|
void |
zoom(double scale)
Zooms the display by the given amount.
|
void |
zoomIn()
Zooms in on the display.
|
void |
zoomOut()
Zooms out on the display.
|
public static final double DEFAULT_ZOOM_2D
public static final double DEFAULT_ZOOM_3D
public static final double DEFAULT_ROTATION
public static final double ZOOM_AMOUNT
public static final double ROTATION_AMOUNT
public static final double PAN_AMOUNT
protected DisplayWindow window
protected double xasp
protected double yasp
protected double zasp
protected boolean showScale
protected boolean boundingBox
protected boolean parallel
protected double[] matrix
protected ViewPanel panel
public ViewHandler(DisplayWindow dw)
public DisplayWindow getWindow()
public ViewPanel getPanel()
public void zoomIn()
public void zoomOut()
public void rotateClockwise()
public void rotateCounterclockwise()
public void rotateLeft()
public void rotateRight()
public void rotateUp()
public void rotateDown()
public void panLeft()
public void panRight()
public void panUp()
public void panDown()
public void zoom(double scale)
public void rotate(double rotx, double roty, double rotz)
public void pan(double panx, double pany, double panz)
public void applyMatrix(double[] m)
public double[] getMatrix()
public void reset()
public void guessAspect()
public void setAspect(double x, double y, double z)
public double getAspectX()
public double getAspectY()
public double getAspectZ()
public void toggleScale(boolean value)
public boolean isScale()
public void toggleBoundingBox(boolean value)
public boolean isBoundingBox()
public void toggleParallel(boolean value)
public boolean isParallel()
public boolean matches(ViewHandler handler)
public void initState(ViewHandler handler)
public void saveState(Element el) throws SaveException
saveState
in interface Saveable
SaveException
public void restoreState(Element el) throws SaveException
restoreState
in interface Saveable
SaveException
protected void doAspect(double x, double y, double z)
protected double[] makeDefaultMatrix()
protected void setMatrix(double[] m)
Copyright © 2015–2022 SciJava. All rights reserved.