示例#1
0
  public void testHoverOffWhenHoverStyledWasRemovedFromProp() throws Exception {
    MouseEvent event = new MouseEvent(new JPanel(), 1, 2, 3, 4, 5, 6, false);
    prop.hoverStyle = new FlatStyle();

    panel.mouseEntered(event);
    prop.hoverStyle = null;
    panel.mouseExited(event);

    assertEquals(Cursor.DEFAULT_CURSOR, root.getContentPane().getCursor().getType());
    assertEquals(null, style.getScreen());
  }
示例#2
0
  public void setUp() throws Exception {
    root = new RootPanel(new MockPropFrame());

    prop = new MockProp();
    style = prop.getStyle();
    panel = new PropPanel(prop);
    root.setPanel(panel);
  }
示例#3
0
  public void testHoverOnWithHoverStyle() throws Exception {
    MouseEvent event = new MouseEvent(new JPanel(), 1, 2, 3, 4, 5, 6, false);
    prop.hoverStyle = new FlatStyle();

    panel.mouseEntered(event);

    assertEquals(Cursor.HAND_CURSOR, root.getContentPane().getCursor().getType());
    assertSame(prop.hoverStyle, style.getScreen());
  }