Exemplo n.º 1
0
        public override void Draw(Graphics g, Vista v, bool high, bool sel)
        {
            Stile.Colore col = sel ? Stile.Colore.Selected : Stile.Colore.Ramo;
            if (high)
            {
                col = Stile.Colore.Highlighted;
            }

            g.DrawLine(v.Pen(col), nd[0].Ps, nd[1].Ps);                     // Disegna prima la linea, poi sovrappone una figura con il simbolo

            if (Point2D.Mod(new Point(nd[1].Ps.X - nd[0].Ps.X, nd[1].Ps.Y - nd[0].Ps.Y)) > Def.SHAPE_HALFSIZE * Def.SHAPE_HALFSIZE * 4)
            {
                GraphicsPath pth = (GraphicsPath)Def.Shape2D.GetShape(Def.Shape2D.Name.Arrow).Clone();
                pth.Transform(m);
                g.DrawPath(v.Pen(col), pth);
                //g.FillPath(br,pth);
            }

            g.DrawString(id.ToString(), v.Font(0), v.Brush(col), pc.X + Def.NODE_HALFSIZE * 2, pc.Y + Def.NODE_HALFSIZE * 2);
        }
Exemplo n.º 2
0
        public override void Draw(Graphics g, Vista v, bool high, bool sel)
        {
            GraphicsPath pth = (GraphicsPath)Def.Shape2D.GetShape(Def.Shape2D.Name.Circle).Clone();

            Stile.Colore col = sel ? Stile.Colore.Selected : Stile.Colore.Nodo;
            if (high)
            {
                col = Stile.Colore.Highlighted;
            }
            Matrix m = new Matrix();

            m.Translate(ps.X, ps.Y);
            pth.Transform(m);
            g.DrawPath(v.Pen(Stile.Colore.Nodo), pth);
            string str = id.ToString() + System.Environment.NewLine + "---";
            SizeF  sz  = g.MeasureString(str, v.Font(0));

            g.DrawRectangle(v.Pen(col), ps.X - 2 * Def.FONT_SIZE - Def.NODE_HALFSIZE * 2, ps.Y - Def.FONT_SIZE - Def.NODE_HALFSIZE * 2, sz.Width, sz.Height);
            //g.FillRectangle(     ,ps.X-2*Def.FONT_SIZE-Def.NODE_HALFSIZE*2, ps.Y-Def.FONT_SIZE-Def.NODE_HALFSIZE*2,sz.Width,sz.Height);
            g.DrawString(str, v.Font(0), v.Brush(col), ps.X - 2 * Def.FONT_SIZE - Def.NODE_HALFSIZE * 2, ps.Y - Def.FONT_SIZE - Def.NODE_HALFSIZE * 2);
        }
Exemplo n.º 3
0
 public Brush Brush(Stile.Colore color)
 {
     return(clrs.BRUSH[(int)color]);
 }
Exemplo n.º 4
0
 public Pen Pen(Stile.Colore color)
 {
     return(clrs.PEN[(int)color]);
 }