コード例 #1
0
        protected override RectD GetBounds(ICanvasContext context, INode node)
        {
            RectD bounds = node.Layout.ToRectD();

            if (ShowTopMessage)
            {
                bounds = bounds.GetEnlarged(new InsetsD(0, MessageDistance + BpmnConstants.MessageSize.Height, 0, 0));
            }
            if (ShowBottomMessage)
            {
                bounds = bounds.GetEnlarged(new InsetsD(0, 0, 0, MessageDistance + BpmnConstants.MessageSize.Height));
            }

            return(bounds);
        }
コード例 #2
0
 /// <summary>
 /// Overridden to take the connection lines to the label into account.
 /// </summary>
 /// <remarks>
 /// Otherwise label intersection lines might not be painted if the node is outside
 /// of the clipping bounds.
 /// </remarks>
 protected override bool IsVisible(ICanvasContext context, RectD rectangle, INode node)
 {
     if (base.IsVisible(context, rectangle, node))
     {
         return(true);
     }
     // check for labels connection lines
     rectangle = rectangle.GetEnlarged(10);
     return(node.Labels.Any(label => rectangle.IntersectsLine(node.Layout.GetCenter(), label.GetLayout().GetCenter())));
 }
コード例 #3
0
        ////////////////////////////////////////////////////
        //////////////// New in this sample ////////////////
        ////////////////////////////////////////////////////

        /// <summary>
        /// Overridden to take the connection lines to the label into account.
        /// </summary>
        /// <remarks>
        /// Otherwise label intersection lines might not be painted if the node is outside
        /// of the clipping bounds.
        /// </remarks>
        protected override bool IsVisible(ICanvasContext context, RectD rectangle, INode node)
        {
            // return base.IsVisible(node, clip, canvasContext);
            if (base.IsVisible(context, rectangle, node))
            {
                return(true);
            }
            // check for labels connection lines
            rectangle = rectangle.GetEnlarged(10);
            foreach (var label in node.Labels)
            {
                if (rectangle.IntersectsLine(node.Layout.GetCenter(), label.GetLayout().GetCenter()))
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #4
0
 protected override bool IsVisible(ICanvasContext context, RectD rectangle, INode node)
 {
     // first check if the wrapped style is visible
     if (wrapped.Renderer.GetVisibilityTestable(node, wrapped).IsVisible(context, rectangle))
     {
         return(true);
     }
     // if not, check for labels connection lines
     rectangle = rectangle.GetEnlarged(10);
     foreach (var label in node.Labels)
     {
         if (rectangle.IntersectsLine(node.Layout.GetCenter(), label.GetLayout().GetCenter()))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #5
0
 /// <summary>
 /// Overridden to take the connection lines to the label into account.
 /// </summary>
 /// <remarks>
 /// Otherwise label intersection lines might not be painted if the node is outside
 /// of the clipping bounds.
 /// </remarks>
 protected override bool IsVisible(ICanvasContext context, RectD rectangle, INode node)
 {
     // uncomment the following line to watch the default behaviour that
     // doesn't paint the label edge if the node lies completely outside the viewport
     // return base.IsVisible(context, rectangle, node);
     if (base.IsVisible(context, rectangle, node))
     {
         return(true);
     }
     // check for labels connection lines
     rectangle = rectangle.GetEnlarged(10);
     foreach (var label in node.Labels)
     {
         if (rectangle.IntersectsLine(node.Layout.GetCenter(), label.GetLayout().GetCenter()))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #6
0
 public void Reshape(IRectangle newRectangle)
 {
     tightRect = newRectangle.ToRectD();
     rectangle.Reshape(tightRect.GetEnlarged(Margins));
     invalid = false;
 }
コード例 #7
0
 /// <inheritdoc/>
 protected override bool IsInBox(IInputModeContext context, RectD rectangle, ILabel label)
 {
     Configure(label);
     return(rectangle.Intersects(boundingBox.GetEnlarged(context.HitTestRadius)));
 }