Exemple #1
0
        /// <summary>
        /// Setup
        /// </summary>
        /// <param name="spotfireViewProps"></param>
        /// <param name="sizeAxis"></param>

        public void Setup(
            SizeAxisMsx sizeAxis,
            VisualMsx visual,
            SpotfireViewProps spotfireViewProps,
            EventHandler editValueChangedEventHandler = null)
        {
            InSetup = true;

            SVP      = spotfireViewProps;
            Visual   = visual;
            SizeAxis = sizeAxis;

            EditValueChanged = editValueChangedEventHandler;

            if (Lex.IsUndefined(sizeAxis.Expression))
            {
                SizeByFixedSize.Checked = true;
            }
            else
            {
                SizeByColumn.Checked = true;
            }

            SizeColumnSelector.Setup(SizeAxis, Visual, SVP, SizeByColumn_EditValueChanged);
            OverallSize.Value = (int)SizeAxis.FixedSize;

            InSetup = false;
            return;
        }
Exemple #2
0
        /// <summary>
        /// Setup
        /// </summary>
        /// <param name="v"></param>

        public void Setup(
            VisualMsx v,
            TrellisMsx t)
        {
            InSetup = true;
            V       = v;
            T       = t;

            if (T.TrellisMode == TrellisModeMsx.RowsColumns)
            {
                TrellisByRowsAndCols.Checked = true;
            }
            else
            {
                TrellisByPanels.Checked = true;
            }

            //TrellisColumnSelector.Setup(T.BaseQuery, T.TrellisColQc);
            //TrellisRowSelector.Setup(T.BaseQuery, T.TrellisRowQc);
            //TrellisPageSelector.Setup(T.BaseQuery, T.TrellisPageQc);

            //TrellisFlowBySelector.Setup(T.BaseQuery, T.TrellisFlowQc);

            TrellisManualLayout.Checked = T.ManualLayout;
            SetTrellisManualLayoutEnableds();
            TrellisMaxRows.Text = T.ManualRowCount.ToString();
            TrellisMaxCols.Text = T.ManualColumnCount.ToString();

            //ShowAxesTitles.Checked = T.ShowAxesTitles;
            //ShowAxesScaleLabels.Checked = T.ShowAxesScaleLabels;


            InSetup = false;
        }
Exemple #3
0
        /// <summary>
        /// Setup
        /// </summary>
        /// <param name="view"></param>
        /// <param name="colorBy"></param>

        public void Setup(
            ShapeAxisMsx shapeAxis,
            //ContextMenuStrip shapeMenu,
            VisualMsx visual,
            SpotfireViewProps spotfireViewProps,
            EventHandler editValueChangedEventHandler = null)
        {
            InSetup = true;

            SVP       = spotfireViewProps;
            Visual    = visual;
            ShapeAxis = shapeAxis;

            //ShapeTypeMenu = shapeMenu; // (needed?)

            SetupFixedShapeButton();
            ShapeColumnSelector.Setup(ShapeAxis, Visual, SVP, EditValueChanged);
            SetupShapeSchemeGrid();

            if (Lex.IsDefined(ShapeAxis.Expression))
            {
                ShapeByColumn.Checked = true;
            }
            else
            {
                ShapeByFixedShape.Checked = true;
            }

            InSetup = false;
            return;
        }
Exemple #4
0
/// <summary>
/// Return true if visual properties can be edited
/// </summary>
/// <param name="v"></param>
/// <returns></returns>

        public static bool CanEditVisualProperties(
            VisualMsx v)
        {
            DialogResult dr = DialogResult.Cancel;

            if (v == null)
            {
                return(false);
            }

            //else if (v is TablePlotMsx) return true;

            else if (v is BarChartMsx)
            {
                return(true);
            }

            else if (v is ScatterPlotMsx)
            {
                return(true);
            }

            //else if (v is TreemapMsx) return true;

            //else if (v is HeatMapMsx) return true;

            //else if (v is TrellisCardVisualMsx) return true;

            else
            {
                return(false);
            }
        }
Exemple #5
0
        /// <summary>
        /// ShowDialog
        /// </summary>
        /// <param name="svm"></param>
        /// <param name="initialTabName"></param>
        /// <returns></returns>

        public static DialogResult ShowDialog(
            VisualMsx v,
            SpotfireViewManager svm)
        {
            Instance = new BasicVisualPropertiesDialog();

            return(Instance.ShowDialog2(v, svm));
        }
Exemple #6
0
        private void ShowVisualPropertiesDialog()
        {
            VisualMsx v = Api.GetActiveVisual();

            SpotfireToolbar.EditVisualProperties(v, SVP);

            return;
        }
Exemple #7
0
        private void VisualPropertiesMenuItem_Click(object sender, EventArgs e)
        {
            VisualMsx v = SpotfireSession.SpotfireApiClient?.GetActiveVisual();

            SpotfireToolbar.EditVisualProperties(v, SVP);

            return;
        }
Exemple #8
0
 public void GetValues(VisualMsx v)
 {
     InSetup           = true;
     v.Title           = Title.Text;
     v.ShowTitle       = ShowTitle.Checked;
     v.ShowDescription = ShowDescriptionInVis.Checked;
     v.Description     = Description.Text;
     InSetup           = false;
 }
Exemple #9
0
        /// <summary>
        /// Retrieve and apply any pending marker color/shape changes
        /// </summary>

        void ApplyPendingChanges()
        {
            GetFormValues();
            string serializedText = SerializeMsx.Serialize(V);                          // serialize

            VisualMsx visMx = SerializeMsx.DeserializeVisual(serializedText, Analysis); // debug

            Api.SetVisualProperties(V.Id, serializedText);
        }
Exemple #10
0
        private void ShowVisualPropertiesDialog()
        {
            //WebBrowser.Document.MouseDown += new HtmlElementEventHandler(Document_MouseDown);

            VisualMsx v = SpotfireApiClient.GetActiveVisual();

            SpotfireToolbar.EditVisualProperties(v, SVP);

            return;
        }
Exemple #11
0
        /// <summary>
        /// Setup
        /// </summary>
        /// <param name="v"></param>

        public void Setup(
            VisualMsx v,
            EventHandler callerValueChangedCallback = null)
        {
            Title.Text                   = v.Title;
            ShowTitle.Checked            = v.ShowTitle;
            Description.Text             = v.Description;
            ShowDescriptionInVis.Checked = v.ShowDescription;

            ValueChangedCallback = callerValueChangedCallback;
        }
Exemple #12
0
        /// <summary>
        /// Setup
        /// </summary>
        /// <param name="v"></param>

        public void Setup(
            VisualMsx v,
            EventHandler callercallerEditValueChangedEventHandler = null)
        {
            Title.Text                   = v.Title;
            ShowTitle.Checked            = v.ShowTitle;
            Description.Text             = v.Description;
            ShowDescriptionInVis.Checked = v.ShowDescription;

            CallerEditValueChangedEventHandler = callercallerEditValueChangedEventHandler;
        }
Exemple #13
0
        /// <summary>
        /// Changes cancelled, restore state
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void CancelButton_Click(object sender, EventArgs e)
        {
            V = (BarChartMsx)VisualMsx.Deserialize(OriginalChartState, Analysis);

            //if (SVM.ConfigureCount != OriginalConfigureCount) // reconfigure if config changed
            //	SVM.ConfigureRenderingControl();

            //else if (SVM.RefreshCount != OriginalRefreshCount) // refresh if other change
            //	SVM.Refresh();

            DialogResult = DialogResult.Cancel;
            return;
        }
Exemple #14
0
		/// <summary>
		/// Setup
		/// </summary>
		/// <param name="v"></param>

		public void Setup(
			VisualMsx v,
			SpotfireViewManager svm,
			EventHandler callerEditValueChangedEventHandler = null)
		{
			DataTableMsx mainDataTable = v?.Data?.DataTableReference;
			SVM = svm;

			MainDataTableSelectorControl.Setup(mainDataTable, SVP, callerEditValueChangedEventHandler);
			CallerEditValueChangedEventHandler = callerEditValueChangedEventHandler;

			return;
		}
Exemple #15
0
        private void VisPropsButton_Click(object sender, EventArgs e)
        {
            VisualMsx v = SpotfireSession.SpotfireApiClient?.GetActiveVisual();

            if (v == null)
            {
                return;
            }

            DialogResult dr = EditVisualProperties(v, SVP);

            return;
        }
Exemple #16
0
        /// <summary>
        /// Get visualization properties from form
        /// </summary>

        void GetFormValues()
        {
            VisualMsx v = V;             // update existing visual instance

            // General

            GeneralPropertiesPanel.GetValues(v);

            // Data
            // --- todo ---

            return;
        }
Exemple #17
0
        public static DialogResult EditVisualProperties(
            VisualMsx v,
            SpotfireViewProps svp)
        {
            DialogResult dr = DialogResult.Cancel;

            if (v == null)
            {
                return(DialogResult.Cancel);
            }

            else if (v is TablePlotMsx)
            {
                TablePlotPropertiesDialog.ShowDialog((TablePlotMsx)v, svp);
            }

            else if (v is BarChartMsx)
            {
                BarChartPropertiesDialog.ShowDialog((BarChartMsx)v, svp);
            }

            else if (v is ScatterPlotMsx)
            {
                ScatterPlotPropertiesDialog.ShowDialog((ScatterPlotMsx)v, svp);
            }

            else if (v is TreemapMsx)
            {
                TreemapPropertiesDialog.ShowDialog((TreemapMsx)v, svp);
            }

            else if (v is HeatMapMsx)
            {
                HeatMapPropertiesDialog.ShowDialog((HeatMapMsx)v, svp);
            }

            else if (v is TrellisCardVisualMsx)
            {
                TrellisCardPropertiesDialog.ShowDialog((TrellisCardVisualMsx)v, svp);
            }

            else
            {
                MessageBox.Show("Can't edit properties for a " + v.TypeId.DisplayName + " visualization", "Spotfire Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(dr);
        }
Exemple #18
0
        void ValidateViewInitialization()
        {
            if (SVM == null)
            {
                throw new Exception("ViewManager not defined");
            }

            SVM.ValidateSpotfireViewPropsInitialization();

            if (V == null)
            {
                V = new VisualMsx();
            }

            return;
        }
Exemple #19
0
        /// <summary>
        /// Get active visual properties
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void GetVisPropsButton_Click(object sender, EventArgs e)
        {
            Stopwatch sw = Stopwatch.StartNew();

            string serializedVisual = Api.GetVisualProperties("<activeVisual>");

            if (Lex.IsUndefined(serializedVisual))
            {
                return;
            }

            VisualMsx vixualMsx = VisualMsx.Deserialize(serializedVisual, Analysis);

            long ms = sw.ElapsedMilliseconds;

            StatusTextBox.Text += "Response: " + serializedVisual + "\r\nTime: " + ms + " ms.";
            return;
        }
Exemple #20
0
/// <summary>
/// Setup
/// </summary>
/// <param name="expr"></param>
/// <param name="svm"></param>
/// <param name="editValueChangedEventHandler"></param>

        public void Setup(
            AxisMsx axis,
            VisualMsx visual,
            SpotfireViewManager svm,
            EventHandler editValueChangedEventHandler = null)
        {
            Axis = axis;
            AxisExpressionList = AxisExpressionListMsx.Parse(axis.Expression);
            MultiExpressionSelectionAllowed = axis.MultiExpressionSelectionAllowed;             // (not correct)

            Visual = visual;

            SVM = svm;
            CallerEditValueChangedHandler = editValueChangedEventHandler;

            SetupLayoutPanel();

            return;
        }
Exemple #21
0
        /// <summary>
        /// Setup
        /// </summary>
        /// <param name="v"></param>

        public void Setup(
            VisualMsx v,
            SpotfireViewProps svp,
            EventHandler valueChangedCallback = null)
        {
            InSetup = true;

            Visual = v;
            SVP    = svp;

            DataTableMsx mainDataTable = v?.Data?.DataTableReference;

            MainDataTableSelectorControl.Setup(svp.Doc.Doc_Tables.TableList, mainDataTable, SVP, MainDataTableSelectorControl_EditValueChanged);
            ValueChangedCallback = valueChangedCallback;

            InSetup = false;

            return;
        }
Exemple #22
0
        private DialogResult ShowDialog2(
            VisualMsx v,
            SpotfireViewManager svm)
        {
            SVM = svm;
            V   = v;

            PropertyDialogsUtil.AdjustPropertyPageTabs(Tabs, TabPageSelector, TabsContainerPanel);;

            SetupForm();

            DialogResult dr = ShowDialog(SessionManager.ActiveForm);

            if (dr == DialogResult.Cancel)
            {
                return(dr);
            }

            return(dr);
        }
Exemple #23
0
        //public void SetupMessageSnatcher()
        //{
        //	MessageSnatcher = new MessageSnatcher(WebBrowser);
        //	MessageSnatcher.RightMouseClickOccured += BrowserControlRightMouseClickOccured;
        //}

        /// <summary>
        /// Rt-click picked up by MessageSnatcher
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        //private void BrowserControlRightMouseClickOccured(object sender, EventArgs e)
        //{
        //	DelayedCallback.Schedule(ShowVisContextMenu, e, 200); // schedule callback, need 200 ms to keep Spotfire selection rectangle from appearing
        //	return;
        //}

        private void ShowVisContextMenu(object state)
        {
            Point p = WindowsHelper.GetMousePosition();

            // Setup the menu

            VisualMsx v = SpotfireSession.SpotfireApiClient?.GetActiveVisual();

            if (SpotfireToolbar.CanEditVisualProperties(v))
            {
                VisualPropertiesMenuItem.Visible = true;
            }

            else
            {
                VisualPropertiesMenuItem.Visible = true;
            }

            WebBrowserRtClickContextMenu.Show(p);

            return;
        }
Exemple #24
0
        /// <summary>
        /// Setup
        /// </summary>
        /// <param name="view"></param>
        /// <param name="colorBy"></param>

        public void Setup(
            ColorAxisMsx colorAxis,
            VisualMsx visual,
            SpotfireViewProps spotfireViewProps,
            EventHandler editValueChangedEventHandler = null)
        {
            InSetup = true;

            SVP       = spotfireViewProps;
            Visual    = visual;
            ColorAxis = colorAxis;

            EditValueChanged = editValueChangedEventHandler;

            ColumnsSelector.Setup(ColorAxis, Visual, SVP, EditValueChanged);

            //ColorBy = colorBy;
            //FixedColor.Color = colorBy.FixedColor;
            //BorderColor.Color = colorBy.BorderColor;

            //SetupColorSchemeGrid(colorBy.QueryColumn, View);

            if (Lex.IsDefined(ColorAxis.Expression))
            {
                ColorByColumn.Checked = true;
            }
            else
            {
                ColorByFixedColor.Checked = true;
            }

            //ColumnValueContainsColor.Checked = colorBy.FieldValueContainsColor;

            InSetup = false;
            return;
        }
Exemple #25
0
        /// <summary>
        /// Setup options for an axis
        /// </summary>
        /// <param name="axis"></param>
        /// <param name="svm"></param>

        public void Setup(
            ScaleAxisMsx axis,
            VisualMsx visual,
            SpotfireViewProps svp,
            EventHandler editValueChangedEventHandler = null)
        {
            InSetup = true;

            Axis   = axis;
            Visual = visual;
            SVP    = svp;
            ValueChangedCallback = editValueChangedEventHandler;

            ColumnSelector.Setup(axis, visual, svp, EditValueChanged);

// Range

            if (axis.Range.Low == null)
            {
                RangeMin.Text = "Automatic";
            }
            else
            {
                RangeMin.Text = axis.Range.Low.ToString();
            }

            if (axis.Range.High == null)
            {
                RangeMax.Text = "Automatic";
            }
            else
            {
                RangeMax.Text = axis.Range.High.ToString();
            }

            IncludeOrigin.Checked  = axis.IncludeZeroInAutoZoom;
            ShowZoomSlider.Checked = Axis.ManualZoom;
            ShowGridLines.Checked  = Axis.Scale.ShowGridlines;

// Labels

            ShowLabels.Checked = Axis.Scale.ShowLabels;
            if (Axis.Scale.LabelOrientation == LabelOrientationMsx.Horizontal)
            {
                HorizontalLabels.Checked = true;
            }
            else
            {
                VerticalLabels.Checked = true;
            }

            bool usingMaxTickLayout = (Axis.Scale.LabelLayout == ScaleLabelLayoutMsx.MaximumNumberOfTicks);

            MaxNumberOfLabels.Checked = usingMaxTickLayout;
            MaxNumberOfTicks.Enabled  = usingMaxTickLayout;
            MaxNumberOfTicks.Value    = Axis.Scale.MaximumNumberOfTicks;

// Scaling

            LogScale.Checked     = axis.TransformType == AxisTransformTypeMsx.Log10;
            ReverseScale.Checked = axis.Reversed;

            InSetup = false;

            return;
        }
Exemple #26
0
        /// <summary>
        /// Setup the dropdown for a Column(s) expression
        /// </summary>
        /// <param name="parsedColExpr"></param>
        /// <param name="axis"></param>
        /// <param name="visual"></param>
        /// <param name="b"></param>
        /// <param name="parentColumnExressionSelectorControl"></param>
        /// <param name="callerEditValueChanged"></param>

        public void Setup(
            ParsedColumnExpressionMsx parsedColExpr,
            AxisMsx axis,
            VisualMsx visual,
            DropDownButton b,
            ColumnsSelector parentColumnExressionSelectorControl,
            EventHandler callerEditValueChanged = null)
        {
            InSetup = true;

            ParsedColExpr = parsedColExpr;
            Axis          = axis;
            Visual        = visual;

            InvokingButton         = b;
            PC                     = parentColumnExressionSelectorControl;
            SVM                    = PC.SVM;
            CallerEditValueChanged = callerEditValueChanged;

            DataTableMsx dt = GetSelectorDataTable();

            if (dt != null)
            {
                TableSelector.Name = dt.Name;
            }
            else
            {
                TableSelector.Name = "";
            }

            List <DataTableMsx> tables = Axis.GetAllowedDataTables();

            ColumnList.Items.Clear();

            string selectedColName = null;

            if (parsedColExpr.ColumnNames.Count > 0)
            {
                selectedColName = parsedColExpr.ColumnNames[0];
            }

            foreach (DataColumnMsx col in dt.Columns)
            {
                CheckedListBoxItem item = new CheckedListBoxItem();
                item.Description = col.Name;
                if (Lex.Eq(col.Name, selectedColName))
                {
                    item.CheckState = CheckState.Checked;
                }

                ColumnList.Items.Add(item);
            }

            //DataMapControl.ShowSelectedColumnCheckBoxes = true;
            //DataMapControl.SelectSingleColumn = true;
            //DataMapControl.ShowTableControls = false;
            //DataMapControl.Setup(SVM, DataMapSelectedColumnChanged);

            ////DataMapControl.MobiusTableNameCol.Visible = false;
            ////DataMapControl.MobiusColNameCol.Visible = false;

            //DataMapControl.FieldGridView.OptionsView.ColumnAutoWidth = false;
            ////DataMapControl.FieldGridView.OptionsView.ShowColumnHeaders = false;

            InSetup = false;

            return;
        }