cad.simcad.pathfinding.ui.map
Class WhitePaperMapPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--cad.simcad.pathfinding.ui.map.MapDisplayer
                          |
                          +--cad.simcad.pathfinding.ui.map.WhitePaperMapPanel
All Implemented Interfaces:
AbstractMapEventListener, java.util.EventListener, java.awt.image.ImageObserver, MapUIEventListener, java.awt.MenuContainer, PathPlaceEventListener, java.io.Serializable

public class WhitePaperMapPanel
extends MapDisplayer
implements AbstractMapEventListener, PathPlaceEventListener

Version:
1.0
Author:
Charles-Philip Bentley
See Also:
Serialized Form

Field Summary
 
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
WhitePaperMapPanel(AStarInterface frame, UIMediator uim, SimMediator sm)
          Creates new WhitePaperMapPanel
 
Method Summary
 void blankMap()
           
 void computePath()
           
 void doMouseEntered(java.awt.event.MouseEvent e)
           
 void doMousePressed(java.awt.event.MouseEvent e)
           
 void doMouseReleased(java.awt.event.MouseEvent evt)
           
 int getBottomY()
           
 java.awt.Dimension getMinimumSize()
           
 int getMode()
           
 java.awt.Dimension getPreferredSize()
           
 AbstractMap getRenderedMap()
           
 int getRightX()
           
 PathUser getSelectedPathUser()
          Returns null if not PathUser selected
 Selection getSelection()
           
 int getViewableHeight()
           
 int getViewableWidth()
           
 int getXCentered()
           
 int getYCentered()
           
 boolean isStartSet()
           
 void mapPlaceStateChanged(PathPlaceEvent p)
           
 void newMapOpened(AbstractMap am)
           
 void noticeModeChange(java.lang.String s)
           
 void noticeMouseReleased()
           
 void paint(java.awt.Graphics g)
          Our paint method First, it learns what portion of the map is to be displayed.
 void pathComputed(AbstractMapEvent p)
           
 void redoLastAction()
           
 void resetAllCells()
           
 void setDrawBorder(boolean b)
           
 void setEditMode(int mode)
           
 void setShowCoordinate(boolean b)
           
 void setShowValues(boolean b)
           
 void setSizeOfCells(int value)
           
 void setViewCenter(int x, int y)
           
 boolean showCoordinate()
           
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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
 

Constructor Detail

WhitePaperMapPanel

public WhitePaperMapPanel(AStarInterface frame,
                          UIMediator uim,
                          SimMediator sm)
Creates new WhitePaperMapPanel

Method Detail

doMouseReleased

public void doMouseReleased(java.awt.event.MouseEvent evt)

doMouseEntered

public void doMouseEntered(java.awt.event.MouseEvent e)

doMousePressed

public void doMousePressed(java.awt.event.MouseEvent e)

setViewCenter

public void setViewCenter(int x,
                          int y)

paint

public void paint(java.awt.Graphics g)
Our paint method First, it learns what portion of the map is to be displayed. Draw the first layer of fillers Draw the second layer of fillers Draw the simObjects

Overrides:
paint in class javax.swing.JComponent

getRenderedMap

public AbstractMap getRenderedMap()

getRightX

public int getRightX()
Specified by:
getRightX in class MapDisplayer

getBottomY

public int getBottomY()
Specified by:
getBottomY in class MapDisplayer

getXCentered

public int getXCentered()
Specified by:
getXCentered in class MapDisplayer

getYCentered

public int getYCentered()
Specified by:
getYCentered in class MapDisplayer

getViewableWidth

public int getViewableWidth()
Specified by:
getViewableWidth in class MapDisplayer

getViewableHeight

public int getViewableHeight()
Specified by:
getViewableHeight in class MapDisplayer

setDrawBorder

public void setDrawBorder(boolean b)
Specified by:
setDrawBorder in class MapDisplayer

setSizeOfCells

public void setSizeOfCells(int value)
Specified by:
setSizeOfCells in class MapDisplayer

setShowCoordinate

public void setShowCoordinate(boolean b)
Specified by:
setShowCoordinate in class MapDisplayer

showCoordinate

public boolean showCoordinate()
Specified by:
showCoordinate in class MapDisplayer

blankMap

public void blankMap()
Specified by:
blankMap in class MapDisplayer

computePath

public void computePath()
Specified by:
computePath in class MapDisplayer

isStartSet

public boolean isStartSet()
Specified by:
isStartSet in class MapDisplayer

getSelectedPathUser

public PathUser getSelectedPathUser()
Returns null if not PathUser selected

Specified by:
getSelectedPathUser in class MapDisplayer

getSelection

public Selection getSelection()
Specified by:
getSelection in class MapDisplayer

noticeMouseReleased

public void noticeMouseReleased()
Specified by:
noticeMouseReleased in class MapDisplayer

getMode

public int getMode()
Specified by:
getMode in class MapDisplayer

setEditMode

public void setEditMode(int mode)
Specified by:
setEditMode in class MapDisplayer

noticeModeChange

public void noticeModeChange(java.lang.String s)
Specified by:
noticeModeChange in class MapDisplayer

getPreferredSize

public java.awt.Dimension getPreferredSize()
Specified by:
getPreferredSize in class MapDisplayer

getMinimumSize

public java.awt.Dimension getMinimumSize()
Specified by:
getMinimumSize in class MapDisplayer

mapPlaceStateChanged

public void mapPlaceStateChanged(PathPlaceEvent p)
Specified by:
mapPlaceStateChanged in interface PathPlaceEventListener

pathComputed

public void pathComputed(AbstractMapEvent p)
Specified by:
pathComputed in interface AbstractMapEventListener

newMapOpened

public void newMapOpened(AbstractMap am)
Specified by:
newMapOpened in interface MapUIEventListener
Specified by:
newMapOpened in class MapDisplayer

resetAllCells

public void resetAllCells()
Specified by:
resetAllCells in class MapDisplayer

redoLastAction

public void redoLastAction()
Specified by:
redoLastAction in class MapDisplayer

setShowValues

public void setShowValues(boolean b)
Specified by:
setShowValues in class MapDisplayer

Logo

With the help of www.sourceforge.net and www.info.ucl.ac.be