Examples of MockEventAction


Examples of limelight.ui.model.inputs.MockEventAction

    parent.setSize(1000, 1000);
    child.setLocation(250, 250);
    child.setSize(500, 500);

    parentAction = new MockEventAction();
    childAction = new MockEventAction();
  }
View Full Code Here

Examples of limelight.ui.model.inputs.MockEventAction

    child2Panel.setLocation(1, 1);
    child2Panel.setSize(100, 100);

    assertNull(listener.hooveredPanel);

    MockEventAction moveAction = new MockEventAction();
    parent.getEventHandler().add(MouseEnteredEvent.class, parentAction);
    parent.getEventHandler().add(MouseMovedEvent.class, moveAction);
    listener.mouseMoved(event(0, 0));
    assertSame(parent, listener.hooveredPanel);
    checkEvent(parentAction, MouseEnteredEvent.class, 0, 0);
    checkEvent(moveAction, MouseMovedEvent.class, 0, 0);

    moveAction.reset();
    parentAction.reset();
    MockEventAction child2MoveAction = new MockEventAction();
    child2Panel.getEventHandler().add(MouseEnteredEvent.class, childAction);
    child2Panel.getEventHandler().add(MouseMovedEvent.class, child2MoveAction);
    listener.mouseMoved(event(50, 50));
    assertSame(child2Panel, listener.hooveredPanel);
    assertEquals(false, moveAction.invoked || parentAction.invoked);
    checkEvent(childAction, MouseEnteredEvent.class, 50, 50);
    checkEvent(child2MoveAction, MouseMovedEvent.class, 50, 50);

    child2MoveAction.reset();
    MockEventAction childExitAction = new MockEventAction();
    MockEventAction childMoveAction = new MockEventAction();
    child2Panel.getEventHandler().add(MouseExitedEvent.class, childExitAction);
    child.getEventHandler().add(MouseMovedEvent.class, childMoveAction);
    listener.mouseMoved(event(500, 500));
    assertSame(child, listener.hooveredPanel);
    checkEvent(childExitAction, MouseExitedEvent.class, 500, 500);
View Full Code Here

Examples of limelight.ui.model.inputs.MockEventAction

    child2Panel.setLocation(1, 1);
    child2Panel.setSize(100, 100);

    assertNull(listener.hooveredPanel);

    MockEventAction parentDragAction = new MockEventAction();
    parent.getEventHandler().add(MouseDraggedEvent.class, parentDragAction);
    listener.mousePressed(event(0, 0));
    listener.mouseDragged(event(0, 0));
    assertSame(parent, listener.hooveredPanel);
    checkEvent(parentDragAction, MouseDraggedEvent.class, 0, 0);

    parentDragAction.reset();
    MockEventAction child2EnteredAction = new MockEventAction();
    child2Panel.getEventHandler().add(MouseEnteredEvent.class, child2EnteredAction);
    listener.mouseDragged(event(50, 50));
    assertSame(child2Panel, listener.hooveredPanel);
    checkEvent(parentDragAction, MouseDraggedEvent.class, 50, 50);
    checkEvent(child2EnteredAction, MouseEnteredEvent.class, 50, 50);

    MockEventAction child2ExitedAction = new MockEventAction();
    child2Panel.getEventHandler().add(MouseExitedEvent.class, child2ExitedAction);
    MockEventAction childEnteredAction = new MockEventAction();
    child.getEventHandler().add(MouseEnteredEvent.class, childEnteredAction);
    listener.mouseDragged(event(500, 500));
    assertSame(child, listener.hooveredPanel);
    checkEvent(child2ExitedAction, MouseExitedEvent.class, 500, 500);
    checkEvent(childEnteredAction, MouseEnteredEvent.class, 500, 500);
View Full Code Here

Examples of limelight.ui.model.inputs.MockEventAction

    context.frameManager = manager;
    context.studio = new MockStudio();
    context.environment = "test";
    stage = new MockStage();
    frame = new StageFrame(stage);
    action = new MockEventAction();
  }
View Full Code Here

Examples of limelight.ui.model.inputs.MockEventAction

    root = new FakeScene();
    listener = new StageKeyListener(root);
    panel = new MockParentPanel();
    root.add(panel);
    component = new Panel();
    action = new MockEventAction();
    action2 = new MockEventAction();
  }
View Full Code Here

Examples of limelight.ui.model.inputs.MockEventAction

  @Test
  public void dispatching() throws Exception
  {
    MockPanel recipient = new MockPanel();
    MockEventAction action = new MockEventAction();
    recipient.getEventHandler().add(event.getClass(), action);

    event.dispatch(recipient);

    assertEquals(event, action.event);
View Full Code Here

Examples of limelight.ui.model.inputs.MockEventAction

  private ParentPanelBase parent;

  @Before
  public void setUp() throws Exception
  {
    action = new MockEventAction();
    parent = new TestableParentPanel();
    panel = new TestablePanelBase();
    parent.add(panel);
  }
View Full Code Here

Examples of limelight.ui.model.inputs.MockEventAction

  public void setUp() throws Exception
  {
    production = new FakeProduction("/foo/bar");
    studio = new MockStudio();
    Context.instance().studio = studio;
    action = new MockEventAction();
  }
View Full Code Here

Examples of limelight.ui.model.inputs.MockEventAction

  @Test
  public void closeProduction() throws Exception
  {
    production.open();
    MockEventAction closingAction = new MockEventAction();
    MockEventAction closedAction = new MockEventAction();
    production.getEventHandler().add(ProductionClosingEvent.class, closingAction);
    production.getEventHandler().add(ProductionClosedEvent.class, closedAction);

    production.close();
    production.getClosingThread().join();
View Full Code Here

Examples of limelight.ui.model.inputs.MockEventAction

  @Before
  public void setUp() throws Exception
  {
    production = new FakeProduction();
    event = new TestableProductionEvent();
    action = new MockEventAction();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.