public abstract class DisplayRendererJ2D extends DisplayRenderer implements RendererSourceListener
DisplayRendererJ2D
is the VisAD abstract super-class for
background and metadata rendering algorithms. These complement
depictions of Data
objects created by
DataRenderer
objects.
DisplayRendererJ2D
also manages the overall relation of
DataRenderer
output to Java2D and manages the VisAD scene
graph.
It creates the binding between Control
objects and scene
graph Behavior
objects for direct manipulation of
Control
objects.
DisplayRendererJ2D
is not Serializable
and
should not be copied between JVMs.
Constructor and Description |
---|
DisplayRendererJ2D() |
Modifier and Type | Method and Description |
---|---|
void |
addDirectManipulationSceneGraphComponent(VisADGroup group,
DirectManipulationRendererJ2D renderer) |
void |
addKeyboardBehavior(KeyboardBehaviorJ2D behavior)
Add a
KeyboardBehavior for keyboard control of translation
and zoom. |
void |
addSceneGraphComponent(VisADGroup group) |
boolean |
anyCursorStringVector() |
boolean |
anyDirects() |
void |
clearScale(AxisScale axisScale)
Remove a particular scale being rendered.
|
void |
clearScales()
Remove all the scales being rendered.
|
void |
clearScene(DataRenderer renderer) |
void |
controlChanged(ControlEvent evt)
Update internal values from those in the
RendererControl . |
VisADGroup |
createBasicSceneGraph(VisADCanvasJ2D c,
MouseBehaviorJ2D m)
Deprecated.
use createBasicSceneGraph(VisADCanvasJ2D c,
MouseBehaviorJ2D m, VisADAppearance bx, VisADAppearance cr)
instead
|
VisADGroup |
createBasicSceneGraph(VisADCanvasJ2D c,
MouseBehaviorJ2D m,
VisADAppearance bx,
VisADAppearance cr)
Create scene graph root, if none exists, with Transform
and direct manipulation root.
|
abstract VisADGroup |
createSceneGraph(VisADCanvasJ2D c)
Create scene graph root, if none exists, with Transform,
direct manipulation root, and non-direct-manipulation root;
create special graphics (e.g., 3-D box, SkewT background),
any lights, any user interface embedded in scene.
|
void |
depth_cursor(VisADRay ray)
set a VisADRay along which to drag cursor in depth (in and out
of screen)
|
void |
drag_cursor(VisADRay ray,
boolean first)
drag cursor parallel to plane of screen
|
void |
drag_depth(float diff)
drag cursor in depth (in and out of screen)
|
void |
drawCursorStringVector(Graphics graphics,
AffineTransform tgeometry,
int width,
int height)
Whenever
cursorOn or directOn is
true , display Strings in cursorStringVector. |
DataRenderer |
findDirect(VisADRay ray,
int mouseModifiers)
Returns a direct manipulation renderer if one is close to
the specified ray (within pick threshold).
|
VisADGroup |
getBoxOnBranch() |
VisADCanvasJ2D |
getCanvas() |
double[] |
getCursor()
Returns the location of the last unmodified, middle mouse button press.
|
VisADGroup |
getCursorOnBranch() |
VisADGroup |
getDirect() |
BufferedImage |
getImage()
Get a snapshot of the displayed image.
|
MouseBehavior |
getMouseBehavior() |
VisADGroup |
getNonDirect() |
VisADGroup |
getRoot() |
int |
getTextureHeightMax() |
int |
getTextureWidthMax() |
AffineTransform |
getTrans() |
void |
initControl(RendererControl ctl)
Internal method used to initialize newly created
RendererControl with current renderer settings
before it is actually connected to the renderer. |
boolean |
legalDataRenderer(DataRenderer renderer)
determine whether a DataRenderer is legal for this DisplayRenderer
|
Control |
makeControl(ScalarMap map)
Factory for constructing a subclass of
Control
appropriate for the graphics API and for this
DisplayRenderer ; invoked by ScalarMap
when it is addMap() ed to a Display . |
DataRenderer |
makeDefaultRenderer()
Factory for constructing the default subclass of
DataRenderer for this DisplayRenderer . |
void |
render_trigger()
trigger the graphics API to render the scene graph to the screen;
intended to be over-ridden by graphics-API-specific extensions of
DisplayRenderer
|
void |
rendererDeleted(DataRenderer renderer) |
void |
setClip(float xlow,
float xhi,
float ylow,
float yhi) |
void |
setCursorOn(boolean on)
set flag indicating whether the cursor should be displayed.
|
void |
setDirectOn(boolean on)
set flag indicating whether direct manipulation is active
|
void |
setDisplay(DisplayImpl dpy)
Specify
DisplayImpl to be rendered. |
void |
setLineWidth(float width) |
void |
setScale(AxisScale axisScale)
Set the scale for the appropriate axis.
|
void |
setScale(int axis,
int axis_ordinal,
VisADLineArray array,
float[] scale_color)
Set the scale for the appropriate axis.
|
void |
setScale(int axis,
int axis_ordinal,
VisADLineArray array,
VisADTriangleArray labels,
float[] scale_color)
Set the scale for the appropriate axis.
|
void |
setScaleOn(boolean on)
Allow scales to be displayed if they are set on.
|
void |
setTransform2D(AffineTransform t) |
void |
setWaitFlag(boolean b)
Set the wait flag to the specified value.
|
void |
unsetClip() |
getAnimationString, getAnimationStringVisible, getBoxOn, getCursorColor, getCursorStringVector, getCursorStringVectorUnconditional, getDirectAxisValue, getDirectAxisValue, getDisplay, getMode2D, getPickThreshhold, getRendererControl, getRotateAboutCenter, getScaleRotation, getWaitFlag, getWaitMessageVisible, legalDisplayScalar, prepareAction, setAnimationString, setAnimationStringVisible, setBackgroundColor, setBackgroundColor, setBoxAspect, setBoxColor, setBoxColor, setBoxOn, setCursorColor, setCursorColor, setCursorStringOn, setCursorStringVector, setCursorStringVector, setForegroundColor, setForegroundColor, setPickThreshhold, setRotateAboutCenter, setScaleRotation, setWaitMessageVisible
public void setDisplay(DisplayImpl dpy) throws VisADException
DisplayImpl
to be rendered.setDisplay
in class DisplayRenderer
dpy
- Display
to render.VisADException
- If a DisplayImpl
has already
been specified.public VisADGroup getRoot()
public void setClip(float xlow, float xhi, float ylow, float yhi)
public void unsetClip()
public void initControl(RendererControl ctl)
RendererControl
with current renderer settings
before it is actually connected to the renderer. This
means that changes will not generate MonitorEvent
s.initControl
in class DisplayRenderer
ctl
- RendererControl to initializepublic void controlChanged(ControlEvent evt) throws VisADException, RemoteException
RendererControl
.controlChanged
in interface ControlListener
evt
- ControlEvent
generated by a change to the
RendererControl
VisADException
RemoteException
public AffineTransform getTrans()
public VisADCanvasJ2D getCanvas()
public BufferedImage getImage()
DisplayRenderer
getImage
in class DisplayRenderer
public VisADGroup getCursorOnBranch()
public VisADGroup getBoxOnBranch()
public void setCursorOn(boolean on)
DisplayRenderer
setCursorOn
in class DisplayRenderer
on
- value of flag to setpublic void setDirectOn(boolean on)
DisplayRenderer
setDirectOn
in class DisplayRenderer
on
- value of flag to setpublic VisADGroup getDirect()
public VisADGroup getNonDirect()
public abstract VisADGroup createSceneGraph(VisADCanvasJ2D c) throws DisplayException
c
- DisplayException
public VisADGroup createBasicSceneGraph(VisADCanvasJ2D c, MouseBehaviorJ2D m) throws DisplayException
DisplayException
public VisADGroup createBasicSceneGraph(VisADCanvasJ2D c, MouseBehaviorJ2D m, VisADAppearance bx, VisADAppearance cr) throws DisplayException
c
- m
- DisplayException
public MouseBehavior getMouseBehavior()
getMouseBehavior
in class DisplayRenderer
public void addSceneGraphComponent(VisADGroup group) throws DisplayException
DisplayException
public void addDirectManipulationSceneGraphComponent(VisADGroup group, DirectManipulationRendererJ2D renderer) throws DisplayException
DisplayException
public void clearScene(DataRenderer renderer)
public double[] getCursor()
getCursor
in class DisplayRenderer
public void depth_cursor(VisADRay ray)
DisplayRenderer
depth_cursor
in class DisplayRenderer
ray
- VisADRay to setpublic void drag_depth(float diff)
DisplayRenderer
drag_depth
in class DisplayRenderer
diff
- amount to move cursor in depth (0.0 corresponds
to no movement)public void drag_cursor(VisADRay ray, boolean first)
DisplayRenderer
drag_cursor
in class DisplayRenderer
ray
- VisADRay that goes through new cursor locationfirst
- true to indicate this is first call to drag_cursor()
for this dragpublic void render_trigger()
DisplayRenderer
render_trigger
in class DisplayRenderer
public boolean anyCursorStringVector()
public void drawCursorStringVector(Graphics graphics, AffineTransform tgeometry, int width, int height)
cursorOn
or directOn
is
true
, display Strings in cursorStringVector.graphics
- tgeometry
- width
- height
- public DataRenderer findDirect(VisADRay ray, int mouseModifiers)
DisplayRenderer
findDirect
in class DisplayRenderer
ray
- The ray used to look for a nearby direct manipulation
renderer.mouseModifiers
- Value of InputEvent.getModifiers().null
.public boolean anyDirects()
anyDirects
in class DisplayRenderer
public void setScaleOn(boolean on)
setScaleOn
in class DisplayRenderer
on
- true to turn them on, false to set them invisiblepublic void setScale(AxisScale axisScale) throws VisADException
setScale
in class DisplayRenderer
axisScale
- AxisScale for this scaleVisADException
- couldn't set the scalepublic void setScale(int axis, int axis_ordinal, VisADLineArray array, float[] scale_color) throws VisADException
setScale
in class DisplayRenderer
axis
- axis for this scale (0 = XAxis, 1 = YAxis, 2 = ZAxis)axis_ordinal
- position along the axisarray
- VisADLineArray
representing the scale plotscale_color
- array (dim 3) representing the red, green and blue
color values.VisADException
- couldn't set the scalepublic void setScale(int axis, int axis_ordinal, VisADLineArray array, VisADTriangleArray labels, float[] scale_color) throws VisADException
setScale
in class DisplayRenderer
axis
- axis for this scale (0 = XAxis, 1 = YAxis, 2 = ZAxis)axis_ordinal
- position along the axisarray
- VisADLineArray
representing the scale plotlabels
- VisADTriangleArray
representing the labels
created using a font (can be null)scale_color
- array (dim 3) representing the red, green and blue
color values.VisADException
- couldn't set the scalepublic void clearScales()
clearScales
in class DisplayRenderer
public void clearScale(AxisScale axisScale)
clearScale
in class DisplayRenderer
axisScale
- scale to be removedpublic void setTransform2D(AffineTransform t)
public Control makeControl(ScalarMap map)
Control
appropriate for the graphics API and for this
DisplayRenderer
; invoked by ScalarMap
when it is addMap()
ed to a Display
.makeControl
in class DisplayRenderer
map
- The ScalarMap
for which a Control
should be built.Control
.public DataRenderer makeDefaultRenderer()
DisplayRenderer
DataRenderer
for this DisplayRenderer
.makeDefaultRenderer
in class DisplayRenderer
DataRenderer
.public boolean legalDataRenderer(DataRenderer renderer)
DisplayRenderer
legalDataRenderer
in class DisplayRenderer
renderer
- DisplayRenderer to test for legalitypublic void rendererDeleted(DataRenderer renderer)
rendererDeleted
in interface RendererSourceListener
public void setLineWidth(float width)
public void addKeyboardBehavior(KeyboardBehaviorJ2D behavior)
KeyboardBehavior
for keyboard control of translation
and zoom. This adds a KeyListener
to the VisADCanvasJ2D to
handle the behaviors for the arrow keys. Do not use this in conjunction
with other KeyListener
s that handle events for the arrow keys.behavior
- keyboard behavior to addpublic void setWaitFlag(boolean b)
DisplayRenderer
Display
.) DisplayEvent.WAIT_ON and
DisplayEvent.WAIT_OFF events are fired based on value of b.setWaitFlag
in class DisplayRenderer
b
- Boolean value to which wait flag is set.public int getTextureWidthMax()
getTextureWidthMax
in class DisplayRenderer
public int getTextureHeightMax()
getTextureHeightMax
in class DisplayRenderer
Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.