nl.tudelft.goal.ut2004.visualizer.map
Class MapGLPanel

Package class diagram package MapGLPanel
java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by javax.media.opengl.awt.GLJPanel
                      extended by nl.tudelft.goal.ut2004.visualizer.map.MapGLPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, javax.media.nativewindow.WindowClosingProtocol, javax.media.opengl.awt.AWTGLAutoDrawable, javax.media.opengl.awt.ComponentEvents, javax.media.opengl.GLAutoDrawable, javax.media.opengl.GLDrawable, MapViewpoint.ViewpointListener
Direct Known Subclasses:
SelectableMapGLPanel

public abstract class MapGLPanel
extends javax.media.opengl.awt.GLJPanel
implements MapViewpoint.ViewpointListener

This is a GLJPanel that displays UT2004Map. it is a base class, so it takes care of some things, while others are left for derived class to do.

What it does: * Can render passed map * Can render all stuff in agentRenderers * Takes care of user interaction for map viewpoint * Selection of object

What it doesn't do: * automatically display map, someone else has to take care of that (adding/removing) from agentRenderers * fill in agentRenderers, derived class has to do that. In lookup are selected objects

Author:
Honza
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
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 javax.media.nativewindow.WindowClosingProtocol
javax.media.nativewindow.WindowClosingProtocol.WindowClosingMode
 
Field Summary
protected  CollectionRenderer<cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer> agentRenderes
           
protected  EnvironmentRenderer environmentRenderer
           
protected  int lastGLName
           
protected  MapController mapController
           
protected  MapRenderer mapRenderer
           
protected  MapViewpoint mapViewpoint
           
protected  CollectionRenderer<Object> objectRenderes
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.media.opengl.GLAutoDrawable
SCREEN_CHANGE_ACTION_ENABLED
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
protected MapGLPanel(javax.media.opengl.GLCapabilities caps, cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap map)
          Create a panel for
protected MapGLPanel(cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap map, Logger log)
          Create a pane showing passed map
 
Method Summary
 void destroy()
          Remove listeners and basically clean up this map.
protected  cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap getMap()
           
 Set<Object> getObjectsAt(Point p)
          Get agents at point p in the scene.
 void onChangedViewpoint(MapViewpoint viewpoint)
          When viewpoint is changed, render the map (call display()).
 
Methods inherited from class javax.media.opengl.awt.GLJPanel
addGLEventListener, addGLEventListener, addNotify, createContext, display, dispose, getAnimator, getAutoSwapBufferMode, getChosenGLCapabilities, getContext, getContextCreationFlags, getDefaultCloseOperation, getDelegatedDrawable, getFactory, getGL, getGLProfile, getHandle, getNativeSurface, getThreadName, getUpstreamWidget, invoke, isRealized, paintComponent, removeGLEventListener, removeGLEventListener, removeNotify, reshape, setAnimator, setAutoSwapBufferMode, setContext, setContextCreationFlags, setDefaultCloseOperation, setGL, setOpaque, setRealized, shouldPreserveColorBufferIfTranslucent, swapBuffers, toString
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, 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, 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, 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, hide, 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, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.media.opengl.awt.AWTGLAutoDrawable
repaint, setSize
 
Methods inherited from interface javax.media.opengl.GLDrawable
getHeight, getWidth
 
Methods inherited from interface javax.media.opengl.awt.ComponentEvents
addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener
 

Field Detail

mapViewpoint

protected MapViewpoint mapViewpoint

mapController

protected MapController mapController

mapRenderer

protected MapRenderer mapRenderer

agentRenderes

protected CollectionRenderer<cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer> agentRenderes

objectRenderes

protected CollectionRenderer<Object> objectRenderes

environmentRenderer

protected EnvironmentRenderer environmentRenderer

lastGLName

protected int lastGLName
Constructor Detail

MapGLPanel

protected MapGLPanel(javax.media.opengl.GLCapabilities caps,
                     cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap map)
Create a panel for

Parameters:
caps -
map -
log -

MapGLPanel

protected MapGLPanel(cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap map,
                     Logger log)
Create a pane showing passed map

Parameters:
map - Map this pane is supposed to show
Method Detail

onChangedViewpoint

public void onChangedViewpoint(MapViewpoint viewpoint)
When viewpoint is changed, render the map (call display()).

Specified by:
onChangedViewpoint in interface MapViewpoint.ViewpointListener
Parameters:
viewpoint -

getObjectsAt

public Set<Object> getObjectsAt(Point p)
Get agents at point p in the scene.

Parameters:
p - in window coordiates system, [0,0] is left top
Returns:
List of renderable agents that are at the passed point

destroy

public void destroy()
Remove listeners and basically clean up this map. Any call to this object after this method should invoke exception (it doesn't but I can always hope in NullPointerException).

Specified by:
destroy in interface javax.media.opengl.GLAutoDrawable
Overrides:
destroy in class javax.media.opengl.awt.GLJPanel

getMap

protected cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap getMap()


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.