Exemplo n.º 1
0
        public NPanel()
        {
            InitializeComponent();

            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.UserPaint, true);

            NComponents = new List <NComponent>();
            mouseTool   = new NBoxTool(this.NComponents);

            mouseTool.ReDraw            += new Action(mouseTool_ReDraw);
            mouseTool.ComponentSelected += new Action <NComponent>(mouseTool_ComponentSelected);
            mouseTool.Change            += new Action(mouseTool_Change);

            pathResolver = new NPathResolver
            {
                BoundingBox = new NBox
                {
                    X      = 0,
                    Y      = 0,
                    Width  = 900,
                    Height = 1200
                },
                Components = this.NComponents
            };

            viewVisitor        = new NViewVisitor(this.Font);
            vertexMovedVisitor = new NVertexMovedVisitor(pathResolver, this.NComponents);

            this.MouseDown        += new MouseEventHandler(Box_MouseDown);
            this.MouseUp          += new MouseEventHandler(Box_MouseUp);
            this.MouseMove        += new MouseEventHandler(Box_MouseMove);
            this.MouseDoubleClick += new MouseEventHandler(NPanel_MouseDoubleClick);

            this.txtText.TextChanged += new EventHandler(TextBoxTextChange);
            this.txtText.KeyDown     += new KeyEventHandler(txtText_KeyDown);

            this.ComponentAdded += new Action <NComponent>(NPanel_ComponentAdded);
        }
Exemplo n.º 2
0
 public override void Accept(NViewVisitor visitor)
 {
     visitor.Visit(this);
 }
Exemplo n.º 3
0
 public abstract void Accept(NViewVisitor visitor);