Exemple #1
0
        internal void Draw(Graphic g)
        {
            int fh = 30;
            int space = node.GetSpace();
            // TODO:unfinished
            if (space >= fh)
            {
                active = true;
                HTCoordS zs = node.GetScreenCoordinates();
                String name = node.GetName();
                Color color = node.GetColor();

                height = fh + 2 * node.GetSize();
                width = space + 10 + 2 * node.GetSize();
                x = zs.X - (width / 2) - node.GetSize();
                y = zs.Y - (fh / 2) - node.GetSize();

                g.DrawDot(zs.X, zs.Y, 3, color);
                g.DrawLabel(x, y, width, height, name, color);

            }
            else
            {
                active = false;
            }
        }
Exemple #2
0
 internal virtual void DrawNodes(Graphic g)
 {
     if (fastMode == false)
     {
         label.Draw(g);
     }
 }
Exemple #3
0
 internal void Draw(Graphic g, Color color)
 {
     g.SetColor(color);
     switch (type)
     {
         case LINE:
             g.DrawLine(a.X, a.Y, b.X, b.Y);
             break;
         case ARC:
             g.DrawCurve(a.X, a.Y, c.X, c.Y, b.X, b.Y);
             break;
         default:
             break;
     }
 }
Exemple #4
0
        public MainPage()
        {
            InitializeComponent();

            XDocument xdoc = XDocument.Load("resources/result.xml");

            root = new HTXMLNode(xdoc.Element("xbrldata"));

            hypertree = new HyperTree(root);

            //TODO:是否使用静态方法?
            Graphic graphic = new Graphic();
            //graphic.Canvas = this.LayoutRoot;

            SilverlightHTView view = hypertree.GetSLView();
            graphic.Canvas = view.LayoutRoot;
            view.graphic = graphic;
            view.Repaint();

            this.Width = 500;
            this.Height = 500;

            this.LayoutRoot.Children.Add(view);
        }
Exemple #5
0
 internal virtual void DrawBranches(Graphic g)
 {
 }
        internal override void DrawBranches(Graphic g)
        {
            HTDrawNode child = null;
            for (IEnumerator i = Children(); i.MoveNext(); )
            {
                child = (HTDrawNode)i.Current;
                HTGeodesic geod = (HTGeodesic)geodesics[child];

                if (geod != null)
                {

                    geod.Draw(g, child.GetBranchColor());
                }
                child.DrawBranches(g);
            }
        }
        internal override void DrawNodes(Graphic g)
        {
            if (fastMode == false)
            {
                base.DrawNodes(g);

                HTDrawNode child = null;
                for (IEnumerator i = Children(); i.MoveNext(); )
                {
                    child = (HTDrawNode)i.Current;
                    child.DrawNodes(g);
                }
            }
        }
 public void PaintComponent(Graphic g)
 {
     draw.RefreshScreenCoordinates();
     draw.DrawBranches(g);
     draw.DrawNodes(g);
 }
Exemple #9
0
 internal void DrawNodes(Graphic g)
 {
     drawRoot.DrawNodes(g);
 }
Exemple #10
0
 internal void DrawBranches(Graphic g)
 {
     drawRoot.DrawBranches(g);
 }