Exemplo n.º 1
0
  public void setUp() throws Exception {
    root = new RootPanel(new MockPropFrame());

    prop = new MockProp();
    style = prop.getStyle();
    panel = new PropPanel(prop);
    root.setPanel(panel);
  }
Exemplo n.º 2
0
  public void testHoverOnWithoutHoverStyle() throws Exception {
    MouseEvent event = new MouseEvent(new JPanel(), 1, 2, 3, 4, 5, 6, false);
    prop.hoverStyle = null;

    panel.mouseEntered(event);

    assertEquals(Cursor.DEFAULT_CURSOR, root.getContentPane().getCursor().getType());
    assertEquals(null, style.getScreen());
  }
Exemplo n.º 3
0
  public void testHorizontalMouseWheelMovement() throws Exception {
    panel.addVerticalScrollBar();
    panel.getVerticalScrollbar().configure(100, 200);
    panel.addHorizontalScrollBar();
    panel.getHorizontalScrollbar().configure(100, 200);

    int modifer = 1;
    int scrollAmount = 8;
    int wheelRotation = 2;
    MouseWheelEvent e =
        new MouseWheelEvent(
            root.getContentPane(), 1, 2, modifer, 4, 5, 6, false, 7, scrollAmount, wheelRotation);

    panel.mouseWheelMoved(e);

    assertEquals(0, panel.getVerticalScrollbar().getScrollBar().getValue());
    assertEquals(16, panel.getHorizontalScrollbar().getScrollBar().getValue());
  }