gui.controls
Class WorldView

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bygui.controls.WorldView
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable

public final class WorldView
extends javax.swing.JPanel
implements java.awt.event.MouseListener

A view displaying the current state og the associated world.

Author:
Piotrek
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
private static int AIRPORT_HALF_SIDE
          A length in pixels (with scale of 1) of a half of length of a side of a square representing an airport.
private  java.awt.Image airportImage
          An image of the airport symbol.
private static int BUS_STOP_HALF_SIDE
          A length in pixels (with scale of 1) of a half of length of a side of a square representing a bus stop.
private  java.awt.Image busStopImage
          An image of the bus stop symbol.
private static int CITY_HALF_SIDE
          A length in pixels (with scale of 1) of a half of length of a side of a square representing a city.
private  ConnectionEditChooser connectionEditChooser
          A chooser of a connection to be edited.
 Airport editedAirport
          An airport being edited.
 BusStop editedBusStop
          A bus stop being edited.
 City editedCity
          A city being edited.
 Harbour editedHarbour
          A harbour being edited.
 TrainStation editedTrainStation
          A train station being edited.
 boolean fShowAirConnections
          Indicates whether to draw the air connections in the view.
 boolean fShowAirportsNames
          Indicates whether to draw the names of the airports in the view.
 boolean fShowBusConnections
          Indicates whether to draw the bus connections in the view.
 boolean fShowBusStopsNames
          Indicates whether to draw the names of the bus stops in the view.
 boolean fShowCitiesNames
          Indicates whether to draw the names of the cities in the view.
 boolean fShowConnections
          Indicates whether to draw the connections in the view.
 boolean fShowHarboursNames
          Indicates whether to draw the names of the harbours in the view.
 boolean fShowNames
          Indicates whether to draw the names of the objects in the view.
 boolean fShowRailwayConnections
          Indicates whether to draw the railway connections in the view.
 boolean fShowSeaConnections
          Indicates whether to draw the sea connections in the view.
 boolean fShowTrainStationsNames
          Indicates whether to draw the names of the train stations in the view.
private  boolean fUpdateScrollers
          Indicates whether to update the scrollers positions in the paint method.
private static int HARBOUR_HALF_SIDE
          A length in pixels (with scale of 1) of a half of length of a side of a square representing a harbour.
private  java.awt.Image harbourImage
          An image of the harbour symbol.
static int height
          The height of the view.
private  LocationsChooser locationsChooser
          A locations chooser to receive the origin/destination location notifications.
private static int MAX_SCALE
          Defines a maximal value for a scale.
private  int mode
          A mode the view is in.
static int MODE_ADD_AIRPORT
          Indicates that a view is in a `add airport' mode.
static int MODE_ADD_BUS_STOP
          Indicates that a view is in a `add bus stop' mode.
static int MODE_ADD_CITY
          Indicates that a view is in a `add city' mode.
static int MODE_ADD_HARBOUR
          Indicates that a view is in a `add harbour' mode.
static int MODE_ADD_TRAIN_STATION
          Indicates that a view is in a `add train station' mode.
static int MODE_CHOOSE_STATION
          Indicates that a view is in `choose station' mode.
static int MODE_CONNECTION_EDITION
          Indicates that a view is in `connection edition' mode.
static int MODE_EDIT_AIRPORT
          Indicates that a view is in a `edit airport' mode.
static int MODE_EDIT_BUS_STOP
          Indicates that a view is in a `edit bus stop' mode.
static int MODE_EDIT_CITY
          Indicates that a view is in a `edit city' mode.
static int MODE_EDIT_HARBOUR
          Indicates that a view is in a `edit harbour' mode.
static int MODE_EDIT_TRAIN_STATION
          Indicates that a view is in a `edit train station' mode.
static int MODE_NORMAL_VIEW
          Indicates that a view is in a `normal view' mode.
static int MODE_ORIGIN_DESTINATION_CHOOSING
          Indicates that a view is in `chossing the origin and destination' mode.
private  int newHorizontalPosition
          The new position of the horizontal scroller to be set.
private  int newVerticalPosition
          The new postion of the vertical scroller to be set.
private  MainDialog parent
          The parent dialog.
private  int scale
          A scale of the display.
private  StationsChooser stationsChooser
          A universal stations chooser to be notified about selected station.
private static int TRAIN_STATION_HALF_SIDE
          A length in pixels (with scale of 1) of a half of length of a side of a square representing a train station.
private  java.awt.Image trainStationImage
          An image of the train station symbol.
private  TravelDivisionsChooser travelDivisionsChooser
          A list used to choose one of the travel divisions.
private  TravelSolutionsChooser travelSolutionsChooser
          A list used to choose one of the travel solutions.
static int width
          The width of the view.
private  java.awt.Image worldImage
          An image of the world (it is displayed in the background of the world).
 
Fields inherited from class javax.swing.JPanel
 
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.Container
 
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
WorldView(MainDialog parent)
          Constructor.
 
Method Summary
 void CancelEditionMarkings()
          Cancels the marking of the objects being edited.
private  void DrawLine(java.awt.Graphics g, int x1, int y1, int x2, int y2)
          Draws a line on the given graphics between the two specified points taking into account the fact that the West and East edges are the single edge (roundness of the world).
private  void DrawString(java.awt.Graphics g, java.lang.String text, java.awt.Point p1, java.awt.Point p2)
          Draws a string on the given graphics in the middle between the two specified points taking into account the fact that the West and East edges are the single edge (roundness of the world).
private  boolean IsDirectLine(int x1, int y1, int x2, int y2)
          Checks whether the line between the two given points is a direct line or maybe it goes through the Easr/West edge.
(package private)  java.awt.Point LocationToViewPoint(Location location)
          Translates the location to the point on the view area (in the current scale).
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent arg0)
           
 void paint(java.awt.Graphics g)
           
 void SetConnectionEditChooser(ConnectionEditChooser connectionEditChooser)
          Sets a chooser of a connection to be edited.
 void SetLocationsChooser(LocationsChooser locationsChooser)
          Sets the locations chooser.
 void SetMode(int mode)
          Sets the mode of this view.
 void SetTravelDivisionChooser(TravelDivisionsChooser travelDivisionsChooser)
          Sets a list used to choose one of the travel divisions.
 void SetTravelSolutionsChooser(TravelSolutionsChooser travelSolutionsChooser)
          Sets a list used to choose one of the travel solutions.
 void SetUniversalStationsChooser(StationsChooser stationChooser)
          Sets the universal stations chooser to be notified about selected station.
(package private)  Location ViewPointToLocation(java.awt.Point point)
          Translates the point of a view to the location.
 void ZoomIn()
          Zooms in the view of the world.
 void ZoomOut()
          Zooms out the view of the world.
 
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, 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, setEnabled, 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

parent

private MainDialog parent
The parent dialog.


worldImage

private java.awt.Image worldImage
An image of the world (it is displayed in the background of the world).


airportImage

private java.awt.Image airportImage
An image of the airport symbol.


trainStationImage

private java.awt.Image trainStationImage
An image of the train station symbol.


busStopImage

private java.awt.Image busStopImage
An image of the bus stop symbol.


harbourImage

private java.awt.Image harbourImage
An image of the harbour symbol.


width

public static final int width
The width of the view. Multipile it by a scale factor to get a real width.

See Also:
Constant Field Values

height

public static final int height
The height of the view. Multipile it by a scale factor to get a real height.

See Also:
Constant Field Values

scale

private int scale
A scale of the display.


fShowNames

public boolean fShowNames
Indicates whether to draw the names of the objects in the view.


fShowConnections

public boolean fShowConnections
Indicates whether to draw the connections in the view.


fShowAirportsNames

public boolean fShowAirportsNames
Indicates whether to draw the names of the airports in the view.


fShowAirConnections

public boolean fShowAirConnections
Indicates whether to draw the air connections in the view.


fShowBusStopsNames

public boolean fShowBusStopsNames
Indicates whether to draw the names of the bus stops in the view.


fShowBusConnections

public boolean fShowBusConnections
Indicates whether to draw the bus connections in the view.


fShowTrainStationsNames

public boolean fShowTrainStationsNames
Indicates whether to draw the names of the train stations in the view.


fShowRailwayConnections

public boolean fShowRailwayConnections
Indicates whether to draw the railway connections in the view.


fShowHarboursNames

public boolean fShowHarboursNames
Indicates whether to draw the names of the harbours in the view.


fShowSeaConnections

public boolean fShowSeaConnections
Indicates whether to draw the sea connections in the view.


fShowCitiesNames

public boolean fShowCitiesNames
Indicates whether to draw the names of the cities in the view.


CITY_HALF_SIDE

private static final int CITY_HALF_SIDE
A length in pixels (with scale of 1) of a half of length of a side of a square representing a city.

See Also:
Constant Field Values

AIRPORT_HALF_SIDE

private static final int AIRPORT_HALF_SIDE
A length in pixels (with scale of 1) of a half of length of a side of a square representing an airport.

See Also:
Constant Field Values

TRAIN_STATION_HALF_SIDE

private static final int TRAIN_STATION_HALF_SIDE
A length in pixels (with scale of 1) of a half of length of a side of a square representing a train station.

See Also:
Constant Field Values

BUS_STOP_HALF_SIDE

private static final int BUS_STOP_HALF_SIDE
A length in pixels (with scale of 1) of a half of length of a side of a square representing a bus stop.

See Also:
Constant Field Values

HARBOUR_HALF_SIDE

private static final int HARBOUR_HALF_SIDE
A length in pixels (with scale of 1) of a half of length of a side of a square representing a harbour.

See Also:
Constant Field Values

MAX_SCALE

private static final int MAX_SCALE
Defines a maximal value for a scale. In practice it defines the maximal zoom. It should be a power of 2.

See Also:
Constant Field Values

newHorizontalPosition

private int newHorizontalPosition
The new position of the horizontal scroller to be set.


newVerticalPosition

private int newVerticalPosition
The new postion of the vertical scroller to be set.


fUpdateScrollers

private boolean fUpdateScrollers
Indicates whether to update the scrollers positions in the paint method.


mode

private int mode
A mode the view is in.


MODE_NORMAL_VIEW

public static final int MODE_NORMAL_VIEW
Indicates that a view is in a `normal view' mode. It is a mode for browsing the map without any special actions available.

See Also:
Constant Field Values

MODE_ADD_CITY

public static final int MODE_ADD_CITY
Indicates that a view is in a `add city' mode. It is a mode for adding a city to the world. A view is awaitng for a click and places a city where it has been clicked on.

See Also:
Constant Field Values

MODE_EDIT_CITY

public static final int MODE_EDIT_CITY
Indicates that a view is in a `edit city' mode. It is a mode for editing a city properties. A click on a city opens a property pane for this city with two additional buttons on it: `apply changes' and `remove city'. A city being edited is marked on a view.

See Also:
Constant Field Values

MODE_ADD_AIRPORT

public static final int MODE_ADD_AIRPORT
Indicates that a view is in a `add airport' mode. It is a mode for adding an airport to the world. A view is awaitng for a click and places an airport where it has been clicked on.

See Also:
Constant Field Values

MODE_EDIT_AIRPORT

public static final int MODE_EDIT_AIRPORT
Indicates that a view is in a `edit airport' mode. It is a mode for editing an airport properties. A click on an airport opens a property pane for this airport with two additional buttons on it: `apply changes' and `remove airport'. An airport being edited is marked on a view.

See Also:
Constant Field Values

MODE_ADD_TRAIN_STATION

public static final int MODE_ADD_TRAIN_STATION
Indicates that a view is in a `add train station' mode. It is a mode for adding a train station to the world. A view is awaitng for a click and places a train station where it has been clicked on.

See Also:
Constant Field Values

MODE_EDIT_TRAIN_STATION

public static final int MODE_EDIT_TRAIN_STATION
Indicates that a view is in a `edit train station' mode. It is a mode for editing a train station properties. A click on a train station opens a property pane for this train station with two additional buttons on it: `apply changes' and `remove tain station'. A train station being edited is marked on a view.

See Also:
Constant Field Values

MODE_ADD_BUS_STOP

public static final int MODE_ADD_BUS_STOP
Indicates that a view is in a `add bus stop' mode. It is a mode for adding a bus stop to the world. A view is awaitng for a click and places a bus stop where it has been clicked on.

See Also:
Constant Field Values

MODE_EDIT_BUS_STOP

public static final int MODE_EDIT_BUS_STOP
Indicates that a view is in a `edit bus stop' mode. It is a mode for editing a bus stop properties. A click on a bus stop opens a property pane for this bus stop with two additional buttons on it: `apply changes' and `remove bus stop'. A bus stop being edited is marked on a view.

See Also:
Constant Field Values

MODE_ADD_HARBOUR

public static final int MODE_ADD_HARBOUR
Indicates that a view is in a `add harbour' mode. It is a mode for adding a harbour to the world. A view is awaitng for a click and places a harbour where it has been clicked on.

See Also:
Constant Field Values

MODE_EDIT_HARBOUR

public static final int MODE_EDIT_HARBOUR
Indicates that a view is in a `edit harbour' mode. It is a mode for editing a harbour properties. A click on a bus stop opens a property pane for this harbour with two additional buttons on it: `apply changes' and `remove harbour'. A harbour being edited is marked on a view.

See Also:
Constant Field Values

MODE_CHOOSE_STATION

public static final int MODE_CHOOSE_STATION
Indicates that a view is in `choose station' mode. It is a mode for choosing stations when creating a new connection. View checks what the type of station is needed, and if such one is clicked notifies the stations chooser control.

See Also:
Constant Field Values

MODE_CONNECTION_EDITION

public static final int MODE_CONNECTION_EDITION
Indicates that a view is in `connection edition' mode. It is a mode for editing connections a view is displaying a currently selected connection only or all if there is none seclected.

See Also:
Constant Field Values

MODE_ORIGIN_DESTINATION_CHOOSING

public static final int MODE_ORIGIN_DESTINATION_CHOOSING
Indicates that a view is in `chossing the origin and destination' mode. It is a mode enabling user toi click the two locations (the origin and the destination of the travel) A view is displaying a currently selected location if there is any and sends the notifications to the locations chooser panel.

See Also:
Constant Field Values

stationsChooser

private StationsChooser stationsChooser
A universal stations chooser to be notified about selected station. Null if there is none.


editedCity

public City editedCity
A city being edited. Null if there is none.


editedAirport

public Airport editedAirport
An airport being edited. Null if there is none.


editedTrainStation

public TrainStation editedTrainStation
A train station being edited. Null if there is none.


editedBusStop

public BusStop editedBusStop
A bus stop being edited. Null if there is none.


editedHarbour

public Harbour editedHarbour
A harbour being edited. Null if there is none.


connectionEditChooser

private ConnectionEditChooser connectionEditChooser
A chooser of a connection to be edited. Set by the ConnectionsEditChooser.


locationsChooser

private LocationsChooser locationsChooser
A locations chooser to receive the origin/destination location notifications.


travelDivisionsChooser

private TravelDivisionsChooser travelDivisionsChooser
A list used to choose one of the travel divisions.


travelSolutionsChooser

private TravelSolutionsChooser travelSolutionsChooser
A list used to choose one of the travel solutions.

Constructor Detail

WorldView

public WorldView(MainDialog parent)
Constructor.

Parameters:
parent - The parent dialog.
Method Detail

DrawLine

private void DrawLine(java.awt.Graphics g,
                      int x1,
                      int y1,
                      int x2,
                      int y2)
Draws a line on the given graphics between the two specified points taking into account the fact that the West and East edges are the single edge (roundness of the world).

Parameters:
g - The graphics to draw on.
x1 - The x coordinate of the first of the points.
y1 - The y coordinate of the first of the points.
x2 - The x coordinate of the second of the points.
y2 - The y coordinate of the second of the points.

DrawString

private void DrawString(java.awt.Graphics g,
                        java.lang.String text,
                        java.awt.Point p1,
                        java.awt.Point p2)
Draws a string on the given graphics in the middle between the two specified points taking into account the fact that the West and East edges are the single edge (roundness of the world).

Parameters:
g - The graphics to draw on.
text - The text to be displayed.
p1 - The first point.
p2 - The second point.

IsDirectLine

private boolean IsDirectLine(int x1,
                             int y1,
                             int x2,
                             int y2)
Checks whether the line between the two given points is a direct line or maybe it goes through the Easr/West edge.

Parameters:
x1 - The x coordinate of the first of the points.
y1 - The y coordinate of the first of the points.
x2 - The x coordinate of the second of the points.
y2 - The y coordinate of the second of the points.
Returns:
A boolean value indicating whether the line between the two given points is a direct line or maybe it goes through the Easr/West edge.

paint

public void paint(java.awt.Graphics g)
See Also:
Component.paint(java.awt.Graphics)

ZoomIn

public void ZoomIn()
Zooms in the view of the world. It becomes more clear.


ZoomOut

public void ZoomOut()
Zooms out the view of the world. It becomes less clear.


SetMode

public void SetMode(int mode)
Sets the mode of this view. Only changes to valid modes are enforced.

Parameters:
mode -

SetUniversalStationsChooser

public void SetUniversalStationsChooser(StationsChooser stationChooser)
Sets the universal stations chooser to be notified about selected station.

Parameters:
stationChooser - A universal stations chooser to be notified about selected station.

ViewPointToLocation

Location ViewPointToLocation(java.awt.Point point)
Translates the point of a view to the location.

Parameters:
point - A point in the view area.
Returns:
The location at the given point.

LocationToViewPoint

java.awt.Point LocationToViewPoint(Location location)
Translates the location to the point on the view area (in the current scale).

Parameters:
location -
Returns:
The translated point.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseClicked(java.awt.event.MouseEvent)

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseEntered(java.awt.event.MouseEvent)

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseExited(java.awt.event.MouseEvent)

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener
See Also:
MouseListener.mousePressed(java.awt.event.MouseEvent)

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent arg0)
Specified by:
mouseReleased in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseReleased(java.awt.event.MouseEvent)

SetConnectionEditChooser

public void SetConnectionEditChooser(ConnectionEditChooser connectionEditChooser)
Sets a chooser of a connection to be edited.

Parameters:
connectionEditChooser - A chooser of a connection to be edited to be set.

SetLocationsChooser

public void SetLocationsChooser(LocationsChooser locationsChooser)
Sets the locations chooser.

Parameters:
locationsChooser - A locations chooser to be set.

SetTravelDivisionChooser

public void SetTravelDivisionChooser(TravelDivisionsChooser travelDivisionsChooser)
Sets a list used to choose one of the travel divisions.

Parameters:
travelDivisionsChooser - A list to be set.

SetTravelSolutionsChooser

public void SetTravelSolutionsChooser(TravelSolutionsChooser travelSolutionsChooser)
Sets a list used to choose one of the travel solutions.

Parameters:
travelSolutionsChooser - A list to be set.

CancelEditionMarkings

public void CancelEditionMarkings()
Cancels the marking of the objects being edited.