| java.lang.Object com.sun.midp.i3test.TestCase javax.microedition.lcdui.TestItemLFImplLDoInternalLayout
TestItemLFImplLDoInternalLayout | public class TestItemLFImplLDoInternalLayout extends TestCase (Code) | | This test is designed to test Chameleon's ItemLFImpl.lDoInternalLayout()
routine only. It does not test label size or content size calculations.
It tests label location and content location calculations.
Internal layout for all items is handled in ItemLFImpl.
lDoInternalLayout() is given label and content sizes and available
width, height, it should place label and content in correct place.
Here is what to expect:
If label and content are empty, both bounds are set to 0.
If label is empty, content is given as much space as it needs but
not more than available.
If content is empty, label is given as much space as it needs but
not more than available.
If label is a single line label (its height <= label font height) then
there is an attempt to fit label, content and 3 pixel padding between
them on the same line.
Otherwise content is placed under label with 2 pixel horizontal padding
in between.
Furthermore, if label and content are on the same line than
shorter part (label or content) is vertically centered
against the taller one (content or label).
Then if there is extra space (item can fit in smaller size than
it is given) then the space is distributed based on the layout
primitives set.
ItemLFImpl and Item area abstract in javax.microedition.lcdui.
We extend them to test lDoInternalLayout().
|
Inner Class :class TestItem extends Item | |
Inner Class :class TestItemLFImpl extends ItemLFImpl | |
runTests | public void runTests()(Code) | | |
Methods inherited from com.sun.midp.i3test.TestCase | public void assertEquals(Object expected, Object actual)(Code)(Java Doc) public void assertEquals(String message, Object expected, Object actual)(Code)(Java Doc) public void assertEquals(int expected, int actual)(Code)(Java Doc) public void assertEquals(String message, int expected, int actual)(Code)(Java Doc) public void assertFalse(boolean condition)(Code)(Java Doc) public void assertFalse(String message, boolean condition)(Code)(Java Doc) public void assertNotNull(Object object)(Code)(Java Doc) public void assertNotNull(String message, Object object)(Code)(Java Doc) public void assertNotSame(Object expected, Object actual)(Code)(Java Doc) public void assertNotSame(String message, Object expected, Object actual)(Code)(Java Doc) public void assertNull(Object object)(Code)(Java Doc) public void assertNull(String message, Object object)(Code)(Java Doc) public void assertSame(Object expected, Object actual)(Code)(Java Doc) public void assertSame(String message, Object expected, Object actual)(Code)(Java Doc) public void assertTrue(String message, boolean condition)(Code)(Java Doc) public void assertTrue(boolean condition)(Code)(Java Doc) public void declare(String testName)(Code)(Java Doc) public void fail()(Code)(Java Doc) public void fail(String message)(Code)(Java Doc) protected SecurityToken getSecurityToken()(Code)(Java Doc) protected boolean getVerbose()(Code)(Java Doc) public void info(String s)(Code)(Java Doc) abstract public void runTests() throws Throwable(Code)(Java Doc)
|
|
|