예제 #1
0
        public void Activate()
        {
            UIPositionManager uIPositionManager = this.viewControl.GetUIPositionManager();
            bool flag = false;

            if (this.legend.GetLastView() != null)
            {
                LegendView lastView = this.legend.GetLastView();
                if (lastView.showingPreview)
                {
                    throw new Exception("unimpl");
                }
                this.SetupNonpreviewView();
                uIPositionManager.GetSMPos().setPosition(lastView.GetSourceMapView());
                uIPositionManager.GetVEPos().setPosition(lastView.GetReferenceMapView());
                flag = true;
                this.viewControl.SetVEMapStyle(lastView.GetReferenceMapView().style);
            }
            if (!flag)
            {
                this.SetupNonpreviewView();
                uIPositionManager.GetSMPos().setPosition(new ContinuousCoordinateSystem().GetDefaultView());
                uIPositionManager.GetVEPos().setPosition(this.DefaultReferenceMapPosition());
            }
            uIPositionManager.SetPositionMemory(this.legend);
            this.viewControl.SetOptionsPanelVisibility(OptionsPanelVisibility.LegendOptions);
            this.viewControl.GetLegendPanel().Configure(this.legend, this.mapTileSourceFactory.CreateDisplayableUnwarpedSource(this.sourceMap));
            uIPositionManager.PositionUpdated();
        }
예제 #2
0
 public void Activate()
 {
     try
     {
         UIPositionManager uIPositionManager = this.viewControl.GetUIPositionManager();
         ViewerControlIfc  sMViewerControl   = this.viewControl.GetSMViewerControl();
         bool flag = false;
         if (this.sourceMap.lastView is SourceMapRegistrationView)
         {
             try
             {
                 SourceMapRegistrationView sourceMapRegistrationView = (SourceMapRegistrationView)this.sourceMap.lastView;
                 if (sourceMapRegistrationView.locked)
                 {
                     if (this.sourceMap.ReadyToLock())
                     {
                         this.SetupLockedView();
                         uIPositionManager.GetVEPos().setPosition(sourceMapRegistrationView.GetReferenceMapView());
                         flag = true;
                     }
                 }
                 else
                 {
                     this.SetupUnlockedView();
                     uIPositionManager.GetSMPos().setPosition(sourceMapRegistrationView.GetSourceMapView());
                     uIPositionManager.GetVEPos().setPosition(sourceMapRegistrationView.GetReferenceMapView());
                     flag = true;
                 }
                 this.viewControl.SetVEMapStyle(sourceMapRegistrationView.GetReferenceMapView().style);
             }
             catch (CorrespondencesAreSingularException)
             {
             }
             catch (InsufficientCorrespondencesException)
             {
             }
         }
         if (!flag)
         {
             this.SetupUnlockedView();
             uIPositionManager.GetSMPos().setPosition(new ContinuousCoordinateSystem().GetDefaultView());
             uIPositionManager.GetVEPos().setPosition(this.DefaultReferenceMapPosition(this.drv));
         }
         uIPositionManager.SetPositionMemory(this.sourceMap);
         this.viewControl.SetOptionsPanelVisibility(OptionsPanelVisibility.SourceMapOptions);
         this.viewControl.GetSourceMapInfoPanel().Configure(this.sourceMap);
         this.viewControl.GetSourceMapInfoPanel().Enabled = true;
         this.viewControl.GetTransparencyPanel().Configure(this.sourceMap, sMViewerControl);
         this.viewControl.GetTransparencyPanel().Enabled = true;
         this.viewControl.GetSMViewerControl().SetSnapViewStore(new SourceSnapView(this));
         this.viewControl.GetVEViewerControl().SetSnapViewStore(new RefSnapView(this));
         uIPositionManager.PositionUpdated();
     }
     catch (Exception)
     {
         this.Dispose();
         throw;
     }
 }
예제 #3
0
        public void Activate()
        {
            UIPositionManager uIPositionManager = this.viewControl.GetUIPositionManager();

            uIPositionManager.switchFree();
            uIPositionManager.GetSMPos().setPosition(ContinuousCoordinateSystem.theInstance.GetDefaultView());
            uIPositionManager.GetVEPos().setPosition(MercatorCoordinateSystem.theInstance.GetDefaultView());
        }
        public void Activate()
        {
            ViewerControlIfc  sMViewerControl   = viewControl.GetSMViewerControl();
            UIPositionManager uIPositionManager = viewControl.GetUIPositionManager();

            foreach (SourceMap current in layer.GetBackToFront())
            {
                IDisplayableSource displayableSource = mapTileSourceFactory.CreateDisplayableWarpedSource(current);
                if (displayableSource != null)
                {
                    sMViewerControl.AddLayer(displayableSource);
                }
            }

            uIPositionManager.SetPositionMemory(layer);
            LayerView layerView = (LayerView)layer.lastView;

            viewControl.GetUIPositionManager().switchSlaved();
            if (layerView != null)
            {
                uIPositionManager.GetVEPos().setPosition(layerView.GetReferenceMapView());
                uIPositionManager.GetVEPos().setStyle(layerView.GetReferenceMapView().style);
                return;
            }

            MapRectangle mapRectangle = null;

            try
            {
                mapRectangle = layer.GetUserBoundingBox(mapTileSourceFactory);
            }
            catch (CorrespondencesAreSingularException)
            {
            }
            catch (InsufficientCorrespondencesException)
            {
            }

            LatLonZoom position;

            if (mapRectangle != null)
            {
                Size size = new Size(600, 600);
                position = viewControl.GetVEViewerControl().GetCoordinateSystem()
                           .GetBestViewContaining(mapRectangle, size);
            }
            else
            {
                position = viewControl.GetVEViewerControl().GetCoordinateSystem().GetDefaultView();
            }

            uIPositionManager.GetVEPos().setPosition(position);
        }
예제 #5
0
        public void Dispose()
        {
            this.viewControl.GetCachePackage().ClearSchedulers();
            UIPositionManager uIPositionManager = this.viewControl.GetUIPositionManager();

            uIPositionManager.SetPositionMemory(null);
            uIPositionManager.GetSMPos().setPosition(new LatLonZoom(0.0, 0.0, 0));
            uIPositionManager.switchFree();
            this.viewControl.GetSMViewerControl().ClearLayers();
            this.viewControl.SetOptionsPanelVisibility(OptionsPanelVisibility.Nothing);
            this.viewControl.GetLegendPanel().Configure(null, null);
            this.viewControl.setDisplayedRegistration(null);
            this.legend = null;
        }
        public void Dispose()
        {
            UIPositionManager uIPositionManager = viewControl.GetUIPositionManager();

            uIPositionManager.switchFree();
            uIPositionManager.SetPositionMemory(null);
            uIPositionManager.GetSMPos().setPosition(new LatLonZoom(0.0, 0.0, 0));
            viewControl.GetSMViewerControl().ClearLayers();
            viewControl.SetOptionsPanelVisibility(OptionsPanelVisibility.Nothing);
            viewControl.GetSourceMapInfoPanel().Configure(null);
            viewControl.GetSourceMapInfoPanel().Enabled = false;
            viewControl.GetTransparencyPanel().Configure(null, null);
            viewControl.GetTransparencyPanel().Enabled = false;
            viewControl.setDisplayedRegistration(null);
            viewControl.GetCachePackage().ClearSchedulers();
        }
예제 #7
0
 public void StartUpApplication()
 {
     try
     {
         D.SetDebugLevel(BuildConfig.theConfig.debugLevel);
         this.cachePackage = new CachePackage();
         this.renderedTileCachePackage = this.cachePackage.DeriveCache("renderedTile");
         this.InitializeComponent();
         this.SetOptionsPanelVisibility(OptionsPanelVisibility.Nothing);
         this.mapTileSourceFactory = new MapTileSourceFactory(this.cachePackage);
     }
     catch (ConfigurationException)
     {
         this.UndoConstruction();
         throw;
     }
     this.layerControls.SetLayerControl(this);
     this.RestoreWindowParameters();
     this.SetInterfaceNoMashupOpen();
     System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
     timer.Interval = 10000;
     timer.Tick += new EventHandler(this.saveBackupTimer_Tick);
     timer.Start();
     this.registrationControls.ShowDMS = new MapDrawingOption(this.registrationControls, this.showDMSMenuItem, false);
     this.smViewerControl.ShowCrosshairs = new MapDrawingOption(this.smViewerControl, this.showCrosshairsMenuItem, true);
     this.smViewerControl.ShowTileBoundaries = new MapDrawingOption(this.smViewerControl, this.showTileBoundariesMenuItem, true);
     this.smViewerControl.ShowPushPins = new MapDrawingOption(this.smViewerControl, this.showPushPinsMenuItem, true);
     this.smViewerControl.ShowTileNames = new MapDrawingOption(this.smViewerControl, this.showTileNamesMenuItem, false);
     this.smViewerControl.ShowSourceCrop = new MapDrawingOption(this.smViewerControl, this.showSourceCropToolStripMenuItem, true);
     this.smViewerControl.ShowDMS = new MapDrawingOption(this.smViewerControl, this.showDMSMenuItem, false);
     this.smViewerControl.SetLLZBoxLabelStyle(LLZBox.LabelStyle.XY);
     this.SetVEMapStyle(VirtualEarthWebDownloader.RoadStyle);
     this.veViewerControl.ShowCrosshairs = new MapDrawingOption(this.veViewerControl, this.showCrosshairsMenuItem, true);
     this.veViewerControl.ShowTileBoundaries = new MapDrawingOption(this.veViewerControl, this.showTileBoundariesMenuItem, false);
     this.veViewerControl.ShowPushPins = new MapDrawingOption(this.veViewerControl, this.showPushPinsMenuItem, true);
     this.veViewerControl.ShowTileNames = new MapDrawingOption(this.veViewerControl, this.showTileNamesMenuItem, false);
     this.veViewerControl.ShowDMS = new MapDrawingOption(this.veViewerControl, this.showDMSMenuItem, false);
     this.veViewerControl.configureLLZBoxEditable();
     this.uiPosition = new UIPositionManager(this.smViewerControl, this.veViewerControl);
     this.uiPosition.GetVEPos().setPosition(this.veViewerControl.GetCoordinateSystem().GetDefaultView());
     this.recordSnapViewMenuItem.Click += new EventHandler(this.recordSnapViewMenuItem_Click);
     this.restoreSnapViewMenuItem.Click += new EventHandler(this.restoreSnapViewMenuItem_Click);
     this.recordSnapZoomMenuItem.Click += new EventHandler(this.recordSnapZoomMenuItem_Click);
     this.restoreSnapZoomMenuItem.Click += new EventHandler(this.restoreSnapZoomMenuItem_Click);
     this.registrationControls.setAssociationIfc(this);
     this.setDisplayedRegistration(null);
     this.sourceMapInfoPanel.Initialize(new SourceMapInfoPanel.PreviewSourceMapZoomDelegate(this.PreviewSourceMapZoom));
     BigDebugKnob.theKnob.AddListener(new BigDebugKnob.DebugKnobListener(this.debugKnobChanged));
     BigDebugKnob.theKnob.debugFeaturesEnabled = false;
     this.enableDebugModeToolStripMenuItem.Visible = BuildConfig.theConfig.debugModeEnabled;
     this.debugModeToolStripSeparator.Visible = BuildConfig.theConfig.debugModeEnabled;
     if (this.startDocumentPath != null)
     {
         this.LoadMashup(Path.GetFullPath(this.startDocumentPath));
     }
     else
     {
         this.NewMashup();
     }
     if (this.renderOnLaunch)
     {
         this.currentMashup.AutoSelectMaxZooms(this.mapTileSourceFactory);
         this.LaunchRenderWindow();
         this.renderWindow.StartRender(new RenderProgressPanel2.RenderCompleteDelegate(this.LaunchedRenderComplete));
         base.Shown += new EventHandler(this.MainAppForm_Shown_BringRenderWindowToFront);
     }
 }