Пример #1
0
        protected virtual void DrawSquareConnector(Graphics g)
        {
            Pen   pen   = ArtPalette.GetSimpleConnectorPenStyle().DrawingPen();
            Brush brush = ArtPalette.GetSimpleConnectorPaintStyle().GetBrush(this.Rectangle);

            g.DrawRectangle(pen, this.Rectangle);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:ConnectionBase"/> class.
 /// </summary>
 /// <param name="from">From.</param>
 /// <param name="to">To.</param>
 protected ConnectionBase(Point from, Point to) : base()
 {
     this.mFrom        = new Connector(from);
     this.mFrom.Parent = this;
     this.mTo          = new Connector(to);
     this.mTo.Parent   = this;
     PenStyle          = ArtPalette.GetDefaultPenStyle();
 }
Пример #3
0
        /// <summary>
        /// Called when the shape is added to the canvas.
        /// </summary>
        public void OnAddition()
        {
            Transform(new Rectangle(Rectangle.Location, new Size(150, FolderMaterial.HeaderHeight + 20)));
            //use a light color rather than the random low saturation color to show off the connection lines
            PaintStyle = ArtPalette.GetDefaultSolidPaintStyle();

            (PaintStyle as SolidPaintStyle).SolidColor = Color.WhiteSmoke;
        }
Пример #4
0
        // ------------------------------------------------------------------
        /// <summary>
        /// Called when a new DiagramEntityBase is instantiated.
        /// </summary>
        // ------------------------------------------------------------------
        protected virtual void Initialize()
        {
            PaintStyle = ArtPalette.GetDefaultPaintStyle();
            PenStyle   = ArtPalette.GetDefaultPenStyle();

            mServices = new Dictionary <Type, IInteraction>();
            mServices[typeof(IMouseListener)] = this;
            mServices[typeof(IHoverListener)] = this;
        }
Пример #5
0
        // -----------------------------------------------------------------
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        // -----------------------------------------------------------------
        protected override void Initialize()
        {
            base.Initialize();

            PaintStyle       = ArtPalette.GetDefaultSolidPaintStyle();
            Resizable        = false;
            connector        = new Connector(new Point((int)(Rectangle.Left + Rectangle.Width / 2), Rectangle.Bottom), Model);
            connector.Name   = "Central connector";
            connector.Parent = this;
            Connectors.Add(connector);
        }
Пример #6
0
 /// <summary>
 /// Constructs a connection between the two given points
 /// </summary>
 /// <param name="mFrom">the starting point of the connection</param>
 /// <param name="mTo">the end-point of the connection</param>
 /// <param name="model">The model.</param>
 public Connection(Point mFrom, Point mTo, IModel model)
     : base(model)
 {
     this.From        = new Connector(mFrom, model);
     this.From.Name   = "From";
     this.From.Parent = this;
     this.To          = new Connector(mTo, model);
     this.To.Name     = "To";
     this.To.Parent   = this;
     PenStyle         = ArtPalette.GetDefaultPenStyle();
 }
Пример #7
0
        // ------------------------------------------------------------------
        /// <summary>
        /// Draws a blue 'x' using 'Dot' as the line style, with a transparent
        /// color.
        /// </summary>
        /// <param name="g">Graphics</param>
        // ------------------------------------------------------------------
        protected virtual void DrawSimpleConnector(Graphics g)
        {
            Pen   pen   = ArtPalette.GetSimpleConnectorPenStyle().DrawingPen();
            Brush brush =
                ArtPalette.GetSimpleConnectorPaintStyle().GetBrush(
                    this.Rectangle);

            GraphicsPath path = new GraphicsPath();

            // Diagonal line from top left to bottom right.
            g.DrawLine(pen, this.TopLeftCorner, this.BottomRightCorner);


            // Diagonal line from top right to bottom lrft.
            g.DrawLine(pen, this.TopRightCorner, this.BottomLeftCorner);
        }
Пример #8
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="site"></param>
 protected ConnectionBase(IModel site) : base(site)
 {
     PenStyle = ArtPalette.GetDefaultPenStyle();
 }
Пример #9
0
 // -----------------------------------------------------------------
 /// <summary>
 /// Initializes this instance.
 /// </summary>
 // -----------------------------------------------------------------
 protected override void Initialize()
 {
     base.Initialize();
     this.PaintStyle = ArtPalette.GetTransparentPaintStyle();
 }