예제 #1
0
        public void OneContextTwoNodes()
        {
            Gtk.Application.Init ();

            string context = "Context1";
            TestModel model = new TestModel();
            /*INode nodeA = */model.CreateAddNode(10, context, new Size(80, 50));
            /*INode nodeB = */model.CreateAddNode(20, context, new Size(100, 40));
            TimelineLayoutManager layout = new TimelineLayoutManager(model);
            layout.Update();

            TestRenderer renderer = new TestRenderer();
            TimelineView view = new TimelineView(model, renderer);

            Gtk.Widget[] children = view.Children;

            Assert.That(children.Length, Is.EqualTo(2));

            Assert.That(children[0].Visible, Is.True);
            Assert.That(children[1].Visible, Is.True);

            int ax = (int) view.ChildGetProperty(children[0], "x").Val;
            int ay = (int) view.ChildGetProperty(children[0], "y").Val;
            int bx = (int) view.ChildGetProperty(children[1], "x").Val;
            int by = (int) view.ChildGetProperty(children[1], "y").Val;

            Assert.That(ay, Is.GreaterThan(0));
            Assert.That(ay, Is.EqualTo(by));

            Assert.That(ax, Is.GreaterThan(0));
            Assert.That(bx, Is.GreaterThan(0));
            Assert.That(ax, Is.Not.EqualTo(bx));
        }
예제 #2
0
        public void OneContextTwoNodes()
        {
            Gtk.Application.Init();

            string    context = "Context1";
            TestModel model   = new TestModel();

            /*INode nodeA = */ model.CreateAddNode(10, context, new Size(80, 50));
            /*INode nodeB = */ model.CreateAddNode(20, context, new Size(100, 40));
            TimelineLayoutManager layout = new TimelineLayoutManager(model);

            layout.Update();

            TestRenderer renderer = new TestRenderer();
            TimelineView view     = new TimelineView(model, renderer);

            Gtk.Widget[] children = view.Children;

            Assert.That(children.Length, Is.EqualTo(2));

            Assert.That(children[0].Visible, Is.True);
            Assert.That(children[1].Visible, Is.True);

            int ax = (int)view.ChildGetProperty(children[0], "x").Val;
            int ay = (int)view.ChildGetProperty(children[0], "y").Val;
            int bx = (int)view.ChildGetProperty(children[1], "x").Val;
            int by = (int)view.ChildGetProperty(children[1], "y").Val;

            Assert.That(ay, Is.GreaterThan(0));
            Assert.That(ay, Is.EqualTo(by));

            Assert.That(ax, Is.GreaterThan(0));
            Assert.That(bx, Is.GreaterThan(0));
            Assert.That(ax, Is.Not.EqualTo(bx));
        }
예제 #3
0
 public void OneContextOneNode()
 {
     string context = "Context1";
     TestModel model = new TestModel();
     INode node = model.CreateAddNode(10, context, new Size(100, 50));
     TimelineLayoutManager layout = new TimelineLayoutManager(model);
     layout.Update();
     Assert.That(node.Position, Is.EqualTo(new Point(layout.XMargin, layout.YMargin)));
 }
예제 #4
0
        public void OneContextOneNode()
        {
            string                context = "Context1";
            TestModel             model   = new TestModel();
            INode                 node    = model.CreateAddNode(10, context, new Size(100, 50));
            TimelineLayoutManager layout  = new TimelineLayoutManager(model);

            layout.Update();
            Assert.That(node.Position, Is.EqualTo(new Point(layout.XMargin, layout.YMargin)));
        }
예제 #5
0
 public void OneContextTwoNodes()
 {
     string context = "Context1";
     TestModel model = new TestModel();
     INode nodeA = model.CreateAddNode(10, context, new Size(80, 50));
     INode nodeB = model.CreateAddNode(20, context, new Size(100, 40));
     TimelineLayoutManager layout = new TimelineLayoutManager(model);
     layout.Update();
     Assert.That(nodeA.Position, Is.EqualTo(new Point(layout.XMargin, layout.YMargin)));
     Assert.That(nodeB.Position, Is.EqualTo(new Point(layout.XMargin + nodeA.Allocation.Width + layout.XPadding, layout.YMargin)));
 }
예제 #6
0
        public void OneContextTwoNodes()
        {
            string                context = "Context1";
            TestModel             model   = new TestModel();
            INode                 nodeA   = model.CreateAddNode(10, context, new Size(80, 50));
            INode                 nodeB   = model.CreateAddNode(20, context, new Size(100, 40));
            TimelineLayoutManager layout  = new TimelineLayoutManager(model);

            layout.Update();
            Assert.That(nodeA.Position, Is.EqualTo(new Point(layout.XMargin, layout.YMargin)));
            Assert.That(nodeB.Position, Is.EqualTo(new Point(layout.XMargin + nodeA.Allocation.Width + layout.XPadding, layout.YMargin)));
        }
예제 #7
0
파일: MainWindow.cs 프로젝트: SayHalou/ospy
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build();

        Dump testDump = m_dumpLoader.Load(File.OpenRead("/home/oleavr/teststream.osd"));
        m_model = new EventTimelineModel(testDump);

        m_layout = new TimelineLayoutManager(m_model);
        m_layout.Update();

        EventNodeRenderer renderer = new EventNodeRenderer();

        m_timeline = new TimelineView(m_model, renderer);
        m_timeline.Show();
        scrolledwindow.AddWithViewport(m_timeline);

        m_dumpLoader.LoadCompleted += dumpLoader_LoadCompleted;
        m_dumpLoader.LoadProgressChanged += dumpLoader_LoadProgressChanged;
    }
예제 #8
0
        public void TwoContextsInSequence()
        {
            TestModel model = new TestModel();
            string context1 = "Context1";
            INode ctx1nodeA = model.CreateAddNode(10, context1, new Size(80, 50));
            INode ctx1nodeB = model.CreateAddNode(20, context1, new Size(100, 40));
            string context2 = "Context2";
            INode ctx2node = model.CreateAddNode(30, context2, new Size(50, 30));

            TimelineLayoutManager layout = new TimelineLayoutManager(model);
            layout.Update();

            Assert.That(layout.RowCount, Is.EqualTo(1));

            Assert.That(ctx1nodeA.Position, Is.EqualTo(new Point(layout.XMargin, layout.YMargin)));
            Assert.That(ctx1nodeB.Position.X, Is.EqualTo(ctx1nodeA.Position.X + ctx1nodeA.Allocation.Width + layout.XPadding));
            Assert.That(ctx1nodeB.Position.Y, Is.EqualTo(layout.YMargin));
            Assert.That(ctx2node.Position.X, Is.EqualTo(ctx1nodeB.Position.X + ctx1nodeB.Allocation.Width + layout.XPadding));
            Assert.That(ctx2node.Position.Y, Is.EqualTo(layout.YMargin));
        }
예제 #9
0
파일: MainWindow.cs 프로젝트: wyrover/ospy
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build();

        Dump testDump = m_dumpLoader.Load(File.OpenRead("/home/oleavr/teststream.osd"));

        m_model = new EventTimelineModel(testDump);

        m_layout = new TimelineLayoutManager(m_model);
        m_layout.Update();

        EventNodeRenderer renderer = new EventNodeRenderer();

        m_timeline = new TimelineView(m_model, renderer);
        m_timeline.Show();
        scrolledwindow.AddWithViewport(m_timeline);

        m_dumpLoader.LoadCompleted       += dumpLoader_LoadCompleted;
        m_dumpLoader.LoadProgressChanged += dumpLoader_LoadProgressChanged;
    }
예제 #10
0
        public void TwoContextsInSequence()
        {
            TestModel model     = new TestModel();
            string    context1  = "Context1";
            INode     ctx1nodeA = model.CreateAddNode(10, context1, new Size(80, 50));
            INode     ctx1nodeB = model.CreateAddNode(20, context1, new Size(100, 40));
            string    context2  = "Context2";
            INode     ctx2node  = model.CreateAddNode(30, context2, new Size(50, 30));

            TimelineLayoutManager layout = new TimelineLayoutManager(model);

            layout.Update();

            Assert.That(layout.RowCount, Is.EqualTo(1));

            Assert.That(ctx1nodeA.Position, Is.EqualTo(new Point(layout.XMargin, layout.YMargin)));
            Assert.That(ctx1nodeB.Position.X, Is.EqualTo(ctx1nodeA.Position.X + ctx1nodeA.Allocation.Width + layout.XPadding));
            Assert.That(ctx1nodeB.Position.Y, Is.EqualTo(layout.YMargin));
            Assert.That(ctx2node.Position.X, Is.EqualTo(ctx1nodeB.Position.X + ctx1nodeB.Allocation.Width + layout.XPadding));
            Assert.That(ctx2node.Position.Y, Is.EqualTo(layout.YMargin));
        }