Java 类javax.swing.plaf.basic.BasicIconFactory 实例源码

项目:cn1    文件:JTabbedPaneTest.java   
public void testAddComponentObjectint() {
    int index = 2;
    JComponent comp = new JLabel("label");
    comp.setName("labelName");
    Object constraints = "label";
    tabbed.add(comp, constraints, index);
    assertEquals("index", index, tabbed.indexOfComponent(comp));
    assertEquals("title", constraints, tabbed.getTitleAt(index));
    tabbed.remove(comp);
    comp = new JLabel("label");
    comp.setName("labelName");
    constraints = BasicIconFactory.createEmptyFrameIcon(); // just some icon
    tabbed.add(comp, constraints, index);
    assertEquals("title", "", tabbed.getTitleAt(index));
    assertEquals("icon", constraints, tabbed.getIconAt(index));
    tabbed.remove(comp);
    comp = new JLabel("label");
    comp.setName("labelName");
    constraints = new Integer(3); // just some Object
    tabbed.add(comp, constraints, 1);
    if (BasicSwingTestCase.isHarmony()) {
        assertEquals("title", "labelName", tabbed.getTitleAt(tabbed.indexOfComponent(comp)));
    }
    assertNull("icon", tabbed.getIconAt(tabbed.indexOfComponent(comp)));
    tabbed.remove(comp);
}
项目:freeVM    文件:JTabbedPaneTest.java   
public void testAddComponentObjectint() {
    int index = 2;
    JComponent comp = new JLabel("label");
    comp.setName("labelName");
    Object constraints = "label";
    tabbed.add(comp, constraints, index);
    assertEquals("index", index, tabbed.indexOfComponent(comp));
    assertEquals("title", constraints, tabbed.getTitleAt(index));
    tabbed.remove(comp);
    comp = new JLabel("label");
    comp.setName("labelName");
    constraints = BasicIconFactory.createEmptyFrameIcon(); // just some icon
    tabbed.add(comp, constraints, index);
    assertEquals("title", "", tabbed.getTitleAt(index));
    assertEquals("icon", constraints, tabbed.getIconAt(index));
    tabbed.remove(comp);
    comp = new JLabel("label");
    comp.setName("labelName");
    constraints = new Integer(3); // just some Object
    tabbed.add(comp, constraints, 1);
    if (BasicSwingTestCase.isHarmony()) {
        assertEquals("title", "labelName", tabbed.getTitleAt(tabbed.indexOfComponent(comp)));
    }
    assertNull("icon", tabbed.getIconAt(tabbed.indexOfComponent(comp)));
    tabbed.remove(comp);
}
项目:freeVM    文件:JTabbedPaneTest.java   
public void testAddComponentObjectint() {
    int index = 2;
    JComponent comp = new JLabel("label");
    comp.setName("labelName");
    Object constraints = "label";
    tabbed.add(comp, constraints, index);
    assertEquals("index", index, tabbed.indexOfComponent(comp));
    assertEquals("title", constraints, tabbed.getTitleAt(index));
    tabbed.remove(comp);
    comp = new JLabel("label");
    comp.setName("labelName");
    constraints = BasicIconFactory.createEmptyFrameIcon(); // just some icon
    tabbed.add(comp, constraints, index);
    assertEquals("title", "", tabbed.getTitleAt(index));
    assertEquals("icon", constraints, tabbed.getIconAt(index));
    tabbed.remove(comp);
    comp = new JLabel("label");
    comp.setName("labelName");
    constraints = new Integer(3); // just some Object
    tabbed.add(comp, constraints, 1);
    if (BasicSwingTestCase.isHarmony()) {
        assertEquals("title", "labelName", tabbed.getTitleAt(tabbed.indexOfComponent(comp)));
    }
    assertNull("icon", tabbed.getIconAt(tabbed.indexOfComponent(comp)));
    tabbed.remove(comp);
}
项目:cn1    文件:JTabbedPaneTest.java   
public void testIndexOfTabIcon() {
    Icon otherIcon = BasicIconFactory.getCheckBoxIcon();
    assertEquals("index of null", 0, tabbed.indexOfTab((Icon) null));
    tabbed.setIconAt(1, someIcon);
    assertEquals(1, tabbed.indexOfTab(someIcon));
    assertEquals("no icon", -1, tabbed.indexOfTab(otherIcon));
}
项目:freeVM    文件:JTabbedPaneTest.java   
public void testIndexOfTabIcon() {
    Icon otherIcon = BasicIconFactory.getCheckBoxIcon();
    assertEquals("index of null", 0, tabbed.indexOfTab((Icon) null));
    tabbed.setIconAt(1, someIcon);
    assertEquals(1, tabbed.indexOfTab(someIcon));
    assertEquals("no icon", -1, tabbed.indexOfTab(otherIcon));
}
项目:freeVM    文件:JTabbedPaneTest.java   
public void testIndexOfTabIcon() {
    Icon otherIcon = BasicIconFactory.getCheckBoxIcon();
    assertEquals("index of null", 0, tabbed.indexOfTab((Icon) null));
    tabbed.setIconAt(1, someIcon);
    assertEquals(1, tabbed.indexOfTab(someIcon));
    assertEquals("no icon", -1, tabbed.indexOfTab(otherIcon));
}