Bug 79625 - [nbmidp] TableItem is badly displayed in emulator/phone
[nbmidp] TableItem is badly displayed in emulator/phone
Status: RESOLVED WONTFIX
Product: javame
Classification: Unclassified
Component: Visual Designer
5.x
All Windows XP
: P3 (vote)
: 6.x
Assigned To: Karol Harezlak
issues@mobility
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-03 15:54 UTC by Fabiola Rios
Modified: 2007-10-30 18:23 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
sample project with table (11.83 KB, application/octet-stream)
2006-07-24 12:34 UTC, Lukas Hasik
Details
screenshot of a wrongly painted table (27.23 KB, image/jpeg)
2006-07-24 12:35 UTC, Lukas Hasik
Details
Screenshot of trivial MIDlet with TableItem displayed as black rectangle on P910 (5.85 KB, image/png)
2006-09-13 23:34 UTC, dimitris
Details
TableTrouble MIDlet running under the emulator and displaying fine (156.05 KB, image/png)
2006-09-13 23:43 UTC, dimitris
Details
MIDlet source code (6.00 KB, text/plain)
2006-09-17 23:45 UTC, dimitris
Details
Emulator snapshot with ColorSchema.isBackgroundTransparent() returning false (155.06 KB, image/png)
2006-09-17 23:47 UTC, dimitris
Details
Emulator snapshot with ColorSchema.isBackgroundTransparent() returning true (155.60 KB, image/png)
2006-09-17 23:49 UTC, dimitris
Details
MIDlet on P910, ColorSchema.isBackgroundTransparent() returns false (6.27 KB, image/png)
2006-09-17 23:50 UTC, dimitris
Details
MIDlet on P910a, ColorSchema.isBackgroundTransparent() returns true (7.18 KB, image/png)
2006-09-17 23:51 UTC, dimitris
Details
MIDlet on P910a, ColorSchema.isBackgroundTransparent() returns true, after some scrolling in the table (6.73 KB, image/png)
2006-09-17 23:52 UTC, dimitris
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabiola Rios 2006-07-03 15:54:33 UTC
(it was bug 6323262) 

---Decription---
create a midlet with TableItem- run the project- the table looks strange. See
screenshot from emulator. It look even worse on real phone.
--------------

---Evaluation---
I fixed the particular problem from the screenshot, but the table still behaves
strangely on some devices. On WTK it seems to be working ok, but on the real
devices there is still a lot of work.
--------------
Comment 1 Lukas Hasik 2006-07-24 10:35:01 UTC
*** Issue 80447 has been marked as a duplicate of this issue. ***
Comment 2 Lukas Hasik 2006-07-24 12:34:57 UTC
Created attachment 32138 [details]
sample project with table
Comment 3 Lukas Hasik 2006-07-24 12:35:39 UTC
Created attachment 32139 [details]
screenshot of a wrongly painted table
Comment 4 Martin Brehovsky 2006-09-07 14:07:59 UTC
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 ...).

Comment 5 dimitris 2006-09-13 23:34:47 UTC
Created attachment 33907 [details]
Screenshot of trivial MIDlet with TableItem displayed as black rectangle on P910
Comment 6 dimitris 2006-09-13 23:38:18 UTC
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.
Comment 7 dimitris 2006-09-13 23:43:17 UTC
Created attachment 33908 [details]
TableTrouble MIDlet running under the emulator and displaying fine
Comment 8 Lukas Hasik 2006-09-14 09:03:37 UTC
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.
Comment 9 dimitris 2006-09-17 23:45:58 UTC
Created attachment 34058 [details]
MIDlet source code
Comment 10 dimitris 2006-09-17 23:47:40 UTC
Created attachment 34059 [details]
Emulator snapshot with ColorSchema.isBackgroundTransparent() returning false
Comment 11 dimitris 2006-09-17 23:49:07 UTC
Created attachment 34060 [details]
Emulator snapshot with ColorSchema.isBackgroundTransparent() returning true
Comment 12 dimitris 2006-09-17 23:50:29 UTC
Created attachment 34061 [details]
MIDlet on P910, ColorSchema.isBackgroundTransparent() returns false
Comment 13 dimitris 2006-09-17 23:51:49 UTC
Created attachment 34062 [details]
MIDlet on P910a, ColorSchema.isBackgroundTransparent() returns true
Comment 14 dimitris 2006-09-17 23:52:59 UTC
Created attachment 34063 [details]
MIDlet on P910a, ColorSchema.isBackgroundTransparent() returns true, after some scrolling in the table
Comment 15 dimitris 2006-09-18 00:01:20 UTC
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
Comment 16 Martin Brehovsky 2006-09-18 17:05:22 UTC
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.



Comment 17 dimitris 2006-09-19 06:53:06 UTC
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;
    }
}
Comment 18 _ gtzabari 2006-12-29 20:51:30 UTC
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?
Comment 19 Martin Brehovsky 2006-12-30 10:37:32 UTC
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.
Comment 20 David Kaspar 2007-07-11 09:27:40 UTC
Designer 1 has been removed. Therefore reassigning to Designer 2 module.
Karol, could you check this issue? Thanks.
Comment 21 Karol Harezlak 2007-08-31 15:10:24 UTC
This is Java ME implementation related issue, there is not much I can do about.
Comment 22 Marian Mirilovic 2007-10-30 18:23:38 UTC
Nobody will waive WONTFIXed issue ...


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo