001: /*
002: * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
003: * for visualizing and manipulating spatial features with geometry and attributes.
004: *
005: * Copyright (C) 2003 Vivid Solutions
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License
009: * as published by the Free Software Foundation; either version 2
010: * of the License, or (at your option) any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
015: * GNU General Public License for more details.
016: *
017: * You should have received a copy of the GNU General Public License
018: * along with this program; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
020: *
021: * For more information, contact:
022: *
023: * Vivid Solutions
024: * Suite #1A
025: * 2328 Government Street
026: * Victoria BC V8T 5G5
027: * Canada
028: *
029: * (250)385-6040
030: * www.vividsolutions.com
031: */
032:
033: package com.vividsolutions.jump.workbench;
034:
035: import com.vividsolutions.jump.util.Blackboard;
036: import com.vividsolutions.jump.workbench.driver.DriverManager;
037: import com.vividsolutions.jump.workbench.model.LayerManager;
038: import com.vividsolutions.jump.workbench.model.LayerManagerProxy;
039: import com.vividsolutions.jump.workbench.model.Task;
040: import com.vividsolutions.jump.workbench.plugin.PlugInContext;
041: import com.vividsolutions.jump.workbench.registry.Registry;
042: import com.vividsolutions.jump.workbench.ui.*;
043: import com.vividsolutions.jump.workbench.ui.ErrorHandler;
044: import com.vividsolutions.jump.workbench.ui.LayerNamePanel;
045: import com.vividsolutions.jump.workbench.ui.LayerNamePanelProxy;
046: import com.vividsolutions.jump.workbench.ui.LayerViewPanel;
047: import com.vividsolutions.jump.workbench.ui.LayerViewPanelProxy;
048:
049: /**
050: * Convenience methods for accessing the various elements in the Workbench
051: * structure. Some getters return null -- subclasses may choose to override them
052: * or leave them unimplemented, depending on their needs.
053: */
054: public abstract class WorkbenchContext implements LayerViewPanelProxy,
055: LayerNamePanelProxy, LayerManagerProxy {
056: public DriverManager getDriverManager() {
057: return null;
058: }
059:
060: public JUMPWorkbench getWorkbench() {
061: return null;
062: }
063:
064: public ErrorHandler getErrorHandler() {
065: return null;
066: }
067:
068: public Blackboard getBlackboard() {
069: return null;
070: }
071:
072: public LayerNamePanel getLayerNamePanel() {
073: return null;
074: }
075:
076: public LayerViewPanel getLayerViewPanel() {
077: return null;
078: }
079:
080: //Sometimes you can have a layer manager but no layer view panel
081: //e.g. when the attribute window is at the forefront. [Jon Aquino]
082: public LayerManager getLayerManager() {
083: return null;
084: }
085:
086: public Task getTask() {
087: return null;
088: }
089:
090: /**
091: * Creates a snapshot of the system for use by plug-ins.
092: */
093: public PlugInContext createPlugInContext() {
094: return new PlugInContext(this , getTask(), this ,
095: getLayerNamePanel(), getLayerViewPanel());
096: }
097:
098: public FeatureTextWriterRegistry getFeatureTextWriterRegistry() {
099: return featureTextWriterRegistry;
100: }
101:
102: private Registry registry = new Registry();
103:
104: private FeatureTextWriterRegistry featureTextWriterRegistry = new FeatureTextWriterRegistry();
105:
106: public Registry getRegistry() {
107: return registry;
108: }
109: }
|