Class DrawingFrame3D
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
- All Implemented Interfaces:
ClipboardOwner
,ImageObserver
,MenuContainer
,Serializable
,Accessible
,RootPaneContainer
,WindowConstants
,AppFrame
,Hidable
,DrawingFrame3D
- Direct Known Subclasses:
Display3DFrame
DrawingFrame: a frame that contains a generic drawing panel.
- Version:
- March 2005
- Author:
- Francisco Esquembre, Adapted from Wolfgang Christian
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Nested classes/interfaces inherited from interface org.opensourcephysics.display3d.core.DrawingFrame3D
DrawingFrame3D.Loader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JFrame
protected JMenuItem
protected JMenuItem
protected JMenuItem
protected JMenuItem
protected JMenu
protected JMenuItem
protected JMenuItem
protected JMenuItem
protected JMenuItem
protected JMenu
protected JMenuItem
protected JMenu
protected JMenuItem
protected JMenuItem
protected JMenuItem
protected JMenuItem
protected JMenuItem
protected DrawingPanel3D
protected JMenu
protected JMenu
protected JFrame
protected JMenuItem
protected static final int
protected JMenuBar
protected JMenuItem
protected JMenuItem
protected JMenuItem
protected JMenu
protected JMenuItem
Fields inherited from class org.opensourcephysics.display.OSPFrame
action, animated, autoclear, buttonPanel, childFrames, constructorThreadGroup, customButtons, keepHidden, myFontLevel, strategy
Fields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields 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_CURSOR
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
Constructor Summary
ConstructorsConstructorDescriptionDefault DrawingFrame constructorDrawingFrame3D
(String title, DrawingPanel3D _drawingPanel) DrawingFrame constructor specifying the title and the DrawingPanel that will be placed in the center of the content pane.DrawingFrame3D
(DrawingPanel3D drawingPanel) DrawingFrame constructor specifying the DrawingPanel that will be placed in the center of the content pane. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Copies objects found in the specified xml control.protected JFrame
createLightInspectorFrame
(DrawingPanel3D drawingPanel) Dummy creator of a LightInspector.Gets the drawing panel.Getting the pointer to the real JFrame in itstatic XML.ObjectLoader
getMenuItem
(String menuName) Gets a menu with the given name from the menu bar.void
Inspects the drawing frame by using an xml document tree.protected JMenu
Adds a Tools menu to the menu bar.void
lostOwnership
(Clipboard clipboard, Transferable contents) Implementation of ClipboardOwner interface.protected void
Paste actionremoveMenuItem
(String menuName) Removes a menu with the given name from the menu bar and returns the removed item.void
render()
Renders the drawing panel if the frame is showing and not iconified.void
Replaces the drawables with the drawables found in the specified XML control.void
saveXML()
void
setDrawingPanel3D
(DrawingPanel3D _drawingPanel) Adds the drawing panel to the the frame.void
setEnabledCopy
(boolean enable) Enables the copy edit menu item.void
setEnabledPaste
(boolean enable) Enables the paste edit menu item.void
setEnabledReplace
(boolean enable) Enables the replace edit menu item.void
setMessage
(String msg) Shows a message in a yellow text box in the lower right hand corner.void
setMessage
(String msg, int location) Shows a message in a yellow text box.protected boolean
Whether this implementation supports LightInspectorsMethods 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, wishesToExit
Methods 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, update
Methods 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, setUndecorated
Methods 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, toFront
Methods 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, validateTree
Methods 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, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opensourcephysics.display.AppFrame
getDefaultCloseOperation
Methods inherited from interface org.opensourcephysics.display3d.core.DrawingFrame3D
setVisible
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
fileMenu
-
editMenu
-
copyItem
-
pasteItem
-
replaceItem
-
visualMenu
-
displayMenu
-
decorationMenu
-
cursorMenu
-
displayPerspectiveItem
-
displayNoPerspectiveItem
-
displayXYItem
-
displayXZItem
-
displayYZItem
-
decorationCubeItem
-
decorationNoneItem
-
decorationAxesItem
-
cursorNoneItem
-
cursorCubeItem
-
cursorXYZItem
-
cursorCrosshairItem
-
zoomToFitItem
-
resetCameraItem
-
cameraItem
-
lightItem
-
cameraInspectorFrame
-
lightInspectorFrame
-
drawingPanel
-
MENU_SHORTCUT_KEY_MASK
protected static final int MENU_SHORTCUT_KEY_MASK
-
-
Constructor Details
-
DrawingFrame3D
public DrawingFrame3D()Default DrawingFrame constructor -
DrawingFrame3D
DrawingFrame constructor specifying the DrawingPanel that will be placed in the center of the content pane.- Parameters:
drawingPanel
-
-
DrawingFrame3D
DrawingFrame constructor specifying the title and the DrawingPanel that will be placed in the center of the content pane.- Parameters:
title
-_drawingPanel
-
-
-
Method Details
-
render
public void render()Renders the drawing panel if the frame is showing and not iconified. -
setMessage
Shows a message in a yellow text box in the lower right hand corner.- Parameters:
msg
-
-
setMessage
Shows a message in a yellow text box. location 0=bottom left location 1=bottom right location 2=top right location 3=top left- Parameters:
msg
-location
-
-
getDrawingPanel3D
Gets the drawing panel.- Specified by:
getDrawingPanel3D
in interfaceDrawingFrame3D
- Returns:
- the drawingPanel
-
setDrawingPanel3D
Adds the drawing panel to the the frame. The panel is added to the center of the frame's content pane.- Specified by:
setDrawingPanel3D
in interfaceDrawingFrame3D
- Parameters:
_drawingPanel
-
-
getJFrame
Getting the pointer to the real JFrame in it- Specified by:
getJFrame
in interfaceDrawingFrame3D
- Returns:
- JFrame
-
setEnabledPaste
public void setEnabledPaste(boolean enable) Enables the paste edit menu item.- Parameters:
enable
- boolean
-
pasteAction
protected void pasteAction()Paste action -
setEnabledReplace
public void setEnabledReplace(boolean enable) Enables the replace edit menu item.- Parameters:
enable
- boolean
-
replaceAction
public void replaceAction()Replaces the drawables with the drawables found in the specified XML control. -
copyAction
protected void copyAction()Copies objects found in the specified xml control. -
lostOwnership
Implementation of ClipboardOwner interface. Override this method to receive notification that data copied to the clipboard has changed.- Specified by:
lostOwnership
in interfaceClipboardOwner
- Parameters:
clipboard
- Clipboardcontents
- Transferable
-
setEnabledCopy
public void setEnabledCopy(boolean enable) Enables the copy edit menu item.- Parameters:
enable
- boolean
-
supportsLightInspectors
protected boolean supportsLightInspectors()Whether this implementation supports LightInspectors- Returns:
-
createLightInspectorFrame
Dummy creator of a LightInspector. To be overwritten by packages that offer light inspectors- Parameters:
drawingPanel
-- Returns:
-
loadToolsMenu
Adds a Tools menu to the menu bar.- Overrides:
loadToolsMenu
in classOSPFrame
-
getMenuItem
Gets a menu with the given name from the menu bar. Returns null if menu item does not exist.- Parameters:
menuName
- String- Returns:
- JMenu
-
removeMenuItem
Removes a menu with the given name from the menu bar and returns the removed item. Returns null if menu item does not exist.- Parameters:
menuName
- String- Returns:
- JMenu
-
inspectXML
public void inspectXML()Inspects the drawing frame by using an xml document tree. -
saveXML
public void saveXML() -
getLoader
-