예제 #1
0
        public const int CANVAS_SIZE_INCREMENT = 1000; //画布大小增长

        /// <summary>
        ///
        /// </summary>
        /// <param name="tree"></param>
        public MapView(MapTree tree)
        {
            this.tree = tree;
            MetaModel.MetaModel.Instance.SystemIconList.ForEach(a => a.StatusChange += systemIcon_StatusChange);

            Canvas = new MapViewPanel(this);

            Canvas.BackColor = System.Drawing.Color.White;
            Canvas.Location  = new System.Drawing.Point(0, 0);
            Canvas.TabIndex  = 0;
            Canvas.Width     = CANVAS_DEFAULT_WIDTH;
            Canvas.Height    = CANVAS_DEFAULT_HEIGHT;

            RegisterTreeEvents();                                                    //注册节点树事件
            RefreshNodePositions();                                                  //刷新节点位置
            Canvas.Invalidate();                                                     //画布刷新

            this.nodeTextEditor = new MapViewTextEditor(this, NodeView.DefaultFont); //文本编辑器
            FormatPainter       = new MapViewFormatPainter(this);                    //格式画板
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="tree"></param>
        public MapView(MapTree tree)
        {
            this.tree = tree;
            MetaModel.MetaModel.Instance.SystemIconList.ForEach(a => a.StatusChange += systemIcon_StatusChange);

            Canvas = new MapViewPanel(this);

            Canvas.BackColor = tree.CanvasBackColor;
            Canvas.Location  = new Point(0, 0);
            Canvas.TabIndex  = 0;
            Canvas.Width     = CANVAS_DEFAULT_WIDTH;
            Canvas.Height    = CANVAS_DEFAULT_HEIGHT;

            RegisterTreeEvents();
            RefreshNodePositions();
            Canvas.Invalidate();

            this.nodeTextEditor = new MapViewTextEditor(this, NodeFormat.DefaultFont);
            FormatPainter       = new MapViewFormatPainter(this);
        }
예제 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="tree"></param>
        public MapView(MapTree tree)
        {
            this.tree = tree;
            MetaModel.MetaModel.Instance.SystemIconList.ForEach(a => a.StatusChange += systemIcon_StatusChange);

            Canvas = new MapViewPanel(this);

            Canvas.BackColor = System.Drawing.Color.White;
            Canvas.Location  = new System.Drawing.Point(0, 0);
            Canvas.Size      = new System.Drawing.Size(200, 300);
            Canvas.TabIndex  = 0;
            Canvas.Width     = 4096;
            Canvas.Height    = 4096;

            RegisterTreeEvents();
            RefreshNodePositions();
            Canvas.Invalidate();

            this.nodeTextEditor = new MapViewTextEditor(this, NodeView.DefaultFont);
            FormatPainter       = new MapViewFormatPainter(this);
        }