Exemplo n.º 1
0
 public Settings(System.Windows.Forms.PropertyGrid propertyGrid, MainWindow mainWindow, Viewport viewport, Drawer drawer, Timer timer, Diagram diagram, RectangleSelector zoomSelector, RectangleSelector unZoomSelector, Dragger panDragger, VisibleFrameCounter frameCounter)
     : base("Settings")
 {
     this.mainWindow = mainWindow;
     this.viewport = new ViewportSettings("ViewportSettings", viewport);
     this.drawer = new DrawerSettings("DrawerSettings", drawer);
     this.diagram = new DiagramSettings("DiagramSettings", propertyGrid, timer, diagram);
     this.zoomSelector = new RectangleSelectorSettings("ZoomSelectorSettings", zoomSelector);
     this.unZoomSelector = new RectangleSelectorSettings("UnZoomSelectorSettings", unZoomSelector);
     this.panDragger = new DraggerSettings("PanDraggerSettings", panDragger);
     this.frameCounter = new FrameCounterSettings("FrameCounterSettings", frameCounter);
 }
Exemplo n.º 2
0
 public DraggerSettings(string xElementName, Dragger dragger)
     : base(xElementName)
 {
     this.dragger = dragger;
 }
Exemplo n.º 3
0
        public MainWindow(Parameters parameters)
        {
            Console.WriteLine("Initializing graphics and user interface...");
            InitializeComponent();

            Text = title;

            this.parameters = parameters;

            this.drawer = new Drawer(viewport);

            this.timer = new Data.Timer();

            this.diagram = CreateDiagram(viewport, drawer, timer, parameters);

            this.zoomSelector = new RectangleSelector(drawer, viewport);
            this.zoomSelector.Button = MouseButtons.Left;
            this.zoomSelector.Color = System.Drawing.Color.White;
            this.zoomSelector.EndSelect += zoomSelector_Select;

            this.unZoomSelector = new RectangleSelector(drawer, viewport);
            this.unZoomSelector.Button = MouseButtons.Middle;
            this.unZoomSelector.Color = System.Drawing.Color.Blue;
            this.unZoomSelector.EndSelect += unZoomSelector_Select;

            this.panDragger = new Dragger(viewport);
            this.panDragger.Button = MouseButtons.Right;
            this.panDragger.Drag += panDragger_Drag;
            this.panDragger.EndDrag += panDragger_EndDrag;

            this.frameCounter = new VisibleFrameCounter(drawer);
            this.frameCounter.Color = System.Drawing.Color.Yellow;
            this.frameCounter.Alignment = TextAlignment.Far;

            this.coordinateLabel = new CoordinateLabel(coordinateStatusLabel, viewport, diagram);

            NewSession(parameters.PortStrings);

            if (parameters.MinimalMode != null) MinimalMode = parameters.MinimalMode.Value;

            this.settings = new Settings(properties, this, viewport, drawer, timer, diagram, zoomSelector, unZoomSelector, panDragger, frameCounter);
            if (System.IO.File.Exists(SettingsPath)) this.settings.XElement = XElement.Load(SettingsPath);
            properties.SelectedObject = settings;

            viewport.AddComponent(diagram);
            viewport.AddComponent(zoomSelector);
            viewport.AddComponent(unZoomSelector);
            viewport.AddComponent(frameCounter);
            viewport.AddComponent(coordinateLabel);
        }