Esempio n. 1
0
        public void PaintNavigationMap(MindMap map, float zoom, PaintEventArgs e)
        {
            if (map == null)
            {
                throw new ArgumentNullException();
            }

            var graphics = new GdiGraphics(e.Graphics);

            ResetObjects(graphics, map);

            if (!map.BackColor.IsEmpty)
            {
                e.Graphics.Clear(map.BackColor);
            }

            if (map.Root != null)
            {
                Liner = LayoutManage.GetLiner(map.LayoutType);

                Font font  = ChartBox.DefaultChartFont;
                var  font2 = new GdiFont(font.FontFamily, font.Size * zoom);

                //GenerateFoldingButtonImage(map, zoom);
                PaintNavigationMap(graphics, map.Root, zoom, font2);

                PaintNavigationMapLinkLines(graphics, map.Root, zoom, font2);
            }
        }
Esempio n. 2
0
        void Map_LayoutTypeChanged(object sender, EventArgs e)
        {
            ChartLayouter = LayoutManage.GetLayouter(Map.LayoutType);

            if (!IsUpdating)
            {
                UpdateView(ChangeTypes.AllVisual);
            }
        }
Esempio n. 3
0
        public void Paint(MindMap map, RenderArgs args)
        {
            if (map == null)
            {
                throw new ArgumentNullException();
            }

            ResetObjects(args.Graphics, map);

            //PaintBackground(map, args);

            if (map.Root != null)
            {
                Liner = LayoutManage.GetLiner(map.LayoutType);

                //GenerateFoldingButtonImage(map);
                PaintNode(map.Root, args);
                PaintLinkLines(map.Root, args);
            }
        }
Esempio n. 4
0
        //protected override Padding DefaultMargin
        //{
        //    get
        //    {
        //        return new Padding(8);
        //    }
        //}

        //protected override Padding DefaultPadding
        //{
        //    get
        //    {
        //        return new Padding(2);
        //    }
        //}

        private void OnMapChanged(MindMap old)
        {
            if (old != null)
            {
                old.PropertyChanged            -= new Blumind.Core.PropertyChangedEventHandler(Map_StyleChanged);
                old.LayoutTypeChanged          -= new EventHandler(Map_LayoutTypeChanged);
                old.ChartObjectPropertyChanged -= new Blumind.Core.PropertyChangedEventHandler(Map_ChartObjectPropertyChanged);

                old.TopicAdded         -= new TopicEventHandler(Map_TopicAdded);
                old.TopicRemoved       -= new TopicEventHandler(Map_TopicRemoved);
                old.TopicAfterSort     -= new EventHandler(Map_TopicAfterSort);
                old.ObjectStyleChanged -= new ChartObjectPropertyEventHandler(Chart_ChartObjectStyleChanged);
                //old.TopicTextChanged -= new TopicEventHandler(Map_TopicTextChanged);
                old.TopicWidgetChanged      -= new Blumind.Core.PropertyChangedEventHandler(Map_TopicWidgetChanged);
                old.TopicDescriptionChanged -= new TopicEventHandler(Map_TopicDescriptionChanged);
                old.TopicFoldedChanged      -= new TopicEventHandler(Map_TopicFoldedChanged);
                old.TopicWidthChanged       -= new TopicEventHandler(Map_TopicWidthChanged);
                old.TopicHeightChanged      -= new TopicEventHandler(Map_TopicHeightChanged);
                old.TopicIconChanged        -= new TopicEventHandler(Map_TopicIconChanged);
                old.TopicBeforeCollapse     -= new TopicCancelEventHandler(Map_TopicBeforeCollapse);
                old.LinkAdded     -= new LinkEventHandler(Map_LinkAdded);
                old.LinkRemoved   -= new LinkEventHandler(Map_LinkRemoved);
                old.WidgetRemoved -= new WidgetEventHandler(Map_WidgetRemoved);

                old.LinkPropertyChanged -= new Blumind.Core.PropertyChangedEventHandler(Map_LinkChanged);
                old.LinkVisibleChanged  -= new LinkEventHandler(Map_LinkVisibleChanged);
            }

            if (Map != null)
            {
                ChartLayouter = LayoutManage.GetLayouter(Map.LayoutType);

                Map.PropertyChanged            += new Blumind.Core.PropertyChangedEventHandler(Map_StyleChanged);
                Map.LayoutTypeChanged          += new EventHandler(Map_LayoutTypeChanged);
                Map.ModifiedChanged            += new EventHandler(Map_ModifiedChanged);
                Map.ChartObjectPropertyChanged += new Blumind.Core.PropertyChangedEventHandler(Map_ChartObjectPropertyChanged);

                Map.TopicAdded         += new TopicEventHandler(Map_TopicAdded);
                Map.TopicRemoved       += new TopicEventHandler(Map_TopicRemoved);
                Map.TopicAfterSort     += new EventHandler(Map_TopicAfterSort);
                Map.ObjectStyleChanged += new ChartObjectPropertyEventHandler(Chart_ChartObjectStyleChanged);
                //Map.TopicTextChanged += new TopicEventHandler(Map_TopicTextChanged);
                Map.TopicWidgetChanged      += new Blumind.Core.PropertyChangedEventHandler(Map_TopicWidgetChanged);
                Map.TopicDescriptionChanged += new TopicEventHandler(Map_TopicDescriptionChanged);
                Map.TopicFoldedChanged      += new TopicEventHandler(Map_TopicFoldedChanged);
                Map.TopicWidthChanged       += new TopicEventHandler(Map_TopicWidthChanged);
                Map.TopicHeightChanged      += new TopicEventHandler(Map_TopicHeightChanged);
                Map.TopicIconChanged        += new TopicEventHandler(Map_TopicIconChanged);
                Map.TopicBeforeCollapse     += new TopicCancelEventHandler(Map_TopicBeforeCollapse);
                Map.LinkAdded     += new LinkEventHandler(Map_LinkAdded);
                Map.LinkRemoved   += new LinkEventHandler(Map_LinkRemoved);
                Map.WidgetRemoved += new WidgetEventHandler(Map_WidgetRemoved);

                Map.LinkPropertyChanged += new Blumind.Core.PropertyChangedEventHandler(Map_LinkChanged);
                Map.LinkVisibleChanged  += new LinkEventHandler(Map_LinkVisibleChanged);
            }
            else
            {
                ChartLayouter = null;
            }

            if (Map != null && Map.Root != null)
            {
                Select(Map.Root);
                //SelectTopic(Map.Root);
            }

            Modified = false;
            ClearCommandHistory();
            ResetChartStyle();
            UpdateView(ChangeTypes.All);
            ScrollToCenter();
        }