lejos.robotics.mapping
Class NavigationPanel

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 lejos.robotics.mapping.NavigationPanel
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, MapApplicationUI
Direct Known Subclasses:
NXJMapCommand

public abstract class NavigationPanel
extends javax.swing.JPanel
implements MapApplicationUI, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ActionListener

NavigationPanel is a JPanel that displays navigation data from PCNavigationModel, and allows the user to interact with it.

Author:
Lawrie Griffiths
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.JMenuItem about
           
protected  javax.swing.JMenu aboutMenu
           
protected  javax.swing.JMenuItem backgroundColor
           
protected  javax.swing.JTextField borderField
           
protected  javax.swing.JLabel borderLabel
           
protected  javax.swing.JMenuItem calculatePath
           
protected  javax.swing.JFileChooser chooser
           
protected  javax.swing.JMenuItem clear
           
protected  javax.swing.JTextField clearanceField
           
protected  javax.swing.JLabel clearanceLabel
           
protected  javax.swing.JTextField clearField
           
protected  javax.swing.JLabel clearLabel
           
protected  javax.swing.JMenuItem closestColor
           
protected  javax.swing.JColorChooser colorChooser
           
protected  javax.swing.JMenu colorMenu
           
protected  javax.swing.JPanel commandPanel
           
protected  javax.swing.JMenu commandsMenu
           
protected  javax.swing.JDialog configureDetector
           
protected  javax.swing.JDialog configureMCL
           
protected  javax.swing.JMenu configureMenu
           
protected  javax.swing.JDialog configureMesh
           
protected  javax.swing.JDialog configurePilot
           
protected  javax.swing.JDialog configureRandom
           
protected  javax.swing.JDialog configureScanner
           
protected  javax.swing.JMenuItem connect
           
protected  javax.swing.JButton connectButton
           
protected  javax.swing.JLabel connectedLabel
           
protected  javax.swing.JPanel connectPanel
           
protected  javax.swing.JPanel controlPanel
           
protected  javax.swing.JMenuItem defaultColors
           
protected  javax.swing.JTextField delayField
           
protected  javax.swing.JLabel delayLabel
           
protected  java.lang.String description
           
protected  javax.swing.JMenuItem detector
           
protected  javax.swing.JPanel detectorForm
           
protected  javax.swing.JButton detectorOKButton
           
protected  javax.swing.JPanel detectorPanel
           
protected  javax.swing.JPanel differentialPanel
           
protected  javax.swing.JComboBox driveMotorBox
           
protected  javax.swing.JLabel driveMotorLabel
           
protected  javax.swing.JCheckBox driveReverseBox
           
protected  javax.swing.JLabel driveReverseLabel
           
protected  javax.swing.JMenuItem estimateColor
           
protected  EventPanel eventPanel
           
protected  javax.swing.JMenuItem exit
           
protected  javax.swing.JMenuItem featureColor
           
protected  javax.swing.JMenu fileMenu
           
protected  javax.swing.JMenuItem finder
           
protected  javax.swing.JPanel finderForm
           
protected  javax.swing.JButton finderOKButton
           
protected  javax.swing.JPanel finderPanel
           
protected  javax.swing.JMenuItem followPath
           
protected  javax.swing.JFrame frame
           
protected  javax.swing.JTextField gearRatioField
           
protected  javax.swing.JLabel gearRatioLabel
           
protected  javax.swing.JMenuItem getPose
           
protected  javax.swing.JMenuItem gridColor
           
protected  javax.swing.JTextField gridSizeField
           
protected  javax.swing.JLabel gridSizeLabel
           
protected  javax.swing.JComboBox headMotorBox
           
protected  javax.swing.JLabel headMotorLabel
           
protected  java.awt.Point initialViewStart
           
protected static java.lang.String KEY_DEFAULT_MAP
           
protected static java.lang.String KEY_DEFAULT_NXT
           
protected static java.lang.String KEY_DETECTOR_DELAY
           
protected static java.lang.String KEY_DETECTOR_MAX_DISTANCE
           
protected static java.lang.String KEY_DIFF_PILOT_LEFT_MOTOR
           
protected static java.lang.String KEY_DIFF_PILOT_REVERSE
           
protected static java.lang.String KEY_DIFF_PILOT_RIGHT_MOTOR
           
protected static java.lang.String KEY_DIFF_PILOT_TRACK_WIDTH
           
protected static java.lang.String KEY_DIFF_PILOT_WHEEL_DIAMETER
           
protected static java.lang.String KEY_MAX_ROTATE_SPEED
           
protected static java.lang.String KEY_MAX_TRAVEL_SPEED
           
protected static java.lang.String KEY_MCL_CLEARANCE
           
protected static java.lang.String KEY_MCL_NUM_PARTICLES
           
protected static java.lang.String KEY_MESH_CLEARANCE
           
protected static java.lang.String KEY_MESH_GRID_SIZE
           
protected static java.lang.String KEY_RANDOM_MOVE_CLEARANCE
           
protected static java.lang.String KEY_RANDOM_MOVE_MAX_DISTANCE
           
protected static java.lang.String KEY_RANGE_SCANNER_GEAR_RATIO
           
protected static java.lang.String KEY_RANGE_SCANNER_HEAD_MOTOR
           
protected static java.lang.String KEY_STEER_PILOT_DRIVE_MOTOR
           
protected static java.lang.String KEY_STEER_PILOT_DRIVE_MOTOR_REVERSE
           
protected static java.lang.String KEY_STEER_PILOT_LEFT_TACHO
           
protected static java.lang.String KEY_STEER_PILOT_RIGHT_TACHO
           
protected static java.lang.String KEY_STEER_PILOT_STEERING_MOTOR
           
protected static java.lang.String KEY_STEER_PILOT_WHEEL_DIAMETER
           
protected  javax.swing.JTextField lastMoveField
           
protected  javax.swing.JPanel lastMovePanel
           
protected  javax.swing.JComboBox leftMotorBox
           
protected  javax.swing.JLabel leftMotorLabel
           
protected  javax.swing.JTextField leftTachoField
           
protected  javax.swing.JLabel leftTachoLabel
           
protected  javax.swing.JButton loadMapButton
           
protected  javax.swing.JPanel loadPanel
           
protected  javax.swing.JMenuItem localize
           
protected  javax.swing.JPanel logPanel
           
protected  javax.swing.JMenuItem mapColor
           
protected  javax.swing.JTextField mapFileField
           
protected  javax.swing.JLabel mapFileLabel
           
protected  javax.swing.JLabel mapLabel
           
protected  javax.swing.JMenu mapMenu
           
protected  MapPanel mapPanel
           
protected  java.awt.Dimension mapPaneSize
           
protected  javax.swing.JTextField maxDistanceField
           
protected  javax.swing.JLabel maxDistanceLabel
           
protected  javax.swing.JTextField maxDistField
           
protected  javax.swing.JLabel maxDistLabel
           
protected  int maxZoom
           
protected  javax.swing.JMenuItem mcl
           
protected  javax.swing.JPanel mclForm
           
protected  javax.swing.JButton mclOKButton
           
protected  javax.swing.JPanel mclPanel
           
protected  javax.swing.JMenuBar menuBar
           
protected  javax.swing.JMenuItem meshColor
           
protected  javax.swing.JPanel meshPanel
           
protected  int minZoom
           
protected  PCNavigationModel model
           
protected  java.lang.String[] motors
           
protected  javax.swing.JMenuItem moveColor
           
protected  javax.swing.JTextField numParticlesField
           
protected  javax.swing.JLabel numParticlesLabel
           
protected  javax.swing.JLabel nxtLabel
           
protected  javax.swing.JTextField nxtName
           
protected  javax.swing.JMenuItem open
           
protected  javax.swing.JMenuItem particleColor
           
protected  javax.swing.JTextField particleField
           
protected  javax.swing.JPanel particlePanel
           
protected  javax.swing.JMenuItem pathColor
           
protected  java.lang.String[] pathFinders
           
protected  javax.swing.JComboBox pfBox
           
protected  javax.swing.JLabel pfLabel
           
protected  javax.swing.JMenuItem pilot
           
protected  javax.swing.JPanel pilotForm
           
protected  javax.swing.JButton pilotOKButton
           
protected  javax.swing.JComboBox pilotTypeBox
           
protected  javax.swing.JLabel pilotTypeLabel
           
protected  java.lang.String[] pilotTypes
           
protected  float pixelsPerUnit
           
protected  java.lang.String program
           
protected  java.util.Properties props
           
protected  javax.swing.JMenuItem random
           
protected  javax.swing.JPanel randomForm
           
protected  javax.swing.JMenuItem randomMove
           
protected  javax.swing.JButton randomOKButton
           
protected  javax.swing.JPanel randomPanel
           
protected  javax.swing.JTextField readingsField
           
protected  javax.swing.JPanel readingsPanel
           
protected  javax.swing.JMenuItem repaint
           
protected  javax.swing.JMenuItem reset
           
protected  javax.swing.JCheckBox reverseBox
           
protected  javax.swing.JLabel reverseLabel
           
protected  javax.swing.JComboBox rightMotorBox
           
protected  javax.swing.JLabel rightMotorLabel
           
protected  javax.swing.JTextField rightTachoField
           
protected  javax.swing.JLabel rightTachoLabel
           
protected  javax.swing.JMenuItem robotColor
           
protected  javax.swing.JMenuItem save
           
protected  javax.swing.JMenuItem scanner
           
protected  javax.swing.JPanel scannerForm
           
protected  javax.swing.JButton scannerOKButton
           
protected  javax.swing.JPanel scannerPanel
           
protected  boolean showCommandPanel
           
protected  boolean showConnectPanel
           
protected  boolean showControlPanel
           
protected  boolean showEventPanel
           
protected  boolean showGrid
           
protected  boolean showLastMovePanel
           
protected  boolean showLoadMapPanel
           
protected  boolean showLog
           
protected  boolean showMesh
           
protected  boolean showMoves
           
protected  boolean showParticlePanel
           
protected  boolean showParticles
           
protected  boolean showReadingsPanel
           
protected  boolean showStatusPanel
           
protected  boolean showZoomLabels
           
protected  java.awt.Point startDrag
           
protected  javax.swing.JPanel statusPanel
           
protected  javax.swing.JComboBox steeringMotorBox
           
protected  javax.swing.JLabel steeringMotorLabel
           
protected  javax.swing.JPanel steeringPanel
           
protected  javax.swing.JTextField steerWheelDiameterField
           
protected  javax.swing.JLabel steerWheelDiameterLabel
           
protected  javax.swing.JMenuItem stop
           
protected  javax.swing.JMenuItem targetColor
           
protected  java.lang.String title
           
protected  javax.swing.JTextField trackWidthField
           
protected  javax.swing.JLabel trackWidthLabel
           
protected  javax.swing.JCheckBox uploadBox
           
protected  javax.swing.JCheckBoxMenuItem viewCommands
           
protected  javax.swing.JCheckBoxMenuItem viewConnect
           
protected  javax.swing.JCheckBoxMenuItem viewControls
           
protected  javax.swing.JCheckBoxMenuItem viewEventForm
           
protected  javax.swing.JCheckBoxMenuItem viewGrid
           
protected  javax.swing.JCheckBoxMenuItem viewLastMove
           
protected  javax.swing.JCheckBoxMenuItem viewLoadMap
           
protected  javax.swing.JCheckBoxMenuItem viewLog
           
protected  javax.swing.JMenu viewMenu
           
protected  javax.swing.JCheckBoxMenuItem viewMesh
           
protected  javax.swing.JCheckBoxMenuItem viewMousePosition
           
protected  javax.swing.JCheckBoxMenuItem viewParticlePanel
           
protected  javax.swing.JCheckBoxMenuItem viewParticles
           
protected  javax.swing.JMenuItem waypointColor
           
protected  javax.swing.JTextField wheelDiameterField
           
protected  javax.swing.JLabel wheelDiameterLabel
           
protected  javax.swing.JTextField xField
           
protected  javax.swing.JLabel xLabel
           
protected  javax.swing.JPanel xyPanel
           
protected  javax.swing.JTextField yField
           
protected  javax.swing.JLabel yLabel
           
protected  int zoomIncrement
           
protected  int zoomInitialValue
           
protected  int zoomMajorTick
           
protected  javax.swing.JSlider zoomSlider
           
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
NavigationPanel()
           
 
Method Summary
protected  void about()
          Provides a pop up about dialog which can be tailored or overridden
 void actionPerformed(java.awt.event.ActionEvent e)
          Called when a menu item is selected or button clicked
protected  void buildGUI()
          Build the GUI- used by MCLTest but deprecated
 void buildPanels()
          Build all the panels
protected  void createAboutMenu()
          Create an About menu
protected  void createCommandMenu()
          Create the Commands menu
protected  void createCommandPanel()
          Create the command panel - this is added to by overriding classes
protected  void createConfigureMenu()
          Create the Configure menu
protected  void createConnectPanel()
          Create the Connect panel to allow connection to a NXT brick
protected  void createControlPanel()
          Create the control panel, which controls the GUI
protected  void createDetectorPanel()
          Create the Feature Detector configuration form
protected  void createDifferentialPanel()
           
protected  void createFileMenu()
          Create a File menu
protected  void createFinderPanel()
          Create the PathFinder configuration form
protected  void createHelpMenu()
          Create a help menu
protected  void createLoadPanel()
          Create load map panel
protected  void createMapMenu()
          Create a Map menu
protected  void createMapPanel()
          Create the map panel
protected  void createMCLPanel()
          Create the MCL configuration form
protected  void createMenu()
          Create the menu
protected  void createMeshPanel()
          Create the mesh configuration panel
protected  void createMovePanel()
          Create the move panel, which shows the last move made by the robot
protected  void createParticlePanel()
          Create the particle panel which shows range readings for a specific particle
protected  void createPilotPanel()
          Create the Pilot Configuration Form
protected  void createRandomPanel()
          Create the Random Move configuration form
protected  void createReadingsPanel()
          Create the readings panel which shows the last range readings
protected  void createScannerPanel()
          Create the range scanner configuration form
protected  void createStatusPanel()
          Create the status Panel
protected  void createSteeringPanel()
           
protected  void createViewMenu()
          Create a View menu
protected  void createXYPanel()
          Create the map panel which shows the mouse position in map coordinates
 void error(java.lang.String msg)
          Show a pop-up error message
 void eventReceived(NavigationModel.NavEvent navEvent)
          Override this method to perform some action (other than repaining) when an event is received
 void fatal(java.lang.String msg)
          Print the error message and exit
protected  void loadProperties()
           
 void log(java.lang.String message)
          Log a message
 void mouseClicked(java.awt.event.MouseEvent e)
          Optionally overridden by subclasses
 void mouseDragged(java.awt.event.MouseEvent e)
          Optionally overridden by subclasses
 void mouseEntered(java.awt.event.MouseEvent e)
          Optionally overridden by subclasses
 void mouseExited(java.awt.event.MouseEvent e)
          Called when the mouse exits the map panel.
 void mouseMoved(java.awt.event.MouseEvent e)
          Optionally overridden by subclasses
 void mousePressed(java.awt.event.MouseEvent e)
          Optionally overridden by subclasses
 void mouseReleased(java.awt.event.MouseEvent e)
          Optionally overridden by subclasses
static javax.swing.JFrame openInJFrame(NavigationPanel content, int width, int height, java.lang.String title, java.awt.Color bgColor)
          Version without a menu
static javax.swing.JFrame openInJFrame(NavigationPanel content, int width, int height, java.lang.String title, java.awt.Color bgColor, javax.swing.JMenuBar menuBar)
          Create a frame to display the panel in
 void paintComponent(java.awt.Graphics g)
           
protected  void popupMenu(java.awt.event.MouseEvent me)
          Display a context menu at the specified point in the map panel.
protected  void popupMenuItems(java.awt.Point p, javax.swing.JPopupMenu menu)
          Used by subclasses to add popup menu items
protected  void saveProperties()
           
 void setDescription(java.lang.String description)
          Set the description used in the About popup
 void setMapOrigin(java.awt.Point origin)
           
 void setMapPanelSize(java.awt.Dimension size)
          Set the size of the map panel
 void setMapSize(java.awt.Dimension size)
          Set the size of the map panel
 void setTitle(java.lang.String title)
          Set the title use for the frame and the About popup
 void whenConnected()
          Override this method to specify actions to do after connection to the NXT
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, 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, 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, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface lejos.robotics.mapping.MapApplicationUI
repaint
 

Field Detail

KEY_DEFAULT_NXT

protected static final java.lang.String KEY_DEFAULT_NXT
See Also:
Constant Field Values

KEY_DEFAULT_MAP

protected static final java.lang.String KEY_DEFAULT_MAP
See Also:
Constant Field Values

KEY_DIFF_PILOT_WHEEL_DIAMETER

protected static final java.lang.String KEY_DIFF_PILOT_WHEEL_DIAMETER
See Also:
Constant Field Values

KEY_DIFF_PILOT_TRACK_WIDTH

protected static final java.lang.String KEY_DIFF_PILOT_TRACK_WIDTH
See Also:
Constant Field Values

KEY_DIFF_PILOT_LEFT_MOTOR

protected static final java.lang.String KEY_DIFF_PILOT_LEFT_MOTOR
See Also:
Constant Field Values

KEY_DIFF_PILOT_RIGHT_MOTOR

protected static final java.lang.String KEY_DIFF_PILOT_RIGHT_MOTOR
See Also:
Constant Field Values

KEY_DIFF_PILOT_REVERSE

protected static final java.lang.String KEY_DIFF_PILOT_REVERSE
See Also:
Constant Field Values

KEY_STEER_PILOT_WHEEL_DIAMETER

protected static final java.lang.String KEY_STEER_PILOT_WHEEL_DIAMETER
See Also:
Constant Field Values

KEY_STEER_PILOT_DRIVE_MOTOR

protected static final java.lang.String KEY_STEER_PILOT_DRIVE_MOTOR
See Also:
Constant Field Values

KEY_STEER_PILOT_DRIVE_MOTOR_REVERSE

protected static final java.lang.String KEY_STEER_PILOT_DRIVE_MOTOR_REVERSE
See Also:
Constant Field Values

KEY_STEER_PILOT_STEERING_MOTOR

protected static final java.lang.String KEY_STEER_PILOT_STEERING_MOTOR
See Also:
Constant Field Values

KEY_STEER_PILOT_LEFT_TACHO

protected static final java.lang.String KEY_STEER_PILOT_LEFT_TACHO
See Also:
Constant Field Values

KEY_STEER_PILOT_RIGHT_TACHO

protected static final java.lang.String KEY_STEER_PILOT_RIGHT_TACHO
See Also:
Constant Field Values

KEY_MESH_GRID_SIZE

protected static final java.lang.String KEY_MESH_GRID_SIZE
See Also:
Constant Field Values

KEY_MESH_CLEARANCE

protected static final java.lang.String KEY_MESH_CLEARANCE
See Also:
Constant Field Values

KEY_DETECTOR_DELAY

protected static final java.lang.String KEY_DETECTOR_DELAY
See Also:
Constant Field Values

KEY_DETECTOR_MAX_DISTANCE

protected static final java.lang.String KEY_DETECTOR_MAX_DISTANCE
See Also:
Constant Field Values

KEY_RANGE_SCANNER_GEAR_RATIO

protected static final java.lang.String KEY_RANGE_SCANNER_GEAR_RATIO
See Also:
Constant Field Values

KEY_RANGE_SCANNER_HEAD_MOTOR

protected static final java.lang.String KEY_RANGE_SCANNER_HEAD_MOTOR
See Also:
Constant Field Values

KEY_RANDOM_MOVE_MAX_DISTANCE

protected static final java.lang.String KEY_RANDOM_MOVE_MAX_DISTANCE
See Also:
Constant Field Values

KEY_RANDOM_MOVE_CLEARANCE

protected static final java.lang.String KEY_RANDOM_MOVE_CLEARANCE
See Also:
Constant Field Values

KEY_MCL_NUM_PARTICLES

protected static final java.lang.String KEY_MCL_NUM_PARTICLES
See Also:
Constant Field Values

KEY_MCL_CLEARANCE

protected static final java.lang.String KEY_MCL_CLEARANCE
See Also:
Constant Field Values

KEY_MAX_TRAVEL_SPEED

protected static final java.lang.String KEY_MAX_TRAVEL_SPEED
See Also:
Constant Field Values

KEY_MAX_ROTATE_SPEED

protected static final java.lang.String KEY_MAX_ROTATE_SPEED
See Also:
Constant Field Values

minZoom

protected int minZoom

maxZoom

protected int maxZoom

zoomIncrement

protected int zoomIncrement

zoomInitialValue

protected int zoomInitialValue

showZoomLabels

protected boolean showZoomLabels

zoomMajorTick

protected int zoomMajorTick

pixelsPerUnit

protected float pixelsPerUnit

model

protected PCNavigationModel model

mapPanel

protected MapPanel mapPanel

commandPanel

protected javax.swing.JPanel commandPanel

connectPanel

protected javax.swing.JPanel connectPanel

statusPanel

protected javax.swing.JPanel statusPanel

xyPanel

protected javax.swing.JPanel xyPanel

logPanel

protected javax.swing.JPanel logPanel

xLabel

protected javax.swing.JLabel xLabel

xField

protected javax.swing.JTextField xField

yLabel

protected javax.swing.JLabel yLabel

yField

protected javax.swing.JTextField yField

connectedLabel

protected javax.swing.JLabel connectedLabel

mapLabel

protected javax.swing.JLabel mapLabel

controlPanel

protected javax.swing.JPanel controlPanel

zoomSlider

protected javax.swing.JSlider zoomSlider

nxtLabel

protected javax.swing.JLabel nxtLabel

nxtName

protected javax.swing.JTextField nxtName

connectButton

protected javax.swing.JButton connectButton

showConnectPanel

protected boolean showConnectPanel

showStatusPanel

protected boolean showStatusPanel

showControlPanel

protected boolean showControlPanel

showCommandPanel

protected boolean showCommandPanel

showReadingsPanel

protected boolean showReadingsPanel

showLastMovePanel

protected boolean showLastMovePanel

showParticlePanel

protected boolean showParticlePanel

showMoves

protected boolean showMoves

showMesh

protected boolean showMesh

showGrid

protected boolean showGrid

showLog

protected boolean showLog

showParticles

protected boolean showParticles

showLoadMapPanel

protected boolean showLoadMapPanel

showEventPanel

protected boolean showEventPanel

readingsPanel

protected javax.swing.JPanel readingsPanel

readingsField

protected javax.swing.JTextField readingsField

lastMovePanel

protected javax.swing.JPanel lastMovePanel

lastMoveField

protected javax.swing.JTextField lastMoveField

particlePanel

protected javax.swing.JPanel particlePanel

particleField

protected javax.swing.JTextField particleField

mapPaneSize

protected java.awt.Dimension mapPaneSize

startDrag

protected java.awt.Point startDrag

initialViewStart

protected java.awt.Point initialViewStart

title

protected java.lang.String title

description

protected java.lang.String description

program

protected java.lang.String program

menuBar

protected javax.swing.JMenuBar menuBar

fileMenu

protected javax.swing.JMenu fileMenu

aboutMenu

protected javax.swing.JMenu aboutMenu

mapMenu

protected javax.swing.JMenu mapMenu

viewMenu

protected javax.swing.JMenu viewMenu

colorMenu

protected javax.swing.JMenu colorMenu

commandsMenu

protected javax.swing.JMenu commandsMenu

configureMenu

protected javax.swing.JMenu configureMenu

exit

protected javax.swing.JMenuItem exit

about

protected javax.swing.JMenuItem about

clear

protected javax.swing.JMenuItem clear

repaint

protected javax.swing.JMenuItem repaint

reset

protected javax.swing.JMenuItem reset

open

protected javax.swing.JMenuItem open

save

protected javax.swing.JMenuItem save

connect

protected javax.swing.JMenuItem connect

gridColor

protected javax.swing.JMenuItem gridColor

robotColor

protected javax.swing.JMenuItem robotColor

mapColor

protected javax.swing.JMenuItem mapColor

particleColor

protected javax.swing.JMenuItem particleColor

meshColor

protected javax.swing.JMenuItem meshColor

targetColor

protected javax.swing.JMenuItem targetColor

waypointColor

protected javax.swing.JMenuItem waypointColor

pathColor

protected javax.swing.JMenuItem pathColor

moveColor

protected javax.swing.JMenuItem moveColor

featureColor

protected javax.swing.JMenuItem featureColor

backgroundColor

protected javax.swing.JMenuItem backgroundColor

estimateColor

protected javax.swing.JMenuItem estimateColor

closestColor

protected javax.swing.JMenuItem closestColor

getPose

protected javax.swing.JMenuItem getPose

randomMove

protected javax.swing.JMenuItem randomMove

localize

protected javax.swing.JMenuItem localize

stop

protected javax.swing.JMenuItem stop

calculatePath

protected javax.swing.JMenuItem calculatePath

followPath

protected javax.swing.JMenuItem followPath

pilot

protected javax.swing.JMenuItem pilot

scanner

protected javax.swing.JMenuItem scanner

finder

protected javax.swing.JMenuItem finder

detector

protected javax.swing.JMenuItem detector

random

protected javax.swing.JMenuItem random

mcl

protected javax.swing.JMenuItem mcl

defaultColors

protected javax.swing.JMenuItem defaultColors

viewGrid

protected javax.swing.JCheckBoxMenuItem viewGrid

viewMousePosition

protected javax.swing.JCheckBoxMenuItem viewMousePosition

viewControls

protected javax.swing.JCheckBoxMenuItem viewControls

viewConnect

protected javax.swing.JCheckBoxMenuItem viewConnect

viewCommands

protected javax.swing.JCheckBoxMenuItem viewCommands

viewMesh

protected javax.swing.JCheckBoxMenuItem viewMesh

viewLog

protected javax.swing.JCheckBoxMenuItem viewLog

viewLastMove

protected javax.swing.JCheckBoxMenuItem viewLastMove

viewParticlePanel

protected javax.swing.JCheckBoxMenuItem viewParticlePanel

viewParticles

protected javax.swing.JCheckBoxMenuItem viewParticles

viewLoadMap

protected javax.swing.JCheckBoxMenuItem viewLoadMap

viewEventForm

protected javax.swing.JCheckBoxMenuItem viewEventForm

chooser

protected javax.swing.JFileChooser chooser

eventPanel

protected EventPanel eventPanel

colorChooser

protected javax.swing.JColorChooser colorChooser

frame

protected javax.swing.JFrame frame

loadPanel

protected javax.swing.JPanel loadPanel

mapFileLabel

protected javax.swing.JLabel mapFileLabel

mapFileField

protected javax.swing.JTextField mapFileField

loadMapButton

protected javax.swing.JButton loadMapButton

uploadBox

protected javax.swing.JCheckBox uploadBox

configurePilot

protected javax.swing.JDialog configurePilot

differentialPanel

protected javax.swing.JPanel differentialPanel

pilotForm

protected javax.swing.JPanel pilotForm

pilotTypeLabel

protected javax.swing.JLabel pilotTypeLabel

pilotTypes

protected java.lang.String[] pilotTypes

pilotTypeBox

protected javax.swing.JComboBox pilotTypeBox

wheelDiameterLabel

protected javax.swing.JLabel wheelDiameterLabel

wheelDiameterField

protected javax.swing.JTextField wheelDiameterField

trackWidthLabel

protected javax.swing.JLabel trackWidthLabel

trackWidthField

protected javax.swing.JTextField trackWidthField

pilotOKButton

protected javax.swing.JButton pilotOKButton

motors

protected java.lang.String[] motors

leftMotorLabel

protected javax.swing.JLabel leftMotorLabel

leftMotorBox

protected javax.swing.JComboBox leftMotorBox

rightMotorLabel

protected javax.swing.JLabel rightMotorLabel

rightMotorBox

protected javax.swing.JComboBox rightMotorBox

reverseLabel

protected javax.swing.JLabel reverseLabel

reverseBox

protected javax.swing.JCheckBox reverseBox

steeringPanel

protected javax.swing.JPanel steeringPanel

steerWheelDiameterLabel

protected javax.swing.JLabel steerWheelDiameterLabel

steerWheelDiameterField

protected javax.swing.JTextField steerWheelDiameterField

driveMotorLabel

protected javax.swing.JLabel driveMotorLabel

driveMotorBox

protected javax.swing.JComboBox driveMotorBox

driveReverseLabel

protected javax.swing.JLabel driveReverseLabel

driveReverseBox

protected javax.swing.JCheckBox driveReverseBox

steeringMotorLabel

protected javax.swing.JLabel steeringMotorLabel

steeringMotorBox

protected javax.swing.JComboBox steeringMotorBox

leftTachoLabel

protected javax.swing.JLabel leftTachoLabel

leftTachoField

protected javax.swing.JTextField leftTachoField

rightTachoLabel

protected javax.swing.JLabel rightTachoLabel

rightTachoField

protected javax.swing.JTextField rightTachoField

finderPanel

protected javax.swing.JPanel finderPanel

configureMesh

protected javax.swing.JDialog configureMesh

meshPanel

protected javax.swing.JPanel meshPanel

finderForm

protected javax.swing.JPanel finderForm

pfLabel

protected javax.swing.JLabel pfLabel

pathFinders

protected java.lang.String[] pathFinders

pfBox

protected javax.swing.JComboBox pfBox

gridSizeLabel

protected javax.swing.JLabel gridSizeLabel

gridSizeField

protected javax.swing.JTextField gridSizeField

clearanceLabel

protected javax.swing.JLabel clearanceLabel

clearanceField

protected javax.swing.JTextField clearanceField

finderOKButton

protected javax.swing.JButton finderOKButton

delayLabel

protected javax.swing.JLabel delayLabel

delayField

protected javax.swing.JTextField delayField

maxDistanceLabel

protected javax.swing.JLabel maxDistanceLabel

maxDistanceField

protected javax.swing.JTextField maxDistanceField

detectorPanel

protected javax.swing.JPanel detectorPanel

detectorForm

protected javax.swing.JPanel detectorForm

configureDetector

protected javax.swing.JDialog configureDetector

detectorOKButton

protected javax.swing.JButton detectorOKButton

gearRatioLabel

protected javax.swing.JLabel gearRatioLabel

gearRatioField

protected javax.swing.JTextField gearRatioField

headMotorLabel

protected javax.swing.JLabel headMotorLabel

headMotorBox

protected javax.swing.JComboBox headMotorBox

scannerPanel

protected javax.swing.JPanel scannerPanel

scannerForm

protected javax.swing.JPanel scannerForm

configureScanner

protected javax.swing.JDialog configureScanner

scannerOKButton

protected javax.swing.JButton scannerOKButton

maxDistLabel

protected javax.swing.JLabel maxDistLabel

maxDistField

protected javax.swing.JTextField maxDistField

clearLabel

protected javax.swing.JLabel clearLabel

clearField

protected javax.swing.JTextField clearField

randomPanel

protected javax.swing.JPanel randomPanel

randomForm

protected javax.swing.JPanel randomForm

randomOKButton

protected javax.swing.JButton randomOKButton

configureRandom

protected javax.swing.JDialog configureRandom

numParticlesLabel

protected javax.swing.JLabel numParticlesLabel

numParticlesField

protected javax.swing.JTextField numParticlesField

borderLabel

protected javax.swing.JLabel borderLabel

borderField

protected javax.swing.JTextField borderField

mclPanel

protected javax.swing.JPanel mclPanel

mclForm

protected javax.swing.JPanel mclForm

mclOKButton

protected javax.swing.JButton mclOKButton

configureMCL

protected javax.swing.JDialog configureMCL

props

protected java.util.Properties props
Constructor Detail

NavigationPanel

public NavigationPanel()
Method Detail

loadProperties

protected void loadProperties()

saveProperties

protected void saveProperties()

buildPanels

public void buildPanels()
Build all the panels


buildGUI

protected void buildGUI()
Build the GUI- used by MCLTest but deprecated


createMapPanel

protected void createMapPanel()
Create the map panel


createLoadPanel

protected void createLoadPanel()
Create load map panel


createPilotPanel

protected void createPilotPanel()
Create the Pilot Configuration Form


createDifferentialPanel

protected void createDifferentialPanel()

createSteeringPanel

protected void createSteeringPanel()

createFinderPanel

protected void createFinderPanel()
Create the PathFinder configuration form


createMeshPanel

protected void createMeshPanel()
Create the mesh configuration panel


createDetectorPanel

protected void createDetectorPanel()
Create the Feature Detector configuration form


createScannerPanel

protected void createScannerPanel()
Create the range scanner configuration form


createRandomPanel

protected void createRandomPanel()
Create the Random Move configuration form


createMCLPanel

protected void createMCLPanel()
Create the MCL configuration form


createConnectPanel

protected void createConnectPanel()
Create the Connect panel to allow connection to a NXT brick


createControlPanel

protected void createControlPanel()
Create the control panel, which controls the GUI


createXYPanel

protected void createXYPanel()
Create the map panel which shows the mouse position in map coordinates


createStatusPanel

protected void createStatusPanel()
Create the status Panel


createCommandPanel

protected void createCommandPanel()
Create the command panel - this is added to by overriding classes


createReadingsPanel

protected void createReadingsPanel()
Create the readings panel which shows the last range readings


createMovePanel

protected void createMovePanel()
Create the move panel, which shows the last move made by the robot


createParticlePanel

protected void createParticlePanel()
Create the particle panel which shows range readings for a specific particle


createMenu

protected void createMenu()
Create the menu


createFileMenu

protected void createFileMenu()
Create a File menu


createViewMenu

protected void createViewMenu()
Create a View menu


createMapMenu

protected void createMapMenu()
Create a Map menu


createCommandMenu

protected void createCommandMenu()
Create the Commands menu


createConfigureMenu

protected void createConfigureMenu()
Create the Configure menu


createAboutMenu

protected void createAboutMenu()
Create an About menu


createHelpMenu

protected void createHelpMenu()
Create a help menu


fatal

public void fatal(java.lang.String msg)
Print the error message and exit

Specified by:
fatal in interface MapApplicationUI
Parameters:
msg - the message

error

public void error(java.lang.String msg)
Show a pop-up error message

Specified by:
error in interface MapApplicationUI
Parameters:
msg - the message

setMapSize

public void setMapSize(java.awt.Dimension size)
Set the size of the map panel

Parameters:
size - the preferred panel dimensions

paintComponent

public void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

openInJFrame

public static javax.swing.JFrame openInJFrame(NavigationPanel content,
                                              int width,
                                              int height,
                                              java.lang.String title,
                                              java.awt.Color bgColor,
                                              javax.swing.JMenuBar menuBar)
Create a frame to display the panel in


openInJFrame

public static javax.swing.JFrame openInJFrame(NavigationPanel content,
                                              int width,
                                              int height,
                                              java.lang.String title,
                                              java.awt.Color bgColor)
Version without a menu


log

public void log(java.lang.String message)
Log a message

Specified by:
log in interface MapApplicationUI
Parameters:
message -

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Optionally overridden by subclasses

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Optionally overridden by subclasses

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Optionally overridden by subclasses

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Optionally overridden by subclasses

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Called when the mouse exits the map panel.

Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Optionally overridden by subclasses

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Optionally overridden by subclasses

Specified by:
mouseReleased in interface java.awt.event.MouseListener

popupMenu

protected void popupMenu(java.awt.event.MouseEvent me)
Display a context menu at the specified point in the map panel. Overridden by subclasses.

Parameters:
me - the mouse event

popupMenuItems

protected void popupMenuItems(java.awt.Point p,
                              javax.swing.JPopupMenu menu)
Used by subclasses to add popup menu items

Parameters:
p - the point at which the menu was popped up
menu - the popup menu

whenConnected

public void whenConnected()
Override this method to specify actions to do after connection to the NXT

Specified by:
whenConnected in interface MapApplicationUI

eventReceived

public void eventReceived(NavigationModel.NavEvent navEvent)
Override this method to perform some action (other than repaining) when an event is received

Specified by:
eventReceived in interface MapApplicationUI
Parameters:
navEvent - the event

about

protected void about()
Provides a pop up about dialog which can be tailored or overridden


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Called when a menu item is selected or button clicked

Specified by:
actionPerformed in interface java.awt.event.ActionListener

setTitle

public void setTitle(java.lang.String title)
Set the title use for the frame and the About popup

Parameters:
title - the title

setDescription

public void setDescription(java.lang.String description)
Set the description used in the About popup

Parameters:
description - the description

setMapPanelSize

public void setMapPanelSize(java.awt.Dimension size)
Set the size of the map panel

Parameters:
size - the size as a Dimension

setMapOrigin

public void setMapOrigin(java.awt.Point origin)