? diffTest.txt ? data/.xvpics ? data/testIcon24.gif ? data/testIcon24_disabled.gif ? data/testIcon24_pressed.gif ? data/testIcon24_rollover.gif Index: ActionsTest.java =================================================================== RCS file: /cvs/openide/test/unit/src/org/openide/awt/ActionsTest.java,v retrieving revision 1.4 diff -c -r1.4 ActionsTest.java *** ActionsTest.java 18 Feb 2004 14:21:25 -0000 1.4 --- ActionsTest.java 13 May 2004 15:10:56 -0000 *************** *** 45,54 **** // testIcon_pressed.gif // testIcon_disabled.gif private static int[][] RESULT_COLORS = { ! {83, 155, 226 }, ! {206, 132, 202}, ! {216, 202, 130}, ! {221, 130, 130} }; public ActionsTest(String name) { --- 45,58 ---- // testIcon_pressed.gif // testIcon_disabled.gif private static int[][] RESULT_COLORS = { ! {83, 155, 226}, ! {206, 132, 202}, ! {216, 202, 130}, ! {221, 130, 130}, ! {50, 200, 34}, ! {100, 100, 50}, ! {50, 50, 200}, ! {200, 50, 50} }; public ActionsTest(String name) { *************** *** 63,69 **** System.setProperty("org.openide.util.Lookup", "org.openide.awt.ActionsTest$Lkp"); assertNotNull ("Keymap has to be in lookup", org.openide.util.Lookup.getDefault ().lookup (Keymap.class)); } ! /** * Test whether pressed, rollover and disabled icons --- 67,97 ---- System.setProperty("org.openide.util.Lookup", "org.openide.awt.ActionsTest$Lkp"); assertNotNull ("Keymap has to be in lookup", org.openide.util.Lookup.getDefault ().lookup (Keymap.class)); } ! ! /** ! * Test whether pressed, rollover and disabled icons ! * work for javax.swing.Action. ! */ ! public void testIconsAction() throws Exception { ! JButton jb = new JButton(); ! Actions.connect(jb, new TestAction()); ! ! Icon icon = jb.getIcon(); ! assertNotNull(icon); ! if (! isIconOk(icon, jb, RESULT_COLORS[0])) fail(); ! ! Icon rolloverIcon = jb.getRolloverIcon(); ! assertNotNull(rolloverIcon); ! if (! isIconOk(rolloverIcon, jb, RESULT_COLORS[1])) fail(); ! ! Icon pressedIcon = jb.getPressedIcon(); ! assertNotNull(pressedIcon); ! if (! isIconOk(pressedIcon, jb, RESULT_COLORS[2])) fail(); ! ! Icon disabledIcon = jb.getDisabledIcon(); ! assertNotNull(disabledIcon); ! if (! isIconOk(disabledIcon, jb, RESULT_COLORS[3])) fail(); ! } /** * Test whether pressed, rollover and disabled icons *************** *** 93,120 **** } /** ! * Test whether pressed, rollover and disabled icons * work for javax.swing.Action. */ ! public void testIconsAction() throws Exception { JButton jb = new JButton(); Actions.connect(jb, new TestAction()); Icon icon = jb.getIcon(); assertNotNull(icon); ! if (! isIconOk(icon, jb, RESULT_COLORS[0])) fail(); Icon rolloverIcon = jb.getRolloverIcon(); assertNotNull(rolloverIcon); ! if (! isIconOk(rolloverIcon, jb, RESULT_COLORS[1])) fail(); Icon pressedIcon = jb.getPressedIcon(); assertNotNull(pressedIcon); ! if (! isIconOk(pressedIcon, jb, RESULT_COLORS[2])) fail(); Icon disabledIcon = jb.getDisabledIcon(); assertNotNull(disabledIcon); ! if (! isIconOk(disabledIcon, jb, RESULT_COLORS[3])) fail(); } /** --- 121,177 ---- } /** ! * Test whether pressed, rollover and disabled 24x24 icons * work for javax.swing.Action. */ ! public void testIconsAction24() throws Exception { JButton jb = new JButton(); + jb.putClientProperty("PreferredIconSize","24"); Actions.connect(jb, new TestAction()); Icon icon = jb.getIcon(); assertNotNull(icon); ! if (! isIconOk(icon, jb, RESULT_COLORS[4])) fail(); Icon rolloverIcon = jb.getRolloverIcon(); assertNotNull(rolloverIcon); ! if (! isIconOk(rolloverIcon, jb, RESULT_COLORS[5])) fail(); Icon pressedIcon = jb.getPressedIcon(); assertNotNull(pressedIcon); ! if (! isIconOk(pressedIcon, jb, RESULT_COLORS[6])) fail(); Icon disabledIcon = jb.getDisabledIcon(); assertNotNull(disabledIcon); ! if (! isIconOk(disabledIcon, jb, RESULT_COLORS[7])) fail(); ! } ! ! /** ! * Test whether pressed, rollover and disabled 24x24 icons ! * work for SystemAction. ! */ ! public void testIconsSystemAction24() throws Exception { ! SystemAction saInstance = SystemAction.get(TestSystemAction.class); ! ! JButton jb = new JButton(); ! jb.putClientProperty("PreferredIconSize","24"); ! Actions.connect(jb, saInstance); ! ! Icon icon = jb.getIcon(); ! assertNotNull(icon); ! if (! isIconOk(icon, jb, RESULT_COLORS[4])) fail(); ! ! Icon rolloverIcon = jb.getRolloverIcon(); ! assertNotNull(rolloverIcon); ! if (! isIconOk(rolloverIcon, jb, RESULT_COLORS[5])) fail(); ! ! Icon pressedIcon = jb.getPressedIcon(); ! assertNotNull(pressedIcon); ! if (! isIconOk(pressedIcon, jb, RESULT_COLORS[6])) fail(); ! ! Icon disabledIcon = jb.getDisabledIcon(); ! assertNotNull(disabledIcon); ! if (! isIconOk(disabledIcon, jb, RESULT_COLORS[7])) fail(); } /**