public class Panel3D extends javax.swing.JPanel implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener
Drawable3D but the panel
provides convenience methods to get/set it.
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
Panel3D(Drawable3D drawable)
Creates a new panel with the specified
Drawable3D to
display. |
| Modifier and Type | Method and Description |
|---|---|
Drawable3D |
getDrawable()
Returns the
Drawable3D object that is displayed in this
panel. |
protected java.awt.Point |
getLastClickPoint()
Returns the last click point (possibly
null). |
double |
getMargin()
Returns the margin, expressed as a percentage, that controls the amount
of space to leave around the edges of the 3D content when the
zoomToFit() method is called. |
double |
getMaxViewingDistanceMultiplier()
Returns the multiplier for the maximum viewing distance (a multiple of
the minimum viewing distance).
|
double |
getMinViewingDistance()
Returns the minimum viewing distance.
|
double |
getPanIncrement()
Returns the angle delta for each pan left or right.
|
protected RenderingInfo |
getRenderingInfo()
Returns the rendering info from the previous call to
draw().
|
double |
getRollIncrement()
Returns the angle delta for each roll operation.
|
double |
getRotateIncrement()
Returns the angle delta for each rotate up or down.
|
ViewPoint3D |
getViewPoint()
Returns the view point that is maintained by the
Drawable3D
instance on display. |
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent mwe)
Receives notification of a mouse wheel movement and responds by moving
the viewpoint in or out (zooming).
|
void |
paintComponent(java.awt.Graphics g)
Paints the panel by asking the drawable to render a 2D projection of the
objects it is managing.
|
void |
panLeftRight(double angle)
Rotates the view point around from left to right by the specified
angle and repaints the 3D scene.
|
void |
registerForTooltips()
Registers this component with the tool tip manager.
|
void |
setMargin(double margin)
Sets the margin that controls the amount of space to leave around the
edges of the 3D content when the
zoomToFit() method is
called. |
void |
setMaxViewingDistanceMultiplier(double multiplier)
Sets the multiplier used to calculate the maximum viewing distance.
|
void |
setPanIncrement(double panIncrement)
Sets the standard increment for panning left and right (a rotation
specified in radians).
|
void |
setRollIncrement(double rollIncrement)
Sets the roll increment in radians.
|
void |
setRotateIncrement(double rotateIncrement)
Sets the vertical (up and down) rotation increment (in radians).
|
void |
setViewPoint(ViewPoint3D vp)
Sets a new view point and repaints the panel.
|
void |
unregisterForTooltips()
Unregisters this component with the tool tip manager.
|
void |
zoomToFit()
Adjusts the viewing distance so that the chart fits the current panel
size.
|
void |
zoomToFit(java.awt.geom.Dimension2D size)
Adjusts the viewing distance so that the chart fits the specified
size.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic Panel3D(Drawable3D drawable)
Drawable3D to
display.drawable - the content to display (null not
permitted).public Drawable3D getDrawable()
Drawable3D object that is displayed in this
panel. This is specified via the panel constructor and there is no
setter method to change it.Drawable3D object (never null).public double getMargin()
zoomToFit() method is called. The default value is
0.25 (25 percent).public void setMargin(double margin)
zoomToFit() method is
called.margin - the margin (as a percentage, where 0.25 = 25 percent).public double getMinViewingDistance()
public double getMaxViewingDistanceMultiplier()
8.0.public void setMaxViewingDistanceMultiplier(double multiplier)
multiplier - the new multiplier.public double getPanIncrement()
Math.PI / 60.public void setPanIncrement(double panIncrement)
panIncrement - the increment (in radians).public double getRotateIncrement()
Math.PI / 60.public void setRotateIncrement(double rotateIncrement)
rotateIncrement - the increment (in radians).public double getRollIncrement()
Math.PI / 60.public void setRollIncrement(double rollIncrement)
rollIncrement - the increment (in radians).public ViewPoint3D getViewPoint()
Drawable3D
instance on display.null).public void setViewPoint(ViewPoint3D vp)
vp - the view point (null not permitted).protected java.awt.Point getLastClickPoint()
null).null).protected RenderingInfo getRenderingInfo()
null).public void panLeftRight(double angle)
angle - the angle of rotation (in radians).public void zoomToFit()
getMargin() around the edges to
leave room for labels etc.public void zoomToFit(java.awt.geom.Dimension2D size)
getMargin() around the edges to
leave room for labels etc.size - the target size (null not permitted).public void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentg - the graphics target (null not permitted, assumed to be
an instance of Graphics2D).public void registerForTooltips()
public void unregisterForTooltips()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void mouseWheelMoved(java.awt.event.MouseWheelEvent mwe)
mouseWheelMoved in interface java.awt.event.MouseWheelListenermwe - the mouse wheel event.