コード例 #1
0
ファイル: LineDialog.cs プロジェクト: evest/Tree
        private void samplePanel_Paint(object sender, PaintEventArgs e)
        {
            const int margin = 5;

            if (decorationGroupBox.Visible)
            {
                Rectangle myrect = samplePanel.ClientRectangle;
                myrect.Inflate(-45, -10);
                Decoration d = this.Decoration;
                using (Graphics g = e.Graphics)
                    using (Pen pen = d.penstyle.GetPen())
                        DrawShape(g, d.mode, d.shape, pen, myrect);
            }
            else
            {
                PenStyle ps = this.Style;
                using (Graphics g = e.Graphics)
                    using (Pen pen = ps.GetPen())
                    {
                        Rectangle r = samplePanel.ClientRectangle;
                        if (traceGroupBox.Visible && traceCurveRadioButton.Checked)
                        {
                            g.DrawBezier(pen, new Point(r.Left + margin, r.Top + margin),
                                         new Point(r.Left + r.Width / 4, r.Bottom),
                                         new Point(r.Left + 3 * r.Width / 4, r.Top),
                                         new Point(r.Right - margin, r.Bottom - margin));
                        }
                        else
                        {
                            g.DrawLine(pen, new Point(r.Left + margin, r.Top + r.Height / 2),
                                       new Point(r.Right - margin, r.Top + r.Height / 2));
                        }
                    }
            }
        }
コード例 #2
0
 public Decoration(DecorationMode mode, DecorationShape shape, PenStyle penstyle, int padding)
 {
     this.mode     = mode;
     this.shape    = shape;
     this.penstyle = penstyle;
     this.padding  = padding;
 }
コード例 #3
0
 public Decoration(DecorationMode mode, DecorationShape shape)
 {
     this.mode     = mode;
     this.shape    = shape;
     this.penstyle = new PenStyle(Color.Black, 1.0f, DashStyle.Solid, ArrowStyle.None);
     this.padding  = 4;
 }
コード例 #4
0
 public Trace(Node source, Node destination, PenStyle penstyle, TraceStyle tracestyle)
 {
     this.penstyle    = penstyle;
     this.source      = source;
     this.destination = destination;
     this.tracestyle  = tracestyle;
 }
コード例 #5
0
 public TreeOptions()
 {
     rendermode        = RenderMode.Walker;
     treealignment     = TreeAlignmentEnum.Middle;
     marginhorizontal  = 20;
     marginvertical    = 20;
     paddinghorizontal = 0;
     paddingvertical   = 5;
     tracehorizontal   = 3;
     tracevertical     = 10;
     backgroundcolor   = Color.White;
     labelfont         = new FontAndColor(DefaultFont(), Color.Black);
     lexicalfont       = new FontAndColor(DefaultFont(), Color.Red);
     highlightcolor    = Color.Blue;
     antialias         = true;
     linestyle         = new PenStyle(Color.Black, 1.0f, DashStyle.Solid, ArrowStyle.None);
     tracestyle        = new PenStyle(Color.Black, 1.0f, DashStyle.Dot, ArrowStyle.LittleArrow);
     tracemode         = TraceStyle.Line;
 }
コード例 #6
0
ファイル: SyntaxTree.cs プロジェクト: ArsenShnurkov/Tree
 public Decoration(DecorationMode mode, DecorationShape shape)
 {
     this.mode = mode;
     this.shape = shape;
     this.penstyle = new PenStyle(Color.Black, 1.0f, DashStyle.Solid, ArrowStyle.None);
     this.padding = 4;
 }
コード例 #7
0
ファイル: SyntaxTree.cs プロジェクト: ArsenShnurkov/Tree
 public TreeOptions()
 {
     rendermode = RenderMode.Walker;
     treealignment = TreeAlignmentEnum.Middle;
     marginhorizontal = 20;
     marginvertical = 20;
     paddinghorizontal = 0;
     paddingvertical = 5;
     tracehorizontal = 3;
     tracevertical = 10;
     backgroundcolor = Color.White;
     labelfont = new FontAndColor(DefaultFont(), Color.Black);
     lexicalfont = new FontAndColor(DefaultFont(), Color.Red);
     highlightcolor = Color.Blue;
     antialias = true;
     linestyle = new PenStyle(Color.Black, 1.0f, DashStyle.Solid, ArrowStyle.None);
     tracestyle = new PenStyle(Color.Black, 1.0f, DashStyle.Dot, ArrowStyle.LittleArrow);
     tracemode = TraceStyle.Line;
 }
コード例 #8
0
ファイル: SyntaxTree.cs プロジェクト: ArsenShnurkov/Tree
 public Trace(Node source, Node destination, PenStyle penstyle, TraceStyle tracestyle)
 {
     this.penstyle = penstyle;
     this.source = source;
     this.destination = destination;
     this.tracestyle = tracestyle;
 }
コード例 #9
0
ファイル: SyntaxTree.cs プロジェクト: ArsenShnurkov/Tree
 public Decoration(DecorationMode mode, DecorationShape shape, PenStyle penstyle, int padding)
 {
     this.mode = mode;
     this.shape = shape;
     this.penstyle = penstyle;
     this.padding = padding;
 }