/// <summary>
 /// Build the body of this Connection
 /// </summary>
 private void BuildBody()
 {
     //GraphicsPath bodyPath = new GraphicsPath();
     //bodyPath.AddEllipse(0, 0, 5, 5);
     //m_Body = new GraphicShape(bodyPath);
     m_Body = new GraphicShape(); //dummy
 }
Exemple #2
0
        protected override void BuildBody()
        {
            GraphicsPath bodypath = new GraphicsPath();

            int          halfheight = GraphicConstants.GraphicSignalHeight / 2;
            List <Point> points     = new List <Point>(5);

            points.Add(new Point(0, 0));
            points.Add(new Point(GraphicConstants.GraphicSignalWidth - halfheight, 0));
            points.Add(new Point(GraphicConstants.GraphicSignalWidth, halfheight));
            points.Add(new Point(GraphicConstants.GraphicSignalWidth - halfheight, GraphicConstants.GraphicSignalHeight));
            points.Add(new Point(0, GraphicConstants.GraphicSignalHeight));
            bodypath.AddPolygon(points.ToArray());
            points.Clear();
            points.Add(new Point(2, 8));
            points.Add(new Point(6, 8));
            points.Add(new Point(6, 2));
            points.Add(new Point(10, 2));
            points.Add(new Point(10, 8));
            points.Add(new Point(14, 8));
            points.Add(new Point(14, 2));
            points.Add(new Point(18, 2));
            points.Add(new Point(18, 8));
            points.Add(new Point(22, 8));
            bodypath.AddLines(points.ToArray());
            bodypath.AddLines(points.ToArray().Reverse().ToArray());

            //add terminals
            AddTerminals();

            m_Body = new GraphicShape(bodypath);
        }
Exemple #3
0
        /// <summary>
        /// Build the body of this Connection
        /// </summary>
        private void BuildBody()
        {
            GraphicsPath bodyPath = new GraphicsPath();

            bodyPath.AddLine(m_Nodes[0].Location, m_Nodes[1].Location);
            m_Body = new GraphicShape(bodyPath);
        }
 /// <summary>
 /// Private constructor, used for cloning
 /// </summary>
 /// <param name="shape">
 /// Reference to another shape whose deep copy has to be created.
 /// </param>
 private GraphicShape(GraphicShape shape)
 {
     Initialize();
     m_Angle  = shape.m_Angle;
     m_Pen    = (Pen)shape.m_Pen.Clone();
     m_Brush  = (Brush)shape.m_Brush.Clone();
     m_Path   = (GraphicsPath)shape.m_Path.Clone();
     m_Bounds = shape.m_Bounds;
 }
        /// <summary>
        /// Build the body of this Connection
        /// </summary>
        private void BuildBody()
        {
            //TODO: build up lines routed from terminal to terminal
            //Connection connection = LinkedObject as Connection;
            //List<Terminal> terminals = connection.Terminals;
            //if (m_Children != null)
            //{
            //    m_Children.Clear();
            //}


            m_Body = new GraphicShape(); //dummy
        }
        private void BuildBody()
        {
            GraphicsPath bodypath = new GraphicsPath();
            Terminal     terminal = (Terminal)m_LinkedObject;

            if (terminal.Negated)
            {
                bodypath.AddEllipse(0, 0, 5, 5);
                bodypath.AddLine(5, 3, GraphicConstants.GraphicTerminalWidth, 3);
            }
            else
            {
                bodypath.AddLine(0, 0, GraphicConstants.GraphicTerminalWidth, 0);
            }
            m_Body = new GraphicShape(bodypath);
        }
Exemple #7
0
        protected virtual void BuildBody()
        {
            GraphicsPath bodypath = new GraphicsPath();

            int termCount = 0;
            InputOutputElement ioElement = LinkedObject as InputOutputElement;

            if (ioElement != null)
            {
                termCount = ioElement.InputCount > ioElement.OutputCount ? ioElement.InputCount : ioElement.OutputCount;
                termCount--;
            }
            bodypath.AddRectangle(new Rectangle(0, 0, GraphicConstants.GraphicElementWidth,
                                                GraphicConstants.GraphicElementUpperSpace + GraphicConstants.GraphicElementLowerSpace + termCount * GraphicConstants.GraphicElementTerminalSpace));
            //add terminals
            AddTerminals();
            m_Body = new GraphicShape(bodypath);
        }
        protected override void BuildBody()
        {
            GraphicsPath bodypath = new GraphicsPath();

            int          halfheight = GraphicConstants.GraphicSignalHeight / 2;
            List <Point> points     = new List <Point>(5);

            points.Add(new Point(0, 0));
            points.Add(new Point(GraphicConstants.GraphicSignalWidth - halfheight, 0));
            points.Add(new Point(GraphicConstants.GraphicSignalWidth, halfheight));
            points.Add(new Point(GraphicConstants.GraphicSignalWidth - halfheight, GraphicConstants.GraphicSignalHeight));
            points.Add(new Point(0, GraphicConstants.GraphicSignalHeight));
            bodypath.AddPolygon(points.ToArray());
            //add terminals
            AddTerminals();

            //Font arial = new Font("Arial", 12, System.Drawing.GraphicsUnit.Point);
            //FontFamily family = new FontFamily("Arial");
            //bodypath.AddString(Text, family, 0, 12, new Point(4, 18), StringFormat.GenericDefault);

            m_Body = new GraphicShape(bodypath);
        }