java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.mitre.cvw.CVWFrame
org.mitre.cvw.CVWMap
org.mitre.cvw.CVWMapWin
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
- public class CVWMapWin
- extends CVWMap
- implements java.awt.event.ActionListener
This is the window displaying the layout of rooms in the CVW. It handles
both storage and visual display the map data. It is updated by the CVW
server whenever map data changes (e.g. a floor is added or removed, a room's
name changes, etc).
- Version:
- 1.0
| Nested classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
| Nested classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
| Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
| 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 |
| Fields inherited from class java.awt.Frame |
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Window |
|
| Fields inherited from class java.awt.Container |
|
|
Constructor Summary |
(package private) |
CVWMapWin()
Constructor |
|
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent e)
This method is invoked when an action occurs. |
void |
closeWindow()
Closes the window and lets the CVW server know the map is closed. |
private int |
convertToIndex(mapFloor floor,
java.lang.String room)
Takes a floor object, and a room name and returns the index of that room
in the floor's room array. |
private void |
currentHighlight(int newRoom)
Unhighlights any room previously highlighted on the map and highlights a
new room (given its index in the array of rooms currently displayed). |
void |
CVWMapUpdate(int numlevels,
java.lang.String fNames,
java.lang.String fObjs,
java.lang.String rNames,
java.lang.String rObjs)
Updates the Map window with info about the room and floor layout of the CVW server. |
void |
CVWMapUpdateLocale(int floorIndex,
java.lang.String room)
Redraws the current floor displayed on the map. |
java.lang.String[] |
getFloorNames()
Returns an ordered array of floor names. |
java.lang.String[] |
getFloorObjs()
Returns an ordered array of floor object numbers. |
java.lang.String[] |
getRoomNames()
Returns an ordered array of room names. |
java.lang.String[] |
getRoomObjs()
Returns an ordered array of room object numbers. |
int |
howManyFloors()
Returns the number of floors that exist. |
int |
howManyRooms()
Returns the total number of rooms that exist. |
void |
requestFocus()
Makes sure that the current floor selection has focus whenever
the map window has focus. |
private void |
selectedfloorChoice()
Called when the user selects a floor from the drop-down floor list, in turn
calls CVWMapUpdateLocale to change the map's display to the seleceted floor. |
private void |
setUpFloorLayout()
The map display is divided into 5 rows, this creates & initializes them. |
private java.lang.String[] |
splitString(java.lang.String altogether,
java.lang.String splitter,
int len)
Given a string, a break, and the number of tokens, this proc splits a string
into an array of tokens. |
| Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getPreferredSize, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.awt.Frame |
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.awt.Window |
addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getGraphicsConfiguration, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle |
roomsPerFloor
public static final int roomsPerFloor
- See Also:
- Constant Field Values
floors
mapFloor[] floors
floorObjs
java.lang.String[] floorObjs
floorNames
java.lang.String[] floorNames
numFloors
int numFloors
curFloorIndex
int curFloorIndex
rooms
Room[] rooms
highlight
Room highlight
level1
MapLevel level1
level2
MapLevel level2
level3
MapLevel level3
level4
MapLevel level4
level5
MapLevel level5
currentRoom
java.lang.String currentRoom
currentFloor
mapFloor currentFloor
floorLabel
java.awt.Label floorLabel
floorChoice
java.awt.Choice floorChoice
hilightColor
java.awt.Color hilightColor
applet
CVWCoordinator applet
top
FirstLevel top
status
java.awt.Label status
showing
java.lang.String showing
contentPane
java.awt.Container contentPane
mapChoiceGroup
javax.swing.ButtonGroup mapChoiceGroup
toggle
javax.swing.JPanel toggle
hierarchicalButton
javax.swing.JRadioButton hierarchicalButton
overheadButton
javax.swing.JRadioButton overheadButton
CVWMapWin
CVWMapWin()
- Constructor
setUpFloorLayout
private void setUpFloorLayout()
- The map display is divided into 5 rows, this creates & initializes them.
splitString
private java.lang.String[] splitString(java.lang.String altogether,
java.lang.String splitter,
int len)
- Given a string, a break, and the number of tokens, this proc splits a string
into an array of tokens. The string must start and end with 'splitter', and
will be subdivided at each occurrance of 'splitter'. Could be converted to
use a string tokenizer now.
CVWMapUpdate
public void CVWMapUpdate(int numlevels,
java.lang.String fNames,
java.lang.String fObjs,
java.lang.String rNames,
java.lang.String rObjs)
- Updates the Map window with info about the room and floor layout of the CVW server.
MCP receive cvw-map-info
- Specified by:
CVWMapUpdate in class CVWMap
convertToIndex
private int convertToIndex(mapFloor floor,
java.lang.String room)
- Takes a floor object, and a room name and returns the index of that room
in the floor's room array.
CVWMapUpdateLocale
public void CVWMapUpdateLocale(int floorIndex,
java.lang.String room)
- Redraws the current floor displayed on the map. Can occur for a few reasons
1) The user moved to another room (so highlight must change, and current
floor might change), 2) the user is viewing a particular floor (so display
the selected floor, rather than the one the user resides on), 3) the map
data changed and must be redrawn (a room name might have changed, or new
floors were added, etc).
- Specified by:
CVWMapUpdateLocale in class CVWMap
selectedfloorChoice
private void selectedfloorChoice()
- Called when the user selects a floor from the drop-down floor list, in turn
calls CVWMapUpdateLocale to change the map's display to the seleceted floor.
currentHighlight
private void currentHighlight(int newRoom)
- Unhighlights any room previously highlighted on the map and highlights a
new room (given its index in the array of rooms currently displayed). If
index passed in is -1, no room will be highlighted. No more than one room
is ever highlighted at one time.
closeWindow
public void closeWindow()
- Closes the window and lets the CVW server know the map is closed.
MCP send cvw-map-interest
howManyFloors
public int howManyFloors()
- Returns the number of floors that exist. This is called by other
parts of the client that need to know about the room structure.
howManyRooms
public int howManyRooms()
- Returns the total number of rooms that exist. This is called by other
parts of the client that need to know about the room structure.
getFloorObjs
public java.lang.String[] getFloorObjs()
- Returns an ordered array of floor object numbers. This is called by other
parts of the client that need to know about the room structure.
getFloorNames
public java.lang.String[] getFloorNames()
- Returns an ordered array of floor names. This is called by other
parts of the client that need to know about the room structure.
getRoomObjs
public java.lang.String[] getRoomObjs()
- Returns an ordered array of room object numbers. This is called by other
parts of the client that need to know about the room structure.
getRoomNames
public java.lang.String[] getRoomNames()
- Returns an ordered array of room names. This is called by other
parts of the client that need to know about the room structure.
requestFocus
public void requestFocus()
- Makes sure that the current floor selection has focus whenever
the map window has focus. Doing this internally helps with
multiple types of maps.
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Description copied from interface:
java.awt.event.ActionListener
- This method is invoked when an action occurs.
- Specified by:
actionPerformed in interface java.awt.event.ActionListener