jfreerails.client.top
Class UserInputOnMapController
java.lang.Object
java.awt.event.KeyAdapter
jfreerails.client.top.UserInputOnMapController
- All Implemented Interfaces:
- java.awt.event.KeyListener, java.util.EventListener
public class UserInputOnMapController
- extends java.awt.event.KeyAdapter
Handles key presses and mouse movements on the map - responsible for moving
the cursor etc.
- Author:
- Luke
Methods inherited from class java.awt.event.KeyAdapter |
keyReleased, keyTyped |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JFREERAILS_CLIENT_SOUNDS_BUILDTRACK_WAV
private static final java.lang.String JFREERAILS_CLIENT_SOUNDS_BUILDTRACK_WAV
- See Also:
- Constant Field Values
logger
private static final java.util.logging.Logger logger
stationTypesPopup
private StationTypesPopup stationTypesPopup
buildIndustryJPopupMenu
private BuildIndustryJPopupMenu buildIndustryJPopupMenu
mapView
private MapViewJComponent mapView
trackBuilder
private TrackMoveProducer trackBuilder
dialogueBoxController
private DialogueBoxController dialogueBoxController
modelRoot
private final ModelRoot modelRoot
actionRoot
private final ActionRoot actionRoot
mouseInputAdapter
private final javax.swing.event.MouseInputAdapter mouseInputAdapter
buildTrack
private BuildTrackController buildTrack
soundManager
private SoundManager soundManager
ignoreDragging
private boolean ignoreDragging
UserInputOnMapController
public UserInputOnMapController(ModelRoot mr,
ActionRoot ar)
cursorOneTileMove
private void cursorOneTileMove(ImPoint oldPosition,
Step vector)
playAppropriateSound
private void playAppropriateSound()
setup
public void setup(MapViewJComponent mv,
TrackMoveProducer trackBuilder,
StationTypesPopup stPopup,
ModelRoot mr,
DialogueBoxController dbc,
FreerailsCursor cursor,
BuildTrackController buildTrack)
cursorJumped
private void cursorJumped(ImPoint to)
getCursorPosition
private ImPoint getCursorPosition()
setCursorPosition
private void setCursorPosition(ImPoint p)
setCursorMessage
private void setCursorMessage(java.lang.String s)
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
- Specified by:
keyPressed
in interface java.awt.event.KeyListener
- Overrides:
keyPressed
in class java.awt.event.KeyAdapter
cancelProposedBuild
private void cancelProposedBuild()
moveCursorJump
private void moveCursorJump(ImPoint tryThisPoint)
legalRectangleContains
private boolean legalRectangleContains(ImPoint tryThisPoint)
- Checks whether specified point is in legal rectangle.
- Parameters:
tryThisPoint
- ImPoint
- Returns:
- boolean
moveCursorOneTile
private void moveCursorOneTile(Step v)
getBts
private BuildTrackStrategy getBts()
setIgnoreKeyEvents
private void setIgnoreKeyEvents(boolean ignoreKeyEvents)
isIgnoreKeyEvents
private boolean isIgnoreKeyEvents()