Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextBoxContainer&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="container">Panel where <see cref="EditableTextBox">EditableTextBoxes</see>
 /// are created</param>
 /// <param name="xCaseCanvas"><see cref="XCaseCanvas"/> containing the control</param>
 public TextBoxContainer(Panel container, ExolutioCanvas exolutioCanvas, DiagramView diagramView)
 {
     if (container == null)
     {
         throw new ArgumentNullException("container");
     }
     if (exolutioCanvas == null)
     {
         throw new ArgumentNullException("exolutioCanvas");
     }
     this.container      = container;
     this.ExolutioCanvas = exolutioCanvas;
     this.DiagramView    = diagramView;
 }
Beispiel #2
0
        protected override void CreateInnerControls(ExolutioCanvas canvas)
        {
            base.CreateInnerControls(canvas);

            foldingButton = new FoldingButton();
            MainNode.InnerConnectorControl.Children.Add(foldingButton);
            Canvas.SetBottom(foldingButton, -15);
            foldingButton.Click += delegate { this.ViewHelper.IsFolded = !this.ViewHelper.IsFolded; };

            #region main node content components
            border = new Border
            {
                BorderBrush     = ViewToolkitResources.NodeBorderBrush,
                BorderThickness = ViewToolkitResources.Thickness1,
                Background      = ViewToolkitResources.NoInterpretationBrush,
                Opacity         = ViewToolkitResources.LittleOpaque,
                Padding         = ViewToolkitResources.Thickness0,
                CornerRadius    = new CornerRadius(15)
            };
            MainNode.InnerContentControl.Content = border;
            MainNode.MinWidth = 50;

            stackPanel = new StackPanel
            {
                Orientation = Orientation.Vertical
            };
            border.Child = stackPanel;

            tbContentModelHeader = new EditableTextBox
            {
                FontWeight    = FontWeights.Bold,
                TextAlignment = TextAlignment.Center,
                Background    = ViewToolkitResources.TransparentBrush,
                FontSize      = 15,
            };

            stackPanel.Children.Add(tbContentModelHeader);

            #endregion

            ExolutioContextMenu exolutioContextMenu = MenuHelper.GetContextMenu(ScopeAttribute.EScope.PSMContentModel, this.DiagramView.Diagram);
            ContextMenu = exolutioContextMenu;

#if SILVERLIGHT
            ContextMenuService.SetContextMenu(tbContentModelHeader, ContextMenu);
#endif
        }
Beispiel #3
0
 /// <summary>
 /// Creates new instance of <see cref="PIMAttributesContainer" />.
 /// </summary>
 /// <param name="container">Panel used to display the items</param>
 /// <param name="exolutioCanvas">canvas owning the control</param>
 public PSMAttributesContainer(Panel container, ExolutioCanvas exolutioCanvas, DiagramView diagramView)
     : base(container, exolutioCanvas, diagramView)
 {
 }
Beispiel #4
0
 /// <summary>
 /// Creates new instance of <see cref="PIMOperationsContainer" />.
 /// </summary>
 /// <param name="container">Panel used to display the items</param>
 /// <param name="exolutioCanvas">canvas owning the control</param>
 public PIMOperationsContainer(Panel container, ExolutioCanvas exolutioCanvas, DiagramView diagram)
     : base(container, exolutioCanvas, diagram)
 {
 }
Beispiel #5
0
        protected override void CreateInnerControls(ExolutioCanvas canvas)
        {
            base.CreateInnerControls(canvas);

            foldingButton = new FoldingButton();
            MainNode.InnerConnectorControl.Children.Add(foldingButton);
            Canvas.SetBottom(foldingButton, -15);
            foldingButton.Click += delegate { this.ViewHelper.IsFolded = !this.ViewHelper.IsFolded; };

            #region main node content components
            border = new Border
            {
                BorderBrush       = ViewToolkitResources.NodeBorderBrush,
                BorderThickness   = ViewToolkitResources.Thickness1,
                VerticalAlignment = VerticalAlignment.Stretch,
                Opacity           = ViewToolkitResources.LittleOpaque
            };
            MainNode.InnerContentControl.Content = border;

            stackPanel = new StackPanel
            {
                Orientation = Orientation.Vertical
            };
            border.Child = stackPanel;

            Border headerBorder = new Border
            {
                Background      = ViewToolkitResources.NoInterpretationBrush,
                BorderThickness = ViewToolkitResources.Thickness0,
                Padding         = ViewToolkitResources.Thickness2,
                BorderBrush     = ViewToolkitResources.BlackBrush
            };

            tbClassHeader = new EditableTextBox
            {
                FontWeight    = FontWeights.Bold,
                TextAlignment = TextAlignment.Center,
                Background    = ViewToolkitResources.NoInterpretationBrush,
                FontSize      = 15,
            };

            headerBorder.Child = tbClassHeader;
            stackPanel.Children.Add(headerBorder);

            Border attributesBorder = new Border
            {
                BorderBrush = ViewToolkitResources.BlackBrush,
                Visibility  = Visibility.Collapsed,
                Background  = ViewToolkitResources.ClassBody
            };
            StackPanel attributesSection = new StackPanel
            {
                Background = ViewToolkitResources.ClassBody
            };
            attributesBorder.Child = attributesSection;

            stackPanel.Children.Add(attributesBorder);
            //Border operationsBorder = new Border
            //{
            //    BorderBrush = ViewToolkitResources.BlackBrush,
            //    Visibility = Visibility.Collapsed,
            //    Background = ViewToolkitResources.SeaShellBrush
            //};

            //StackPanel operationsSection = new StackPanel
            //{
            //    Background = ViewToolkitResources.SeaShellBrush
            //};
            //operationsBorder.Child = operationsSection;
            //stackPanel.Children.Add(operationsBorder);

            //Border[] stackBorders = new Border[] { headerBorder, attributesBorder };
            //ITextBoxContainer[] stackContainers = new ITextBoxContainer[] { attributesContainer };
            //attributesContainer.StackBorders = stackBorders;
            //attributesContainer.StackContainers = stackContainers;
            //classOperations.StackBorders = stackBorders;
            //classOperations.StackContainers = stackContainers;

            #endregion

            ExolutioContextMenu exolutioContextMenu = MenuHelper.GetContextMenu(ScopeAttribute.EScope.PSMSchemaClass, this.DiagramView.Diagram);
            exolutioContextMenu.ScopeObject = PSMSchemaClass;
            exolutioContextMenu.Diagram     = DiagramView.Diagram;
            ContextMenu = exolutioContextMenu;

#if SILVERLIGHT
            ContextMenuService.SetContextMenu(headerBorder, ContextMenu);
#else
            headerBorder.ContextMenu  = ContextMenu;
            tbClassHeader.MouseEnter += tbClassHeader_MouseEnter;
            tbClassHeader.MouseLeave += tbClassHeader_MouseLeave;
#endif
        }
Beispiel #6
0
        protected override void CreateInnerControls(ExolutioCanvas canvas)
        {
            base.CreateInnerControls(canvas);
            #region main node content components
            border = new Border
            {
                BorderBrush       = ViewToolkitResources.NodeBorderBrush,
                BorderThickness   = ViewToolkitResources.Thickness1,
                VerticalAlignment = VerticalAlignment.Stretch,
                Opacity           = ViewToolkitResources.LittleOpaque
            };
            MainNode.InnerContentControl.Content = border;

            stackPanel = new StackPanel
            {
                Orientation = Orientation.Vertical
            };
            border.Child = stackPanel;

            Border headerBorder = new Border
            {
                Background      = ViewToolkitResources.ClassHeader,
                BorderThickness = ViewToolkitResources.Thickness0,
                Padding         = ViewToolkitResources.Thickness2,
                BorderBrush     = ViewToolkitResources.BlackBrush
            };

            tbClassHeader = new EditableTextBox
            {
                FontWeight    = FontWeights.Bold,
                TextAlignment = TextAlignment.Center,
                Background    = ViewToolkitResources.ClassHeader,
                FontSize      = 15,
            };

            headerBorder.Child = tbClassHeader;
            stackPanel.Children.Add(headerBorder);

            Border attributesBorder = new Border
            {
                BorderBrush = ViewToolkitResources.BlackBrush,
                Visibility  = Visibility.Collapsed,
                Background  = ViewToolkitResources.ClassBody
            };
            Border operationsBorder = new Border
            {
                BorderBrush = ViewToolkitResources.BlackBrush,
                Visibility  = Visibility.Collapsed,
                Background  = ViewToolkitResources.ClassBody
            };
            StackPanel attributesSection = new StackPanel
            {
                Background = ViewToolkitResources.ClassBody
            };
            StackPanel operationsSection = new StackPanel
            {
                Background = ViewToolkitResources.ClassBody
            };
            attributesBorder.Child = attributesSection;
            operationsBorder.Child = operationsSection;
            attributesContainer    = new PIMAttributesContainer(attributesSection, canvas, DiagramView);
            operationsContainer    = new PIMOperationsContainer(operationsSection, canvas, DiagramView);

            stackPanel.Children.Add(attributesBorder);
            stackPanel.Children.Add(operationsBorder);

            Border[]            stackBorders    = new Border[] { headerBorder, attributesBorder, operationsBorder };
            ITextBoxContainer[] stackContainers = new ITextBoxContainer[] { attributesContainer, operationsContainer };
            attributesContainer.StackBorders    = stackBorders;
            attributesContainer.StackContainers = stackContainers;
            operationsContainer.StackBorders    = stackBorders;
            operationsContainer.StackContainers = stackContainers;

            #endregion

            ExolutioContextMenu exolutioContextMenu = MenuHelper.GetContextMenu(ScopeAttribute.EScope.PIMClass, this.DiagramView.Diagram);
            ContextMenu = exolutioContextMenu;

#if SILVERLIGHT
            ContextMenuService.SetContextMenu(tbClassHeader, ContextMenu);
            DoubleClickSupplement dc = new DoubleClickSupplement();
            tbClassHeader.MouseLeftButtonDown += dc.Click;
            dc.DoubleClickW += tbClassHeader_MouseDoubleClick;
#else
            tbClassHeader.MouseDoubleClick += tbClassHeader_MouseDoubleClick;
#endif
        }
 protected virtual void CreateInnerControls(ExolutioCanvas canvas)
 {
 }