|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel triptracker.client.map.ui.SuperPanel triptracker.client.map.ui.MapViewPanel
public class MapViewPanel
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Nested classes/interfaces inherited from interface triptracker.client.net.MapSocketListener |
---|
MapSocketListener.RouteState |
Field Summary |
---|
Fields inherited from class triptracker.client.map.ui.SuperPanel |
---|
coordList, map, realtime, route, user |
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.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
MapViewPanel(MapSocket model,
TabbedForm view)
The constructor creates a JPanel for the map view |
Method Summary | |
---|---|
void |
addFollowBtnListener(ItemListener listener)
|
void |
addMoveBtnListener(MouseListener listener)
|
void |
addResetBtnListener(ActionListener listener)
|
void |
addZoomBtnListener(MouseListener listener)
|
void |
addZoomInBtnListener(ActionListener listener)
Adds listener to zoomInBtn |
void |
addZoomOutBtnListener(ActionListener listener)
Adds listener to zoomOutBtn |
void |
connectionUpdate(ConnectionState state)
Invoked when the connection state of the underlying socket has changed. |
void |
coordReceived(int routeId,
Coordinate coord)
Invoked when a coordinate is received. |
void |
coordsReceived(List<Coordinate> coords)
Invoked when buffered coordinates is received. |
void |
invalidMessage(String message)
Invoked when an invalid or unsupported message is received from the server. |
void |
resetMap()
Resets map to initial state |
void |
routeList(List<Route> routes)
Invoked when a list of routes is received. |
void |
routeReceived(int routeId,
List<Coordinate> coords)
Called from model when route is recieved from server |
void |
routeUpdate(int routeId,
MapSocketListener.RouteState state)
Invoked when the state of a route is changed. |
void |
setFollow(int follow)
|
void |
setMove()
Sets mouseKlick to center on selected position |
void |
setRoute(boolean realtime,
Route route)
Asks server for coordinates to selected route |
void |
setState(String state)
|
void |
setZoom()
Sets mouseKlick to zoom in on klicked position |
void |
socketError(IOException e)
Invoked when a socket error is encountered. |
void |
userReceived(User user)
Invoked when a rouser is received. |
void |
usersReceived(List<User> users)
Unimplemented methods from interface |
Methods inherited from class triptracker.client.map.ui.SuperPanel |
---|
getMap, getRoute, getUser, setCoordList, setRoute, setUser |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MapViewPanel(MapSocket model, TabbedForm view)
Method Detail |
---|
public void addZoomInBtnListener(ActionListener listener)
public void addZoomOutBtnListener(ActionListener listener)
public void addZoomBtnListener(MouseListener listener)
public void addMoveBtnListener(MouseListener listener)
public void addFollowBtnListener(ItemListener listener)
public void addResetBtnListener(ActionListener listener)
public void setRoute(boolean realtime, Route route)
public void setState(String state)
public void setFollow(int follow)
public void routeReceived(int routeId, List<Coordinate> coords)
routeReceived
in interface MapSocketListener
routeId
- route the list of coordinates belongs tocoords
- list of coordinatespublic void connectionUpdate(ConnectionState state)
connectionUpdate
in interface SocketListener
state
- new connection statepublic void usersReceived(List<User> users)
usersReceived
in interface MapSocketListener
users
- list of userspublic void routeList(List<Route> routes)
MapSocketListener
routeList
in interface MapSocketListener
routes
- list of routespublic void coordReceived(int routeId, Coordinate coord)
MapSocketListener
coordReceived
in interface MapSocketListener
routeId
- route the coordinate belongs tocoord
- coordinate receivedpublic void routeUpdate(int routeId, MapSocketListener.RouteState state)
MapSocketListener
routeUpdate
in interface MapSocketListener
routeId
- route the state change applies tostate
- the new statepublic void invalidMessage(String message)
SocketListener
SocketConnection.messageHandler(String)
) fails to understand
the message, or if it contains invalid data.
invalidMessage
in interface SocketListener
message
- the message that triggered the eventpublic void socketError(IOException e)
SocketListener
socketError
in interface SocketListener
e
- the error that triggered the eventpublic void userReceived(User user)
MapSocketListener
userReceived
in interface MapSocketListener
public void coordsReceived(List<Coordinate> coords)
MapSocketListener
coordsReceived
in interface MapSocketListener
coords
- list of coordinatespublic void setZoom()
public void setMove()
public void resetMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |