Inheritance: MonoBehaviour
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);
            _graph = FindViewById <GraphView> (Resource.Id.graph);

            var points = StepModel.Mockup ().Select (
                (x, i) => new DataPoint (
                    new Java.Util.Date (x.Date.Ticks),
                    x.Steps)
            ).ToArray ();

            BarGraphSeries series = new BarGraphSeries (points);
            series.Spacing = 20;
            series.DrawValuesOnTop = true;
            series.ValuesOnTopColor = (int)Color.Yellow;
            series.Color = (int)Color.Yellow;

            _graph.GridLabelRenderer.LabelFormatter = new DateLabelFormat ();
            _graph.GridLabelRenderer.NumHorizontalLabels = 5;
            _graph.AddSeries (series);

            _graph.Viewport.SetMaxY (points.Max (x => x.GetY()) + 100);
            _graph.Viewport.SetMinY (0);
            _graph.Viewport.YAxisBoundsManual = true;

            double aDay = 24 * 60 * 60 * 1000;
            _graph.Viewport.SetMaxX (points.Max (x => x.GetX()) + aDay);
            _graph.Viewport.SetMinX (points.Min (x => x.GetX()) - aDay);
            _graph.Viewport.XAxisBoundsManual = true;
        }
		public override void LoadView ()
		{

			NavigationItem.RightBarButtonItem= new UIBarButtonItem(UIBarButtonSystemItem.Compose,
				delegate {
					var actionSheet = new UIActionSheet ("Email", null, "Cancel", "PNG", "PDF"){
						Style = UIActionSheetStyle.Default
					};

					actionSheet.Clicked += delegate (object sender, UIButtonEventArgs args){

						if(args.ButtonIndex > 1)
							return;

						Email(args.ButtonIndex == 0 ? "png" : "pdf");
					};

					actionSheet.ShowInView (View);
				});


			View = new UIView(plotFrame);
			image_plotted_by_OxyPlot = new GraphView(plotModel);
			image_plotted_by_OxyPlot.Frame = plotFrame;
			View.AddSubview(image_plotted_by_OxyPlot);
			image_plotted_by_OxyPlot.SetAllowPinchScaling(true);

		}
    public SingleLineDrawingMouseHandler(GraphView view)
    {
      this._grac = view;

      if(_grac!=null)
        _grac.SetPanelCursor(Cursors.Arrow);
    }
Exemplo n.º 4
0
    public ZoomAxesMouseHandler(GraphView grac)
      : base(grac)
    {
			NextMouseHandlerType = this.GraphToolType;

      if(_grac!=null)
        _grac.SetPanelCursor(Cursors.Arrow);
    }
Exemplo n.º 5
0
        // Initialization of the Activity after it is first created.  Must at least
        // call {@link android.app.Activity#setContentView setContentView()} to
        // describe what is to be displayed in the screen.
        protected override void OnCreate(Bundle savedInstanceState)
        {
            // Be sure to call the base class.
            base.OnCreate (savedInstanceState);

            sensor_manager = (SensorManager)GetSystemService (SensorService);
            graph_view = new GraphView (this.BaseContext);
            SetContentView (graph_view);

            sensor_manager.RegisterListener (graph_view,
                SensorManager.SensorAccelerometer |
                SensorManager.SensorMagneticField |
                SensorManager.SensorOrientation,
                SensorDelay.Fastest);
        }
Exemplo n.º 6
0
        // Initialization of the Activity after it is first created.  Must at least
        // call {@link android.app.Activity#setContentView setContentView()} to
        // describe what is to be displayed in the screen.
        protected override void OnCreate(Bundle savedInstanceState)
        {
            // Be sure to call the base class.
            base.OnCreate (savedInstanceState);

            sensor_manager = (SensorManager)GetSystemService (SensorService);
            graph_view = new GraphView (this.BaseContext);
            SetContentView (graph_view);

            var accel = sensor_manager.GetDefaultSensor (SensorType.Accelerometer);
            var mag = sensor_manager.GetDefaultSensor (SensorType.MagneticField);
            var ori = sensor_manager.GetDefaultSensor (SensorType.Orientation);

            sensor_manager.RegisterListener (graph_view, accel, SensorDelay.Fastest);
            sensor_manager.RegisterListener (graph_view, mag, SensorDelay.Fastest);
            sensor_manager.RegisterListener (graph_view, ori, SensorDelay.Fastest);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Attach the specified Model and View.
        /// </summary>
        /// <param name="model">The axis model</param>
        /// <param name="view">The axis view</param>
        /// <param name="explorerPresenter">The parent explorer presenter</param>
        public void Attach(object model, object view, ExplorerPresenter explorerPresenter)
        {
            IModel folder = model as IModel;

            List<UserControl> views = new List<UserControl>();

            foreach (Graph graph in Apsim.Children(folder, typeof(Graph)))
            {
                GraphView graphView = new GraphView();
                GraphPresenter presenter = new GraphPresenter();
                presenter.Attach(graph, graphView, explorerPresenter);
                views.Add(graphView);
            }

            if (views.Count > 0)
                (view as IFolderView).SetContols(views);
        }
Exemplo n.º 8
0
 public RectangleDrawingMouseHandler(GraphView grac)
   : base(grac)
 {
   
 }
		public CurlyBraceDrawingMouseHandler(GraphView grac)
			: base(grac)
		{

		}
Exemplo n.º 10
0
 public ReadPlotItemDataMouseHandler(GraphView grac)
 {
   _grac = grac;
   if(_grac!=null)
     _grac.SetPanelCursor(Cursors.Cross);
 }
Exemplo n.º 11
0
        /// <summary>Creates the graph.</summary>
        /// <param name="writer">The writer.</param>
        /// <param name="graphAndTable">The graph and table to convert to html.</param>
        /// <param name="workingDirectory">The working directory.</param>
        private void CreateGraphPDF(Section section, AutoDocumentation.GraphAndTable graphAndTable, string workingDirectory)
        {
            // Create a 2 column, 1 row table. Image in first cell, X/Y data in second cell.
            Table table = section.AddTable();

            table.Style           = "GraphAndTable";
            table.Rows.LeftIndent = graphAndTable.indent + "cm";

            Column column1 = table.AddColumn();

            column1.Width = "8cm";
            //column1.Format.Alignment = ParagraphAlignment.Right;
            Column column2 = table.AddColumn();

            column2.Width = "8cm";
            //column2.Format.Alignment = ParagraphAlignment.Right;
            Row row = table.AddRow();

            // Ensure graphs directory exists.
            string graphDirectory = Path.Combine(workingDirectory, "Graphs");

            Directory.CreateDirectory(graphDirectory);

            // Determine the name of the .png file to write.
            string pngFileName = Path.Combine(graphDirectory,
                                              graphAndTable.xyPairs.Parent.Parent.Name + graphAndTable.xyPairs.Parent.Name + ".png");
            int count = 0;

            // If there are multiple graphs with the same name, they may overwrite each other.
            // Therefore, we attempt to generate a unique name. After 20 attempts, we give up.
            while (File.Exists(pngFileName) && count < 20)
            {
                count++;
                pngFileName = Path.Combine(graphDirectory, graphAndTable.xyPairs.Parent.Parent.Name + graphAndTable.xyPairs.Parent.Name + Guid.NewGuid() + ".png");
            }
            // Setup graph.
            GraphView graph = new GraphView();

            graph.Clear();
            graph.Width  = 400;
            graph.Height = 250;

            // Create a line series.
            graph.DrawLineAndMarkers("", graphAndTable.xyPairs.X, graphAndTable.xyPairs.Y, null, null, null,
                                     Models.Graph.Axis.AxisType.Bottom, Models.Graph.Axis.AxisType.Left,
                                     System.Drawing.Color.Blue, Models.Graph.LineType.Solid, Models.Graph.MarkerType.None,
                                     Models.Graph.LineThicknessType.Normal, Models.Graph.MarkerSizeType.Normal, true);

            graph.ForegroundColour = OxyPlot.OxyColors.Black;
            graph.BackColor        = OxyPlot.OxyColors.White;
            // Format the axes.
            graph.FormatAxis(Models.Graph.Axis.AxisType.Bottom, graphAndTable.xName, false, double.NaN, double.NaN, double.NaN, false);
            graph.FormatAxis(Models.Graph.Axis.AxisType.Left, graphAndTable.yName, false, double.NaN, double.NaN, double.NaN, false);
            graph.FontSize = 10;
            graph.Refresh();

            // Export graph to bitmap file.
            Bitmap image = new Bitmap(graph.Width, graph.Height);

            using (Graphics gfx = Graphics.FromImage(image))
                using (SolidBrush brush = new SolidBrush(System.Drawing.Color.White))
                {
                    gfx.FillRectangle(brush, 0, 0, image.Width, image.Height);
                }
            graph.Export(ref image, new Rectangle(0, 0, image.Width, image.Height), false);
            graph.MainWidget.Destroy();
            image.Save(pngFileName, System.Drawing.Imaging.ImageFormat.Png);
            MigraDoc.DocumentObjectModel.Shapes.Image sectionImage = row.Cells[0].AddImage(pngFileName);
            sectionImage.LockAspectRatio = true;
            sectionImage.Width           = "8cm";

            // Add x/y data.
            Paragraph xyParagraph = row.Cells[1].AddParagraph();

            xyParagraph.Style = "xyStyle";
            AddFixedWidthText(xyParagraph, "X", 10);
            AddFixedWidthText(xyParagraph, "Y", 10);
            xyParagraph.AddLineBreak();
            for (int i = 0; i < graphAndTable.xyPairs.X.Length; i++)
            {
                AddFixedWidthText(xyParagraph, graphAndTable.xyPairs.X[i].ToString(), 10);
                AddFixedWidthText(xyParagraph, graphAndTable.xyPairs.Y[i].ToString(), 10);
                xyParagraph.AddLineBreak();
            }

            // Add an empty paragraph for spacing.
            section.AddParagraph();
        }
Exemplo n.º 12
0
 public ObjectPointerMouseHandler(GraphView grac)
 {
   _grac = grac;
   if(_grac!=null)
     _grac.SetPanelCursor(Cursors.Arrow);
 }
Exemplo n.º 13
0
 public ArrowLineDrawingMouseHandler(GraphView grac)
   : base(grac)
 {
   if(_grac!=null)
     _grac.SetPanelCursor(Cursors.Arrow);
 }
Exemplo n.º 14
0
 void OnContextualMenuEvent(ContextualMenuPopulateEvent evt)
 {
     GraphView.BuildContextualMenu(evt);
 }
Exemplo n.º 15
0
        /// <summary>Writes PDF for specified auto-doc commands.</summary>
        /// <param name="section">The writer to write to.</param>
        /// <param name="tags">The autodoc tags.</param>
        /// <param name="workingDirectory">The working directory.</param>
        private void TagsToMigraDoc(Section section, List <AutoDocumentation.ITag> tags, string workingDirectory)
        {
            int figureNumber = 0;

            foreach (AutoDocumentation.ITag tag in tags)
            {
                if (tag is AutoDocumentation.Heading)
                {
                    AutoDocumentation.Heading heading = tag as AutoDocumentation.Heading;
                    if (heading.headingLevel > 0 && heading.headingLevel <= 6)
                    {
                        Paragraph para = section.AddParagraph(heading.text, "Heading" + heading.headingLevel);
                        para.Format.KeepWithNext = true;
                        if (heading.headingLevel == 1)
                        {
                            para.Format.OutlineLevel = OutlineLevel.Level1;
                        }
                        else if (heading.headingLevel == 2)
                        {
                            para.Format.OutlineLevel = OutlineLevel.Level2;
                        }
                        else if (heading.headingLevel == 3)
                        {
                            para.Format.OutlineLevel = OutlineLevel.Level3;
                        }
                        else if (heading.headingLevel == 4)
                        {
                            para.Format.OutlineLevel = OutlineLevel.Level4;
                        }
                        else if (heading.headingLevel == 5)
                        {
                            para.Format.OutlineLevel = OutlineLevel.Level5;
                        }
                        else if (heading.headingLevel == 6)
                        {
                            para.Format.OutlineLevel = OutlineLevel.Level6;
                        }
                    }
                }
                else if (tag is AutoDocumentation.Paragraph)
                {
                    AutoDocumentation.Paragraph paragraph = tag as AutoDocumentation.Paragraph;
                    if (paragraph.text.Contains("![Alt Text]"))
                    {
                        figureNumber++;
                    }
                    paragraph.text = paragraph.text.Replace("[FigureNumber]", figureNumber.ToString());
                    AddFormattedParagraphToSection(section, paragraph);
                }
                else if (tag is AutoDocumentation.GraphAndTable)
                {
                    CreateGraphPDF(section, tag as AutoDocumentation.GraphAndTable, workingDirectory);
                }
                else if (tag is GraphPage)
                {
                    CreateGraphPage(section, tag as GraphPage, workingDirectory);
                }
                else if (tag is AutoDocumentation.NewPage)
                {
                    section.AddPageBreak();
                }
                else if (tag is AutoDocumentation.Table)
                {
                    CreateTable(section, tag as AutoDocumentation.Table, workingDirectory);
                }
                else if (tag is Graph)
                {
                    GraphPresenter graphPresenter = new GraphPresenter();
                    explorerPresenter.ApsimXFile.Links.Resolve(graphPresenter);
                    GraphView graphView = new GraphView();
                    graphView.BackColor        = OxyPlot.OxyColors.White;
                    graphView.ForegroundColour = OxyPlot.OxyColors.Black;
                    graphView.FontSize         = 12;
                    graphView.Width            = 500;
                    graphView.Height           = 500;
                    graphPresenter.Attach(tag, graphView, explorerPresenter);
                    string pngFileName = graphPresenter.ExportToPNG(workingDirectory);
                    section.AddImage(pngFileName);
                    string caption = (tag as Graph).Caption;
                    if (caption != null)
                    {
                        section.AddParagraph(caption);
                    }
                    graphPresenter.Detach();
                    graphView.MainWidget.Destroy();
                }
                else if (tag is Map && (tag as Map).GetCoordinates().Count > 0)
                {
                    MapPresenter mapPresenter = new MapPresenter();
                    MapView      mapView      = new MapView(null);
                    mapPresenter.Attach(tag, mapView, explorerPresenter);
                    string pngFileName = mapPresenter.ExportToPNG(workingDirectory);
                    if (!String.IsNullOrEmpty(pngFileName))
                    {
                        section.AddImage(pngFileName);
                    }
                    mapPresenter.Detach();
                    mapView.MainWidget.Destroy();
                }
                else if (tag is AutoDocumentation.Image)
                {
                    AutoDocumentation.Image imageTag = tag as AutoDocumentation.Image;
                    if (imageTag.image.Width > 700)
                    {
                        imageTag.image = ImageUtilities.ResizeImage(imageTag.image, 700, 500);
                    }
                    string pngFileName = Path.Combine(workingDirectory, imageTag.name);
                    imageTag.image.Save(pngFileName, System.Drawing.Imaging.ImageFormat.Png);
                    section.AddImage(pngFileName);
                    figureNumber++;
                }
                else if (tag is AutoDocumentation.ModelView)
                {
                    AutoDocumentation.ModelView modelView     = tag as AutoDocumentation.ModelView;
                    ViewNameAttribute           viewName      = ReflectionUtilities.GetAttribute(modelView.model.GetType(), typeof(ViewNameAttribute), false) as ViewNameAttribute;
                    PresenterNameAttribute      presenterName = ReflectionUtilities.GetAttribute(modelView.model.GetType(), typeof(PresenterNameAttribute), false) as PresenterNameAttribute;
                    if (viewName != null && presenterName != null)
                    {
                        ViewBase   view      = Assembly.GetExecutingAssembly().CreateInstance(viewName.ToString(), false, BindingFlags.Default, null, new object[] { ViewBase.MasterView }, null, null) as ViewBase;
                        IPresenter presenter = Assembly.GetExecutingAssembly().CreateInstance(presenterName.ToString()) as IPresenter;

                        if (view != null && presenter != null)
                        {
                            explorerPresenter.ApsimXFile.Links.Resolve(presenter);
                            presenter.Attach(modelView.model, view, explorerPresenter);

                            Gtk.Window popupWin = null;
                            if (view is MapView)
                            {
                                popupWin = (view as MapView)?.GetPopupWin();
                                popupWin?.SetSizeRequest(515, 500);
                            }
                            if (popupWin == null)
                            {
                                popupWin = new Gtk.Window(Gtk.WindowType.Popup);
                                popupWin.SetSizeRequest(800, 800);
                                popupWin.Add(view.MainWidget);
                            }
                            popupWin.ShowAll();
                            while (Gtk.Application.EventsPending())
                            {
                                Gtk.Application.RunIteration();
                            }

                            string pngFileName = (presenter as IExportable).ExportToPNG(workingDirectory);
                            section.AddImage(pngFileName);
                            presenter.Detach();
                            view.MainWidget.Destroy();
                            popupWin.Destroy();
                        }
                    }
                }
            }
        }
Exemplo n.º 16
0
        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.splitter = new System.Windows.Forms.Splitter();
            this.panel1 = new System.Windows.Forms.Panel();
            this.graphView = new GraphView();
            this.gridView = new GridView();
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // splitter
            // 
            this.splitter.BackColor = System.Drawing.SystemColors.Control;
            this.splitter.Dock = System.Windows.Forms.DockStyle.Top;
            this.splitter.Location = new System.Drawing.Point(0, 171);
            this.splitter.Name = "splitter";
            this.splitter.Size = new System.Drawing.Size(568, 5);
            this.splitter.TabIndex = 2;
            this.splitter.TabStop = false;
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.gridView);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(568, 171);
            this.panel1.TabIndex = 3;
            // 
            // graphView
            // 
            this.graphView.Dock = System.Windows.Forms.DockStyle.Fill;
            this.graphView.LeftRightPadding = 0;
            this.graphView.Location = new System.Drawing.Point(0, 176);
            this.graphView.Margin = new System.Windows.Forms.Padding(2);
            this.graphView.Name = "graphView";
            this.graphView.Size = new System.Drawing.Size(568, 325);
            this.graphView.TabIndex = 4;
            // 
            // gridView
            // 
            this.gridView.AutoFilterOn = false;
            this.gridView.DataSource = null;
            this.gridView.Dock = System.Windows.Forms.DockStyle.Fill;
            this.gridView.GetCurrentCell = null;
            this.gridView.Location = new System.Drawing.Point(0, 0);
            this.gridView.Margin = new System.Windows.Forms.Padding(4);
            this.gridView.ModelName = null;
            this.gridView.Name = "gridView";
            this.gridView.NumericFormat = null;
            this.gridView.ReadOnly = false;
            this.gridView.RowCount = 0;
            this.gridView.Size = new System.Drawing.Size(568, 171);
            this.gridView.TabIndex = 5;
            // 
            // XYPairsView
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.graphView);
            this.Controls.Add(this.splitter);
            this.Controls.Add(this.panel1);
            this.Name = "XYPairsView";
            this.Size = new System.Drawing.Size(568, 501);
            this.panel1.ResumeLayout(false);
            this.ResumeLayout(false);

        }
Exemplo n.º 17
0
 public EllipseDrawingMouseHandler(GraphView grac)
   : base(grac)
 {
   
 }
Exemplo n.º 18
0
        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.splitter = new System.Windows.Forms.Splitter();
            this.panel1 = new System.Windows.Forms.Panel();
            this.label3 = new System.Windows.Forms.Label();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.label5 = new System.Windows.Forms.Label();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.comboBox1 = new System.Windows.Forms.ComboBox();
            this.label7 = new System.Windows.Forms.Label();
            this.radioButton2 = new System.Windows.Forms.RadioButton();
            this.radioButton1 = new System.Windows.Forms.RadioButton();
            this.label6 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.textBox2 = new System.Windows.Forms.TextBox();
            this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
            this.label1 = new System.Windows.Forms.Label();
            this.graphView1 = new GraphView();
            this.panel1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
            this.SuspendLayout();
            // 
            // splitter
            // 
            this.splitter.BackColor = System.Drawing.SystemColors.Control;
            this.splitter.Location = new System.Drawing.Point(311, 0);
            this.splitter.Name = "splitter";
            this.splitter.Size = new System.Drawing.Size(5, 501);
            this.splitter.TabIndex = 2;
            this.splitter.TabStop = false;
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.label3);
            this.panel1.Controls.Add(this.groupBox2);
            this.panel1.Controls.Add(this.groupBox1);
            this.panel1.Controls.Add(this.label1);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(311, 501);
            this.panel1.TabIndex = 3;
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(4, 211);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(23, 13);
            this.label3.TabIndex = 4;
            this.label3.Text = "OR";
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.label5);
            this.groupBox2.Controls.Add(this.textBox1);
            this.groupBox2.Location = new System.Drawing.Point(6, 237);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(283, 100);
            this.groupBox2.TabIndex = 2;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Specifying a depth of wet soil";
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(91, 46);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(59, 13);
            this.label5.TabIndex = 7;
            this.label5.Text = "cm wet soil";
            // 
            // textBox1
            // 
            this.textBox1.Location = new System.Drawing.Point(18, 43);
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(67, 20);
            this.textBox1.TabIndex = 0;
            this.textBox1.TextChanged += new System.EventHandler(this.OnTextBox1TextChanged);
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.comboBox1);
            this.groupBox1.Controls.Add(this.label7);
            this.groupBox1.Controls.Add(this.radioButton2);
            this.groupBox1.Controls.Add(this.radioButton1);
            this.groupBox1.Controls.Add(this.label6);
            this.groupBox1.Controls.Add(this.label2);
            this.groupBox1.Controls.Add(this.textBox2);
            this.groupBox1.Controls.Add(this.numericUpDown1);
            this.groupBox1.Location = new System.Drawing.Point(11, 51);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(283, 140);
            this.groupBox1.TabIndex = 1;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Specifying a fraction of maximum available water";
            // 
            // comboBox1
            // 
            this.comboBox1.FormattingEnabled = true;
            this.comboBox1.Location = new System.Drawing.Point(93, 110);
            this.comboBox1.Name = "comboBox1";
            this.comboBox1.Size = new System.Drawing.Size(172, 21);
            this.comboBox1.TabIndex = 10;
            this.comboBox1.SelectedValueChanged += new System.EventHandler(this.OnComboBox1SelectedValueChanged);
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(23, 113);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(61, 13);
            this.label7.TabIndex = 11;
            this.label7.Text = "Relative to:";
            // 
            // radioButton2
            // 
            this.radioButton2.AutoSize = true;
            this.radioButton2.Location = new System.Drawing.Point(135, 70);
            this.radioButton2.Name = "radioButton2";
            this.radioButton2.Size = new System.Drawing.Size(108, 17);
            this.radioButton2.TabIndex = 6;
            this.radioButton2.TabStop = true;
            this.radioButton2.Text = "Evenly distributed";
            this.radioButton2.UseVisualStyleBackColor = true;
            this.radioButton2.CheckedChanged += new System.EventHandler(this.OnRadioButton1CheckedChanged);
            // 
            // radioButton1
            // 
            this.radioButton1.AutoSize = true;
            this.radioButton1.Location = new System.Drawing.Point(19, 70);
            this.radioButton1.Name = "radioButton1";
            this.radioButton1.Size = new System.Drawing.Size(90, 17);
            this.radioButton1.TabIndex = 5;
            this.radioButton1.TabStop = true;
            this.radioButton1.Text = "Filled from top";
            this.radioButton1.UseVisualStyleBackColor = true;
            this.radioButton1.CheckedChanged += new System.EventHandler(this.OnRadioButton1CheckedChanged);
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(212, 36);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(52, 13);
            this.label6.TabIndex = 9;
            this.label6.Text = "mm water";
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(90, 36);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(43, 13);
            this.label2.TabIndex = 4;
            this.label2.Text = "% full = ";
            // 
            // textBox2
            // 
            this.textBox2.Location = new System.Drawing.Point(139, 34);
            this.textBox2.Name = "textBox2";
            this.textBox2.Size = new System.Drawing.Size(67, 20);
            this.textBox2.TabIndex = 8;
            this.textBox2.TextChanged += new System.EventHandler(this.OnTextBox2TextChanged);
            // 
            // numericUpDown1
            // 
            this.numericUpDown1.Location = new System.Drawing.Point(19, 34);
            this.numericUpDown1.Name = "numericUpDown1";
            this.numericUpDown1.Size = new System.Drawing.Size(65, 20);
            this.numericUpDown1.TabIndex = 0;
            this.numericUpDown1.ValueChanged += new System.EventHandler(this.OnNumericUpDown1ValueChanged);
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(3, 15);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(184, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "You can specify the starting water by:";
            // 
            // graphView1
            // 
            this.graphView1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.graphView1.Location = new System.Drawing.Point(316, 0);
            this.graphView1.Name = "graphView1";
            this.graphView1.Size = new System.Drawing.Size(252, 501);
            this.graphView1.TabIndex = 4;
            // 
            // InitialWaterView
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.graphView1);
            this.Controls.Add(this.splitter);
            this.Controls.Add(this.panel1);
            this.Name = "InitialWaterView";
            this.Size = new System.Drawing.Size(568, 501);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
            this.ResumeLayout(false);

        }
Exemplo n.º 19
0
		private async void Permute(object sender, RoutedEventArgs e)
		{
			// Clear our workspace
			oComponents.Clear();
			_wrkSpace.Children.Clear();

			await _viewModel.Permute();

            Overlap overlap = _dataManager.GetOverlap();
			if (overlap != null)
			{
                int idx = 0;
				foreach (var dataType in _viewModel.DataTypes)
				{
					if (dataType.Selected)
					{
						var cmpView = new GraphView();
						cmpView.Width = 600;  // TODO: Make this dynamic and stretchy
						cmpView.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
						_wrkSpace.Children.Add(cmpView);
						_wrkSpaceComponents.Add(cmpView);

						cmpView.SetDataManager(_dataManager);
                        
                        // TODO: Make this user settable and not blow up
                        cmpView.LoadGraphComponents(overlap, dataType.Tag, NBSmColors[idx]);

                        idx++;
					}
				}

                oComponents.LoadGraphComponents(overlap);
			}

			_btnSave.IsEnabled = true;
		}
Exemplo n.º 20
0
 public TextToolMouseHandler(GraphView grac)
 {
   _grac = grac;
   if(_grac!=null)
     _grac.SetPanelCursor(Cursors.Arrow);
 }