Package limelight.events

Examples of limelight.events.EventAction


    dropDown.setPopup(this);
  }

  private void createListItems()
  {
    EventAction itemChosenAction = new EventAction()
    {
      public void invoke(Event e)
      {
        PanelEvent event = (PanelEvent)e;
        choose((PropPanel) event.getRecipient());
      }
    };

    EventAction itemSelectedAction = new EventAction()
    {
      public void invoke(Event e)
      {
        PanelEvent event = (PanelEvent)e;
        select((PropPanel) event.getRecipient());
View Full Code Here


    popupList = new PropPanel(new SimplePropProxy(), Util.toMap("name", "limelight_builtin_drop_down_popup_list"));
    popupList.getStyle().addExtension(stylesStore.get("limelight_builtin_drop_down_popup_list"));
    popupList.getStyle().setX(dropDown.getParent().getAbsoluteLocation().x - dropDown.getRoot().getX());
    popupList.getStyle().setY(dropDown.getParent().getAbsoluteLocation().y - dropDown.getRoot().getY());
    popupList.getStyle().setWidth(dropDown.getParent().getWidth());
    popupList.getEventHandler().add(MouseClickedEvent.class, new EventAction()
    {
      public void invoke(Event event)
      {
        // eat the event so the curtains won't get it
      }
View Full Code Here

  private void createCurtains()
  {
    curtains = new PropPanel(new SimplePropProxy(), Util.toMap("name", "limelight_builtin_curtains"));
    curtains.getStyle().addExtension(stylesStore.get("limelight_builtin_curtains"));
    curtains.getEventHandler().add(MouseClickedEvent.class, new EventAction()
    {
      public void invoke(Event event)
      {
        close();
      }
View Full Code Here

  private Panel dispatchedRecipient;
  @Test
  public void theRecipientIsSetOnlyDuringDispatchAndThenRestored() throws Exception
  {
    TestablePanelBase recipient = new TestablePanelBase();
    recipient.getEventHandler().add(TestableEvent.class, new EventAction(){
      public void invoke(Event event)
      {
        dispatchedRecipient = ((PanelEvent)event).getRecipient();
      }
    });
View Full Code Here

  }

  @Test
  public void addingToNullEvent() throws Exception
  {
    EventAction action = EventActionMulticaster.add(action1, null);
    assertSame(action1, action);
  }
View Full Code Here

  }

  @Test
  public void addingActionToNull() throws Exception
  {
    EventAction action = EventActionMulticaster.add(null, action1);
    assertSame(action1, action);
  }
View Full Code Here

  }

  @Test
  public void addingTwoActions() throws Exception
  {
    EventAction action = EventActionMulticaster.add(action1, action2);

    assertEquals(EventActionMulticaster.class, action.getClass());
    EventActionMulticaster multicaster = (EventActionMulticaster) action;
    assertEquals(action1, multicaster.getFirst());
    assertEquals(action2, multicaster.getSecond());
  }
View Full Code Here

  }

  @Test
  public void actionsAreInvokedInOrder() throws Exception
  {
    EventAction action = EventActionMulticaster.add(action1, action2);

    action.invoke(null);

    assertSame(action1, invokations.get(0));
    assertSame(action2, invokations.get(1));
  }
View Full Code Here

  }

  @Test
  public void chainingMulticasters() throws Exception
  {
    EventAction action = EventActionMulticaster.add(action1, action2);
    action = EventActionMulticaster.add(action, action3);
    action = EventActionMulticaster.add(action, action4);
    action = EventActionMulticaster.add(action, action5);

    action.invoke(null);

    assertEquals(action1, invokations.get(0));
    assertEquals(action2, invokations.get(1));
    assertEquals(action3, invokations.get(2));
    assertEquals(action4, invokations.get(3));
View Full Code Here

  }

  @Test
  public void removingOnlyAction() throws Exception
  {
    EventAction action = EventActionMulticaster.remove(action1, action1);

    assertEquals(null, action);
  }
View Full Code Here

TOP

Related Classes of limelight.events.EventAction

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.