Package org.opensourcephysics.frames
Class Display3DFrame
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.opensourcephysics.display.OSPFrame
org.opensourcephysics.display3d.simple3d.DrawingFrame3D
org.opensourcephysics.frames.Display3DFrame
- All Implemented Interfaces:
ClipboardOwner,ImageObserver,MenuContainer,Serializable,Accessible,RootPaneContainer,WindowConstants,AppFrame,Hidable,DrawingFrame3D
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrameNested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrameNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyNested classes/interfaces inherited from interface org.opensourcephysics.display3d.core.DrawingFrame3D
DrawingFrame3D.Loader -
Field Summary
Fields inherited from class org.opensourcephysics.display3d.simple3d.DrawingFrame3D
cameraInspectorFrame, cameraItem, copyItem, cursorCrosshairItem, cursorCubeItem, cursorMenu, cursorNoneItem, cursorXYZItem, decorationAxesItem, decorationCubeItem, decorationMenu, decorationNoneItem, displayMenu, displayNoPerspectiveItem, displayPerspectiveItem, displayXYItem, displayXZItem, displayYZItem, drawingPanel, editMenu, fileMenu, lightInspectorFrame, lightItem, MENU_SHORTCUT_KEY_MASK, menuBar, pasteItem, replaceItem, resetCameraItem, visualMenu, zoomToFitItemFields inherited from class org.opensourcephysics.display.OSPFrame
action, animated, autoclear, buttonPanel, childFrames, constructorThreadGroup, customButtons, keepHidden, myFontLevel, strategyFields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSORFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddElement(Element element) Adds an Element to this DrawingPanel3D.voidaddInteractionListener(InteractionListener listener) Adds in interaction listener to the 3D drawing panel.voidenableInteraction(boolean enable) Enables/Disables interaction with the DrawingPanel3D.Provides the Camera object used to project the scene in 3D modes.voidsetAllowQuickRedraw(boolean allow) Whether the scene can be drawn quickly when it is dragged for a new view point.voidsetAltitude(double phi) Sets the angle phi in spherical polar coordiantes (in radians) to rotate the camera away from the z axis before projecting.voidsetAzimuth(double theta) Sets the angle theta angle in spherical polar coordinates (in radians) to rotate the camera about the z axis before projecting.voidsetDecorationType(int value) Types of decoration displayed.voidsetIgnoreRepaint(boolean ignoreRepaint) Sets whether or not paint messages received from the operating system should be ignored.voidsetPreferredMinMax(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) Set the extrema in the X, Y and Z coordinates at oncevoidsetProjectionMode(int mode) Sets the projection mode for the camera.voidsetSquareAspect(boolean square) Whether the panel should try to keep a square aspect.Methods inherited from class org.opensourcephysics.display3d.simple3d.DrawingFrame3D
copyAction, createLightInspectorFrame, getDrawingPanel3D, getJFrame, getLoader, getMenuItem, inspectXML, loadToolsMenu, lostOwnership, pasteAction, removeMenuItem, render, replaceAction, saveXML, setDrawingPanel3D, setEnabledCopy, setEnabledPaste, setEnabledReplace, setMessage, setMessage, supportsLightInspectorsMethods inherited from class org.opensourcephysics.display.OSPFrame
addButton, addChildFrame, bufferStrategyShow, clearChildFrames, clearData, clearDataAndRepaint, createBufferStrategy, dispose, getChildFrames, getChooser, getConstructorThreadGroup, getMenu, invalidateImage, isAnimated, isAutoclear, isIconified, isKeepHidden, loadDisplayMenu, parseXMLMenu, parseXMLMenu, refreshGUI, removeMenu, removeMenuItem, setAnimated, setAutoclear, setDefaultCloseOperation, setFontLevel, setKeepHidden, setResizeAction, setSize, setTitle, setVisible, show, wishesToExitMethods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setUndecoratedMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setType, toBack, toFrontMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opensourcephysics.display.AppFrame
getDefaultCloseOperationMethods inherited from interface org.opensourcephysics.display3d.core.DrawingFrame3D
setVisibleMethods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Constructor Details
-
Display3DFrame
-
-
Method Details
-
addInteractionListener
Adds in interaction listener to the 3D drawing panel. InteractionListeners respond to mouse events.- Parameters:
listener- InteractionListener
-
enableInteraction
public void enableInteraction(boolean enable) Enables/Disables interaction with the DrawingPanel3D.- Parameters:
enable- boolean
-
setPreferredMinMax
public void setPreferredMinMax(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) Set the extrema in the X, Y and Z coordinates at once- Parameters:
xmin- doublexmax- doubleymin- doubleymax- doublezmin- doublezmax- double
-
getCamera
Provides the Camera object used to project the scene in 3D modes.- Returns:
- Camera
- See Also:
-
addElement
Adds an Element to this DrawingPanel3D.- Parameters:
element- Element- See Also:
-
setSquareAspect
public void setSquareAspect(boolean square) Whether the panel should try to keep a square aspect. Default value is true.- Parameters:
square- boolean
-
setAllowQuickRedraw
public void setAllowQuickRedraw(boolean allow) Whether the scene can be drawn quickly when it is dragged for a new view point.- Parameters:
allow- the desired value
-
setIgnoreRepaint
public void setIgnoreRepaint(boolean ignoreRepaint) Sets whether or not paint messages received from the operating system should be ignored. This does not affect paint events generated in software by the AWT, unless they are an immediate response to an OS-level paint message.- Overrides:
setIgnoreRepaintin classComponent
-
setDecorationType
public void setDecorationType(int value) Types of decoration displayed. One of the following- VisualizationHints.DECORATION_NONE: No decoration
- VisualizationHints.DECORATION_AXES: Display labelled axes
- VisualizationHints.DECORATION_CUBE: Display the bounding box
- Parameters:
value- the desired value
-
setAzimuth
public void setAzimuth(double theta) Sets the angle theta angle in spherical polar coordinates (in radians) to rotate the camera about the z axis before projecting. Default is 0.0.- Parameters:
theta- the desired angle
-
setAltitude
public void setAltitude(double phi) Sets the angle phi in spherical polar coordiantes (in radians) to rotate the camera away from the z axis before projecting. Default is 0.0.- Parameters:
phi- the desired angle
-
setProjectionMode
public void setProjectionMode(int mode) Sets the projection mode for the camera. Possible values are:- Camera.MODE_PERSPECTIVE or Camera.MODE_PERSPECTIVE_ON : 3D mode in which objects far away look smaller.
- Camera.MODE_NO_PERSPECTIVE or Camera.MODE_PERSPECTIVE_OFF: 3D mode in which distance doesn't affect the size of the objects
- Camera.MODE_PLANAR_XY: 2D mode in which only the X and Y coordinates are displayed.
- Camera.MODE_PLANAR_XZ: 2D mode in which only the X and Z coordinates are displayed.
- Camera.MODE_PLANAR_YZ: 2D mode in which only the Y and Z coordinates are displayed.
- Parameters:
mode- the desired value
-