|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
gui.controls.WorldView
A view displaying the current state og the associated world.
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 |
private MainDialog parent
private java.awt.Image worldImage
private java.awt.Image airportImage
private java.awt.Image trainStationImage
private java.awt.Image busStopImage
private java.awt.Image harbourImage
public static final int width
public static final int height
private int scale
public boolean fShowNames
public boolean fShowConnections
public boolean fShowAirportsNames
public boolean fShowAirConnections
public boolean fShowBusStopsNames
public boolean fShowBusConnections
public boolean fShowTrainStationsNames
public boolean fShowRailwayConnections
public boolean fShowHarboursNames
public boolean fShowSeaConnections
public boolean fShowCitiesNames
private static final int CITY_HALF_SIDE
private static final int AIRPORT_HALF_SIDE
private static final int TRAIN_STATION_HALF_SIDE
private static final int BUS_STOP_HALF_SIDE
private static final int HARBOUR_HALF_SIDE
private static final int MAX_SCALE
private int newHorizontalPosition
private int newVerticalPosition
private boolean fUpdateScrollers
private int mode
public static final int MODE_NORMAL_VIEW
public static final int MODE_ADD_CITY
public static final int MODE_EDIT_CITY
public static final int MODE_ADD_AIRPORT
public static final int MODE_EDIT_AIRPORT
public static final int MODE_ADD_TRAIN_STATION
public static final int MODE_EDIT_TRAIN_STATION
public static final int MODE_ADD_BUS_STOP
public static final int MODE_EDIT_BUS_STOP
public static final int MODE_ADD_HARBOUR
public static final int MODE_EDIT_HARBOUR
public static final int MODE_CHOOSE_STATION
public static final int MODE_CONNECTION_EDITION
public static final int MODE_ORIGIN_DESTINATION_CHOOSING
private StationsChooser stationsChooser
public City editedCity
public Airport editedAirport
public TrainStation editedTrainStation
public BusStop editedBusStop
public Harbour editedHarbour
private ConnectionEditChooser connectionEditChooser
private LocationsChooser locationsChooser
private TravelDivisionsChooser travelDivisionsChooser
private TravelSolutionsChooser travelSolutionsChooser
Constructor Detail |
public WorldView(MainDialog parent)
parent
- The parent dialog.Method Detail |
private void DrawLine(java.awt.Graphics g, int x1, int y1, int x2, int y2)
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.private void DrawString(java.awt.Graphics g, java.lang.String text, java.awt.Point p1, java.awt.Point p2)
g
- The graphics to draw on.text
- The text to be displayed.p1
- The first point.p2
- The second point.private boolean IsDirectLine(int x1, int y1, int x2, int y2)
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.
public void paint(java.awt.Graphics g)
Component.paint(java.awt.Graphics)
public void ZoomIn()
public void ZoomOut()
public void SetMode(int mode)
mode
- public void SetUniversalStationsChooser(StationsChooser stationChooser)
stationChooser
- A universal stations chooser to be notified about selected station.Location ViewPointToLocation(java.awt.Point point)
point
- A point in the view area.
java.awt.Point LocationToViewPoint(Location location)
location
-
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
MouseListener.mouseClicked(java.awt.event.MouseEvent)
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
MouseListener.mouseEntered(java.awt.event.MouseEvent)
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
MouseListener.mouseExited(java.awt.event.MouseEvent)
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
MouseListener.mousePressed(java.awt.event.MouseEvent)
public void mouseReleased(java.awt.event.MouseEvent arg0)
mouseReleased
in interface java.awt.event.MouseListener
MouseListener.mouseReleased(java.awt.event.MouseEvent)
public void SetConnectionEditChooser(ConnectionEditChooser connectionEditChooser)
connectionEditChooser
- A chooser of a connection to be edited to be set.public void SetLocationsChooser(LocationsChooser locationsChooser)
locationsChooser
- A locations chooser to be set.public void SetTravelDivisionChooser(TravelDivisionsChooser travelDivisionsChooser)
travelDivisionsChooser
- A list to be set.public void SetTravelSolutionsChooser(TravelSolutionsChooser travelSolutionsChooser)
travelSolutionsChooser
- A list to be set.public void CancelEditionMarkings()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |