org.jdesktop.wonderland.client.jme
Class MainFrameImpl

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by org.jdesktop.wonderland.client.jme.MainFrameImpl
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, MainFrame

public class MainFrameImpl
extends javax.swing.JFrame
implements MainFrame

The Main JFrame for the wonderland jme client

Author:
paulby, Ronny Standtke
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Nested classes/interfaces inherited from interface org.jdesktop.wonderland.client.jme.MainFrame
MainFrame.PlacemarkType, MainFrame.ServerURLListener
 
Field Summary
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, 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 javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MainFrameImpl(org.jdesktop.mtgame.WorldManager wm, int width, int height)
          Creates new form MainFrame
 
Method Summary
 org.jdesktop.mtgame.FrameRateListener addFrameRateListener(int frameRate)
           
 void addServerURLListener(MainFrame.ServerURLListener listener)
          Add a listener that will be notified when the server URL changes (i.e.
 void addToCameraChoices(javax.swing.JRadioButtonMenuItem cameraMenuItem)
          Add a camera menu item to the end of the View menu.
 void addToCameraChoices(javax.swing.JRadioButtonMenuItem cameraMenuItem, int index)
          Add a camera menu item to the View menu at the specified index, where -1 adds to the end of the menu
 void addToEditMenu(javax.swing.JMenuItem menuItem)
          Add the specified menu item to the end of the Edit menu
 void addToEditMenu(javax.swing.JMenuItem menuItem, int index)
          Add a menu item to the Edit menu at the specified index, where -1 adds the menu item to the end of the menu
 void addToFileMenu(javax.swing.JMenuItem menuItem)
          Add the specified menu item to the end of the File menu
 void addToFileMenu(javax.swing.JMenuItem menuItem, int index)
          Add the specified menu item to the edit menu.
 void addToHelpMenu(javax.swing.JMenuItem menuItem)
          Add the specified menu item to the end of the Help menu
 void addToHelpMenu(javax.swing.JMenuItem menuItem, int index)
          Add a menu item to the Help menu at the specified index, where -1 adds the menu item to the end of the menu
 void addToInsertMenu(javax.swing.JMenuItem menuItem)
          Add the specified menu item to the end of the Insert menu
 void addToInsertMenu(javax.swing.JMenuItem menuItem, int index)
          Add a menu item to the Insert menu at the specified index, where -1 adds the menu item to the end of the menu
 void addToMenu(javax.swing.JMenu menu, javax.swing.JMenuItem menuItem, int weight)
          Add a menu item to a menu at the specified index, where -1 adds the menu item to the end of the menu
 void addToPlacemarksMenu(javax.swing.JMenuItem menuItem)
          Add the specified menu item to the end of the Placemarks menu
 void addToPlacemarksMenu(javax.swing.JMenuItem menuItem, int index, MainFrame.PlacemarkType placemarkType)
          Add a menu item to the Placemarks menu at the specified index, where -1 adds the menu item to the end of the menu.
 void addToToolsMenu(javax.swing.JMenuItem menuItem)
          Add the specified menu item to the end of the Tools menu
 void addToToolsMenu(javax.swing.JMenuItem menuItem, int index)
          Add a menu item to the Tools menu at the specified index, where -1 adds the menu item to the end of the menu
 void addToViewMenu(javax.swing.JMenuItem menuItem)
          Add the specified menu item to the end of the View menu
 void addToViewMenu(javax.swing.JMenuItem menuItem, int index)
          Add a menu item to the View menu at the specified index, where -1 adds the menu item to the end of the menu
 void addToViewMenuCameraGroup(javax.swing.JRadioButtonMenuItem menuItem)
           
 void addToWindowMenu(javax.swing.JMenuItem menuItem)
          Add the specified menu item to the end of the Window menu
 void addToWindowMenu(javax.swing.JMenuItem menuItem, int index)
          Add a menu item to the Window menu at the specified index, where -1 adds the menu item to the end of the menu
 void connected(boolean connected)
          Notify when a connection is established or disconnected
 java.awt.Canvas getCanvas()
          Returns the canvas of the frame.
 javax.swing.JPanel getCanvas3DPanel()
          Returns the panel of the frame in which the 3D canvas resides.
 javax.swing.JFrame getFrame()
          Return the JME frame
 void removeFrameRateListener(org.jdesktop.mtgame.FrameRateListener listener)
           
 void removeFromCameraChoices(javax.swing.JRadioButtonMenuItem menuItem)
          Removes the specified camera choice
 void removeFromEditMenu(javax.swing.JMenuItem menuItem)
          Remove the specified menu item from the Edit menu.
 void removeFromFileMenu(javax.swing.JMenuItem menuItem)
          Remove the specified menu item from the File menu.
 void removeFromHelpMenu(javax.swing.JMenuItem menuItem)
          Remove the specified menu item from the Help menu.
 void removeFromInsertMenu(javax.swing.JMenuItem menuItem)
          Remove the specified menu item from the Insert menu.
 void removeFromMenu(javax.swing.JMenu menu, javax.swing.JMenuItem item)
          Remove the given menu item from a menu
 void removeFromPlacemarksMenu(javax.swing.JMenuItem menuItem)
          Remove the specified menu item from the Placemarks menu.
 void removeFromToolsMenu(javax.swing.JMenuItem menuItem)
          Remove the specified menu item from the Tools menu.
 void removeFromViewMenu(javax.swing.JMenuItem menuItem)
          Remove the specified menu item from the View menu.
 void removeFromWindowMenu(javax.swing.JMenuItem menuItem)
          Remove the specified menu item from the Window menu.
 void setDesiredFrameRate(int desiredFrameRate)
          Set the desired frame rate
 void setServerURL(java.lang.String serverURL)
          Set the server URL in the location field
 void showFPSMeter(boolean visible)
           
 void updateGoButton()
          updates the Go! button
 
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, setDefaultCloseOperation, 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, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, 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, transferFocusBackward, 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, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, 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, isOpaque, 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, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Constructor Detail

MainFrameImpl

public MainFrameImpl(org.jdesktop.mtgame.WorldManager wm,
                     int width,
                     int height)
Creates new form MainFrame

Method Detail

setDesiredFrameRate

public void setDesiredFrameRate(int desiredFrameRate)
Description copied from interface: MainFrame
Set the desired frame rate

Specified by:
setDesiredFrameRate in interface MainFrame
Parameters:
desiredFrameRate - the desired frame rate in frames per second

updateGoButton

public void updateGoButton()
updates the Go! button


getFrame

public javax.swing.JFrame getFrame()
Return the JME frame

Specified by:
getFrame in interface MainFrame
Returns:
the frame

getCanvas

public java.awt.Canvas getCanvas()
Returns the canvas of the frame.

Specified by:
getCanvas in interface MainFrame
Returns:
the canvas of the frame.

getCanvas3DPanel

public javax.swing.JPanel getCanvas3DPanel()
Returns the panel of the frame in which the 3D canvas resides.

Specified by:
getCanvas3DPanel in interface MainFrame
Returns:
the panel of the frame in which the 3D canvas resides.

addToMenu

public void addToMenu(javax.swing.JMenu menu,
                      javax.swing.JMenuItem menuItem,
                      int weight)
Add a menu item to a menu at the specified index, where -1 adds the menu item to the end of the menu

Specified by:
addToMenu in interface MainFrame
Parameters:
menu - the menu to add the item to
menuItem - the item to add
weight - the position in the menu

removeFromMenu

public void removeFromMenu(javax.swing.JMenu menu,
                           javax.swing.JMenuItem item)
Remove the given menu item from a menu

Parameters:
menu - the menu to remove from
item - the item to remove

addToFileMenu

public void addToFileMenu(javax.swing.JMenuItem menuItem)
Add the specified menu item to the end of the File menu

Specified by:
addToFileMenu in interface MainFrame

addToFileMenu

public void addToFileMenu(javax.swing.JMenuItem menuItem,
                          int index)
Add the specified menu item to the edit menu. Add a menu item to the File menu at the specified index, where -1 adds the menu item to the end of the menu

Specified by:
addToFileMenu in interface MainFrame
index - the position in the menu

removeFromFileMenu

public void removeFromFileMenu(javax.swing.JMenuItem menuItem)
Remove the specified menu item from the File menu.

Specified by:
removeFromFileMenu in interface MainFrame

addToEditMenu

public void addToEditMenu(javax.swing.JMenuItem menuItem)
Add the specified menu item to the end of the Edit menu

Specified by:
addToEditMenu in interface MainFrame

addToEditMenu

public void addToEditMenu(javax.swing.JMenuItem menuItem,
                          int index)
Add a menu item to the Edit menu at the specified index, where -1 adds the menu item to the end of the menu

Specified by:
addToEditMenu in interface MainFrame
index - the position in the menu

removeFromEditMenu

public void removeFromEditMenu(javax.swing.JMenuItem menuItem)
Remove the specified menu item from the Edit menu.

Specified by:
removeFromEditMenu in interface MainFrame

addToViewMenu

public void addToViewMenu(javax.swing.JMenuItem menuItem)
Add the specified menu item to the end of the View menu

Specified by:
addToViewMenu in interface MainFrame

addToViewMenu

public void addToViewMenu(javax.swing.JMenuItem menuItem,
                          int index)
Add a menu item to the View menu at the specified index, where -1 adds the menu item to the end of the menu

Specified by:
addToViewMenu in interface MainFrame

addToViewMenuCameraGroup

public void addToViewMenuCameraGroup(javax.swing.JRadioButtonMenuItem menuItem)
Parameters:
menuItem -

removeFromViewMenu

public void removeFromViewMenu(javax.swing.JMenuItem menuItem)
Remove the specified menu item from the View menu.

Specified by:
removeFromViewMenu in interface MainFrame

addToInsertMenu

public void addToInsertMenu(javax.swing.JMenuItem menuItem)
Add the specified menu item to the end of the Insert menu

Specified by:
addToInsertMenu in interface MainFrame

addToInsertMenu

public void addToInsertMenu(javax.swing.JMenuItem menuItem,
                            int index)
Add a menu item to the Insert menu at the specified index, where -1 adds the menu item to the end of the menu

Specified by:
addToInsertMenu in interface MainFrame

removeFromInsertMenu

public void removeFromInsertMenu(javax.swing.JMenuItem menuItem)
Remove the specified menu item from the Insert menu.

Specified by:
removeFromInsertMenu in interface MainFrame

addToToolsMenu

public void addToToolsMenu(javax.swing.JMenuItem menuItem)
Add the specified menu item to the end of the Tools menu

Specified by:
addToToolsMenu in interface MainFrame

addToToolsMenu

public void addToToolsMenu(javax.swing.JMenuItem menuItem,
                           int index)
Add a menu item to the Tools menu at the specified index, where -1 adds the menu item to the end of the menu

Specified by:
addToToolsMenu in interface MainFrame

removeFromToolsMenu

public void removeFromToolsMenu(javax.swing.JMenuItem menuItem)
Remove the specified menu item from the Tools menu.

Specified by:
removeFromToolsMenu in interface MainFrame

addToPlacemarksMenu

public void addToPlacemarksMenu(javax.swing.JMenuItem menuItem)
Add the specified menu item to the end of the Placemarks menu

Specified by:
addToPlacemarksMenu in interface MainFrame

addToPlacemarksMenu

public void addToPlacemarksMenu(javax.swing.JMenuItem menuItem,
                                int index,
                                MainFrame.PlacemarkType placemarkType)
Add a menu item to the Placemarks menu at the specified index, where -1 adds the menu item to the end of the menu. Weights are not being used (anymore) for alphabetising placemarks as it was impossible to use JSeparators(JComponents) in the Menu.

Specified by:
addToPlacemarksMenu in interface MainFrame
index - the position in the menu

removeFromPlacemarksMenu

public void removeFromPlacemarksMenu(javax.swing.JMenuItem menuItem)
Remove the specified menu item from the Placemarks menu.

Specified by:
removeFromPlacemarksMenu in interface MainFrame

addToWindowMenu

public void addToWindowMenu(javax.swing.JMenuItem menuItem)
Add the specified menu item to the end of the Window menu

Specified by:
addToWindowMenu in interface MainFrame

addToWindowMenu

public void addToWindowMenu(javax.swing.JMenuItem menuItem,
                            int index)
Add a menu item to the Window menu at the specified index, where -1 adds the menu item to the end of the menu

Specified by:
addToWindowMenu in interface MainFrame
index - the position in the menu

removeFromWindowMenu

public void removeFromWindowMenu(javax.swing.JMenuItem menuItem)
Remove the specified menu item from the Window menu.

Specified by:
removeFromWindowMenu in interface MainFrame

addToHelpMenu

public void addToHelpMenu(javax.swing.JMenuItem menuItem)
Add the specified menu item to the end of the Help menu

Specified by:
addToHelpMenu in interface MainFrame

addToHelpMenu

public void addToHelpMenu(javax.swing.JMenuItem menuItem,
                          int index)
Add a menu item to the Help menu at the specified index, where -1 adds the menu item to the end of the menu

Specified by:
addToHelpMenu in interface MainFrame
index - the position in the menu

removeFromHelpMenu

public void removeFromHelpMenu(javax.swing.JMenuItem menuItem)
Remove the specified menu item from the Help menu.

Specified by:
removeFromHelpMenu in interface MainFrame

setServerURL

public void setServerURL(java.lang.String serverURL)
Set the server URL in the location field

Specified by:
setServerURL in interface MainFrame
Parameters:
serverURL - the server URL to set

connected

public void connected(boolean connected)
Description copied from interface: MainFrame
Notify when a connection is established or disconnected

Specified by:
connected in interface MainFrame
Parameters:
connected - true if a connection has been established, false otherwise

addToCameraChoices

public void addToCameraChoices(javax.swing.JRadioButtonMenuItem cameraMenuItem)
Add a camera menu item to the end of the View menu.

Parameters:
cameraMenuItem -

addToCameraChoices

public void addToCameraChoices(javax.swing.JRadioButtonMenuItem cameraMenuItem,
                               int index)
Add a camera menu item to the View menu at the specified index, where -1 adds to the end of the menu

Specified by:
addToCameraChoices in interface MainFrame
Parameters:
cameraMenuItem -

removeFromCameraChoices

public void removeFromCameraChoices(javax.swing.JRadioButtonMenuItem menuItem)
Removes the specified camera choice

Specified by:
removeFromCameraChoices in interface MainFrame
Parameters:
menuItem -

showFPSMeter

public void showFPSMeter(boolean visible)

addFrameRateListener

public org.jdesktop.mtgame.FrameRateListener addFrameRateListener(int frameRate)

removeFrameRateListener

public void removeFrameRateListener(org.jdesktop.mtgame.FrameRateListener listener)

addServerURLListener

public void addServerURLListener(MainFrame.ServerURLListener listener)
Description copied from interface: MainFrame
Add a listener that will be notified when the server URL changes (i.e. when the user types a new location in the location bar)

Specified by:
addServerURLListener in interface MainFrame
Parameters:
listener - the listener to add


Open Wonderland - http://openwonderland.org