Esempio n. 1
0
        private LayerSettingEditor(Rectangle visibleRect, MainControler mainControler)
            : this()
        {
            this.config = mainControler.Config;

            this.Location = new System.Drawing.Point(0, visibleRect.Y);
            this.ClientSize = new System.Drawing.Size(visibleRect.Width, visibleRect.Height);
            this.layerTabControl.Height = this.ClientSize.Height - Caption.Height - 3;
            this.panel1.Height = layerTabControl.Height;
            this.mainControler = mainControler;
            this.tLine = mainControler.LayerManager.TransportPolylineLayer;
            this.tPoint = mainControler.LayerManager.TransportPointLayer;
            this.tPolygon = mainControler.LayerManager.TransportPolygonLayer;
            this.config = mainControler.Config;
        }
Esempio n. 2
0
        public SettingDialog(Rectangle visibleRect, MainControler mainControler)
            : this()
        {
            this.config = mainControler.Config;

            this.Location = new System.Drawing.Point(0, visibleRect.Y);
            this.ClientSize = new System.Drawing.Size(visibleRect.Width, visibleRect.Height);
            this.layerTabControl.Height = this.ClientSize.Height - Caption.Height - 3;
            this.panel1.Height = layerTabControl.Height;

            resizeToRect(visibleRect);
            this.mainControler = mainControler;
            this.tLine = mainControler.LayerManager.TransportPolylineLayer;
            this.tPoint = mainControler.LayerManager.TransportPointLayer;
            this.tPolygon = mainControler.LayerManager.TransportPolygonLayer;
            this.config = mainControler.Config;

            PointLayerSettings.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\tbSettings");
            PointLayerFile.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\tbOpen");
            PolylineLayerSettings.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\tbSettings");
            PolyLineLayerFile.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\tbOpen");
            PolygonLayerSettings.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\tbSettings");
            PolygonLayerFile.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\tbOpen");

            bAddCategory.Icon = addDirIconBox.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\plus");
            bRemoveCategory.Icon = removeDirIconBox.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\minus");
            stOpenIconBox.Icon = ToolbarMaker.GetIconFromFile(config.ApplicationDirectory + @"\Icons\tbOpen");

            PointLayerSettings.Normal_BackColor
            = PolylineLayerSettings.Normal_BackColor
            = PolygonLayerSettings.Normal_BackColor
            = PointLayerFile.Normal_BackColor
            = PolyLineLayerFile.Normal_BackColor
            = PolygonLayerFile.Normal_BackColor

            = addDirIconBox.Normal_BackColor
            = removeDirIconBox.Normal_BackColor
            = stOpenIconBox.Normal_BackColor
            = bAddCategory.Normal_BackColor
            = bRemoveCategory.Normal_BackColor
            = settingDefaultProjectTB.BackColor = SystemColors.Window;

            if (mainControler.DisplayResolution != DisplayResolution.QVGA)
            {
                this.addDirIconBox.Location =
                    new Point(addDirIconBox.Location.X - 3, addDirIconBox.Location.Y - 4);
                this.removeDirIconBox.Location =
                    new Point(this.removeDirIconBox.Location.X - 3, this.removeDirIconBox.Location.Y + 8);
                this.settingsSearchDirListbox.Size =
                    new Size(settingsSearchDirListbox.Size.Width, settingsSearchDirListbox.Height + 4);

                this.bAddCategory.Location =
                    new Point(bAddCategory.Location.X - 3, bAddCategory.Location.Y - 4);
                this.bRemoveCategory.Location =
                    new Point(this.bRemoveCategory.Location.X - 3, this.bRemoveCategory.Location.Y + 8);
                this.lbCategories.Size =
                    new Size(lbCategories.Size.Width, lbCategories.Height + 4);
            }
            if (config.GpsViewMode == GpsView.StaticMap)
                gpsViewSelection.SelectedItem = gpsViewSelection.Items[0];
            else gpsViewSelection.SelectedItem = gpsViewSelection.Items[1];
        }
Esempio n. 3
0
        ////////////////
        // Constructors
        ////////////////
        public LayerManager(MainControler mc, Config config)
        {
            this.config = config;
            this.mainControler = mc;
            layerArray = new List<Layer>();
            layerListViewMappingList = new SortedList<int, int>();
            layerShapeMappingList = new SortedList<int, int>();
            layerArray.Clear();

            transportPointLayer    = new TransportMultiPointLayer(this, config);
            transportPolylineLayer = new TransportPolylineLayer(this, config);
            transportPolygonLayer  = new TransportPolygonLayer(this, config);

            // Initialize the quadtree for the transportLayer data with assumed properties
            transportLayerQuadtree  = new QuadTree<IShape>(new DRect(0.0d, 0.0d, 100.0d, 100.0d), 4);
            this.ScaleChanged += new ScaleChangedDelegate(transportLayerQuadtree.ZoomReactor);
            currentlyVisibleIShapes = new List<QuadTreePositionItem<IShape>>();

            mainControler.SettingsLoaded += new MainControler.SettingsLoadedDelegate(mainControler_SettingsLoaded);

            this.NewLayerStyle = new RandomColorStyle();
        }