This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | [nbmidp] TableItem is badly displayed in emulator/phone | ||
---|---|---|---|
Product: | javame | Reporter: | Fabiola Rios <fabiola> |
Component: | Visual Designer | Assignee: | Karol Harezlak <kharezlak> |
Status: | RESOLVED WONTFIX | ||
Severity: | blocker | CC: | gtzabari, mmirilovic |
Priority: | P3 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
sample project with table
screenshot of a wrongly painted table Screenshot of trivial MIDlet with TableItem displayed as black rectangle on P910 TableTrouble MIDlet running under the emulator and displaying fine MIDlet source code Emulator snapshot with ColorSchema.isBackgroundTransparent() returning false Emulator snapshot with ColorSchema.isBackgroundTransparent() returning true MIDlet on P910, ColorSchema.isBackgroundTransparent() returns false MIDlet on P910a, ColorSchema.isBackgroundTransparent() returns true MIDlet on P910a, ColorSchema.isBackgroundTransparent() returns true, after some scrolling in the table |
Description
Fabiola Rios
2006-07-03 15:54:33 UTC
*** Issue 80447 has been marked as a duplicate of this issue. *** Created attachment 32138 [details]
sample project with table
Created attachment 32139 [details]
screenshot of a wrongly painted table
I'm still experiencing some problems when drawing the table item on sony ericsson phones - their devices expect a wrong size for the item (they seem to be include the size of the label to the expected size ...). Created attachment 33907 [details]
Screenshot of trivial MIDlet with TableItem displayed as black rectangle on P910
I also have encountered problems where TableItems look fine in the emulator, but aren't drawn correctly on the device, a SEMC P910a. I created an attachment of a trivial MIDlet with a Form that only contains a TableItem. I've already reported this in the SEMC forum. See this for more details: http://developer.sonyericsson.com/thread.jspa?threadID=24308&tstart=0 My entry is under "dkogias". Also note that I tried the invalidate() hack mentioned in the same thread, but I saw exactly the same behavior. Created attachment 33908 [details]
TableTrouble MIDlet running under the emulator and displaying fine
Dimitris, could you try it with latest 5.5 q-build? There was introduce new class ColorSchema. IMO, the cause of the black table is the same like in issue 80447. Created attachment 34058 [details]
MIDlet source code
Created attachment 34059 [details]
Emulator snapshot with ColorSchema.isBackgroundTransparent() returning false
Created attachment 34060 [details]
Emulator snapshot with ColorSchema.isBackgroundTransparent() returning true
Created attachment 34061 [details]
MIDlet on P910, ColorSchema.isBackgroundTransparent() returns false
Created attachment 34062 [details]
MIDlet on P910a, ColorSchema.isBackgroundTransparent() returns true
Created attachment 34063 [details]
MIDlet on P910a, ColorSchema.isBackgroundTransparent() returns true, after some scrolling in the table
I installed q-build 200609062200. This is on a Debian Linux box, using JDK 1.5_08. I modified the code to use ColorSchema, see the source attachment: http://www.netbeans.org/nonav/issues/showattachment.cgi/34058/TableTrouble.java I tried several combinations of return values for ColorSchema.getColor() and ColorSchema.isBackgroundTransparent(). All other ColorSchema methods were the same in all cases, returning the values they return in the TableTrouble.java attachment above. When returning false in ColorSchema.isBackgroundTransparent(), the table comes up as a black blob, both in the emulator and on the device. This happens even though the background image is always returned as null. See these attachments: http://www.netbeans.org/nonav/issues/showattachment.cgi/34059/tt-emulator-foreground-opaque.png http://www.netbeans.org/nonav/issues/showattachment.cgi/34061/tt-p910a-foreground-opaque.png If I instead return true from ColorSchema.isBackgroundTransparent(), the table displays. However, both on the emulator and on the device, once you scroll through the cells there are problems. On the emulator, the highlighted cell text is not masked. Instead, the cell is all black: http://www.netbeans.org/nonav/issues/showattachment.cgi/34060/tt-emulator-foreground-transparent.png On the device, the table also first draws correctly: http://www.netbeans.org/nonav/issues/showattachment.cgi/34062/tt-p910a-foreground-transparent.png but then, once I scroll, both the current cell and any cells I navigated through before are left all black: http://www.netbeans.org/nonav/issues/showattachment.cgi/34063/tt-p910a-foreground-transparent-scroll.png The problem here is that generally the CustomItem is responsible for clearing its background, so usually you wantisBackgroundTransparent() method should return false. For some devices, though, the implementation does clear the background automatically and displays a wallpaper on that (e.g. Nokia Series40 3rd edition), so making background transparent significantly enhances the look and feel of the custom item. In the case of P910, you want to paint background, but you need to set appropriate color(white?) for that. It looks like the device itself is using wrong colors there. Can you post what colors are returned on P910 from the following calls? getDisplay().getColor(Display.COLOR_FOREGROUND); getDisplay().getColor(Display.COLOR_BORDER); getDisplay().getColor(Display.COLOR_BACKGROUND); getDisplay().getColor(Display.COLOR_HIGHLIGHTED_FOREGROUND); getDisplay().getColor(Display.COLOR_HIGHLIGHTED_BORDER); getDisplay().getColor(Display.COLOR_HIGHLIGHTED_BACKGROUND); What you need to get there is that background and foreground are contrast colors. Border might be the same color as foreground, but also contrasting to background. In the case of P910 I'm afraid the background returns the same color as foreground (black). To fix that, you need to create your own color schema (UserColorSchema) with contrasting colors. Let me know if it helped. Thanks, this worked in my ColorSchema subclass: private static final int WHITE = 0xffffff; private static final int BLACK = 0x000000; public int getColor(int aColorSpecifier) { switch (aColorSpecifier) { case Display.COLOR_BACKGROUND: case Display.COLOR_HIGHLIGHTED_FOREGROUND: return WHITE; case Display.COLOR_FOREGROUND: case Display.COLOR_HIGHLIGHTED_BACKGROUND: case Display.COLOR_BORDER: case Display.COLOR_HIGHLIGHTED_BORDER: return BLACK; default: return BLACK; } } On a BlackBerry Pearl (model 8100) the TableItem displays as an opaque black box for me. When I applied the ColorSchema subclass mentioned below it fixed the problem. Are you planning to roll out this fix in the next release? The color schema classes are available in 5.5 release of Mobility Pack. I'm afraid there is not many things I could do to fix the component for the blackberry without changing it's behavior for other devices. This should be fixed rather on the Blackberry side, since their implementation does not fully follow MIDP2 standard. Perhaps a bug should be submitted to RIM. Designer 1 has been removed. Therefore reassigning to Designer 2 module. Karol, could you check this issue? Thanks. This is Java ME implementation related issue, there is not much I can do about. Nobody will waive WONTFIXed issue ... |