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_ALIGNMENT
CAMERA_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, getBufferStrategy
action, 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, validate
public 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()
PvDisplayIf
init
in interface PvDisplayIf
public void reset()
public java.lang.String getName()
getName
in interface PsUpdateIf
getName
in interface PvDisplayIf
getName
in class java.awt.Component
public void setName(java.lang.String aName)
setName
in interface PvDisplayIf
setName
in class java.awt.Component
public java.lang.String getSceneTitle()
getSceneTitle
in interface PvDisplayIf
public void setSceneTitle(java.lang.String title)
setSceneTitle
in interface PvDisplayIf
public java.awt.Canvas getCanvas()
getCanvas
in interface PvDisplayIf
public java.awt.Frame getFrame()
getFrame
in interface PvDisplayIf
public void setFrame(java.awt.Frame frame)
setFrame
in interface PvDisplayIf
public PvViewerIf getViewer()
getViewer
in interface PvDisplayIf
public void setViewer(PvViewerIf viewer)
setViewer
in interface PvDisplayIf
public void addKeyListener(java.awt.event.KeyListener listener)
addKeyListener
in interface PvDisplayIf
addKeyListener
in class java.awt.Component
listener
- which is addedremoveKeyListener(KeyListener)
public void removeKeyListener(java.awt.event.KeyListener listener)
removeKeyListener
in interface PvDisplayIf
removeKeyListener
in class java.awt.Component
listener
- which is addedaddKeyListener(KeyListener)
public void addPickListener(PvPickListenerIf listener)
PvPickEvent
.addPickListener
in interface PvDisplayIf
listener
- which is addedhasPickListener(PvPickListenerIf)
,
removePickListener(PvPickListenerIf)
public boolean hasPickListener(PvPickListenerIf listener)
hasPickListener
in interface PvDisplayIf
listener
- which is queriedtrue
if registered listener found.addPickListener(PvPickListenerIf)
,
removePickListener(PvPickListenerIf)
public boolean removePickListener(PvPickListenerIf listener)
removePickListener
in interface PvDisplayIf
listener
- 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 PvDisplayIf
listener
- which is addedhasGeometryListener(PvGeometryListenerIf)
,
removeGeometryListener(PvGeometryListenerIf)
public boolean hasGeometryListener(PvGeometryListenerIf listener)
hasGeometryListener
in interface PvDisplayIf
listener
- which is queriedtrue
if registered listener found.addGeometryListener(PvGeometryListenerIf)
,
removeGeometryListener(PvGeometryListenerIf)
public boolean removeGeometryListener(PvGeometryListenerIf listener)
removeGeometryListener
in interface PvDisplayIf
listener
- which is removedfalse
if listener does not exists.addGeometryListener(PvGeometryListenerIf)
,
hasGeometryListener(PvGeometryListenerIf)
public void addCameraListener(PvCameraListenerIf listener)
PvCameraEvent
.addCameraListener
in interface PvDisplayIf
listener
- which is addedhasCameraListener(PvCameraListenerIf)
,
removeCameraListener(PvCameraListenerIf)
public boolean hasCameraListener(PvCameraListenerIf listener)
hasCameraListener
in interface PvDisplayIf
listener
- which is queriedtrue
if registered listener found.addCameraListener(PvCameraListenerIf)
,
removeCameraListener(PvCameraListenerIf)
public boolean removeCameraListener(PvCameraListenerIf listener)
removeCameraListener
in interface PvDisplayIf
listener
- which is removedfalse
if listener does not exists.addCameraListener(PvCameraListenerIf)
,
hasCameraListener(PvCameraListenerIf)
public void requestPickFocus(PvPickListenerIf listener)
requestPickFocus
in interface PvDisplayIf
listener
- which will receives pick eventsreleasePickFocus()
public void releasePickFocus()
releasePickFocus
in interface PvDisplayIf
requestPickFocus(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 PvDisplayIf
public 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 PvDisplayIf
public boolean removeGeometry(PgGeometryIf aGeom)
If the currently active geometry is removed, then the first geometry becomes active.
removeGeometry
in interface PvDisplayIf
public boolean selectGeometry(PgGeometryIf aGeom)
selectGeometry
in interface PvDisplayIf
public boolean containsGeometry(PgGeometryIf aGeom)
containsGeometry
in interface PvDisplayIf
public int getNumGeometries()
getNumGeometries
in interface PvDisplayIf
public PgGeometryIf[] getGeometries()
getSelectedGeometry
.
Method does not return any special geometries like bounding box
which are for internal use only.getGeometries
in interface PvDisplayIf
public PgGeometryIf[] getVisibleGeometries()
getVisibleGeometries
in interface PvDisplayIf
public PgGeometryIf getSelectedGeometry()
getSelectedGeometry
in interface PvDisplayIf
public void center()
center
in interface PvDisplayIf
public void saveCameraDefaults()
public boolean fit()
fit
in interface PvDisplayIf
public boolean fit(PvCamera camera)
camera
- Output parameter for writing the camera after fitting.public java.awt.Color getBackgroundColor()
getBackgroundColor
in interface PvDisplayIf
public void setBackgroundColor(java.awt.Color color)
setBackgroundColor
in interface PvDisplayIf
public java.awt.Color getForegroundColor()
getForegroundColor
in interface PvDisplayIf
public void setForegroundColor(java.awt.Color color)
setForegroundColor
in interface PvDisplayIf
public boolean isEnabledInspection()
isEnabledInspection
in interface PvDisplayIf
public void setEnabledInspection(boolean flag)
setEnabledInspection
in interface PvDisplayIf
public boolean isEnabledAnimation()
isEnabledAnimation
in interface PvDisplayIf
public void setEnabledAnimation(boolean flag)
setEnabledAnimation
in interface PvDisplayIf
public int getAmbientSpace()
public void setAmbientSpace(int mode)
public int getAmbientProjection()
public void setAmbientProjection(int mode)
public boolean isEnabledLocalTransform()
isEnabledLocalTransform
in interface PvDisplayIf
public void setEnabledLocalTransform(boolean flag)
setEnabledLocalTransform
in interface PvDisplayIf
public int getTransformationMode()
getTransformationMode
in interface PvDisplayIf
public void setTransformationMode(int mode)
setTransformationMode
in interface PvDisplayIf
public void resetTransformModel()
public java.lang.String[] getSearchPaths()
public void setSearchPaths(java.lang.String[] searchPath)
searchPath
- array of search pathspublic boolean isEnabledFillDisplay()
isEnabledFillDisplay
in interface PvDisplayIf
public void setEnabledFillDisplay(boolean flag)
setEnabledFillDisplay
in interface PvDisplayIf
public int getImageFitMode()
getImageFitMode
in interface PvDisplayIf
public void setImageFitMode(int mode)
setImageFitMode
in interface PvDisplayIf
public int getBackgroundImageFit()
getBackgroundImageFit
in interface PvDisplayIf
public void setBackgroundImageFit(int mode)
setBackgroundImageFit
in interface PvDisplayIf
public int getForegroundImageFit()
getForegroundImageFit
in interface PvDisplayIf
public void setForegroundImageFit(int mode)
setForegroundImageFit
in interface PvDisplayIf
public boolean isShowingBackImage()
isShowingBackImage
in interface PvDisplayIf
public boolean isShowingBackgroundImage()
isShowingBackgroundImage
in interface PvDisplayIf
public void showBackImage(boolean aFlag)
public void showBackgroundImage(boolean aFlag)
showBackgroundImage
in interface PvDisplayIf
public boolean isShowingForegroundImage()
isShowingForegroundImage
in interface PvDisplayIf
public void showForegroundImage(boolean aFlag)
showForegroundImage
in interface PvDisplayIf
public boolean isShowingCopyright()
isShowingCopyright
in interface PvDisplayIf
public void showCopyright(boolean aFlag)
showCopyright
in interface PvDisplayIf
public boolean isShowingTitle()
isShowingTitle
in interface PvDisplayIf
public void showTitle(boolean aFlag)
showTitle
in interface PvDisplayIf
public 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 PvDisplayIf
public void showDepthcue(boolean aFlag)
showDepthcue
in interface PvDisplayIf
public int getLightingModel()
getLightingModel
in interface PvDisplayIf
public void setLightingModel(int model)
setLightingModel
in interface PvDisplayIf
model
- lighting model as determined by PvLightIf.MODEL_LIGHT etc.public boolean isShowingEdgesOnce()
isShowingEdgesOnce
in interface PvDisplayIf
public void showEdgesOnce(boolean aFlag)
showEdgesOnce
in interface PvDisplayIf
public boolean isShowingEdgeAura()
isShowingEdgeAura
in interface PvDisplayIf
public void showEdgeAura(boolean aFlag)
showEdgeAura
in interface PvDisplayIf
public void setDrawingOrder(int order, PgGeometryIf aGeom)
PvGeometryIf#DRAW_ORDER_STANDARD
.setDrawingOrder
in interface PvDisplayIf
PvGeometryIf
public boolean isShowingGrid()
isShowingGrid
in interface PvDisplayIf
public void showGrid(boolean flag)
showGrid
in interface PvDisplayIf
public PdVector getGridIncrements(int gridOrient)
getGridIncrements
in interface PvDisplayIf
public void setGridIncrements(int gridOrient, PdVector gridIncrements)
setGridIncrements
in interface PvDisplayIf
gridOrient
- 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 PvDisplayIf
public void showFrame(boolean aFlag)
showFrame
in interface PvDisplayIf
public boolean isShowingBndBox()
isShowingBndBox
in interface PvDisplayIf
public void showBndBox(boolean aFlag)
showBndBox
in interface PvDisplayIf
public java.awt.Color getBndBoxColor()
getBndBoxColor
in interface PvDisplayIf
public void setBndBoxColor(java.awt.Color color)
setBndBoxColor
in interface PvDisplayIf
color
- color of bounding boxpublic double getBndBoxSize()
getBndBoxSize
in interface PvDisplayIf
public void setBndBoxSize(double size)
setBndBoxSize
in interface PvDisplayIf
size
- 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 PvDisplayIf
light
- new light added to scenepublic int getNumLights()
getNumLights
in interface PvDisplayIf
public PvLightIf getLight()
getLight
in interface PvDisplayIf
public PvLightIf[] getLights()
getLights
in interface PvDisplayIf
public boolean hasLight(PvLightIf light)
hasLight
in interface PvDisplayIf
light
- a light objecttrue
if light is registered.public void removeLights()
removeLights
in interface PvDisplayIf
public boolean removeLight(PvLightIf light)
removeLight
in interface PvDisplayIf
light
- a registered light object to be removedtrue
if light was found and successfully removed.public PvLightIf getSelectedLight()
getSelectedLight
in interface PvDisplayIf
public 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 PvDisplayIf
public void showAxes(boolean aFlag)
showAxes
in interface PvDisplayIf
public int getPickType()
A set of geometry classes may be determined using or'ed combinations of other PICK_yyy types.
PvDisplayIf.PICK_ALL
public void setPickType(int type)
A set of geometry classes may be determined using or'ed combinations of other PICK_yyy types.
PvDisplayIf.PICK_ALL
public boolean isEnabledIntegerPick()
isEnabledIntegerPick
in interface PvDisplayIf
public void setEnabledIntegerPick(boolean flag)
setEnabledIntegerPick
in interface PvDisplayIf
public boolean isShowingMagnet()
isShowingMagnet
in interface PvDisplayIf
public void showMagnet(boolean aFlag)
showMagnet
in interface PvDisplayIf
public boolean isEnabledDirectSelect()
isEnabledDirectSelect
in interface PvDisplayIf
public void setEnabledDirectSelect(boolean flag)
setEnabledDirectSelect
in interface PvDisplayIf
public 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 PvDisplayIf
public void setEnabledZBuffer(boolean flag)
setEnabledFastZBuffer
.setEnabledZBuffer
in interface PvDisplayIf
isEnabledZBuffer()
,
setEnabledFastZBuffer(boolean)
public boolean isEnabledTags()
public void setEnabledTags(boolean flag)
public boolean isEnabledPainters()
isEnabledPainters
in interface PvDisplayIf
public void setEnabledPainters(boolean flag)
setEnabledPainters
in interface PvDisplayIf
public boolean isEnabledClip()
isEnabledClip
in interface PvDisplayIf
public void setEnabledClip(boolean flag)
setEnabledClip
in interface PvDisplayIf
public boolean isEnabledClipAutoBounds()
isEnabledClipAutoBounds
in interface PvDisplayIf
public void setEnabledClipAutoBounds(boolean flag)
setEnabledClipAutoBounds
in interface PvDisplayIf
public boolean isEnabledClipBounds()
isEnabledClipBounds
in interface PvDisplayIf
public void setEnabledClipBounds(boolean flag)
setEnabledClipBounds
in interface PvDisplayIf
public boolean isEnabledBoxRatio()
isEnabledBoxRatio
in interface PvDisplayIf
public void setEnabledBoxRatio(boolean flag)
setEnabledBoxRatio
in interface PvDisplayIf
public PdVector getBoxRatio()
getBoxRatio
in interface PvDisplayIf
public void setBoxRatio(PdVector ratio)
setBoxRatio
in interface PvDisplayIf
ratio
- scaling factors of coordinate axespublic boolean isClip()
#isEnabledClip
isClip
in interface PvDisplayIf
public void enableClip(boolean aFlag)
#setEnabledClip
enableClip
in interface PvDisplayIf
public double getNearClip()
getNearClip
in interface PvDisplayIf
public void setNearClip(double dist)
setNearClip
in interface PvDisplayIf
public double getFarClip()
getFarClip
in interface PvDisplayIf
public void setFarClip(double dist)
setFarClip
in interface PvDisplayIf
public int getClipBoundsType()
getClipBoundsType
in interface PvDisplayIf
public void setClipBoundsType(int type)
setClipBoundsType
in interface PvDisplayIf
public double[] getClipBounds(int ind)
getClipBounds
in interface PvDisplayIf
ind
- index of ruler of axes in which direction is clippedpublic void setClipBounds(int ind, double[] range)
setClipBounds
in interface PvDisplayIf
ind
- index of ruler of axes in which direction is clippedrange
- minimum and maximum of visible range in axis directionpublic boolean isEnabled3DLook()
isEnabled3DLook
in interface PvDisplayIf
public void setEnabled3DLook(boolean flag)
setEnabled3DLook
in interface PvDisplayIf
public boolean isEnabledAdaptiveSize()
isEnabledAdaptiveSize
in interface PvDisplayIf
public void setEnabledAdaptiveSize(boolean flag)
setEnabledAdaptiveSize
in interface PvDisplayIf
public PdMatrix getTransMatrix(int type)
getTransMatrix
in interface PvDisplayIf
type
- 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 PvDisplayIf
type
- 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 PvDisplayIf
public PvCameraIf[] getCameras()
getCameras
in interface PvDisplayIf
public 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 PvDisplayIf
type
- 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 PvDisplayIf
type
- 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 PvDisplayIf
type
- 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 PvDisplayIf
getSize
in class java.awt.Component
public 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 PvDisplayIf
width
- 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.Component
public 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 PsUpdateIf
PsUpdateIf.setParent(PsUpdateIf)
,
PsUpdateIf.update(Object)
public void setParent(PsUpdateIf father)
setParent
in interface PsUpdateIf
father
- will receive events which this
does not handlePsUpdateIf.getFather()
,
PsUpdateIf.update(Object)
public boolean isEnabledRepaint()
isEnabledRepaint
in interface PvDisplayIf
public void setEnabledRepaint(boolean flag)
setEnabledRepaint
in interface PvDisplayIf
public boolean isEnabledUpdate()
isEnabledUpdate
in interface PvDisplayIf
public void setEnabledUpdate(boolean flag)
setEnabledUpdate
in interface PvDisplayIf
public boolean update(java.lang.Object event)
update
in interface PsUpdateIf
update
in interface PvDisplayIf
event
- carries a lot of informationPsObject
,
PsUpdateIf.getFather()
,
PsUpdateIf.setParent(PsUpdateIf)
public boolean hasPaintTag(long flags)
hasPaintTag
in interface PvDisplayIf
setPaintTag(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 PvDisplayIf
hasPaintTag(long)
public boolean isEnabledAntiAlias()
isEnabledAntiAlias
in interface PvDisplayIf
public void setEnabledAntiAlias(boolean flag)
setEnabledAntiAlias
in interface PvDisplayIf
public boolean isEnabledDoubleBuffer()
isEnabledDoubleBuffer
in interface PvDisplayIf
public void setEnabledDoubleBuffer(boolean flag)
setEnabledDoubleBuffer
in interface PvDisplayIf
public void paint(java.awt.Graphics g)
Canvas.paint(g)
to initiate redrawing of geometries.paint
in class java.awt.Canvas
public void update(java.awt.Graphics g)
Component.update(g)
to initiate redrawing of geometries.update
in class java.awt.Canvas
public void repaint()
repaint
in class java.awt.Component
public 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 PvDisplayIf
public java.awt.Image getImage()
getImage
in interface PvDisplayIf
public java.awt.Image getBackgroundImage()
getBackgroundImage
in interface PvDisplayIf
public void setBackgroundImage(java.awt.Image anImage)
showForegroundImage(boolean)
to set visibility of foreground image.setBackgroundImage
in interface PvDisplayIf
public java.lang.String getBackgroundImageFile()
getBackgroundImageFile
in interface PvDisplayIf
public void setBackgroundImageFile(java.lang.String fileName)
setBackgroundImageFile
in interface PvDisplayIf
fileName
- 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 PvDisplayIf
public void setForegroundImage(java.awt.Image image)
showForegroundImage(boolean)
to set visibility of foreground image.setForegroundImage
in interface PvDisplayIf
public java.lang.String getForegroundImageFile()
getForegroundImageFile
in interface PvDisplayIf
public void setForegroundImageFile(java.lang.String fileName)
setForegroundImageFile
in interface PvDisplayIf
fileName
- relative file name of image.public void mousePressed(java.awt.event.MouseEvent event)
mousePressed
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseReleased(java.awt.event.MouseEvent event)
mouseReleased
in interface java.awt.event.MouseListener
public 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.MouseMotionListener
public void mouseEntered(java.awt.event.MouseEvent event)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent event)
mouseExited
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent event)
mouseClicked
in interface java.awt.event.MouseListener
public int getMajorMode()
PvDisplayIf.MODE_SCALE
getMajorMode
in interface PvDisplayIf
setMajorMode(int)
public void setMajorMode(int mode)
PvDisplayIf.MODE_SCALE
setMajorMode
in interface PvDisplayIf
mode
- any of the modes available in PvDisplayIf.getMajorMode()
public void keyTyped(java.awt.event.KeyEvent event)
keyTyped
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent event)
keyReleased
in interface java.awt.event.KeyListener
public void keyPressed(java.awt.event.KeyEvent event)
keyPressed
in interface java.awt.event.KeyListener
public void configure(PvDisplayIf disp)
disp
- target display which will be configuredpublic void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
public void clearPopupMenu()
clearPopupMenu
in interface PvDisplayIf
addPopupItem(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 PvDisplayIf
clearPopupMenu()
public PsPanel getInfoPanel()
getInfoPanel
in interface PvDisplayIf
public PsPanel getCameraPanel()
getCameraPanel
in interface PvDisplayIf
public PsPanel getAxisPanel()
public PsPanel getAxisPanel(int ind)
ind
- identifies requested ruler, for example, PsViewerIf.AXIS_X.public PsPanel getLightPanel()
getLightPanel
in interface PvDisplayIf
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Component
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Component
public void start()
start
in interface PvDisplayIf
public void stop()
stop
in interface PvDisplayIf
public void setAutoRotation(PdVector axis, double angle)
setAutoRotation
in interface PvDisplayIf
public boolean incrementAutoRotation()
incrementAutoRotation
in interface PvDisplayIf
public void run()
run
in interface java.lang.Runnable
public void burn()
public boolean selectLight(PvLightIf light)
selectLight
in interface PvDisplayIf
light
- 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 PvDisplayIf
type
- of camerafalse
if type is outOfBounds."