Changes Current users: guest (web) |
{
¡¡
NavigationControl nc = NavigationRegistry.getNavigationControl(classname);
nc.init(compView, p);
¡..
return nc;
}
Below are Helper classes for different types of map
DrawingComponentView drawingCV NavigationTool tool Method: init method to load Drawing Map.
Currently in UI interface class (e.g., SimpleMOOComponentView class), we have
{
¡
DrawingComponentView cv = (DrawingComponentView)navPanel.getComponentView();
NavigationTool tool = new NavigationTool(cv.view(), p, context);
cv.setDrawingPalette(new SingleToolDrawingPalette(tool, ¡°Click to select locatio n¡±));
NavigationControl nc = tool;
¡
}
In our init method, we probably want something as follows:
init(ComponentView cv, NavigableLocation p)
{
¡
drawingCV = (DrawingComponentView)cv;
tool = new NavigationTool(cv.view(), p, context);
...
}
The DrawingMapHelper class functions similar to NavigationTool (see above), so we do not have a NavigationTool object ¡°tool¡± any more. the method setDrawingPalette(DrawingPalette dp) needs to pass a drawing palette interface. But as we do not have ¡°tool¡± any more, we might need to change the constructor (or add a new constructor) for SingleToolDrawingPalette class. SingleToolDrawingPalette implements DrawingPalette interface Note that NavigationTool class also handles mouse movement on the drawing map, so it contains methods such as mouseUp, mouseMove, getFigureCursor, it also has methods such as handleUnlinkedFigure, handleLink for its subclass. Where should we put these methods? It might not be good to put them here as when the DrawingMapHelper object is used in UI, the UI only knows it¡¯s a NavigationControl class, and NavigationControl does not contain these methods. ¡ } //note added April 15th here// We still use a NavigationTool object here, as our purpose of having the helper class is merely to keep UI from knowing which map it is loading. We can still use current Navigation mechanism, including letting a NavigationTool do the job in DrawingObject //end// ¡? GISMapHelper Variable: MapComponentView mapCV Method: init method to load GIS Map. Currently in UI interface class (e.g., SimpleMOOComponentView class), we have
{
¡
MapComponentView cv = (MapComponentView)navPanel.getComponentView();
cv.addNavigationPanel(this);
cv.reloadMap();
cv.setDrawingPath(p);
NavigationControl nc = cv;
¡
}
Currently, MapComponentView class implements NavigationControl, and spotClicked(SharedSpot sp, Component cs). The reason we have addNavigationPanel method in MapComponentView is that in GIS map, we realized the functionality of navigating from one GIS map to another by changing the location of navPanel in the UI, besides navigating to some other object that is loaded to the ComponentViewPanel. In a private class of SimpleMOOComponentView, Listener class, there is a part of code that may address this navigation between two navigable objects. Below is a part of code in Listener class, a private class of SimpleMOOComponentView:
{
¡
if (src == object) {
// This will handle changes to the navigation control,
// once we actually start using that property. Initially
// we just look for the first SharedDrawing.
NavigationControl nc = getNavigationControl();
if (nc != navControl) {
if (navControl != null)
navControl.removePropertyChangeListener(Listener.this);
navControl = nc;
if (navControl != null)
navControl.addPropertyChangeListener(Listener.this);
}
¡
}
To realize this resetNavigationControl functionality, where should we put it? Currently, it is set in the SimpleMOOComponentView , and there are several reasons we put it in this class: ¡? Because the navigable map is changed, the history list and back/forward list should be updated. Currently, history list and back/forward list are maintained in SimpleMOOComponentView calss ¡? Checking which map we will navigate to is currently done in this class Should we add NavigationPanel to the NavigationControl interface? //note added on April 15th// We do not want to pass a NavigationPanel to the MapComponentView, as we want UI to be completely unware of the type of map it loads. Instead, we can use current Listener class in UI (SimpleMOOComponentView) to listen to the change from GIS map. As to the history list and back/forward list, we will take into that account in our design later. //end// In our init method for GISMapHelper, we probably want something as follows:
init(ComponentView cv, NavigableLocation p)
{
mapCV = (MapComponentView)cv;
mapCV.reloadMap();
We set drawing path for the GISMapHelper here
Note: How to respond to resetNavigationControl is not solved yet. Maybe we want to rethink about what should be added to NavigationControl interface
}
Notes/questions:
|
| /public/projects/bridge/design/What should we consider in initializing two maps for navigation | Login | Web Editor | Full Editor |
| Last modified 9/11/03 1:50 PM by isenhour (history) Site contents | |