|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
lejos.robotics.mapping.MapPanel
public class MapPanel
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 static float |
ARROW_LENGTH
|
protected float |
arrowLength
|
protected static java.awt.Color |
BACKGROUND_COLOR
|
static int |
BACKGROUND_COLOR_INDEX
|
protected static java.awt.Color |
CLOSEST_COLOR
|
static int |
CLOSEST_COLOR_INDEX
|
java.lang.String[] |
colorKeys
|
java.awt.Color[] |
colors
|
protected static java.awt.Color |
ESTIMATE_COLOR
|
static int |
ESTIMATE_COLOR_INDEX
|
protected static java.awt.Color |
FEATURE_COLOR
|
static int |
FEATURE_COLOR_INDEX
|
protected static java.awt.Color |
GRID_COLOR
|
static int |
GRID_COLOR_INDEX
|
protected int |
gridSize
|
protected java.awt.Color[] |
INITIAL_COLORS
|
protected static java.awt.Color |
MAP_COLOR
|
static int |
MAP_COLOR_INDEX
|
protected static int |
MAX_CLUSTER_SIZE
|
protected static java.awt.Color |
MESH_COLOR
|
static int |
MESH_COLOR_INDEX
|
protected PCNavigationModel |
model
|
protected static java.awt.Color |
MOVE_COLOR
|
static int |
MOVE_COLOR_INDEX
|
protected static java.awt.Color |
NEIGHBOR_COLOR
|
static int |
NEIGHBOR_COLOR_INDEX
|
protected int |
NODE_CIRC
|
protected NavigationPanel |
parent
|
protected static java.awt.Color |
PARTICLE_COLOR
|
static int |
PARTICLE_COLOR_INDEX
|
protected static java.awt.Color |
PATH_COLOR
|
static int |
PATH_COLOR_INDEX
|
protected static java.awt.Color |
ROBOT_COLOR
|
static int |
ROBOT_COLOR_INDEX
|
protected static int |
ROBOT_SIZE
|
protected java.awt.Dimension |
size
|
protected static java.awt.Color |
TARGET_COLOR
|
static int |
TARGET_COLOR_INDEX
|
protected static int |
TARGET_SIZE
|
java.awt.Point |
viewStart
|
protected static java.awt.Color |
WAYPOINT_COLOR
|
static int |
WAYPOINT_COLOR_INDEX
|
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 | |
---|---|
MapPanel(PCNavigationModel model,
java.awt.Dimension size,
NavigationPanel parent)
Create the panel, set its size, and associated it with the navigation model and navigation panel. |
Method Summary | |
---|---|
protected Line |
getArrowLine(Pose pose)
Create a Line that represents the direction of the pose |
void |
getColors(java.util.Properties props)
|
protected float |
getDistance(float distance)
Convert a distance in map coordinates to a screen distance |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent e)
Get tooltips for individual features - currently just particles |
protected float |
getX(float x)
Get the screen X coordinate for a given map coordinate |
protected float |
getY(float y)
Get the screen Y coordinate for a given map coordinate |
void |
paintComponent(java.awt.Graphics g)
Overrides JPanel paintComponent to paint all the navigation data |
protected void |
paintFeatures(java.awt.Graphics2D g2d)
Paint features detected |
void |
paintGrid(java.awt.Graphics2D g2d)
Paint the grid |
void |
paintMap(java.awt.Graphics2D g2d)
Draw the map using Line2D objects |
protected void |
paintMesh(java.awt.Graphics2D g2d)
Paint the navigation mesh |
protected void |
paintMoves(java.awt.Graphics2D g2d)
Paint the moves made |
void |
paintParticles(java.awt.Graphics2D g2d)
Paint the particles |
protected void |
paintPath(java.awt.Graphics2D g2d)
Paint the path |
void |
paintPose(java.awt.Graphics2D g2d,
Pose pose)
Paint the pose using Ellipse2D |
protected void |
paintRobot(java.awt.Graphics2D g2d)
If we are down to one small cluster show the location of the robot. |
protected void |
paintTarget(java.awt.Graphics2D g2d)
Paint the target |
protected void |
paintWaypoints(java.awt.Graphics2D g2d)
|
void |
saveColors(java.util.Properties props)
|
void |
setDefaults()
|
void |
showColors()
|
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, 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 |
Field Detail |
---|
protected static final java.awt.Color MAP_COLOR
protected static final java.awt.Color PARTICLE_COLOR
protected static final java.awt.Color BACKGROUND_COLOR
protected static final java.awt.Color GRID_COLOR
protected static final java.awt.Color ESTIMATE_COLOR
protected static final java.awt.Color CLOSEST_COLOR
protected static final java.awt.Color MESH_COLOR
protected static final java.awt.Color NEIGHBOR_COLOR
protected static final java.awt.Color TARGET_COLOR
protected static final java.awt.Color PATH_COLOR
protected static final java.awt.Color MOVE_COLOR
protected static final java.awt.Color FEATURE_COLOR
protected static final java.awt.Color WAYPOINT_COLOR
protected static final java.awt.Color ROBOT_COLOR
protected static final float ARROW_LENGTH
protected static final int ROBOT_SIZE
protected static final int TARGET_SIZE
protected final int NODE_CIRC
protected PCNavigationModel model
protected NavigationPanel parent
protected java.awt.Dimension size
protected float arrowLength
protected int gridSize
public java.awt.Color[] colors
public java.lang.String[] colorKeys
public static final int MAP_COLOR_INDEX
public static final int PARTICLE_COLOR_INDEX
public static final int BACKGROUND_COLOR_INDEX
public static final int GRID_COLOR_INDEX
public static final int ESTIMATE_COLOR_INDEX
public static final int CLOSEST_COLOR_INDEX
public static final int MESH_COLOR_INDEX
public static final int NEIGHBOR_COLOR_INDEX
public static final int TARGET_COLOR_INDEX
public static final int PATH_COLOR_INDEX
public static final int MOVE_COLOR_INDEX
public static final int FEATURE_COLOR_INDEX
public static final int WAYPOINT_COLOR_INDEX
public static final int ROBOT_COLOR_INDEX
protected static final int MAX_CLUSTER_SIZE
protected final java.awt.Color[] INITIAL_COLORS
public java.awt.Point viewStart
Constructor Detail |
---|
public MapPanel(PCNavigationModel model, java.awt.Dimension size, NavigationPanel parent)
model
- the navigation modelsize
- the map panel sizeparent
- the navigation panelMethod Detail |
---|
public void paintMap(java.awt.Graphics2D g2d)
g2d
- the Graphics2D objectprotected void paintMesh(java.awt.Graphics2D g2d)
g2d
- the Graphics2D objectpublic void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
protected void paintRobot(java.awt.Graphics2D g2d)
g2d
- the Graphics2D objectpublic void paintPose(java.awt.Graphics2D g2d, Pose pose)
g2d
- the Graphics2D objectpublic void paintGrid(java.awt.Graphics2D g2d)
g2d
- the Graphics2D objectpublic void paintParticles(java.awt.Graphics2D g2d)
g2d
- the Graphics2D objectprotected void paintTarget(java.awt.Graphics2D g2d)
g2d
- the Graphics2D objectprotected void paintFeatures(java.awt.Graphics2D g2d)
g2d
- the Graphics2D objectprotected void paintWaypoints(java.awt.Graphics2D g2d)
protected void paintMoves(java.awt.Graphics2D g2d)
g2d
- the Graphics2D objectprotected Line getArrowLine(Pose pose)
pose
- the pose
protected void paintPath(java.awt.Graphics2D g2d)
g2d
- the Graphics2d objectprotected float getX(float x)
protected float getY(float y)
protected float getDistance(float distance)
public java.lang.String getToolTipText(java.awt.event.MouseEvent e)
getToolTipText
in class javax.swing.JComponent
public void showColors()
public void getColors(java.util.Properties props)
public void saveColors(java.util.Properties props)
public void setDefaults()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |