Package com.neophob.sematrix.core.layout

Examples of com.neophob.sematrix.core.layout.Layout


    @Test
    public void basicTest() throws Exception {
      final int panels = 3;
     
      Layout l = new HorizontalLayout(panels);
      assertEquals(panels, l.getRow1Size());
      assertEquals(0, l.getRow2Size());     
      assertEquals(Layout.LayoutName.HORIZONTAL, l.getLayoutName());
     
      MatrixData matrix = new MatrixData(8, 8);
      IFader f = new Switch(matrix, 50);
      List<OutputMapping> ioMapping = new ArrayList<OutputMapping>();
     
      //testcase#1: each output has a visual assigned
    for (int n=0; n<panels; n++) {
      ioMapping.add(new OutputMapping(f, n));     
    }
      LayoutModel lom0 = l.getDataForScreen(0, ioMapping);
      assertEquals(0, lom0.getOfsX());
      assertEquals(0, lom0.getOfsY());
      assertEquals(1, lom0.getSameFxOnX());
      assertEquals(1, lom0.getSameFxOnY());
      assertEquals(0, lom0.getVisualId());
      assertEquals(true, lom0.screenDoesNotNeedStretching());
     
      //testcase#2: output 0 and 2 shot visual 0, output 1 show visual 1
      ioMapping.get(0).setVisualId(0);
      ioMapping.get(2).setVisualId(0);
      ioMapping.get(1).setVisualId(1);
      lom0 = l.getDataForScreen(0, ioMapping);
      assertEquals(0, lom0.getOfsX());
      assertEquals(0, lom0.getOfsY());
      assertEquals(2, lom0.getSameFxOnX());
      assertEquals(1, lom0.getSameFxOnY());
      assertEquals(0, lom0.getVisualId());
      assertEquals(false, lom0.screenDoesNotNeedStretching());

      LayoutModel lom1 = l.getDataForScreen(1, ioMapping);
      assertEquals(0, lom1.getOfsX());
      assertEquals(0, lom1.getOfsY());
      assertEquals(1, lom1.getSameFxOnX());
      assertEquals(1, lom1.getSameFxOnY());
      assertEquals(1, lom1.getVisualId());
View Full Code Here


    @Test
    public void basicTest() throws Exception {
      final int panels = 2;
     
      Layout l = new BoxLayout(panels, panels);
      assertEquals(panels, l.getRow1Size());
      assertEquals(panels, l.getRow2Size());     
      assertEquals(Layout.LayoutName.BOX, l.getLayoutName());
     
      MatrixData matrix = new MatrixData(8, 8);
      IFader fader = new Switch(matrix, 50);
      List<OutputMapping> ioMapping = new ArrayList<OutputMapping>();
    for (int n=0; n<panels+panels; n++) {
      ioMapping.add(new OutputMapping(fader, n));     
    }

    //testcase#1: each output has a visual assigned
      LayoutModel lom0 = l.getDataForScreen(0, ioMapping);
      assertEquals(0, lom0.getOfsX());
      assertEquals(0, lom0.getOfsY());
      assertEquals(1, lom0.getSameFxOnX());
      assertEquals(1, lom0.getSameFxOnY());
      assertEquals(0, lom0.getVisualId());
      assertEquals(true, lom0.screenDoesNotNeedStretching());
     
    //testcase#2: visual 0 is displayed on ALL outputs     
      ioMapping.clear();
    for (int n=0; n<panels+panels; n++) {
      ioMapping.add(new OutputMapping(fader, 0));     
    }
    lom0 = l.getDataForScreen(0, ioMapping);
      assertEquals(0, lom0.getOfsX());
      assertEquals(0, lom0.getOfsY());
      assertEquals(panels, lom0.getSameFxOnX());
      assertEquals(panels, lom0.getSameFxOnY());
      assertEquals(0, lom0.getVisualId());
      assertEquals(false, lom0.screenDoesNotNeedStretching());
     
      //testcase#3: mix, split vertically
      ioMapping.get(1).setVisualId(1);
      ioMapping.get(3).setVisualId(1);
    lom0 = l.getDataForScreen(0, ioMapping);
      assertEquals(0, lom0.getOfsX());
      assertEquals(0, lom0.getOfsY());
      assertEquals(1, lom0.getSameFxOnX());
      assertEquals(panels, lom0.getSameFxOnY());
      assertEquals(0, lom0.getVisualId());
View Full Code Here

TOP

Related Classes of com.neophob.sematrix.core.layout.Layout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.