public final class PvDisplay extends java.awt.Canvas implements PvDisplayIf, java.lang.Runnable, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ActionListener, java.io.Serializable
PvDisplayIf.
It may be included inside any Java container with any layout manager.
A display may be obtained by three different ways:
PvViewer#getDisplay().
This mechanism avoids any need to connect the geometry of the current project or
viewer to the display.
Each class fulfilling the interface PvDisplayIf
can serve as a display in JavaView.
If the display is not added to an AWT container yet then external rendering does not work since this display has no Graphics yet.
| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
m_backgroundImageFile
Background image for display.
|
boolean |
m_bInsecureKeyRelease
A flag checking if a keyReleased event still has to be checked.
|
java.lang.String |
m_defBackgroundImageFile
Default background image for display.
|
java.lang.String |
m_defForegroundImageFile
Default foreground image for display.
|
java.lang.String |
m_foregroundImageFile
Background image for display.
|
static int |
m_renderType
Determines render engine and choice of display canvas.
|
static int |
RENDER_AWT
AWT type of render engine.
|
static int |
RENDER_GL
GL type of render engine.
|
static int |
RENDER_LWJGL
GL type of render engine.
|
static int |
RENDER_PS
PostScript type of render engine, not interactive but for PS output.
|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTCAMERA_MODEL, CAMERA_NAME, CAMERA_ORTHO_XY, CAMERA_ORTHO_XZ, CAMERA_ORTHO_YZ, CAMERA_PERSPECTIVE, GRID_XY, GRID_XZ, GRID_YZ, IMAGE_CENTER, IMAGE_FIT, IMAGE_RESIZE, IMAGE_TESSELATE, MATRIX_AMBIENT, MATRIX_INV_AMBIENT, MATRIX_INV_MODEL, MATRIX_INV_PROJECT, MATRIX_INV_PROJECT_NON, MATRIX_INV_PROJVIEW, MATRIX_INV_PROJVIEW_NON, MATRIX_INV_TRANS, MATRIX_INV_TRANS_NON, MATRIX_INV_VIEW, MATRIX_MODEL, MATRIX_PROJECT, MATRIX_PROJECT_NON, MATRIX_PROJVIEW, MATRIX_PROJVIEW_NON, MATRIX_TRANS, MATRIX_TRANS_NON, MATRIX_VIEW, MODE_ADD, MODE_ADD_ELEMENT, MODE_BOUNDARY_PICK, MODE_DELETE, MODE_DETAIL, MODE_DISPLAY_PICK, MODE_DRAWING, MODE_DUPLICATE, MODE_FLY, MODE_HIGHLIGHT, MODE_INITIAL_PICK, MODE_MARK, MODE_MARK_ELEMENTS, MODE_ORBIT, MODE_PICK, MODE_SCALE, MODE_SCALE_RECT, MODE_TRANS, MODE_TRANS_Z, MODE_UNMARK, MODE_UNMARK_ELEMENTS, MODE_URL, MODE_VERTICAL, PAINT_BACKIMAGE, PICK_ALL, PICK_BACKGROUND, PICK_SELECTED, PICK_UNSELECTED, TRANSFORM_AMBIENT, TRANSFORM_CAMERA, TRANSFORM_MODEL| Constructor and Description |
|---|
PvDisplay()
Constructor of display without viewer as parent.
|
PvDisplay(java.applet.Applet applet,
java.awt.Frame frame)
Constructor of display inside applet, or inside frame if applet is null.
|
PvDisplay(PvViewerIf viewer)
Constructor of display with given argument viewer as parent.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
Perform action events, currently used for popup menu events only.
|
int |
addCamera(java.lang.String aName,
PvCamera aCamera)
Add new camera and make it accessible under the given name.
|
void |
addCameraListener(PvCameraListenerIf listener)
Add camera listener to receive camera events
PvCameraEvent. |
boolean |
addGeometry(PgGeometryIf aGeom)
Add geometry to display.
|
void |
addGeometryListener(PvGeometryListenerIf listener)
Add geometry listener to receive geometry events.
|
void |
addKeyListener(java.awt.event.KeyListener listener)
Add key listener to receive key events from display canvas.
|
boolean |
addLight(PvLightIf light)
Add a light to the current scene.
|
void |
addPickListener(PvPickListenerIf listener)
Add pick listener to receive pick events
PvPickEvent. |
void |
addPopupItem(int menuID)
Add a menu item to the right-mouse popup menu.
|
void |
burn()
Burn the current status as texture on each surface.
|
void |
center()
Center geometry in window, do no scaling
|
void |
clearPopupMenu()
Removes all added menu items from right-mouse popup menu,
except some standard JavaView items such as "exit".
|
void |
configure(PvDisplayIf disp)
Configure an empty given display with all settings
and geometries of this display.
|
boolean |
containsGeometry(PgGeometryIf aGeom)
Check whether geometry is registered in display.
|
void |
enableClip(boolean aFlag)
Deprecated.
use
#setEnabledClip |
boolean |
fit()
Center and scale camera such that geometry fits exactly into window.
|
boolean |
fit(PvCamera camera)
Center and scale camera such that geometry fits exactly into window.
|
int |
getAmbientProjection()
Get projection mode of ambient space used in model camera.
|
int |
getAmbientSpace()
Get ambient space used in model transformations.
|
PgAxes |
getAxes()
Get axes geometry with individual rulers for each coordinate axis.
|
PsPanel |
getAxisPanel()
Get info panel of axes object to control all rulers uniformly.
|
PsPanel |
getAxisPanel(int ind)
Get info panel of individual ruler.
|
java.awt.Color |
getBackgroundColor()
Get color of background of display.
|
java.awt.Image |
getBackgroundImage()
Make background image of display available to outside world.
|
java.lang.String |
getBackgroundImageFile()
Get filename of background image of display canvas.
|
int |
getBackgroundImageFit()
Get the mode determining how a background image is scaled w.r.t. the display canvas.
|
java.awt.Color |
getBndBoxColor()
Get color of bounding box.
|
double |
getBndBoxSize()
Get thickness of edges of bounding box.
|
PdVector |
getBoxRatio()
Get individual scaling factors of coordinate axes.
|
PvCameraIf |
getCamera()
Get current camera object.
|
PvCameraIf |
getCamera(int type)
Get a camera object by type.
|
PsPanel |
getCameraPanel()
Get info panel of current camera.
|
PvCameraIf[] |
getCameras()
Get current camera object.
|
java.awt.Canvas |
getCanvas()
Get canvas of this display.
|
double[] |
getClipBounds(int ind)
Get minimum and maximum in one dimension of the clipping box.
|
int |
getClipBoundsType()
Get index of axis which is selected when scene clip bounds is active of becomes active.
|
double |
getFarClip()
Get far clip distance of current camera.
|
PsUpdateIf |
getFather()
Get father of display.
|
java.awt.Color |
getForegroundColor()
Get foreground color.
|
java.awt.Image |
getForegroundImage()
Get foreground image of display canvas.
|
java.lang.String |
getForegroundImageFile()
Get filename of foreground image of display canvas.
|
int |
getForegroundImageFit()
Get the mode determining how a foreground image is scaled w.r.t. the display canvas.
|
java.awt.Frame |
getFrame()
Get reference to container frame of display, e.g. to allow display to hide/show frame.
|
java.lang.String |
getFrameLabel(int index)
Get one of the labels of the coordinate frame.
|
PgGeometryIf[] |
getGeometries()
Get array with registered geometries.
|
PdVector |
getGridIncrements(int gridOrient)
Get spacing between grid lines in both coordinate directions.
|
int |
getGridOrientation()
Get orientation of grid which determines the plane in which the grid lies.
|
java.awt.Image |
getImage()
Make image of display available to outside world.
|
int |
getImageFitMode()
Deprecated.
use getBackgroundImageFit()
|
PsPanel |
getInfoPanel()
Get info panel of display.
|
PvLightIf |
getLight()
Get current light object.
|
int |
getLightingModel()
Get currently active lighting model.
|
PsPanel |
getLightPanel()
Get info panel of lights.
|
PvLightIf[] |
getLights()
Get registered lights as array.
|
int |
getMajorMode()
Get the current interaction mode.
|
java.awt.Dimension |
getMinimumSize()
Assure correct horizontal size of all project panels.
|
java.lang.String |
getName()
Get name of this display.
|
double |
getNearClip()
Get near clip distance of current camera.
|
int |
getNumGeometries()
Get number of all registered geometry in display.
|
int |
getNumLights()
Get number of light objects.
|
PvPickEvent |
getPickEvent(int x,
int y)
Find intersection of ray through pick locus on visible geometries and background.
|
PvPickEvent |
getPickEvent(int x,
int y,
int pickType)
Find intersection of ray through pick locus on visible geometries and background.
|
int |
getPickType()
Get pick type which determines the class of pickable geometries
in pick and initialPick mode.
|
java.awt.Point |
getPosition(int xPos,
int yPos)
Get upper left corner of frame, or null if no parent frame available.
|
java.awt.Dimension |
getPreferredSize()
Assure correct horizontal size of all project panels.
|
java.lang.String |
getSceneTitle()
Get title of scene.
|
java.lang.String[] |
getSearchPaths()
Get image search paths.
|
PgGeometryIf |
getSelectedGeometry()
Get currently selected geometry.
|
PvLightIf |
getSelectedLight()
Select light from the list of registered lights in this scene.
|
java.awt.Dimension |
getSize()
Get height of drawing canvas.
|
int |
getTransformationMode()
Check whether transformation of current model is active, i.e. of model matrix.
|
PdMatrix |
getTransMatrix(int type)
Get 4*4 transformation matrix or components from current camera and display.
|
PvViewerIf |
getViewer()
Get the viewer manager of display, which manages multiple displays and is key listener.
|
PgGeometryIf[] |
getVisibleGeometries()
Get array with registered and visible geometries.
|
boolean |
hasAxes()
Check existence of axes geometry.
|
boolean |
hasCamera(int type)
Determine whether a camera object of given type is registered in display.
|
boolean |
hasCameraListener(PvCameraListenerIf listener)
Check for a registered listener.
|
boolean |
hasGeometryListener(PvGeometryListenerIf listener)
Check for a registered geometry listener.
|
boolean |
hasLight(PvLightIf light)
Determine whether a light is registered in display.
|
boolean |
hasPaintTag(long flags)
Check whether either if the bits in parameter has been set.
|
boolean |
hasPickListener(PvPickListenerIf listener)
Check for a registered listener.
|
boolean |
incrementAutoRotation()
Do a single increment of auto-rotation animation.
|
void |
init()
Initialize and reset display.
|
boolean |
isClip()
Deprecated.
use
#isEnabledClip |
boolean |
isEnabled3DLook()
Check whether thick vertices and edges are drawn as 3d shapes in z-buffer mode.
|
boolean |
isEnabledAdaptiveSize()
Check whether adaptive thickness of vertices and edges is enabled.
|
boolean |
isEnabledAnimation()
Check whether auto-rotation is enabled.
|
boolean |
isEnabledAntiAlias()
Check if antialiased drawing is enabled.
|
boolean |
isEnabledBoxRatio()
Check whether individual scaling factors of coordinate axes is enabled.
|
boolean |
isEnabledClearScreen()
Check whether screen is cleared after each repaint.
|
boolean |
isEnabledClip()
Check whether clipping with front and back plane is enabled.
|
boolean |
isEnabledClipAutoBounds()
Check whether automatic recalculation of clip range is enabled
when clipRange is switched on.
|
boolean |
isEnabledClipBounds()
Check whether clipping with scene in direction of coordinate axis is enabled.
|
boolean |
isEnabledDirectSelect()
Check whether selecting is enabled during mouse pick.
|
boolean |
isEnabledDoubleBuffer()
Check if double buffered drawing is enabled.
|
boolean |
isEnabledExternalRendering()
Check if rendering into an external image is enabled.
|
static boolean |
isEnabledFastClipping()
Check whether fast clipping of geometry items is enabled.
|
static boolean |
isEnabledFastZBuffer()
Check whether z-buffered is disabled during drawing.
|
boolean |
isEnabledFillDisplay()
Check if scaling of scene to fill display is enabled.
|
boolean |
isEnabledInspection()
Check whether display and selected geometry can be inspected in control window.
|
boolean |
isEnabledIntegerPick()
Check whether picking is constrained to an integer grid.
|
boolean |
isEnabledLocalTransform()
Get flag whether local coordinate system is used in camera transformations.
|
boolean |
isEnabledPainters()
Check whether painter's algorithm during drawing is enabled.
|
boolean |
isEnabledRepaint()
Determine whether painting is enabled.
|
boolean |
isEnabledTags()
Determine whether tag mode is enabled to move marked elements.
|
boolean |
isEnabledUpdate()
Determine whether update mechanism is enabled.
|
boolean |
isEnabledZBuffer()
Check whether z-buffered drawing is enabled.
|
boolean |
isShowingAllViews()
Check drawing of copyright information in the display window.
|
boolean |
isShowingAxes()
Check whether axes of active geometry is currently showing.
|
boolean |
isShowingBackgroundImage()
Check drawing of background image of display window.
|
boolean |
isShowingBackImage()
Deprecated.
use isShowingBackgroundImage()
|
boolean |
isShowingBndBox()
Check whether bounding box of active geometry is currently showing.
|
boolean |
isShowingCamera()
Check whether active camera of this display is visible.
|
boolean |
isShowingCopyright()
Check drawing of copyright information in the display window.
|
boolean |
isShowingDepthcue()
True if depthcue is enabled. |
boolean |
isShowingEdgeAura()
Check flag of drawing of edges by one or both elements adjacent to an edge.
|
boolean |
isShowingEdgesOnce()
Check flag of drawing of edges by one or both elements adjacent to an edge.
|
boolean |
isShowingForegroundImage()
Check drawing of foreground image of display window.
|
boolean |
isShowingFrame()
Check whether coordinate frame is currently showing.
|
boolean |
isShowingGrid()
Check whether grid is currently showing.
|
boolean |
isShowingInterest()
Check whether interest of active camera is visible.
|
boolean |
isShowingMagnet()
Check whether cursor attached to vertices if nearby.
|
boolean |
isShowingTitle()
Check drawing of title north in the display window.
|
void |
keyPressed(java.awt.event.KeyEvent event) |
void |
keyReleased(java.awt.event.KeyEvent event) |
void |
keyTyped(java.awt.event.KeyEvent event) |
void |
mouseClicked(java.awt.event.MouseEvent event)
Shows popup menu if event is a popup trigger.
|
void |
mouseDragged(java.awt.event.MouseEvent event) |
void |
mouseEntered(java.awt.event.MouseEvent event)
This display requests the focus when the mouse enters the canvas
unless request of focus is disabled by external calls.
|
void |
mouseExited(java.awt.event.MouseEvent event)
Sets a flag that mouse is outside.
|
void |
mouseMoved(java.awt.event.MouseEvent event)
Updates mouse position and invokes temporary information like magnet and info.
|
void |
mousePressed(java.awt.event.MouseEvent event)
Do not react on popup events or other than left mouse clicks.
|
void |
mouseReleased(java.awt.event.MouseEvent event)
Handle mouse key release events.
|
void |
paint(java.awt.Graphics g)
Override
Canvas.paint(g) to initiate redrawing of geometries. |
void |
recomputeAxes()
Recalculate length of axes depending on bounding box of
scene or current geometry depending on current transformation mode.
|
void |
releasePickFocus()
Release pick focus, i.e. to be the unique listener who receives pick events.
|
boolean |
removeCamera(int type)
Remove camera from list of registered cameras.
|
boolean |
removeCameraListener(PvCameraListenerIf listener)
Remove a registered listener from list of registered listeners.
|
void |
removeGeometries()
Remove all geometries from list of registered geometries.
|
boolean |
removeGeometry(PgGeometryIf aGeom)
Remove geometry from list of registered geometries.
|
boolean |
removeGeometryListener(PvGeometryListenerIf listener)
Remove a registered geometry listener from list of registered listeners.
|
void |
removeKeyListener(java.awt.event.KeyListener listener)
Remove key listener to receive key events from display canvas.
|
boolean |
removeLight(PvLightIf light)
Remove light from list of registered lights in this scene.
|
void |
removeLights()
Remove all lights from list of registered lights in this scene.
|
boolean |
removePickListener(PvPickListenerIf listener)
Remove a registered listener from list of registered listeners.
|
void |
render()
Initiate the rendering process when using this display as a batch renderer.
|
void |
repaint()
For debug only.
|
void |
requestPickFocus(PvPickListenerIf listener)
Request pick focus, i.e. to be the unique listener who receives pick events.
|
void |
reset()
Reset this display to state determined by m_sceneDefaults.
|
void |
resetTransformModel()
Reset ambient and model matrix of current model and modelCamera.
|
boolean |
resizeImage()
Resize the target screen image if user has changed the canvas size.
|
void |
run()
Do the animation by incrementing the transformation matrix with the last action.
|
void |
saveCameraDefaults()
Save settings of current camera as default.
|
boolean |
selectCamera(int type)
Select current camera used in dispay by id.
|
boolean |
selectGeometry(PgGeometryIf aGeom)
Select geometry to be active and receive pick events.
|
boolean |
selectLight(PvLightIf light)
Select light from the list of registered lights in this scene.
|
void |
setAmbientProjection(int mode)
Set projection mode of ambient space used in model camera.
|
void |
setAmbientSpace(int mode)
Set ambient space used in model transformations.
|
void |
setAutoCenter(boolean flag)
Set flag which determines whether camera will automatically center on geometry.
|
void |
setAutoRotation(PdVector axis,
double angle)
Set axis and angle for auto-rotation.
|
void |
setAxes(PgAxes axes)
Register axes geometry in this display.
|
void |
setBackgroundColor(java.awt.Color color)
Set color of background of display.
|
void |
setBackgroundImage(java.awt.Image anImage)
Set background image of display canvas.
|
void |
setBackgroundImage(java.lang.String fileName)
Deprecated.
use setBackgroundImageFile(String)
|
void |
setBackgroundImageFile(java.lang.String fileName)
Set filename of background image of display canvas.
|
void |
setBackgroundImageFit(int mode)
Set the mode determining how a background image is scaled w.r.t. the display canvas.
|
void |
setBndBoxColor(java.awt.Color color)
Set color of bounding box.
|
void |
setBndBoxSize(double size)
Set thickness of edges of bounding box.
|
void |
setBoxRatio(PdVector ratio)
Set individual scaling factors of coordinate axes.
|
void |
setClipBounds(int ind,
double[] range)
Set minimum and maximum in one dimension of the clipping box.
|
void |
setClipBoundsType(int type)
Set index of axis which is selected when scene clip bounds is active of becomes active.
|
static void |
setDefaultSize(java.awt.Dimension size)
Set default dimension of drawing canvas from outside.
|
void |
setDrawingOrder(int order,
PgGeometryIf aGeom)
Choose z-order of geometry when drawn in display.
|
void |
setEnabled3DLook(boolean flag)
Enable drawing of thick vertices and edges as 3d shapes in z-buffer mode.
|
void |
setEnabledAdaptiveSize(boolean flag)
Enabled adaptive thickness of vertices and edges.
|
void |
setEnabledAnimation(boolean flag)
Enable and disable auto-rotation of scene.
|
void |
setEnabledAntiAlias(boolean flag)
Enable antialiased drawing.
|
void |
setEnabledBoxRatio(boolean flag)
Enable and disable individual scaling factors of coordinate axes.
|
void |
setEnabledClearScreen(boolean aFlag)
Enable clearing of screen after each repaint.
|
void |
setEnabledClip(boolean flag)
Enable and disable clipping with front and back plane in camera viewing direction.
|
void |
setEnabledClipAutoBounds(boolean flag)
Enable automatic recalculation of clip range when clipRange is switched on.
|
void |
setEnabledClipBounds(boolean flag)
Enable and disable clipping of scene along coordinate axes.
|
void |
setEnabledDirectSelect(boolean flag)
Enable and disable clipping with front and back plane.
|
void |
setEnabledDoubleBuffer(boolean flag)
Enable double buffered drawing.
|
void |
setEnabledExternalRendering(boolean flag)
Enable rendering into an external image.
|
static void |
setEnabledFastClipping(boolean aFlag)
Enable and disable fast clipping of geometry items during rendering.
|
static void |
setEnabledFastZBuffer(boolean aFlag)
Enable and disable z-buffered drawing of scene.
|
void |
setEnabledFillDisplay(boolean flag)
Determine if scaling of scene to fill display is enabled.
|
void |
setEnabledInspection(boolean flag)
Enable whether display and selected geometry can be inspected in control window.
|
void |
setEnabledIntegerPick(boolean flag)
Restrict picking to an integer grid.
|
void |
setEnabledLocalTransform(boolean flag)
Set flag whether local coordinate system is used in camera transformations.
|
void |
setEnabledPainters(boolean flag)
Enable and disable painter's algorithm during drawing, i.e. a z-sort of
drawing items.
|
void |
setEnabledRepaint(boolean flag)
Set flag which determines whether painting is enabled.
|
void |
setEnabledTags(boolean flag)
Enable and disable tag mode to move marked elements.
|
void |
setEnabledUpdate(boolean flag)
Set flag which determines whether update mechanism is enabled.
|
void |
setEnabledZBuffer(boolean flag)
Enable and disable z-buffered drawing of scene.
|
void |
setExternalRenderSize(int width,
int height)
Set dimension of the external render image.
|
void |
setFarClip(double dist)
Set far clip distance of current camera, works even if clipping is disabled.
|
void |
setForegroundColor(java.awt.Color color)
Set foreground color of display.
|
void |
setForegroundImage(java.awt.Image image)
Set foreground image of display canvas.
|
void |
setForegroundImageFile(java.lang.String fileName)
Load an image from file and set it as foreground image of display canvas.
|
void |
setForegroundImageFit(int mode)
Set the mode determining how a background image is scaled w.r.t. the display canvas.
|
void |
setFrame(java.awt.Frame frame)
Set reference to container frame of display, e.g. to allow display to hide/show frame.
|
void |
setFrameLabel(int index,
java.lang.String label)
Sets one of the labels of the coordinate frame.
|
void |
setGridIncrements(int gridOrient,
PdVector gridIncrements)
Set spacing between grid lines in both coordinate directions.
|
void |
setGridOrientation(int gridOrient)
Set orientation of grid which determines the plane in which the grid lies.
|
void |
setImageFitMode(int mode)
Deprecated.
use setBackgroundImageFit(int)
|
void |
setLightingModel(int model)
Set current lighting model, and thereby enable or disable usage of light.
|
void |
setMajorMode(int mode)
Switch between interaction modes like rotating or scaling, usually done interactively.
|
void |
setName(java.lang.String aName)
Set name of this display.
|
void |
setNearClip(double dist)
Set near clip distance of current camera, works even if clipping is disabled.
|
void |
setPaintTag(long flags,
boolean val)
Set all bits which are set in parameter.
|
void |
setParent(PsUpdateIf father)
Set father of display which receives update events when current class has changed.
|
void |
setPickType(int type)
Set pick type which determines the class of pickable geometries
in pick and initialPick mode.
|
void |
setPosition(int xPos,
int yPos)
Set position of upper left corner of frame from outside.
|
void |
setPreferredSize(java.awt.Dimension size)
Set default dimension of drawing canvas from outside.
|
void |
setSceneTitle(java.lang.String title)
Set title of scene.
|
void |
setSearchPaths(java.lang.String[] searchPath)
Set image search paths.
|
void |
setSizeWithinFrame(int width,
int height)
Set dimension of display which is included in a parent frame.
|
void |
setTransformationMode(int mode)
Enable transformation of modeling matrix M of single geometry rather
than transforming the whole scene by modifying project P and view V matrices.
|
void |
setTransMatrix(int type,
PdMatrix mat)
Set transformation matrices PV, P, V and their inverses in current camera and display.
|
void |
setViewer(PvViewerIf viewer)
Set the viewer manager of display, which manages multiple displays and is key listener.
|
void |
showAllViews(boolean flag)
Enable and disable drawing of copyright information in the display window.
|
void |
showAxes(boolean aFlag)
Set visibility of axes active geometry, and create axes if not available.
|
void |
showBackgroundImage(boolean aFlag)
Enable and disable drawing of background image of display window.
|
void |
showBackImage(boolean aFlag)
Deprecated.
use showBackgroundImage(boolean)
|
void |
showBndBox(boolean aFlag)
Set visibility of bounding box of active geometry,
and create bounding box if not available.
|
void |
showCamera(boolean aFlag)
Set visibility of active camera in this display,
and create camera geometry if not available.
|
void |
showCopyright(boolean aFlag)
Enable and disable drawing of copyright information in the display window.
|
void |
showDepthcue(boolean aFlag)
Enable and disable depthcue drawing.
|
void |
showEdgeAura(boolean aFlag)
Enable and disable drawing of edges by one or both elements adjacent to an edge.
|
void |
showEdgesOnce(boolean aFlag)
Enable and disable drawing of edges by one or both elements adjacent to an edge.
|
void |
showForegroundImage(boolean aFlag)
Enable and disable drawing of foreground image of display window.
|
void |
showFrame(boolean aFlag)
Set visibility of coordinate frame is shown, and create frame if not available.
|
void |
showGrid(boolean flag)
Set visibility of grid, and create grid if not available.
|
void |
showInterest(boolean aFlag)
Set visibility of interest of active camera,
and create interest geometry if not available.
|
void |
showMagnet(boolean aFlag)
Attach cursor to vertices if nearby.
|
void |
showTitle(boolean aFlag)
Enable and disable drawing of title north in the display window.
|
void |
start()
Start animation by creating a new thread
|
void |
stop()
Stop animation by stopping the thread.
|
void |
update(java.awt.Graphics g)
Override
Component.update(g) to initiate redrawing of geometries. |
boolean |
update(java.lang.Object event)
Handle update events sent to display by JavaView.
|
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategyaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validatepublic static final int RENDER_AWT
public static final int RENDER_PS
public static final int RENDER_GL
public static final int RENDER_LWJGL
public static int m_renderType
public java.lang.String m_defBackgroundImageFile
public java.lang.String m_backgroundImageFile
public java.lang.String m_defForegroundImageFile
public java.lang.String m_foregroundImageFile
public boolean m_bInsecureKeyRelease
public PvDisplay()
public PvDisplay(PvViewerIf viewer)
viewer - parent of display to handle certain events like export.public PvDisplay(java.applet.Applet applet,
java.awt.Frame frame)
applet - which is container of displayframe - which contains applet, or is container of displaypublic void init()
PvDisplayIfinit in interface PvDisplayIfpublic void reset()
public java.lang.String getName()
getName in interface PsUpdateIfgetName in interface PvDisplayIfgetName in class java.awt.Componentpublic void setName(java.lang.String aName)
setName in interface PvDisplayIfsetName in class java.awt.Componentpublic java.lang.String getSceneTitle()
getSceneTitle in interface PvDisplayIfpublic void setSceneTitle(java.lang.String title)
setSceneTitle in interface PvDisplayIfpublic java.awt.Canvas getCanvas()
getCanvas in interface PvDisplayIfpublic java.awt.Frame getFrame()
getFrame in interface PvDisplayIfpublic void setFrame(java.awt.Frame frame)
setFrame in interface PvDisplayIfpublic PvViewerIf getViewer()
getViewer in interface PvDisplayIfpublic void setViewer(PvViewerIf viewer)
setViewer in interface PvDisplayIfpublic void addKeyListener(java.awt.event.KeyListener listener)
addKeyListener in interface PvDisplayIfaddKeyListener in class java.awt.Componentlistener - which is addedremoveKeyListener(KeyListener)public void removeKeyListener(java.awt.event.KeyListener listener)
removeKeyListener in interface PvDisplayIfremoveKeyListener in class java.awt.Componentlistener - which is addedaddKeyListener(KeyListener)public void addPickListener(PvPickListenerIf listener)
PvPickEvent.addPickListener in interface PvDisplayIflistener - which is addedhasPickListener(PvPickListenerIf),
removePickListener(PvPickListenerIf)public boolean hasPickListener(PvPickListenerIf listener)
hasPickListener in interface PvDisplayIflistener - which is queriedtrue if registered listener found.addPickListener(PvPickListenerIf),
removePickListener(PvPickListenerIf)public boolean removePickListener(PvPickListenerIf listener)
removePickListener in interface PvDisplayIflistener - which is removedfalse if listener does not exists.addPickListener(PvPickListenerIf),
hasPickListener(PvPickListenerIf)public void addGeometryListener(PvGeometryListenerIf listener)
Listener is not informed about changes of special geometries of the display like bndbox, frame, or axis.
addGeometryListener in interface PvDisplayIflistener - which is addedhasGeometryListener(PvGeometryListenerIf),
removeGeometryListener(PvGeometryListenerIf)public boolean hasGeometryListener(PvGeometryListenerIf listener)
hasGeometryListener in interface PvDisplayIflistener - which is queriedtrue if registered listener found.addGeometryListener(PvGeometryListenerIf),
removeGeometryListener(PvGeometryListenerIf)public boolean removeGeometryListener(PvGeometryListenerIf listener)
removeGeometryListener in interface PvDisplayIflistener - which is removedfalse if listener does not exists.addGeometryListener(PvGeometryListenerIf),
hasGeometryListener(PvGeometryListenerIf)public void addCameraListener(PvCameraListenerIf listener)
PvCameraEvent.addCameraListener in interface PvDisplayIflistener - which is addedhasCameraListener(PvCameraListenerIf),
removeCameraListener(PvCameraListenerIf)public boolean hasCameraListener(PvCameraListenerIf listener)
hasCameraListener in interface PvDisplayIflistener - which is queriedtrue if registered listener found.addCameraListener(PvCameraListenerIf),
removeCameraListener(PvCameraListenerIf)public boolean removeCameraListener(PvCameraListenerIf listener)
removeCameraListener in interface PvDisplayIflistener - which is removedfalse if listener does not exists.addCameraListener(PvCameraListenerIf),
hasCameraListener(PvCameraListenerIf)public void requestPickFocus(PvPickListenerIf listener)
requestPickFocus in interface PvDisplayIflistener - which will receives pick eventsreleasePickFocus()public void releasePickFocus()
releasePickFocus in interface PvDisplayIfrequestPickFocus(PvPickListenerIf)public boolean addGeometry(PgGeometryIf aGeom)
After the first geometry is added, the display performs a fit() operation to center and scale the camera such that the geometry is completely visible in the display.
The first geometry added to a display automatically becomes the
active geometry. After having added several geometries the active
geometry may be selected with selectGeometry().
Note, default drawing order is PvGeometryIf#DRAW_ORDER_STANDARD which means, that z-depth of geometry elements
are orderer in comparison with all other geometries. Except, if drawing order
is PvGeometryIf#DRAW_ORDER_FRONT or PvGeometryIf.DRAW_ORDER_BACK then
no comparison is done during display. Use method #setDrawingOrder(int, jv.project.PgGeometryIf) to modify the drawing order of
a geometry after it has been added to the display.
addGeometry in interface PvDisplayIfpublic void removeGeometries()
This method does not remove any special geometry like bounding box, axis frame etc. The special geometries must be removed individually using methods like showBndBox(false).
removeGeometries in interface PvDisplayIfpublic boolean removeGeometry(PgGeometryIf aGeom)
If the currently active geometry is removed, then the first geometry becomes active.
removeGeometry in interface PvDisplayIfpublic boolean selectGeometry(PgGeometryIf aGeom)
selectGeometry in interface PvDisplayIfpublic boolean containsGeometry(PgGeometryIf aGeom)
containsGeometry in interface PvDisplayIfpublic int getNumGeometries()
getNumGeometries in interface PvDisplayIfpublic PgGeometryIf[] getGeometries()
getSelectedGeometry.
Method does not return any special geometries like bounding box
which are for internal use only.getGeometries in interface PvDisplayIfpublic PgGeometryIf[] getVisibleGeometries()
getVisibleGeometries in interface PvDisplayIfpublic PgGeometryIf getSelectedGeometry()
getSelectedGeometry in interface PvDisplayIfpublic void center()
center in interface PvDisplayIfpublic void saveCameraDefaults()
public boolean fit()
fit in interface PvDisplayIfpublic boolean fit(PvCamera camera)
camera - Output parameter for writing the camera after fitting.public java.awt.Color getBackgroundColor()
getBackgroundColor in interface PvDisplayIfpublic void setBackgroundColor(java.awt.Color color)
setBackgroundColor in interface PvDisplayIfpublic java.awt.Color getForegroundColor()
getForegroundColor in interface PvDisplayIfpublic void setForegroundColor(java.awt.Color color)
setForegroundColor in interface PvDisplayIfpublic boolean isEnabledInspection()
isEnabledInspection in interface PvDisplayIfpublic void setEnabledInspection(boolean flag)
setEnabledInspection in interface PvDisplayIfpublic boolean isEnabledAnimation()
isEnabledAnimation in interface PvDisplayIfpublic void setEnabledAnimation(boolean flag)
setEnabledAnimation in interface PvDisplayIfpublic int getAmbientSpace()
public void setAmbientSpace(int mode)
public int getAmbientProjection()
public void setAmbientProjection(int mode)
public boolean isEnabledLocalTransform()
isEnabledLocalTransform in interface PvDisplayIfpublic void setEnabledLocalTransform(boolean flag)
setEnabledLocalTransform in interface PvDisplayIfpublic int getTransformationMode()
getTransformationMode in interface PvDisplayIfpublic void setTransformationMode(int mode)
setTransformationMode in interface PvDisplayIfpublic void resetTransformModel()
public java.lang.String[] getSearchPaths()
public void setSearchPaths(java.lang.String[] searchPath)
searchPath - array of search pathspublic boolean isEnabledFillDisplay()
isEnabledFillDisplay in interface PvDisplayIfpublic void setEnabledFillDisplay(boolean flag)
setEnabledFillDisplay in interface PvDisplayIfpublic int getImageFitMode()
getImageFitMode in interface PvDisplayIfpublic void setImageFitMode(int mode)
setImageFitMode in interface PvDisplayIfpublic int getBackgroundImageFit()
getBackgroundImageFit in interface PvDisplayIfpublic void setBackgroundImageFit(int mode)
setBackgroundImageFit in interface PvDisplayIfpublic int getForegroundImageFit()
getForegroundImageFit in interface PvDisplayIfpublic void setForegroundImageFit(int mode)
setForegroundImageFit in interface PvDisplayIfpublic boolean isShowingBackImage()
isShowingBackImage in interface PvDisplayIfpublic boolean isShowingBackgroundImage()
isShowingBackgroundImage in interface PvDisplayIfpublic void showBackImage(boolean aFlag)
public void showBackgroundImage(boolean aFlag)
showBackgroundImage in interface PvDisplayIfpublic boolean isShowingForegroundImage()
isShowingForegroundImage in interface PvDisplayIfpublic void showForegroundImage(boolean aFlag)
showForegroundImage in interface PvDisplayIfpublic boolean isShowingCopyright()
isShowingCopyright in interface PvDisplayIfpublic void showCopyright(boolean aFlag)
showCopyright in interface PvDisplayIfpublic boolean isShowingTitle()
isShowingTitle in interface PvDisplayIfpublic void showTitle(boolean aFlag)
showTitle in interface PvDisplayIfpublic boolean isShowingDepthcue()
True if depthcue is enabled. No depthcue for non-perspective projections.
Depthcue is always switched off for non-perspective projections since they
usually show planar geometries where depthcue makes not too much sense.isShowingDepthcue in interface PvDisplayIfpublic void showDepthcue(boolean aFlag)
showDepthcue in interface PvDisplayIfpublic int getLightingModel()
getLightingModel in interface PvDisplayIfpublic void setLightingModel(int model)
setLightingModel in interface PvDisplayIfmodel - lighting model as determined by PvLightIf.MODEL_LIGHT etc.public boolean isShowingEdgesOnce()
isShowingEdgesOnce in interface PvDisplayIfpublic void showEdgesOnce(boolean aFlag)
showEdgesOnce in interface PvDisplayIfpublic boolean isShowingEdgeAura()
isShowingEdgeAura in interface PvDisplayIfpublic void showEdgeAura(boolean aFlag)
showEdgeAura in interface PvDisplayIfpublic void setDrawingOrder(int order,
PgGeometryIf aGeom)
PvGeometryIf#DRAW_ORDER_STANDARD.setDrawingOrder in interface PvDisplayIfPvGeometryIfpublic boolean isShowingGrid()
isShowingGrid in interface PvDisplayIfpublic void showGrid(boolean flag)
showGrid in interface PvDisplayIfpublic PdVector getGridIncrements(int gridOrient)
getGridIncrements in interface PvDisplayIfpublic void setGridIncrements(int gridOrient,
PdVector gridIncrements)
setGridIncrements in interface PvDisplayIfgridOrient - Determines the xy, yz, or xz plane, see PvDisplayIf#GRID_XY.gridIncrements - Determine the spacing for both gridlines.public int getGridOrientation()
public void setGridOrientation(int gridOrient)
gridOrient - Orientation identified as PvGrid#GRID_XY etc.public java.lang.String getFrameLabel(int index)
index - 0 for x-Axis, 1 for y-Axis and so onshowFrame(boolean)public void setFrameLabel(int index,
java.lang.String label)
index - 0 for x-Axis, 1 for y-Axis and so onshowFrame(boolean)public boolean isShowingFrame()
isShowingFrame in interface PvDisplayIfpublic void showFrame(boolean aFlag)
showFrame in interface PvDisplayIfpublic boolean isShowingBndBox()
isShowingBndBox in interface PvDisplayIfpublic void showBndBox(boolean aFlag)
showBndBox in interface PvDisplayIfpublic java.awt.Color getBndBoxColor()
getBndBoxColor in interface PvDisplayIfpublic void setBndBoxColor(java.awt.Color color)
setBndBoxColor in interface PvDisplayIfcolor - color of bounding boxpublic double getBndBoxSize()
getBndBoxSize in interface PvDisplayIfpublic void setBndBoxSize(double size)
setBndBoxSize in interface PvDisplayIfsize - thickness of edges bounding boxpublic boolean isShowingInterest()
public void showInterest(boolean aFlag)
BETA: Currently only used in fly mode.
public boolean isShowingCamera()
public void showCamera(boolean aFlag)
public boolean isEnabledClearScreen()
public void setEnabledClearScreen(boolean aFlag)
public boolean addLight(PvLightIf light)
addLight in interface PvDisplayIflight - new light added to scenepublic int getNumLights()
getNumLights in interface PvDisplayIfpublic PvLightIf getLight()
getLight in interface PvDisplayIfpublic PvLightIf[] getLights()
getLights in interface PvDisplayIfpublic boolean hasLight(PvLightIf light)
hasLight in interface PvDisplayIflight - a light objecttrue if light is registered.public void removeLights()
removeLights in interface PvDisplayIfpublic boolean removeLight(PvLightIf light)
removeLight in interface PvDisplayIflight - a registered light object to be removedtrue if light was found and successfully removed.public PvLightIf getSelectedLight()
getSelectedLight in interface PvDisplayIfpublic boolean hasAxes()
public void recomputeAxes()
public PgAxes getAxes()
Before v2.00 of this method, axes were created if they did not exist.
public void setAxes(PgAxes axes)
public boolean isShowingAxes()
isShowingAxes in interface PvDisplayIfpublic void showAxes(boolean aFlag)
showAxes in interface PvDisplayIfpublic int getPickType()
A set of geometry classes may be determined using or'ed combinations of other PICK_yyy types.
PvDisplayIf.PICK_ALLpublic void setPickType(int type)
A set of geometry classes may be determined using or'ed combinations of other PICK_yyy types.
PvDisplayIf.PICK_ALLpublic boolean isEnabledIntegerPick()
isEnabledIntegerPick in interface PvDisplayIfpublic void setEnabledIntegerPick(boolean flag)
setEnabledIntegerPick in interface PvDisplayIfpublic boolean isShowingMagnet()
isShowingMagnet in interface PvDisplayIfpublic void showMagnet(boolean aFlag)
showMagnet in interface PvDisplayIfpublic boolean isEnabledDirectSelect()
isEnabledDirectSelect in interface PvDisplayIfpublic void setEnabledDirectSelect(boolean flag)
setEnabledDirectSelect in interface PvDisplayIfpublic static boolean isEnabledFastClipping()
public static void setEnabledFastClipping(boolean aFlag)
isEnabledFastClipping()public static boolean isEnabledFastZBuffer()
setEnabledZBuffer.public static void setEnabledFastZBuffer(boolean aFlag)
setEnabledZBuffer..public boolean isEnabledZBuffer()
isEnabledZBuffer in interface PvDisplayIfpublic void setEnabledZBuffer(boolean flag)
setEnabledFastZBuffer.setEnabledZBuffer in interface PvDisplayIfisEnabledZBuffer(),
setEnabledFastZBuffer(boolean)public boolean isEnabledTags()
public void setEnabledTags(boolean flag)
public boolean isEnabledPainters()
isEnabledPainters in interface PvDisplayIfpublic void setEnabledPainters(boolean flag)
setEnabledPainters in interface PvDisplayIfpublic boolean isEnabledClip()
isEnabledClip in interface PvDisplayIfpublic void setEnabledClip(boolean flag)
setEnabledClip in interface PvDisplayIfpublic boolean isEnabledClipAutoBounds()
isEnabledClipAutoBounds in interface PvDisplayIfpublic void setEnabledClipAutoBounds(boolean flag)
setEnabledClipAutoBounds in interface PvDisplayIfpublic boolean isEnabledClipBounds()
isEnabledClipBounds in interface PvDisplayIfpublic void setEnabledClipBounds(boolean flag)
setEnabledClipBounds in interface PvDisplayIfpublic boolean isEnabledBoxRatio()
isEnabledBoxRatio in interface PvDisplayIfpublic void setEnabledBoxRatio(boolean flag)
setEnabledBoxRatio in interface PvDisplayIfpublic PdVector getBoxRatio()
getBoxRatio in interface PvDisplayIfpublic void setBoxRatio(PdVector ratio)
setBoxRatio in interface PvDisplayIfratio - scaling factors of coordinate axespublic boolean isClip()
#isEnabledClipisClip in interface PvDisplayIfpublic void enableClip(boolean aFlag)
#setEnabledClipenableClip in interface PvDisplayIfpublic double getNearClip()
getNearClip in interface PvDisplayIfpublic void setNearClip(double dist)
setNearClip in interface PvDisplayIfpublic double getFarClip()
getFarClip in interface PvDisplayIfpublic void setFarClip(double dist)
setFarClip in interface PvDisplayIfpublic int getClipBoundsType()
getClipBoundsType in interface PvDisplayIfpublic void setClipBoundsType(int type)
setClipBoundsType in interface PvDisplayIfpublic double[] getClipBounds(int ind)
getClipBounds in interface PvDisplayIfind - index of ruler of axes in which direction is clippedpublic void setClipBounds(int ind,
double[] range)
setClipBounds in interface PvDisplayIfind - index of ruler of axes in which direction is clippedrange - minimum and maximum of visible range in axis directionpublic boolean isEnabled3DLook()
isEnabled3DLook in interface PvDisplayIfpublic void setEnabled3DLook(boolean flag)
setEnabled3DLook in interface PvDisplayIfpublic boolean isEnabledAdaptiveSize()
isEnabledAdaptiveSize in interface PvDisplayIfpublic void setEnabledAdaptiveSize(boolean flag)
setEnabledAdaptiveSize in interface PvDisplayIfpublic PdMatrix getTransMatrix(int type)
getTransMatrix in interface PvDisplayIftype - Any matrix type jv.project.PvDisplayIf#MATRIX_...public void setTransMatrix(int type,
PdMatrix mat)
Modeling matrix should be set in original geometry model.
setTransMatrix in interface PvDisplayIftype - Any matrix type jv.project.PvDisplayIf#MATRIX_...public boolean isShowingAllViews()
public int addCamera(java.lang.String aName,
PvCamera aCamera)
public PvCameraIf getCamera()
getCamera in interface PvDisplayIfpublic PvCameraIf[] getCameras()
getCameras in interface PvDisplayIfpublic PvCameraIf getCamera(int type)
PvCameraIf#CAMERA_PERSPECTIVE,
PvCameraIf#CAMERA_ORTHO_XY,
PvCameraIf#CAMERA_ORTHO_XZ,
PvCameraIf#CAMERA_ORTHO_YZ,
For a list of possible types see PvDisplayIf.getCamera in interface PvDisplayIftype - of cameranull if argument out of bounds or camera not found.public boolean hasCamera(int type)
PvCameraIf#CAMERA_PERSPECTIVE,
PvCameraIf#CAMERA_ORTHO_XY,
PvCameraIf#CAMERA_ORTHO_XZ,
PvCameraIf#CAMERA_ORTHO_YZ,
For a list of possible types see PvDisplayIf.hasCamera in interface PvDisplayIftype - of cameranull if argument out of bounds or camera not found.selectCamera(int)public boolean removeCamera(int type)
PvCameraIf#CAMERA_PERSPECTIVE,
PvCameraIf#CAMERA_ORTHO_XY,
PvCameraIf#CAMERA_ORTHO_XZ,
PvCameraIf#CAMERA_ORTHO_YZ,
For a list of possible types see PvDisplayIf.removeCamera in interface PvDisplayIftype - of cameratrue if camera was found and successfully removed.public java.awt.Point getPosition(int xPos,
int yPos)
public void setPosition(int xPos,
int yPos)
public java.awt.Dimension getSize()
getSize in interface PvDisplayIfgetSize in class java.awt.Componentpublic void setSizeWithinFrame(int width,
int height)
setSize(Dimension)
resp. setSize(int, int).
Size of parent frame is the size of the display plus the its border margins.setSizeWithinFrame in interface PvDisplayIfwidth - width of display area, not of parent frameheight - height of display area, not of parent framepublic static void setDefaultSize(java.awt.Dimension size)
public void setPreferredSize(java.awt.Dimension size)
setPreferredSize in class java.awt.Componentpublic void setExternalRenderSize(int width,
int height)
setEnabledExternalRendering(boolean)
then the offscreen image is automatically resized to the required size
of this display canvas.width - width of external render imageheight - height of external render imagepublic boolean isEnabledExternalRendering()
public void setEnabledExternalRendering(boolean flag)
Drawing into an external image currently blocks rendering into the
AWT drawing canvas of this display. Currently, the external image
is the offscreen image which may be obtained from this display
using getImage() but future versions will allow
to set the external image into which rendering is done.
public PsUpdateIf getFather()
getFather in interface PsUpdateIfPsUpdateIf.setParent(PsUpdateIf),
PsUpdateIf.update(Object)public void setParent(PsUpdateIf father)
setParent in interface PsUpdateIffather - will receive events which this does not handlePsUpdateIf.getFather(),
PsUpdateIf.update(Object)public boolean isEnabledRepaint()
isEnabledRepaint in interface PvDisplayIfpublic void setEnabledRepaint(boolean flag)
setEnabledRepaint in interface PvDisplayIfpublic boolean isEnabledUpdate()
isEnabledUpdate in interface PvDisplayIfpublic void setEnabledUpdate(boolean flag)
setEnabledUpdate in interface PvDisplayIfpublic boolean update(java.lang.Object event)
update in interface PsUpdateIfupdate in interface PvDisplayIfevent - carries a lot of informationPsObject,
PsUpdateIf.getFather(),
PsUpdateIf.setParent(PsUpdateIf)public boolean hasPaintTag(long flags)
hasPaintTag in interface PvDisplayIfsetPaintTag(long, boolean)public void setPaintTag(long flags,
boolean val)
jv.project.PvDisplayIf
for a list of possible flags.
Special flag for internal purpose is PAINT_ZOOM: Scale transformation matrix to simulate floating point accuracy in pixel integers. Required for PostScript printing to increase pixel accuracy.
HACK: This PostScript Driver temporarily scales all integer valued quantities during display by a factor of PS_ZOOM to increase accuracy. The variable PS_ZOOM is set to allow to adjust all 'thickness' sizes as well. The thickness sizes are not scaled by PostScript, so we must do it in PvThickGraphics by hand. This procedure is very error prune.
Setting flag PvDisplayIf#PAINT_ALL
invokes a repaint() of the display, just for convenience.
setPaintTag in interface PvDisplayIfhasPaintTag(long)public boolean isEnabledAntiAlias()
isEnabledAntiAlias in interface PvDisplayIfpublic void setEnabledAntiAlias(boolean flag)
setEnabledAntiAlias in interface PvDisplayIfpublic boolean isEnabledDoubleBuffer()
isEnabledDoubleBuffer in interface PvDisplayIfpublic void setEnabledDoubleBuffer(boolean flag)
setEnabledDoubleBuffer in interface PvDisplayIfpublic void paint(java.awt.Graphics g)
Canvas.paint(g) to initiate redrawing of geometries.paint in class java.awt.Canvaspublic void update(java.awt.Graphics g)
Component.update(g) to initiate redrawing of geometries.update in class java.awt.Canvaspublic void repaint()
repaint in class java.awt.Componentpublic void render()
public boolean resizeImage()
false if size of display still 0.public void setAutoCenter(boolean flag)
false will prevent automatic centering.setAutoCenter in interface PvDisplayIfpublic java.awt.Image getImage()
getImage in interface PvDisplayIfpublic java.awt.Image getBackgroundImage()
getBackgroundImage in interface PvDisplayIfpublic void setBackgroundImage(java.awt.Image anImage)
showForegroundImage(boolean)
to set visibility of foreground image.setBackgroundImage in interface PvDisplayIfpublic java.lang.String getBackgroundImageFile()
getBackgroundImageFile in interface PvDisplayIfpublic void setBackgroundImageFile(java.lang.String fileName)
setBackgroundImageFile in interface PvDisplayIffileName - relative file name of image.public void setBackgroundImage(java.lang.String fileName)
fileName - relative file name of image.public java.awt.Image getForegroundImage()
getForegroundImage in interface PvDisplayIfpublic void setForegroundImage(java.awt.Image image)
showForegroundImage(boolean)
to set visibility of foreground image.setForegroundImage in interface PvDisplayIfpublic java.lang.String getForegroundImageFile()
getForegroundImageFile in interface PvDisplayIfpublic void setForegroundImageFile(java.lang.String fileName)
setForegroundImageFile in interface PvDisplayIffileName - relative file name of image.public void mousePressed(java.awt.event.MouseEvent event)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseReleased(java.awt.event.MouseEvent event)
mouseReleased in interface java.awt.event.MouseListenerpublic PvPickEvent getPickEvent(int x, int y)
The set of tested geometries is determined by the method getPickType().
x - x coordinate of mouse pick in pixel coordinates of display.y - y coordinate of mouse pick in pixel coordinates of display.getPickEvent(int, int, int),
getPickType()public PvPickEvent getPickEvent(int x, int y, int pickType)
The parameter pickType determines the set of tested geometries. The different types are given, for example, by: PvDisplay.PICK_SELECTED|PvDisplay.PICK_UNSELECTED.
x - x coordinate of mouse pick in pixel coordinates of display.y - y coordinate of mouse pick in pixel coordinates of display.pickType - Determines the set of tested geometries.getPickEvent(int, int)public void mouseMoved(java.awt.event.MouseEvent event)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void mouseEntered(java.awt.event.MouseEvent event)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent event)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseClicked(java.awt.event.MouseEvent event)
mouseClicked in interface java.awt.event.MouseListenerpublic int getMajorMode()
PvDisplayIf.MODE_SCALEgetMajorMode in interface PvDisplayIfsetMajorMode(int)public void setMajorMode(int mode)
PvDisplayIf.MODE_SCALEsetMajorMode in interface PvDisplayIfmode - any of the modes available in PvDisplayIf.getMajorMode()public void keyTyped(java.awt.event.KeyEvent event)
keyTyped in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent event)
keyReleased in interface java.awt.event.KeyListenerpublic void keyPressed(java.awt.event.KeyEvent event)
keyPressed in interface java.awt.event.KeyListenerpublic void configure(PvDisplayIf disp)
disp - target display which will be configuredpublic void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed in interface java.awt.event.ActionListenerpublic void clearPopupMenu()
clearPopupMenu in interface PvDisplayIfaddPopupItem(int)public void addPopupItem(int menuID)
Possible menu items are all major modes of PvDisplay specified in PsViewerIf#MENU_DISPLAY_XXX plus MENU_FILE_NEW_DISPLAY, MENU_WINDOW_CONSOLE, MENU_INSPECTOR and MENU_SEPARATOR.
addPopupItem in interface PvDisplayIfclearPopupMenu()public PsPanel getInfoPanel()
getInfoPanel in interface PvDisplayIfpublic PsPanel getCameraPanel()
getCameraPanel in interface PvDisplayIfpublic PsPanel getAxisPanel()
public PsPanel getAxisPanel(int ind)
ind - identifies requested ruler, for example, PsViewerIf.AXIS_X.public PsPanel getLightPanel()
getLightPanel in interface PvDisplayIfpublic java.awt.Dimension getMinimumSize()
getMinimumSize in class java.awt.Componentpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class java.awt.Componentpublic void start()
start in interface PvDisplayIfpublic void stop()
stop in interface PvDisplayIfpublic void setAutoRotation(PdVector axis, double angle)
setAutoRotation in interface PvDisplayIfpublic boolean incrementAutoRotation()
incrementAutoRotation in interface PvDisplayIfpublic void run()
run in interface java.lang.Runnablepublic void burn()
public boolean selectLight(PvLightIf light)
selectLight in interface PvDisplayIflight - a registered light objecttrue if light was found and successfully selected.public void showAllViews(boolean flag)
flag - enable or disable 4-camera-viewpublic boolean selectCamera(int type)
PvCameraIf#CAMERA_PERSPECTIVE,
PvCameraIf#CAMERA_ORTHO_XY,
PvCameraIf#CAMERA_ORTHO_XZ,
PvCameraIf#CAMERA_ORTHO_YZ,
For a list of possible types see PvDisplayIf.selectCamera in interface PvDisplayIftype - of camerafalse if type is outOfBounds."