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, setWaitMessageVisiblepublic void setDisplay(DisplayImpl dpy) throws VisADException
DisplayImpl to be rendered.setDisplay in class DisplayRendererdpy - 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 MonitorEvents.initControl in class DisplayRendererctl - RendererControl to initializepublic void controlChanged(ControlEvent evt) throws VisADException, RemoteException
RendererControl.controlChanged in interface ControlListenerevt - ControlEvent generated by a change to the
RendererControlVisADExceptionRemoteExceptionpublic AffineTransform getTrans()
public VisADCanvasJ2D getCanvas()
public BufferedImage getImage()
DisplayRenderergetImage in class DisplayRendererpublic VisADGroup getCursorOnBranch()
public VisADGroup getBoxOnBranch()
public void setCursorOn(boolean on)
DisplayRenderersetCursorOn in class DisplayRendereron - value of flag to setpublic void setDirectOn(boolean on)
DisplayRenderersetDirectOn in class DisplayRendereron - value of flag to setpublic VisADGroup getDirect()
public VisADGroup getNonDirect()
public abstract VisADGroup createSceneGraph(VisADCanvasJ2D c) throws DisplayException
c - DisplayExceptionpublic VisADGroup createBasicSceneGraph(VisADCanvasJ2D c, MouseBehaviorJ2D m) throws DisplayException
DisplayExceptionpublic VisADGroup createBasicSceneGraph(VisADCanvasJ2D c, MouseBehaviorJ2D m, VisADAppearance bx, VisADAppearance cr) throws DisplayException
c - m - DisplayExceptionpublic MouseBehavior getMouseBehavior()
getMouseBehavior in class DisplayRendererpublic void addSceneGraphComponent(VisADGroup group) throws DisplayException
DisplayExceptionpublic void addDirectManipulationSceneGraphComponent(VisADGroup group, DirectManipulationRendererJ2D renderer) throws DisplayException
DisplayExceptionpublic void clearScene(DataRenderer renderer)
public double[] getCursor()
getCursor in class DisplayRendererpublic void depth_cursor(VisADRay ray)
DisplayRendererdepth_cursor in class DisplayRendererray - VisADRay to setpublic void drag_depth(float diff)
DisplayRendererdrag_depth in class DisplayRendererdiff - amount to move cursor in depth (0.0 corresponds
to no movement)public void drag_cursor(VisADRay ray, boolean first)
DisplayRendererdrag_cursor in class DisplayRendererray - VisADRay that goes through new cursor locationfirst - true to indicate this is first call to drag_cursor()
for this dragpublic void render_trigger()
DisplayRendererrender_trigger in class DisplayRendererpublic 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)
DisplayRendererfindDirect in class DisplayRendererray - The ray used to look for a nearby direct manipulation
renderer.mouseModifiers - Value of InputEvent.getModifiers().null.public boolean anyDirects()
anyDirects in class DisplayRendererpublic void setScaleOn(boolean on)
setScaleOn in class DisplayRendereron - true to turn them on, false to set them invisiblepublic void setScale(AxisScale axisScale) throws VisADException
setScale in class DisplayRendereraxisScale - 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 DisplayRendereraxis - 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 DisplayRendereraxis - 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 DisplayRendererpublic void clearScale(AxisScale axisScale)
clearScale in class DisplayRendereraxisScale - 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 DisplayRenderermap - The ScalarMap for which a Control
should be built.Control.public DataRenderer makeDefaultRenderer()
DisplayRendererDataRenderer for this DisplayRenderer.makeDefaultRenderer in class DisplayRendererDataRenderer.public boolean legalDataRenderer(DataRenderer renderer)
DisplayRendererlegalDataRenderer in class DisplayRendererrenderer - DisplayRenderer to test for legalitypublic void rendererDeleted(DataRenderer renderer)
rendererDeleted in interface RendererSourceListenerpublic 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 KeyListeners that handle events for the arrow keys.behavior - keyboard behavior to addpublic void setWaitFlag(boolean b)
DisplayRendererDisplay.) DisplayEvent.WAIT_ON and
DisplayEvent.WAIT_OFF events are fired based on value of b.setWaitFlag in class DisplayRendererb - Boolean value to which wait flag is set.public int getTextureWidthMax()
getTextureWidthMax in class DisplayRendererpublic int getTextureHeightMax()
getTextureHeightMax in class DisplayRendererCopyright © 1996–2023 The SSEC Visualization Project. All rights reserved.