dd.ui
Class MapView

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bydd.ui.MapView
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable

public class MapView
extends javax.swing.JPanel
implements java.awt.print.Printable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  Map map
           
 
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.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MapView(Map map, java.lang.Class cellClass)
           
 
Method Summary
 void add(ProposalVisualizer vis)
           
 void beginSingleSelection(MapSelectionListener listener, HexView startingSelection)
           
 void clearCellLabels()
           
 void clearCells()
           
 void clearVisualizers()
           
 void defaultClickHandler(HexView clickedCell, int clickCount)
           
 void drawArrow(java.lang.String location)
           
 void drawDisabledMessage(java.awt.Graphics g)
           
 void drawLegend(java.awt.Image image)
           
 void drawLegend(java.lang.String name)
           
 void drawModeMessage(java.awt.Graphics g)
           
 void drawOverlay(java.lang.String name)
           
 void endSingleSelection()
           
 HexView findCell(MapCell cell)
           
 HexView findCell(java.lang.String location)
           
 java.awt.Point getCellCoordinates(java.lang.String location)
           
 java.awt.Point getLocationFor(int row, int column, int vertex)
          Returns the pixel coordinates for a vertex in a specific cell.
 HexView[] getMapCells()
           
 java.lang.String getRole()
           
 java.util.Collection getSelectedCells()
           
 HexView hexForScreenLocation(int x, int y)
           
 void labelCell(java.lang.String location, java.lang.String message, boolean show)
           
static void main(java.lang.String[] args)
           
 java.awt.geom.GeneralPath makeBezier(java.awt.Point[] points)
           
 void makeMap(Map map, int width, int height, java.lang.Class cellClass)
           
 void makeTableOfContents()
           
 int print(java.awt.Graphics g, java.awt.print.PageFormat format, int pageNum)
           
 void pulseCell(java.lang.String cellName, boolean show)
           
 void removeCellIcon(java.lang.String location, javax.swing.ImageIcon icon)
           
 void resetMap()
           
 void setBackgroundImage(java.awt.Image i)
           
 void setCellIcon(java.lang.String location, javax.swing.ImageIcon icon)
           
 void setCurrentLayer(java.lang.String name)
           
 void setCurrentVisualizer(ProposalVisualizer vis)
           
 void setEnabled(boolean enabled)
           
 void setMap(Map map)
           
 void setRole(java.lang.String role)
           
 void startTicking()
           
 void stopTicking()
           
 void tocUpdated()
           
 void writeFile(java.lang.String filename)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
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, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, setFont, setForeground, 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, 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
 

Field Detail

map

protected Map map
Constructor Detail

MapView

public MapView(Map map,
               java.lang.Class cellClass)
Method Detail

writeFile

public void writeFile(java.lang.String filename)

defaultClickHandler

public void defaultClickHandler(HexView clickedCell,
                                int clickCount)

getSelectedCells

public java.util.Collection getSelectedCells()

clearCells

public void clearCells()

findCell

public HexView findCell(java.lang.String location)

findCell

public HexView findCell(MapCell cell)

pulseCell

public void pulseCell(java.lang.String cellName,
                      boolean show)

drawOverlay

public void drawOverlay(java.lang.String name)

drawLegend

public void drawLegend(java.lang.String name)

setCurrentLayer

public void setCurrentLayer(java.lang.String name)

drawLegend

public void drawLegend(java.awt.Image image)

startTicking

public void startTicking()

stopTicking

public void stopTicking()

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat format,
                 int pageNum)
Specified by:
print in interface java.awt.print.Printable

getMapCells

public HexView[] getMapCells()

getRole

public java.lang.String getRole()

setRole

public void setRole(java.lang.String role)

drawDisabledMessage

public void drawDisabledMessage(java.awt.Graphics g)

drawModeMessage

public void drawModeMessage(java.awt.Graphics g)

drawArrow

public void drawArrow(java.lang.String location)

getCellCoordinates

public java.awt.Point getCellCoordinates(java.lang.String location)

setBackgroundImage

public void setBackgroundImage(java.awt.Image i)

labelCell

public void labelCell(java.lang.String location,
                      java.lang.String message,
                      boolean show)

setCellIcon

public void setCellIcon(java.lang.String location,
                        javax.swing.ImageIcon icon)

removeCellIcon

public void removeCellIcon(java.lang.String location,
                           javax.swing.ImageIcon icon)

clearCellLabels

public void clearCellLabels()

add

public void add(ProposalVisualizer vis)

clearVisualizers

public void clearVisualizers()

setCurrentVisualizer

public void setCurrentVisualizer(ProposalVisualizer vis)

makeTableOfContents

public void makeTableOfContents()

tocUpdated

public void tocUpdated()

setMap

public void setMap(Map map)

beginSingleSelection

public void beginSingleSelection(MapSelectionListener listener,
                                 HexView startingSelection)

endSingleSelection

public void endSingleSelection()

resetMap

public void resetMap()

makeMap

public void makeMap(Map map,
                    int width,
                    int height,
                    java.lang.Class cellClass)
             throws java.lang.Exception
Throws:
java.lang.Exception

hexForScreenLocation

public HexView hexForScreenLocation(int x,
                                    int y)

setEnabled

public void setEnabled(boolean enabled)

makeBezier

public java.awt.geom.GeneralPath makeBezier(java.awt.Point[] points)

getLocationFor

public java.awt.Point getLocationFor(int row,
                                     int column,
                                     int vertex)
Returns the pixel coordinates for a vertex in a specific cell. The vertex numbering is specified by the hex cell at the specified coordinates

Parameters:
row - Row of the desired cell
column - Column of the desired cell
vertex - index of the desired vertex
Returns:
the pixel location of the specified vertex.
See Also:
HexView.getVertex(int)

main

public static void main(java.lang.String[] args)