lejos.pc.tools
Class NXJMapCommand

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
                      extended by lejos.pc.tools.NXJMapCommand
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

public class NXJMapCommand
extends NavigationPanel

MapCommand shows a mapped area and allow navigation commands to be sent to the NXT. The NXT must run the MapTest sample.

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
 
Fields inherited from class lejos.robotics.mapping.NavigationPanel
about, aboutMenu, backgroundColor, borderField, borderLabel, calculatePath, chooser, clear, clearanceField, clearanceLabel, clearField, clearLabel, closestColor, colorChooser, colorMenu, commandPanel, commandsMenu, configureDetector, configureMCL, configureMenu, configureMesh, configurePilot, configureRandom, configureScanner, connect, connectButton, connectedLabel, connectPanel, controlPanel, defaultColors, delayField, delayLabel, description, detector, detectorForm, detectorOKButton, detectorPanel, differentialPanel, driveMotorBox, driveMotorLabel, driveReverseBox, driveReverseLabel, estimateColor, eventPanel, exit, featureColor, fileMenu, finder, finderForm, finderOKButton, finderPanel, followPath, frame, gearRatioField, gearRatioLabel, getPose, gridColor, gridSizeField, gridSizeLabel, headMotorBox, headMotorLabel, initialViewStart, KEY_DEFAULT_MAP, KEY_DEFAULT_NXT, KEY_DETECTOR_DELAY, KEY_DETECTOR_MAX_DISTANCE, KEY_DIFF_PILOT_LEFT_MOTOR, KEY_DIFF_PILOT_REVERSE, KEY_DIFF_PILOT_RIGHT_MOTOR, KEY_DIFF_PILOT_TRACK_WIDTH, KEY_DIFF_PILOT_WHEEL_DIAMETER, KEY_MAX_ROTATE_SPEED, KEY_MAX_TRAVEL_SPEED, KEY_MCL_CLEARANCE, KEY_MCL_NUM_PARTICLES, KEY_MESH_CLEARANCE, KEY_MESH_GRID_SIZE, KEY_RANDOM_MOVE_CLEARANCE, KEY_RANDOM_MOVE_MAX_DISTANCE, KEY_RANGE_SCANNER_GEAR_RATIO, KEY_RANGE_SCANNER_HEAD_MOTOR, KEY_STEER_PILOT_DRIVE_MOTOR, KEY_STEER_PILOT_DRIVE_MOTOR_REVERSE, KEY_STEER_PILOT_LEFT_TACHO, KEY_STEER_PILOT_RIGHT_TACHO, KEY_STEER_PILOT_STEERING_MOTOR, KEY_STEER_PILOT_WHEEL_DIAMETER, lastMoveField, lastMovePanel, leftMotorBox, leftMotorLabel, leftTachoField, leftTachoLabel, loadMapButton, loadPanel, localize, logPanel, mapColor, mapFileField, mapFileLabel, mapLabel, mapMenu, mapPanel, mapPaneSize, maxDistanceField, maxDistanceLabel, maxDistField, maxDistLabel, maxZoom, mcl, mclForm, mclOKButton, mclPanel, menuBar, meshColor, meshPanel, minZoom, model, motors, moveColor, numParticlesField, numParticlesLabel, nxtLabel, nxtName, open, particleColor, particleField, particlePanel, pathColor, pathFinders, pfBox, pfLabel, pilot, pilotForm, pilotOKButton, pilotTypeBox, pilotTypeLabel, pilotTypes, pixelsPerUnit, program, props, random, randomForm, randomMove, randomOKButton, randomPanel, readingsField, readingsPanel, repaint, reset, reverseBox, reverseLabel, rightMotorBox, rightMotorLabel, rightTachoField, rightTachoLabel, robotColor, save, scanner, scannerForm, scannerOKButton, scannerPanel, showCommandPanel, showConnectPanel, showControlPanel, showEventPanel, showGrid, showLastMovePanel, showLoadMapPanel, showLog, showMesh, showMoves, showParticlePanel, showParticles, showReadingsPanel, showStatusPanel, showZoomLabels, startDrag, statusPanel, steeringMotorBox, steeringMotorLabel, steeringPanel, steerWheelDiameterField, steerWheelDiameterLabel, stop, targetColor, title, trackWidthField, trackWidthLabel, uploadBox, viewCommands, viewConnect, viewControls, viewEventForm, viewGrid, viewLastMove, viewLoadMap, viewLog, viewMenu, viewMesh, viewMousePosition, viewParticlePanel, viewParticles, waypointColor, wheelDiameterField, wheelDiameterLabel, xField, xLabel, xyPanel, yField, yLabel, zoomIncrement, zoomInitialValue, zoomMajorTick, 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
NXJMapCommand()
           
 
Method Summary
protected  void buildGUI()
          Build the specific GUI for this application
 void eventReceived(NavigationModel.NavEvent navEvent)
          Set the sliders when the pose is changed
static void main(java.lang.String[] args)
          Create a MapTest object and display it in a GUI frame.
protected  void popupMenuItems(java.awt.Point p, javax.swing.JPopupMenu menu)
          Add the required context menu items
 int run()
           
static int start(java.lang.String[] args)
           
 void whenConnected()
          Send the pose when connected
 
Methods inherited from class lejos.robotics.mapping.NavigationPanel
about, actionPerformed, buildPanels, createAboutMenu, createCommandMenu, createCommandPanel, createConfigureMenu, createConnectPanel, createControlPanel, createDetectorPanel, createDifferentialPanel, createFileMenu, createFinderPanel, createHelpMenu, createLoadPanel, createMapMenu, createMapPanel, createMCLPanel, createMenu, createMeshPanel, createMovePanel, createParticlePanel, createPilotPanel, createRandomPanel, createReadingsPanel, createScannerPanel, createStatusPanel, createSteeringPanel, createViewMenu, createXYPanel, error, fatal, loadProperties, log, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, openInJFrame, openInJFrame, paintComponent, popupMenu, saveProperties, setDescription, setMapOrigin, setMapPanelSize, setMapSize, setTitle
 
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
 

Constructor Detail

NXJMapCommand

public NXJMapCommand()
Method Detail

main

public static void main(java.lang.String[] args)
Create a MapTest object and display it in a GUI frame. Then connect to the NXT.


start

public static int start(java.lang.String[] args)

buildGUI

protected void buildGUI()
Build the specific GUI for this application

Overrides:
buildGUI in class NavigationPanel

whenConnected

public void whenConnected()
Send the pose when connected

Specified by:
whenConnected in interface MapApplicationUI
Overrides:
whenConnected in class NavigationPanel

eventReceived

public void eventReceived(NavigationModel.NavEvent navEvent)
Set the sliders when the pose is changed

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

popupMenuItems

protected void popupMenuItems(java.awt.Point p,
                              javax.swing.JPopupMenu menu)
Add the required context menu items

Overrides:
popupMenuItems in class NavigationPanel
Parameters:
p - the point at which the menu was popped up
menu - the popup menu

run

public int run()