Example #1
0
        private void ComposeGeo(DrawingContext drawingContext)
        {
            rectWidth  = Configurations.PreviewBubbleGeoSize;
            rectHeight = Configurations.PreviewBubbleGeoSize;
            BitmapSource image = this.content as BitmapSource;

            if (null != image)
            {
                rectWidth  = image.PixelWidth;
                rectHeight = image.PixelHeight;
            }

            rectPoint = new Point((int)(anchorPoint.X - rectWidth / 2),
                                  (int)(anchorPoint.Y + Configurations.InfoBubbleArrowHeight));

            //Draw Bubble
            Brush backgroundColor;
            Pen   borderPen;

            if (this.previewType.HasFlag(PreviewTypes.Collapsed))
            {
                backgroundColor = Configurations.PreviewBubbleMinGeoBackground;
                borderPen       = borderPen = Configurations.PreviewBubbleMinGeoBorderPen;
            }
            else
            {
                backgroundColor = Configurations.PreviewBubbleGeoBackground;
                borderPen       = borderPen = Configurations.PreviewBubbleGeoBorderPen;
            }
            base.DrawBubble(drawingContext, backgroundColor, borderPen, !this.previewType.HasFlag(PreviewTypes.Collapsed));

            if (!this.previewType.HasFlag(PreviewTypes.Collapsed))
            {
                Rect newRect = new Rect(rectPoint, new Size(rectWidth, rectHeight));
                // @TODO(Ben): Remove "ResourceNames.RadialBlueImagePath" if needed.
                // string imagePath = ResourceNames.RadialBlueImagePath;
                drawingContext.DrawImage(image, newRect);

                //Draw Context Menu
                Point p = new Point(rectPoint.X + rectWidth, rectPoint.Y);
                p.Offset(0, Configurations.ContextMenuMargin);
                DrawingUtilities.DrawDots(drawingContext, DotTypes.Top | DotTypes.TopRight | DotTypes.MiddleRight, p, Core.AnchorPoint.TopRight, false);
            }
        }
Example #2
0
        protected override void ComposeCore(System.Windows.Media.DrawingContext drawingContext, System.Windows.Media.DrawingVisual visual)
        {
            this.nodeDimension.Width  = Configurations.NodeWidthRender;
            this.nodeDimension.Height = Configurations.NodeHeightRender;

            base.ComposeCore(drawingContext, visual);

            //NorthEast
            Point p = new Point(0, 0);

            p.Offset(Width, Configurations.ContextMenuMargin);
            DrawingUtilities.DrawDots(drawingContext, DotTypes.Top | DotTypes.TopRight | DotTypes.MiddleRight, p, AnchorPoint.TopRight, false);
            //NorthWest
            p = new Point(0, 0);
            p.Offset(Configurations.ContextMenuMargin, Configurations.ContextMenuMargin);
            DrawingUtilities.DrawDots(drawingContext, DotTypes.TopLeft | DotTypes.Top | DotTypes.MiddleLeft, p, AnchorPoint.TopLeft, false);
            //OutputSlots
            p = new Point(0, 0);
            p.Offset(Width, Height - Configurations.ContextMenuMargin);
            DrawingUtilities.DrawDots(drawingContext, DotTypes.TopRight | DotTypes.MiddleRight | DotTypes.BottomRight, p, AnchorPoint.BottomRight, false);
        }
Example #3
0
        private void DrawSelectionBox(double width, double height)
        {
            //headless mode, return
            if (this.visualHost == null)
            {
                return;
            }
            DrawingVisual  visual         = this.visualHost.GetDrawingVisualForSelectionBox();
            DrawingContext drawingContext = visual.RenderOpen();
            Rect           rect           = new Rect(new Size(width, height));

            drawingContext.DrawRectangle(Configurations.SelectionBoxBackgroundColor, Configurations.SelectionBoxPen, rect);

            Point p = new Point(-1, 2);

            p.Offset(width, 0);
            DrawingUtilities.DrawDots(drawingContext, DotTypes.Top | DotTypes.TopRight | DotTypes.MiddleRight, p, AnchorPoint.TopRight, false);

            drawingContext.Close();

            this.width  = width;
            this.height = height;
        }
Example #4
0
        protected override void ComposeCore(DrawingContext drawingContext, DrawingVisual visual)
        {
            double textWidth    = Utilities.GetTextWidth(this.Text);
            double captionWidth = Utilities.GetTextWidth(this.Caption);
            string tempText     = string.Empty;

            if (this.Text.Count() > 25)
            {
                tempText  = this.Text.Substring(0, 25);
                tempText += "...";
                textWidth = Utilities.GetTextWidth(tempText);
            }
            else
            {
                tempText = this.Text;
            }

            //CenterLine
            this.centerLine = Configurations.FunctionNodeCenterLine + this.GetSlotWidth() + (int)GetMaxReplicationTextWidth();

            //Node width
            if (textWidth > captionWidth)
            {
                this.nodeDimension.Width = (int)(Configurations.NodeWidthFunction + this.centerLine + textWidth + 1);
            }
            else
            {
                this.nodeDimension.Width = (int)(Configurations.NodeWidthFunction + this.centerLine + captionWidth + 1);
            }

            //Node height
            this.nodeDimension.Height = Configurations.NodeHeightFunction + 2;
            if (this.inputSlots.Count > 1)
            {
                this.nodeDimension.Height = this.inputSlots.Count * Configurations.SlotStripeSize + 1;
            }
            //the +2 is due to the 2 1px horizontal lines at the top and bottom of the node

            base.ComposeCore(drawingContext, visual);

            //Shade
            double offset  = this.centerLine;
            double xOffset = Configurations.TextHorizontalOffset;
            Point  p1      = new Point(offset, 1);
            Rect   shaded  = new Rect(p1, new Size(this.Width - offset, this.Height - 1));

            drawingContext.DrawRectangle(Configurations.RectGrey, Configurations.NoBorderPen, shaded);

            //Horzontal line
            p1 = new Point((int)offset + xOffset, Math.Ceiling(this.Height / 2));
            Point p2 = new Point((int)this.Width - xOffset, Math.Ceiling(this.Height / 2));

            p1.Offset(0, 0.5);
            p2.Offset(0, 0.5);
            drawingContext.DrawLine(Configurations.BorderPen, p1, p2);

            //Draw text
            Point pt = new Point(offset + (this.Width - offset) / 2 - captionWidth / 2, ((this.Height) / 4) - Configurations.TextSize / 2 - 3);

            Utilities.DrawText(drawingContext, this.Caption, pt, Configurations.TextNormalColor);
            pt.Y += ((this.Height) / 2); //-1
            pt.X  = offset + (this.Width - offset) / 2 - textWidth / 2;
            Utilities.DrawBoldText(drawingContext, tempText, pt);

            pt.Y += this.Height / 2;
            pt.X += Configurations.TextOffset;

            //Vertical line
            p1 = new Point(offset, 1);
            p2 = new Point(offset, this.Height);
            p1.Offset(0.5, 0);
            p2.Offset(0.5, 0);
            drawingContext.DrawLine(Configurations.BorderPen, p1, p2);

            //Shade slots
            p1 = new Point(1, 1);
            Size slotSize = new Size(offset - 1, Configurations.SlotStripeSize);
            Rect slotRect = new Rect(p1, slotSize);

            if (this.inputSlots.Count == 1)
            {
                slotSize.Height = this.Height - 1;
                slotRect        = new Rect(p1, slotSize);
                if (hoveredIndex == 0)
                {
                    drawingContext.DrawRectangle(Configurations.RectHighlighted, Configurations.NoBorderPen, slotRect);
                    hoveredIndex = int.MaxValue;
                }
                else
                {
                    drawingContext.DrawRectangle(Configurations.RectWhite, Configurations.NoBorderPen, slotRect);
                }
            }
            else
            {
                for (int i = 0; i < this.inputSlots.Count; i++)
                {
                    slotRect = new Rect(p1, slotSize);
                    if (hoveredIndex == i)
                    {
                        drawingContext.DrawRectangle(Configurations.RectHighlighted, Configurations.NoBorderPen, slotRect);
                        hoveredIndex = int.MaxValue;
                    }
                    else if (i % 2 == 0)
                    {
                        drawingContext.DrawRectangle(Configurations.RectWhite, Configurations.NoBorderPen, slotRect);
                    }
                    else
                    {
                        drawingContext.DrawRectangle(Configurations.SlotBackground, Configurations.NoBorderPen, slotRect);
                    }
                    int temp = (int)this.Height / this.inputSlots.Count;
                    p1.Y += temp;
                }
            }

            //DrawDots
            //NorthEast
            Point p = new Point(0, 0);

            p.Offset(this.Width, Configurations.ContextMenuMargin);
            if (dotsFlag.HasFlag(MenuDots.NorthEast))
            {
                DrawingUtilities.DrawDots(drawingContext, DotTypes.Top | DotTypes.TopRight | DotTypes.MiddleRight, p, AnchorPoint.TopRight, false);
            }
            //North
            p = new Point(0, 0);
            p.Offset(this.centerLine + Configurations.ContextMenuMargin, Configurations.ContextMenuMargin);
            if (dotsFlag.HasFlag(MenuDots.North))
            {
                DrawingUtilities.DrawDots(drawingContext, DotTypes.TopLeft | DotTypes.Top | DotTypes.MiddleLeft, p, AnchorPoint.TopLeft, false);
            }
            //South
            p = new Point(0, 0);
            p.Offset(this.centerLine + Configurations.ContextMenuMargin, this.Height);
            if (dotsFlag.HasFlag(MenuDots.South))
            {
                DrawingUtilities.DrawDots(drawingContext, DotTypes.MiddleLeft | DotTypes.BottomLeft | DotTypes.Bottom, p, AnchorPoint.BottomLeft, false);
            }
            //NorthWest
            p = new Point(0, 0);
            p.Offset(Configurations.ContextMenuMargin, Configurations.ContextMenuMargin);
            DrawingUtilities.DrawDots(drawingContext, DotTypes.TopLeft | DotTypes.Top | DotTypes.MiddleLeft, p, AnchorPoint.TopLeft, false);
            //OutputSlot
            p    = new Point(this.Width, (this.Height / 4));
            p.Y += (this.Height / 2) - 1;
            DrawingUtilities.DrawDots(drawingContext, DotTypes.TopRight | DotTypes.MiddleRight | DotTypes.BottomRight, p, AnchorPoint.TopRight, false);
            //OutputSlotHittestPixels
            p.Y -= (this.Height / 4) - 1;
            drawingContext.DrawRectangle(Configurations.SlotHitTestColor, Configurations.NoBorderPen, new Rect(p, new Size(Configurations.HittestPixels, this.Height / 2)));

            //InputSlots//InputLabels
            int slotCount = this.inputSlots.Count;

            p1 = new Point(-1, 1);
            p2 = new Point(Configurations.TextHorizontalOffset + Configurations.TextOffset, 1);
            if (slotCount == 1)
            {
                p1.Y += (this.Height / 2) - (Configurations.SlotSize / 2);
                p2.Y += (this.Height / 2) - (Configurations.SlotSize / 2) - (Configurations.TextSize / 2);
                Utilities.DrawText(drawingContext, this.argumentNames[0], p2, Configurations.TextNormalColor);
                Utilities.DrawSlot(drawingContext, p1);
            }
            else if (slotCount > 1)
            {
                int j = 0;
                p1.Y += (Configurations.SlotStripeSize / 2) - (Configurations.SlotSize / 2);
                p2.Y += (Configurations.SlotStripeSize / 2) - (Configurations.SlotSize / 2) - (Configurations.TextSize / 2);
                foreach (uint slotId in this.inputSlots)
                {
                    Utilities.DrawSlot(drawingContext, p1);
                    Utilities.DrawText(drawingContext, this.argumentNames[j++], p2, Configurations.TextNormalColor);
                    p1.Y += Configurations.SlotStripeSize;
                    p2.Y += Configurations.SlotStripeSize;
                }
            }

            //Preview
            if (this.previewBubble != null)
            {
                this.previewBubble.Compose();
            }

            //Replication guides
            p = new Point(this.centerLine - 5, 2);
            double characterWidth = Utilities.GetTextWidth("8");

            p.X -= GetMaxReplicationTextWidth();
            p.Y += (Configurations.SlotStripeSize / 2) - (Configurations.SlotSize / 2) - (Configurations.TextSize / 2);
            Rect repRect = new Rect(new Size(Configurations.ReplicationGuideWidth, Configurations.SlotStripeSize));

            int argCount = this.inputSlots.Count;
            int index    = 0;

            foreach (string str in replicationGuideStrings)
            {
                if (string.IsNullOrEmpty(str) && index < argCount)
                {
                    Point newPoint = p;
                    newPoint.Offset(Configurations.TextHorizontalOffset + 3, Configurations.SlotStripeSize / 2 - 2);
                    drawingContext.DrawRectangle(Configurations.SquareColor, null, new Rect(newPoint, new Size(4, 4)));
                }

                SolidColorBrush textColor = Configurations.TextNormalColor;
                //if (this.replicationErrorIndex.Contains(index) == true)
                //    textColor = Configurations.TextErrorColor;

                Utilities.DrawText(drawingContext, str, p, textColor);
                p.Y += Configurations.SlotStripeSize;
                index++;
            }
        }
Example #5
0
        protected override void ComposeCore(DrawingContext drawingContext, DrawingVisual visual)
        {
            double captionWidth = Utilities.GetTextWidth(this.Caption);
            double textWidth    = Utilities.GetTextWidth(this.Text);
            string tempCaption  = string.Empty;
            string tempText     = string.Empty;

            if (this.Caption.Count() > 25)
            {
                tempCaption  = this.Caption.Substring(0, 25);
                tempCaption += "...";
                captionWidth = Utilities.GetTextWidth(tempCaption);
            }
            else
            {
                tempCaption = this.Caption;
            }

            if (this.Text.Count() > 25)
            {
                tempText  = this.Text.Substring(0, 25);
                tempText += "...";
                textWidth = Utilities.GetTextWidth(tempText);
            }
            else
            {
                tempText = this.Text;
            }

            if (this.Text == string.Empty)
            {
                this.Text = Configurations.DriverInitialTextValue;
            }

            this.centerLine           = Configurations.DriverNodeCenterLine + captionWidth;
            this.nodeDimension.Width  = Configurations.NodeWidthDriver + this.centerLine + textWidth;
            this.nodeDimension.Height = Configurations.NodeHeightDriver;

            base.ComposeCore(drawingContext, visual);
            double offset = this.centerLine;

            //Shade
            Rect shaded = new Rect(new Point(1, 1), new Size(offset, this.Height - 1));

            drawingContext.DrawRectangle(Configurations.RectGrey, Configurations.NoBorderPen, shaded);

            //Draw control dots
            //NorthEast
            Point p = new Point(0, 0);

            p.Offset(this.Width, Configurations.ContextMenuMargin);
            //DrawingUtilities.DrawDots(drawingContext, DotTypes.Top | DotTypes.TopRight | DotTypes.MiddleRight, p, AnchorPoint.TopRight, false);
            //OutputSlot
            p = new Point(0, 0);
            p.Offset(this.Width, ((this.Height - 2) / 2) - 1);
            DrawingUtilities.DrawDots(drawingContext, DotTypes.TopRight | DotTypes.MiddleRight | DotTypes.BottomRight, p, AnchorPoint.TopRight, false);
            p.Y -= Configurations.SlotSize;
            drawingContext.DrawRectangle(Configurations.SlotHitTestColor, Configurations.NoBorderPen, new Rect(p, new Size(Configurations.OutputHittestPixels, Configurations.SlotStripeSize)));
            //North
            p = new Point(0, 0);
            p.Offset(this.centerLine + 3, Configurations.ContextMenuMargin);
            //DrawingUtilities.DrawDots(drawingContext, DotTypes.TopLeft | DotTypes.Top | DotTypes.MiddleLeft, p, AnchorPoint.TopLeft, false);
            //NorthWest
            p = new Point(0, 0);
            p.Offset(Configurations.ContextMenuMargin, Configurations.ContextMenuMargin);
            //DrawingUtilities.DrawDots(drawingContext, DotTypes.TopLeft | DotTypes.Top | DotTypes.MiddleLeft, p, AnchorPoint.TopLeft, false);

            //Draw vertical line
            Point p1 = new Point((int)offset, 0);
            Point p2 = new Point((int)offset, (int)this.Height);

            p1.Offset(0.5, 0);
            p2.Offset(0.5, 0);
            drawingContext.DrawLine(Configurations.BorderPen, p1, p2);

            Utilities.DrawBoldText(drawingContext, tempCaption, new Point(this.centerLine / 2 - (captionWidth / 2), ((this.Height - 2) / 2) - Configurations.TextSize / 2));
            Utilities.DrawText(drawingContext, tempText, new Point(offset + (Configurations.NodeWidthDriver + textWidth) / 2 - textWidth / 2, ((this.Height - 2) / 2) - Configurations.TextSize / 2), Configurations.TextNormalColor);
        }
        protected override void ComposeCore(System.Windows.Media.DrawingContext drawingContext, System.Windows.Media.DrawingVisual visual)
        {
            double captionWidth = Utilities.GetTextWidth(this.Caption);
            string tempText     = string.Empty;

            if (this.Caption.Count() > 25)
            {
                tempText     = this.Caption.Substring(0, 25);
                tempText    += "...";
                captionWidth = Utilities.GetTextWidth(tempText);
            }
            else
            {
                tempText = this.Caption;
            }

            this.nodeDimension.Width  = Configurations.NodeWidthIdentifer + captionWidth + 2;
            this.nodeDimension.Height = Configurations.NodeHeightIdentifier;
            base.ComposeCore(drawingContext, visual);
            RectangleGeometry roundedRect = new RectangleGeometry();

            Rect rect = new Rect(new Point(1, 1), new Size((int)(this.nodeDimension.Width - 1), (int)(this.nodeDimension.Height - 1)));

            drawingContext.DrawRectangle(Configurations.RectGrey, Configurations.NoBorderPen, rect);

            Point pt = new Point(Configurations.TextHorizontalOffset + 2, Configurations.TextVerticalOffset + 2);

            Utilities.DrawBoldText(drawingContext, tempText, pt);

            //NorthEast
            Point p = new Point(0, 0);

            p.Offset(this.Width, Configurations.ContextMenuMargin);
            if (dotsFlag.HasFlag(MenuDots.NorthEast))
            {
                DrawingUtilities.DrawDots(drawingContext, DotTypes.Top | DotTypes.TopRight | DotTypes.MiddleRight, p, AnchorPoint.TopRight, false);
            }
            //OutputSlot
            p = new Point(0, 0);
            p.Offset(this.Width, ((this.Height - 2) / 2) - 1);
            DrawingUtilities.DrawDots(drawingContext, DotTypes.BottomRight | DotTypes.MiddleRight | DotTypes.TopRight, p, AnchorPoint.TopRight, false);
            p.Y -= Configurations.SlotSize;
            drawingContext.DrawRectangle(Configurations.SlotHitTestColor, Configurations.NoBorderPen, new Rect(p, new Size(Configurations.OutputHittestPixels, Configurations.SlotStripeSize)));
            //NorthWest
            p = new Point(0, 0);
            p.Offset(Configurations.ContextMenuMargin, Configurations.ContextMenuMargin);
            if (dotsFlag.HasFlag(MenuDots.NorthWest))
            {
                DrawingUtilities.DrawDots(drawingContext, DotTypes.TopLeft | DotTypes.Top | DotTypes.MiddleLeft, p, AnchorPoint.TopLeft, false);
            }

            //InputSlots
            if (this.InputSlotIsVisible())
            {
                double y = Configurations.NodeHeightIdentifier / 2;
                y -= Configurations.SlotSize / 2;
                Point p1 = new Point(-1, y);
                Utilities.DrawSlot(drawingContext, p1);
            }

            //Preview bubble
            if (this.previewBubble != null)
            {
                this.previewBubble.Compose();
            }
        }
Example #7
0
        private void ComposeValue(DrawingContext drawingContext)
        {
            Brush backgroundColor = null;
            Pen   borderPen       = null;

            if (!previewType.HasFlag(PreviewTypes.Extended))  // only need to condensed bubble
            {
                string text  = Configurations.PreviewBubbleTextDefault;
                string text2 = "";
                if (condensedString != null && condensedString.Count > 0)
                {
                    text = condensedString[0];
                    if (condensedString.Count() > 1)
                    {
                        text2 = condensedString[1];
                    }
                }

                FormattedText newText;
                FormattedText newText2;
                double        textLength;

                SolidColorBrush textColor;
                int             textHorizontalMargin = Configurations.InfoBubbleMargin;
                int             textVerticalMargin   = Configurations.InfoBubbleMargin;

                textColor = Configurations.PreviewBubbleCondensedTextColor;

                newText = new FormattedText(text,
                                            Configurations.culture,
                                            FlowDirection.LeftToRight,
                                            Configurations.TypeFace,
                                            Configurations.InfoBubbleText,
                                            textColor);
                newText2 = new FormattedText(text2,
                                             Configurations.culture,
                                             FlowDirection.LeftToRight,
                                             Configurations.TypeFace,
                                             Configurations.InfoBubbleText,
                                             textColor);

                if (this.content == null)
                {
                    newText.SetFontStyle(FontStyles.Italic);
                }

                newText.LineHeight = Configurations.InfoBubbleText;
                textLength         = Math.Max(newText.WidthIncludingTrailingWhitespace, newText2.WidthIncludingTrailingWhitespace);

                rectWidth = (int)(textLength + 2 * textHorizontalMargin);
                if (rectWidth < Configurations.InfoBubbleMinWidth)
                {
                    rectWidth = Configurations.InfoBubbleMinWidth;
                }
                if (this.previewType.HasFlag(PreviewTypes.Extended))
                {
                    rectWidth += Configurations.PreviewBubbleExtendedScrollBarWidth;
                    if (rectWidth > Configurations.InfoBubbleMaxWidth)
                    {
                        rectWidth = Configurations.InfoBubbleMaxWidth;
                    }
                }

                rectHeight = (int)(textVerticalMargin * 2 + newText.Height);
                if (text2 != "")
                {
                    rectHeight += Configurations.InfoBubbleText + textVerticalMargin;
                }
                if (rectHeight > Configurations.InfoBubbleMaxHeight)
                {
                    rectHeight = Configurations.InfoBubbleMaxHeight;
                }

                backgroundColor = Configurations.PreviewBubbleCondensedBackground;
                borderPen       = Configurations.PreviewBubbleCondensedBorderPen;

                rectPoint = new Point((int)(anchorPoint.X - rectWidth / 2) + 0.5, (int)(anchorPoint.Y + Configurations.InfoBubbleArrowHeight) + 0.5);

                //Draw Bubble
                base.DrawBubble(drawingContext, backgroundColor, borderPen, !this.previewType.HasFlag(PreviewTypes.Collapsed));

                if (!this.previewType.HasFlag(PreviewTypes.Collapsed))
                {
                    //Draw text only in the condensed mode
                    double newTextWidth  = newText.WidthIncludingTrailingWhitespace;
                    double newText2Width = newText2.WidthIncludingTrailingWhitespace;

                    if (text2 == "")
                    {
                        drawingContext.DrawText(newText, new Point(anchorPoint.X - newTextWidth / 2, rectPoint.Y + textVerticalMargin));
                    }
                    else
                    {
                        drawingContext.DrawText(newText, new Point(rectPoint.X + Configurations.InfoBubbleMargin, rectPoint.Y + textVerticalMargin));
                        drawingContext.DrawText(newText2, new Point(rectPoint.X + Configurations.InfoBubbleMargin, rectPoint.Y + textVerticalMargin + newText.Height));
                    }

                    //Draw Context Menu
                    Point p = new Point(rectPoint.X + rectWidth, rectPoint.Y);
                    p.Offset(0, Configurations.ContextMenuMargin);
                    DrawingUtilities.DrawDots(drawingContext, DotTypes.Top | DotTypes.TopRight | DotTypes.MiddleRight, p, Core.AnchorPoint.TopRight, false);
                }
            }
        }
Example #8
0
        protected override void ComposeCore(System.Windows.Media.DrawingContext drawingContext, System.Windows.Media.DrawingVisual visual)
        {
            //Text and Caption size
            string tempText     = string.Empty;
            double textWidth    = Utilities.GetTextWidth(this.Text);
            double captionWidth = Utilities.GetTextWidth(this.Caption);

            if (this.Text.Count() > 25)
            {
                tempText  = this.Text.Substring(0, 25);
                tempText += "...";
                textWidth = Utilities.GetTextWidth(tempText);
            }
            else
            {
                tempText = this.Text;
            }

            //Node width
            if (textWidth > captionWidth)
            {
                this.nodeDimension.Width = (int)(Configurations.NodeWidthProperty + textWidth + 1);
            }
            else
            {
                this.nodeDimension.Width = (int)(Configurations.NodeWidthProperty + captionWidth + 1);
            }

            //Node height
            this.nodeDimension.Height = Configurations.NodeHeightProperty;

            base.ComposeCore(drawingContext, visual);

            Rect rect = new Rect(new Point(1, 1), new Size((int)(this.nodeDimension.Width - 1), (int)(this.nodeDimension.Height - 1)));

            drawingContext.DrawRectangle(Configurations.RectGrey, Configurations.NoBorderPen, rect);

            //horizontal Line
            Point p1 = new Point(1, 1);

            p1.Offset(Configurations.TextHorizontalOffset, (int)(this.Height) / 2);
            p1.Offset(0, 0.5);
            Point p2 = p1;

            p2.X = (this.Width - 1) - Configurations.TextHorizontalOffset;
            drawingContext.DrawLine(Configurations.BorderPen, p1, p2);

            //draw caption and text
            p1 = new Point(1, 1);
            p1.Offset(0, Configurations.TextVerticalOffset);
            p1.X = (this.Width / 2) - captionWidth / 2;
            Utilities.DrawText(drawingContext, this.Caption, p1, Configurations.TextNormalColor);
            p1.Y = ((this.Height - 3) / 2) + Configurations.TextVerticalOffset;
            p1.X = (this.Width / 2) - textWidth / 2;
            Utilities.DrawBoldText(drawingContext, tempText, p1);

            //OutputSlot
            p1    = new Point(this.Width, (this.Height / 4));
            p1.Y += (this.Height / 2) - 2;
            DrawingUtilities.DrawDots(drawingContext, DotTypes.TopRight | DotTypes.MiddleRight | DotTypes.BottomRight, p1, AnchorPoint.TopRight, false);
            //OutputSlotHittestPixels
            p1.Y -= (this.Height / 4) - 1;
            drawingContext.DrawRectangle(Configurations.SlotHitTestColor, Configurations.NoBorderPen, new Rect(p1, new Size(Configurations.HittestPixels, this.Height / 2)));

            //NorthEast
            Point p = new Point(0, 0);

            p.Offset(this.Width, Configurations.ContextMenuMargin);
            if (dotsFlag.HasFlag(MenuDots.NorthEast))
            {
                DrawingUtilities.DrawDots(drawingContext, DotTypes.Top | DotTypes.TopRight | DotTypes.MiddleRight, p, AnchorPoint.TopRight, false);
            }

            //NorthWest
            p = new Point(0, 0);
            p.Offset(Configurations.ContextMenuMargin, Configurations.ContextMenuMargin);
            //DrawingUtilities.DrawDots(drawingContext, DotTypes.TopLeft | DotTypes.Top | DotTypes.MiddleLeft, p, AnchorPoint.TopLeft, false);

            //South
            p = new Point(0, 0);
            p.Offset(Configurations.ContextMenuMargin, this.Height);
            //DrawingUtilities.DrawDots(drawingContext, DotTypes.MiddleLeft | DotTypes.BottomLeft | DotTypes.Bottom, p, AnchorPoint.BottomLeft, false);

            //input Slots
            if (this.inputSlots.Count != 0)
            {
                p1    = new Point(-1, 1);
                p1.Y += Configurations.TextVerticalOffset + Configurations.SlotSize / 2;
                Utilities.DrawSlot(drawingContext, p1);
            }

            // Fix: IDE-1616 Geometry property previews are not showing up.
            // Fix: IDE-1623 Preview not coming for the property nodes.
            if (previewBubble != null)
            {
                this.previewBubble.Compose();
            }
        }