Skip to main content

Inline editing again

43 replies [Last post]
Anonymous

OK, so if I run my app on a samsung blackjack 2 again, even if I set qwerty
to true, is TextField supposed to work? We can't seem to be able to type
anything other numbers

--
http://www.spectrumdt.com
http://codepimps.org
[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Qunhuan Mei

Hi again Shai,

Did you manage to see the problem following the steps listed below?

Regards,

Qunhuan

From: Qunhuan Mei
Sent: 08 September 2008 14:40
To: users@lwuit.dev.java.net
Subject: RE: Problem handling different size of list when doing component transition on form

(Looks like good news - problem gone ... :))

Here are the steps to expose the problem:

Start the app:

* Problem 1: While focus is on the link 1, press selection key, "short list" transits in. The first "down" key press has been ignored by the system (should not be ! :(). The second "down" key press leads to the focus moved to the link 2. Click link 2, "long list" transits in.

* Problem 2: At this moment, there are only 3 items on the screen - and also the scroll bar looks wired.
Keep playing around, you may find more problems.

If you still can't see any problem, please let me know. I can provide screen copies. (I am using netbeans 6.5, WTK 2.5.2 on Windows Vista, I suppose this won't make any difference)

Many thanks,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 08 September 2008 14:13
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing component transition on form

Hi,
sorry but I don't see the problem. Your sample seems to work as expected.

Hi again, Shai,

This is the source code - it is very straightforward. Page of different number of links appears to be a quite common use case. It would be very useful if LWUIT could support this.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

import com.sun.lwuit.Command;
import com.sun.lwuit.Container;

import com.sun.lwuit.geom.Dimension;
import com.sun.lwuit.Display;
import com.sun.lwuit.Font;
import com.sun.lwuit.Form;
import com.sun.lwuit.Label;
import com.sun.lwuit.Image;

import com.sun.lwuit.animations.Transition;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.events.ActionListener;

import com.sun.lwuit.List;

import com.sun.lwuit.layouts.BorderLayout;
import com.sun.lwuit.layouts.BoxLayout;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;
import java.util.Hashtable;
import javax.microedition.midlet.MIDlet;

/**
* Bootstraps the UI toolkit demos
*
*/
public class ProblemMIDlet extends MIDlet implements ActionListener {//, Painter {

boolean TRANSITION_VERTICAL_NOT_HORIZONTAL = false;

private static final Command backCommand = new Command("Back");//
Label logoLabel, labelLong, labelShort;
private String[] shortList = {
"Short list link 1",
"Short list link 2",
"Short list link 3"
};
private String[] longList = {
"Long list link 1",
"Long list link 2",
"Long list link 3",
"Long list link 4",
"Long list link 5",
"Long list link 6",
"Long list link 7",
"Long list link 8",
"Long list link 9",
"Long list link 10",
"Long list link 11",
"Long list link 12",
"Long list link 13",
"Long list link 14",
"Long list link 15",
"Long list link 16",
"Long list link 17",
"Long list link 18",
"Long list link 19",
"Long list link 20",
"Long list link 21",
"Long list link 22",
"Long list link 23",
"Long list link 24",
"Long list link 25",
"Long list link 26"
};
Form form;

Container containerLong, containerShort;
CommonTransitions transition;
boolean currentContainerIsLong;

Form getInitialisedForm() {
form = new Form();
form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
form.setScrollable(false);

form.addCommand(backCommand);
return form;
}

void addLogoImageToTopOfTheForm(Form form) {
try {
//Image image = Image.createImage("/logoImage.png");

logoLabel = new Label("image");
logoLabel.setAlignment(Label.CENTER); // No effect!?
form.addComponent(logoLabel);
} catch (Exception ex) {
ex.printStackTrace();
}
}

void initialiseResource() {
try {
//Resources r = Resources.open("/client.res");
//UIManager.getInstance().setThemeProps(r.getTheme(r.getThemeResourceNames()[0]));
} catch (Exception ex) {
ex.printStackTrace();
}
}

Container getInitialiseContainerLong() {
Container container = new Container();
Label label = new Label("Title Long list");
container.addComponent(label);

List list = new List(longList);

int idealWidth = Display.getInstance().getDisplayWidth();
int idealLongListHeight = list.getPreferredH();
Dimension dimension = new Dimension(idealWidth, idealLongListHeight);//list.getHeight());

System.out.println(" idealLongListHeight: "+idealLongListHeight);

list.setPreferredSize(dimension);
list.setFixedSelection(List.FIXED_NONE_CYCLIC);
list.addActionListener(this);
container.addComponent(list);
return container;
}

Container getInitialiseContainerShort() {
Container container = new Container();
Label label = new Label("Title Short list");
container.addComponent(label);

List list = new List(shortList);

int idealWidth = Display.getInstance().getDisplayWidth();
int idealShortListHeight = list.getPreferredH();
Dimension dimension = new Dimension(idealWidth, idealShortListHeight);//idealHeight);//list.getHeight());

System.out.println(" idealShortListHeight: "+idealShortListHeight);

list.setPreferredSize(dimension);
list.addActionListener(this);
list.setFixedSelection(List.FIXED_NONE_CYCLIC);
container.addComponent(list);
return container;
}

protected void startApp() {

Display.init(this);
initialiseResource();

form = getInitialisedForm();

addLogoImageToTopOfTheForm(form);

containerLong = getInitialiseContainerLong();

containerShort = getInitialiseContainerShort();

form.addComponent(containerLong);

currentContainerIsLong = true;
form.setCommandListener(this);
form.show();

}

protected void pauseApp() {
}

protected void destroyApp(boolean arg0) {
}

public void actionPerformed(ActionEvent evt) {
Command cmd = evt.getCommand();

if (cmd == backCommand) {
setNewTransition(false);
} else { // any other key press
setNewTransition(true);
}

if (currentContainerIsLong) {
form.replace(containerLong, containerShort, transition);
currentContainerIsLong = false;
} else {
form.replace(containerShort, containerLong, transition);
currentContainerIsLong = true;
}
}

void setNewTransition(boolean forward) {
if (forward) {
transition = CommonTransitions.createSlide(TRANSITION_VERTICAL_NOT_HORIZONTAL ? CommonTransitions.SLIDE_VERTICAL : CommonTransitions.SLIDE_HORIZONTAL, false, 500);
} else {
transition = CommonTransitions.createSlide(TRANSITION_VERTICAL_NOT_HORIZONTAL ? CommonTransitions.SLIDE_VERTICAL : CommonTransitions.SLIDE_HORIZONTAL, true, 500);
}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Many thanks,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 05 September 2008 18:24
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing component transition on form

Hi,
There is no attachment. Container.replace works as advertised and performs exactly that, it just won't work for components of differing size.

Hi Shai,

Thanks for your reply.

We would like the transition to happen only to the middle part while keeping both top and bottom parts of the screen. The principle here is moving the "dynamic parts" while keeping the "constant ones". This principle leads to more intuitive UI and has widely been used in the leading mobile apps, such as iPhone's. Make sense?

Attached please find the source code which reproduces the problem (only one user class, the rest are all lwuit source). Hope this helps.

Many thanks,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 04 September 2008 16:12
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing component transition on form

Hi Qunhuan,
I'm not exactly sure what the problem is. Performing a transition (Container.replace) from a small component to a larger component or visa versa isn't currently supported by LWUIT and I personally doubt it would be technically feasible and visually appealing. The assumption is that you would replace a component with an equal or similar preferred size value.

Well done, LWUIT team, original problem scale reduced!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hi again,

Just checked out the latest LWUIT code and found the original problem reported has been scaled down. But there is still something remaining. Here is the description:

1. For horizontal transition

- Left to right (right is newly created)

(1) Large list size going to small one - no list problem right after transition, but first up/down key press has no effect. Only second key up/down and after traverses over the list

(2) Small list size going to large one - still have the small size (including scrollbar) right after transition. BUT the first up/down key press will immediately causing the display of the right size of the list to be displayed while having no traverse effect. Only second up/down key press and after traverses over the list.

- right to left (left is a saved and old one)
Same as Left to right.

2. For vertical transition

- Bottom-up

(1) Large list size to small one - no list problem but clip problem (see below), plus the first down/up key press has no effect. Only second key up/down and after traverses over the list.

(2) Small size to large one - still have the small size (including scrollbar) right after transition. BUT the first down/up key will immediately causing the right size of the list to be displayed with no traverse effect. Only second key up/down and after traverses over the list.

- Top-down

Same as Bottom-up

- Clip problem: The clip size is not using the exact size of component's visible part but may be using the full form's, causing unnecessary part appear on the screen right after transition.

I tried to create problem reproducing code but it appears to be a non-trivial task since the problem code is deeply inside a large project. However, if the problem reproducing code is really required, please let me know.

Many thanks,

Qunhuan

-----Original Message-----
From: Qunhuan Mei [mailto:qunhuan.mei@mfuse.com]
Sent: 29 August 2008 15:49
To: users@lwuit.dev.java.net
Subject: Problem handling different size of list when doing component transition on form

Hi LWUIT team,

I have hit a problem.

Here is the description:

I have a Form.

Within the form, I have a list, called current list, which displays an array of links.

When new array of links received, I use form's replace(Component current, Component next, Transition t) to show new list.

The problem occurs when current list size is so small that it does not cover the rest of the screen (say the list height on screen is "l"), but new list is larger, say its size should be "L" on screen. The display of the new list will still have the screen height of "l" instead of "L" during and after transition. It seems, in this case, some parameters are not updated when new list is initialised within the replace method. The problem happens for both horizontal and vertical transition.

All list items are accessible when problem occurs.

If I stop using replace(Component current, Component next, Transition t) but use
removeComponent(current);
addComponent(next);
instead, everything appears to be normal. That is, the new list will be displayed as it should be.

I did not prepare the problem code for this since I am currently fully occupied. But if it is required, please let me know.

Many thanks,

Qunhuan

Shai Almog
http://lwuit.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Shai Almog
http://lwuit.blogspot.com/

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Shai Almog

Hi,
no I wasn't able to see the problem.

> Hi again Shai,
>
> Did you manage to see the problem following the steps listed below?
>
> Regards,
>
> Qunhuan
>
> From: Qunhuan Mei
> Sent: 08 September 2008 14:40
> To: users@lwuit.dev.java.net
> Subject: RE: Problem handling different size of list when doing
> component transition on form
>
> (Looks like good news – problem gone ... J)
>
>
> Here are the steps to expose the problem:
>
> Start the app:
> · Problem 1: While focus is on the link 1, press selection
> key, “short list” transits in. The first “down” key press has been
> ignored by the system (should not be ! L). The second “down” key
> press leads to the focus moved to the link 2. Click link 2, “long
> list” transits in.
>
> · Problem 2: At this moment, there are only 3 items on the
> screen – and also the scroll bar looks wired.
>
> Keep playing around, you may find more problems.
>
> If you still can’t see any problem, please let me know. I can
> provide screen copies. (I am using netbeans 6.5, WTK 2.5.2 on
> Windows Vista, I suppose this won’t make any difference)
>
> Many thanks,
>
> Qunhuan
>
>
> From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
> Sent: 08 September 2008 14:13
> To: users@lwuit.dev.java.net
> Subject: Re: Problem handling different size of list when doing
> component transition on form
>
> Hi,
> sorry but I don't see the problem. Your sample seems to work as
> expected.
>
> Hi again, Shai,
>
> This is the source code – it is very straightforward. Page of
> different number of links appears to be a quite common use case. It
> would be very useful if LWUIT could support this.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> import com.sun.lwuit.Command;
> import com.sun.lwuit.Container;
>
> import com.sun.lwuit.geom.Dimension;
> import com.sun.lwuit.Display;
> import com.sun.lwuit.Font;
> import com.sun.lwuit.Form;
> import com.sun.lwuit.Label;
> import com.sun.lwuit.Image;
>
> import com.sun.lwuit.animations.Transition;
> import com.sun.lwuit.animations.CommonTransitions;
> import com.sun.lwuit.events.ActionEvent;
> import com.sun.lwuit.events.ActionListener;
>
> import com.sun.lwuit.List;
>
>
> import com.sun.lwuit.layouts.BorderLayout;
> import com.sun.lwuit.layouts.BoxLayout;
> import com.sun.lwuit.plaf.UIManager;
> import com.sun.lwuit.util.Resources;
> import java.util.Hashtable;
> import javax.microedition.midlet.MIDlet;
>
> /**
> * Bootstraps the UI toolkit demos
> *
> */
> public class ProblemMIDlet extends MIDlet implements ActionListener
> {//, Painter {
>
> boolean TRANSITION_VERTICAL_NOT_HORIZONTAL = false;
>
> private static final Command backCommand = new Command("Back");//
> Label logoLabel, labelLong, labelShort;
> private String[] shortList = {
> "Short list link 1",
> "Short list link 2",
> "Short list link 3"
> };
> private String[] longList = {
> "Long list link 1",
> "Long list link 2",
> "Long list link 3",
> "Long list link 4",
> "Long list link 5",
> "Long list link 6",
> "Long list link 7",
> "Long list link 8",
> "Long list link 9",
> "Long list link 10",
> "Long list link 11",
> "Long list link 12",
> "Long list link 13",
> "Long list link 14",
> "Long list link 15",
> "Long list link 16",
> "Long list link 17",
> "Long list link 18",
> "Long list link 19",
> "Long list link 20",
> "Long list link 21",
> "Long list link 22",
> "Long list link 23",
> "Long list link 24",
> "Long list link 25",
> "Long list link 26"
> };
> Form form;
>
> Container containerLong, containerShort;
> CommonTransitions transition;
> boolean currentContainerIsLong;
>
> Form getInitialisedForm() {
> form = new Form();
> form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
> form.setScrollable(false);
>
> form.addCommand(backCommand);
> return form;
> }
>
> void addLogoImageToTopOfTheForm(Form form) {
> try {
> //Image image = Image.createImage("/logoImage.png");
>
> logoLabel = new Label("image");
> logoLabel.setAlignment(Label.CENTER); // No effect!?
> form.addComponent(logoLabel);
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> }
>
> void initialiseResource() {
> try {
> //Resources r = Resources.open("/client.res");
> //UIManager.getInstance().setThemeProps(r.getTheme
> (r.getThemeResourceNames()[0]));
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> }
>
> Container getInitialiseContainerLong() {
> Container container = new Container();
> Label label = new Label("Title Long list");
> container.addComponent(label);
>
> List list = new List(longList);
>
> int idealWidth = Display.getInstance().getDisplayWidth();
> int idealLongListHeight = list.getPreferredH();
> Dimension dimension = new Dimension(idealWidth,
> idealLongListHeight);//list.getHeight());
>
> System.out.println(" idealLongListHeight:
> "+idealLongListHeight);
>
> list.setPreferredSize(dimension);
> list.setFixedSelection(List.FIXED_NONE_CYCLIC);
> list.addActionListener(this);
> container.addComponent(list);
> return container;
> }
>
> Container getInitialiseContainerShort() {
> Container container = new Container();
> Label label = new Label("Title Short list");
> container.addComponent(label);
>
> List list = new List(shortList);
>
> int idealWidth = Display.getInstance().getDisplayWidth();
> int idealShortListHeight = list.getPreferredH();
> Dimension dimension = new Dimension(idealWidth,
> idealShortListHeight);//idealHeight);//list.getHeight());
>
> System.out.println(" idealShortListHeight:
> "+idealShortListHeight);
>
> list.setPreferredSize(dimension);
> list.addActionListener(this);
> list.setFixedSelection(List.FIXED_NONE_CYCLIC);
> container.addComponent(list);
> return container;
> }
>
> protected void startApp() {
>
> Display.init(this);
> initialiseResource();
>
> form = getInitialisedForm();
>
> addLogoImageToTopOfTheForm(form);
>
> containerLong = getInitialiseContainerLong();
>
> containerShort = getInitialiseContainerShort();
>
>
> form.addComponent(containerLong);
>
> currentContainerIsLong = true;
> form.setCommandListener(this);
> form.show();
>
>
> }
>
> protected void pauseApp() {
> }
>
> protected void destroyApp(boolean arg0) {
> }
>
> public void actionPerformed(ActionEvent evt) {
> Command cmd = evt.getCommand();
>
> if (cmd == backCommand) {
> setNewTransition(false);
> } else { // any other key press
> setNewTransition(true);
> }
>
> if (currentContainerIsLong) {
> form.replace(containerLong, containerShort, transition);
> currentContainerIsLong = false;
> } else {
> form.replace(containerShort, containerLong, transition);
> currentContainerIsLong = true;
> }
> }
>
> void setNewTransition(boolean forward) {
> if (forward) {
> transition = CommonTransitions.createSlide
> (TRANSITION_VERTICAL_NOT_HORIZONTAL ?
> CommonTransitions.SLIDE_VERTICAL :
> CommonTransitions.SLIDE_HORIZONTAL, false, 500);
> } else {
> transition = CommonTransitions.createSlide
> (TRANSITION_VERTICAL_NOT_HORIZONTAL ?
> CommonTransitions.SLIDE_VERTICAL :
> CommonTransitions.SLIDE_HORIZONTAL, true, 500);
> }
> }
> }
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Many thanks,
>
> Qunhuan
>
> From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
> Sent: 05 September 2008 18:24
> To: users@lwuit.dev.java.net
> Subject: Re: Problem handling different size of list when doing
> component transition on form
>
> Hi,
> There is no attachment. Container.replace works as advertised and
> performs exactly that, it just won't work for components of
> differing size.
>
>
> Hi Shai,
>
> Thanks for your reply.
>
> We would like the transition to happen only to the middle part
> while keeping both top and bottom parts of the screen. The
> principle here is moving the “dynamic parts” while keeping the
> “constant ones”. This principle leads to more intuitive UI and has
> widely been used in the leading mobile apps, such as iPhone’s.
> Make sense?
>
> Attached please find the source code which reproduces the problem
> (only one user class, the rest are all lwuit source). Hope this helps.
>
> Many thanks,
>
> Qunhuan
>
> From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
> Sent: 04 September 2008 16:12
> To: users@lwuit.dev.java.net
> Subject: Re: Problem handling different size of list when doing
> component transition on form
>
> Hi Qunhuan,
> I'm not exactly sure what the problem is. Performing a transition
> (Container.replace) from a small component to a larger component or
> visa versa isn't currently supported by LWUIT and I personally
> doubt it would be technically feasible and visually appealing. The
> assumption is that you would replace a component with an equal or
> similar preferred size value.
>
>
>
> Well done, LWUIT team, original problem scale reduced!
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Hi again,
>
> Just checked out the latest LWUIT code and found the original
> problem reported has been scaled down. But there is still something
> remaining. Here is the description:
>
> 1. For horizontal transition
>
> - Left to right (right is newly created)
>
> (1) Large list size going to small one – no list problem right
> after transition, but first up/down key press has no effect. Only
> second key up/down and after traverses over the list
>
> (2) Small list size going to large one – still have the small
> size (including scrollbar) right after transition. BUT the first up/
> down key press will immediately causing the display of the right
> size of the list to be displayed while having no traverse effect.
> Only second up/down key press and after traverses over the list.
>
> - right to left (left is a saved and old one)
> Same as Left to right.
>
> 2. For vertical transition
>
> - Bottom-up
>
> (1) Large list size to small one – no list problem but clip
> problem (see below), plus the first down/up key press has no
> effect. Only second key up/down and after traverses over the list.
>
> (2) Small size to large one – still have the small size
> (including scrollbar) right after transition. BUT the first down/up
> key will immediately causing the right size of the list to be
> displayed with no traverse effect. Only second key up/down and
> after traverses over the list.
>
> - Top-down
>
> Same as Bottom-up
>
> - Clip problem: The clip size is not using the exact size of
> component’s visible part but may be using the full form’s, causing
> unnecessary part appear on the screen right after transition.
>
> I tried to create problem reproducing code but it appears to be a
> non-trivial task since the problem code is deeply inside a large
> project. However, if the problem reproducing code is really
> required, please let me know.
>
> Many thanks,
>
> Qunhuan
>
>
> -----Original Message-----
> From: Qunhuan Mei [mailto:qunhuan.mei@mfuse.com]
> Sent: 29 August 2008 15:49
> To: users@lwuit.dev.java.net
> Subject: Problem handling different size of list when doing
> component transition on form
>
> Hi LWUIT team,
>
> I have hit a problem.
>
> Here is the description:
>
> I have a Form.
>
> Within the form, I have a list, called current list, which displays
> an array of links.
>
> When new array of links received, I use form’s replace(Component
> current, Component next, Transition t) to show new list.
>
> The problem occurs when current list size is so small that it does
> not cover the rest of the screen (say the list height on screen is
> “l”), but new list is larger, say its size should be “L” on screen.
> The display of the new list will still have the screen height of
> “l” instead of “L” during and after transition. It seems, in this
> case, some parameters are not updated when new list is initialised
> within the replace method. The problem happens for both horizontal
> and vertical transition.
>
> All list items are accessible when problem occurs.
>
> If I stop using replace(Component current, Component next,
> Transition t) but use
> removeComponent(current);
> addComponent(next);
> instead, everything appears to be normal. That is, the new list
> will be displayed as it should be.
>
> I did not prepare the problem code for this since I am currently
> fully occupied. But if it is required, please let me know.
>
> Many thanks,
>
> Qunhuan
>
>
> Shai Almog
> http://lwuit.blogspot.com/
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
> Shai Almog
> http://lwuit.blogspot.com/
>
>
> Shai Almog
> http://lwuit.blogspot.com/
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Qunhuan Mei

Hi again Shai,

I know initially you said no problem was seen. But after I listed the steps to produce the problem, did you try it again and follow the steps I gave?

The problem not just appear on the emulator, but appear on all our tested phones.

If you confirmed not able to see it, I will do some screen shots for you.

Thanks,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 24 September 2008 13:08
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing component transition on form

Hi,
no I wasn't able to see the problem.

Hi again Shai,

Did you manage to see the problem following the steps listed below?

Regards,

Qunhuan

From: Qunhuan Mei
Sent: 08 September 2008 14:40
To: users@lwuit.dev.java.net
Subject: RE: Problem handling different size of list when doing component transition on form

(Looks like good news - problem gone ... :))

Here are the steps to expose the problem:

Start the app:

* Problem 1: While focus is on the link 1, press selection key, "short list" transits in. The first "down" key press has been ignored by the system (should not be ! :(). The second "down" key press leads to the focus moved to the link 2. Click link 2, "long list" transits in.

* Problem 2: At this moment, there are only 3 items on the screen - and also the scroll bar looks wired.
Keep playing around, you may find more problems.

If you still can't see any problem, please let me know. I can provide screen copies. (I am using netbeans 6.5, WTK 2.5.2 on Windows Vista, I suppose this won't make any difference)

Many thanks,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 08 September 2008 14:13
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing component transition on form

Hi,
sorry but I don't see the problem. Your sample seems to work as expected.

Hi again, Shai,

This is the source code - it is very straightforward. Page of different number of links appears to be a quite common use case. It would be very useful if LWUIT could support this.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

import com.sun.lwuit.Command;
import com.sun.lwuit.Container;

import com.sun.lwuit.geom.Dimension;
import com.sun.lwuit.Display;
import com.sun.lwuit.Font;
import com.sun.lwuit.Form;
import com.sun.lwuit.Label;
import com.sun.lwuit.Image;

import com.sun.lwuit.animations.Transition;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.events.ActionListener;

import com.sun.lwuit.List;

import com.sun.lwuit.layouts.BorderLayout;
import com.sun.lwuit.layouts.BoxLayout;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;
import java.util.Hashtable;
import javax.microedition.midlet.MIDlet;

/**
* Bootstraps the UI toolkit demos
*
*/
public class ProblemMIDlet extends MIDlet implements ActionListener {//, Painter {

boolean TRANSITION_VERTICAL_NOT_HORIZONTAL = false;

private static final Command backCommand = new Command("Back");//
Label logoLabel, labelLong, labelShort;
private String[] shortList = {
"Short list link 1",
"Short list link 2",
"Short list link 3"
};
private String[] longList = {
"Long list link 1",
"Long list link 2",
"Long list link 3",
"Long list link 4",
"Long list link 5",
"Long list link 6",
"Long list link 7",
"Long list link 8",
"Long list link 9",
"Long list link 10",
"Long list link 11",
"Long list link 12",
"Long list link 13",
"Long list link 14",
"Long list link 15",
"Long list link 16",
"Long list link 17",
"Long list link 18",
"Long list link 19",
"Long list link 20",
"Long list link 21",
"Long list link 22",
"Long list link 23",
"Long list link 24",
"Long list link 25",
"Long list link 26"
};
Form form;

Container containerLong, containerShort;
CommonTransitions transition;
boolean currentContainerIsLong;

Form getInitialisedForm() {
form = new Form();
form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
form.setScrollable(false);

form.addCommand(backCommand);
return form;
}

void addLogoImageToTopOfTheForm(Form form) {
try {
//Image image = Image.createImage("/logoImage.png");

logoLabel = new Label("image");
logoLabel.setAlignment(Label.CENTER); // No effect!?
form.addComponent(logoLabel);
} catch (Exception ex) {
ex.printStackTrace();
}
}

void initialiseResource() {
try {
//Resources r = Resources.open("/client.res");
//UIManager.getInstance().setThemeProps(r.getTheme(r.getThemeResourceNames()[0]));
} catch (Exception ex) {
ex.printStackTrace();
}
}

Container getInitialiseContainerLong() {
Container container = new Container();
Label label = new Label("Title Long list");
container.addComponent(label);

List list = new List(longList);

int idealWidth = Display.getInstance().getDisplayWidth();
int idealLongListHeight = list.getPreferredH();
Dimension dimension = new Dimension(idealWidth, idealLongListHeight);//list.getHeight());

System.out.println(" idealLongListHeight: "+idealLongListHeight);

list.setPreferredSize(dimension);
list.setFixedSelection(List.FIXED_NONE_CYCLIC);
list.addActionListener(this);
container.addComponent(list);
return container;
}

Container getInitialiseContainerShort() {
Container container = new Container();
Label label = new Label("Title Short list");
container.addComponent(label);

List list = new List(shortList);

int idealWidth = Display.getInstance().getDisplayWidth();
int idealShortListHeight = list.getPreferredH();
Dimension dimension = new Dimension(idealWidth, idealShortListHeight);//idealHeight);//list.getHeight());

System.out.println(" idealShortListHeight: "+idealShortListHeight);

list.setPreferredSize(dimension);
list.addActionListener(this);
list.setFixedSelection(List.FIXED_NONE_CYCLIC);
container.addComponent(list);
return container;
}

protected void startApp() {

Display.init(this);
initialiseResource();

form = getInitialisedForm();

addLogoImageToTopOfTheForm(form);

containerLong = getInitialiseContainerLong();

containerShort = getInitialiseContainerShort();

form.addComponent(containerLong);

currentContainerIsLong = true;
form.setCommandListener(this);
form.show();

}

protected void pauseApp() {
}

protected void destroyApp(boolean arg0) {
}

public void actionPerformed(ActionEvent evt) {
Command cmd = evt.getCommand();

if (cmd == backCommand) {
setNewTransition(false);
} else { // any other key press
setNewTransition(true);
}

if (currentContainerIsLong) {
form.replace(containerLong, containerShort, transition);
currentContainerIsLong = false;
} else {
form.replace(containerShort, containerLong, transition);
currentContainerIsLong = true;
}
}

void setNewTransition(boolean forward) {
if (forward) {
transition = CommonTransitions.createSlide(TRANSITION_VERTICAL_NOT_HORIZONTAL ? CommonTransitions.SLIDE_VERTICAL : CommonTransitions.SLIDE_HORIZONTAL, false, 500);
} else {
transition = CommonTransitions.createSlide(TRANSITION_VERTICAL_NOT_HORIZONTAL ? CommonTransitions.SLIDE_VERTICAL : CommonTransitions.SLIDE_HORIZONTAL, true, 500);
}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Many thanks,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 05 September 2008 18:24
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing component transition on form

Hi,
There is no attachment. Container.replace works as advertised and performs exactly that, it just won't work for components of differing size.

Hi Shai,

Thanks for your reply.

We would like the transition to happen only to the middle part while keeping both top and bottom parts of the screen. The principle here is moving the "dynamic parts" while keeping the "constant ones". This principle leads to more intuitive UI and has widely been used in the leading mobile apps, such as iPhone's. Make sense?

Attached please find the source code which reproduces the problem (only one user class, the rest are all lwuit source). Hope this helps.

Many thanks,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 04 September 2008 16:12
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing component transition on form

Hi Qunhuan,
I'm not exactly sure what the problem is. Performing a transition (Container.replace) from a small component to a larger component or visa versa isn't currently supported by LWUIT and I personally doubt it would be technically feasible and visually appealing. The assumption is that you would replace a component with an equal or similar preferred size value.

Well done, LWUIT team, original problem scale reduced!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hi again,

Just checked out the latest LWUIT code and found the original problem reported has been scaled down. But there is still something remaining. Here is the description:

1. For horizontal transition

- Left to right (right is newly created)

(1) Large list size going to small one - no list problem right after transition, but first up/down key press has no effect. Only second key up/down and after traverses over the list

(2) Small list size going to large one - still have the small size (including scrollbar) right after transition. BUT the first up/down key press will immediately causing the display of the right size of the list to be displayed while having no traverse effect. Only second up/down key press and after traverses over the list.

- right to left (left is a saved and old one)
Same as Left to right.

2. For vertical transition

- Bottom-up

(1) Large list size to small one - no list problem but clip problem (see below), plus the first down/up key press has no effect. Only second key up/down and after traverses over the list.

(2) Small size to large one - still have the small size (including scrollbar) right after transition. BUT the first down/up key will immediately causing the right size of the list to be displayed with no traverse effect. Only second key up/down and after traverses over the list.

- Top-down

Same as Bottom-up

- Clip problem: The clip size is not using the exact size of component's visible part but may be using the full form's, causing unnecessary part appear on the screen right after transition.

I tried to create problem reproducing code but it appears to be a non-trivial task since the problem code is deeply inside a large project. However, if the problem reproducing code is really required, please let me know.

Many thanks,

Qunhuan

-----Original Message-----
From: Qunhuan Mei [mailto:qunhuan.mei@mfuse.com]
Sent: 29 August 2008 15:49
To: users@lwuit.dev.java.net
Subject: Problem handling different size of list when doing component transition on form

Hi LWUIT team,

I have hit a problem.

Here is the description:

I have a Form.

Within the form, I have a list, called current list, which displays an array of links.

When new array of links received, I use form's replace(Component current, Component next, Transition t) to show new list.

The problem occurs when current list size is so small that it does not cover the rest of the screen (say the list height on screen is "l"), but new list is larger, say its size should be "L" on screen. The display of the new list will still have the screen height of "l" instead of "L" during and after transition. It seems, in this case, some parameters are not updated when new list is initialised within the replace method. The problem happens for both horizontal and vertical transition.

All list items are accessible when problem occurs.

If I stop using replace(Component current, Component next, Transition t) but use
removeComponent(current);
addComponent(next);
instead, everything appears to be normal. That is, the new list will be displayed as it should be.

I did not prepare the problem code for this since I am currently fully occupied. But if it is required, please let me know.

Many thanks,

Qunhuan

Shai Almog
http://lwuit.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Shai Almog
http://lwuit.blogspot.com/

Shai Almog
http://lwuit.blogspot.com/

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Shai Almog

Hi,
I haven't seen it. If you can provide screenshots it would be helpful.

> Hi again Shai,
>
> I know initially you said no problem was seen. But after I listed
> the steps to produce the problem, did you try it again and follow
> the steps I gave?
>
> The problem not just appear on the emulator, but appear on all our
> tested phones.
>
> If you confirmed not able to see it, I will do some screen shots
> for you.
>
> Thanks,
>
> Qunhuan
>
> From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
> Sent: 24 September 2008 13:08
> To: users@lwuit.dev.java.net
> Subject: Re: Problem handling different size of list when doing
> component transition on form
>
> Hi,
> no I wasn't able to see the problem.
>
>
> Hi again Shai,
>
> Did you manage to see the problem following the steps listed below?
>
> Regards,
>
> Qunhuan
>
> From: Qunhuan Mei
> Sent: 08 September 2008 14:40
> To: users@lwuit.dev.java.net
> Subject: RE: Problem handling different size of list when doing
> component transition on form
>
> (Looks like good news – problem gone ... J)
>
>
> Here are the steps to expose the problem:
>
> Start the app:
> · Problem 1: While focus is on the link 1, press selection
> key, “short list” transits in. The first “down” key press has been
> ignored by the system (should not be ! L). The second “down” key
> press leads to the focus moved to the link 2. Click link 2, “long
> list” transits in.
>
> · Problem 2: At this moment, there are only 3 items on the
> screen – and also the scroll bar looks wired.
>
> Keep playing around, you may find more problems.
>
> If you still can’t see any problem, please let me know. I can
> provide screen copies. (I am using netbeans 6.5, WTK 2.5.2 on
> Windows Vista, I suppose this won’t make any difference)
>
> Many thanks,
>
> Qunhuan
>
>
> From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
> Sent: 08 September 2008 14:13
> To: users@lwuit.dev.java.net
> Subject: Re: Problem handling different size of list when doing
> component transition on form
>
> Hi,
> sorry but I don't see the problem. Your sample seems to work as
> expected.
>
> Hi again, Shai,
>
> This is the source code – it is very straightforward. Page of
> different number of links appears to be a quite common use case. It
> would be very useful if LWUIT could support this.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> import com.sun.lwuit.Command;
> import com.sun.lwuit.Container;
>
> import com.sun.lwuit.geom.Dimension;
> import com.sun.lwuit.Display;
> import com.sun.lwuit.Font;
> import com.sun.lwuit.Form;
> import com.sun.lwuit.Label;
> import com.sun.lwuit.Image;
>
> import com.sun.lwuit.animations.Transition;
> import com.sun.lwuit.animations.CommonTransitions;
> import com.sun.lwuit.events.ActionEvent;
> import com.sun.lwuit.events.ActionListener;
>
> import com.sun.lwuit.List;
>
>
> import com.sun.lwuit.layouts.BorderLayout;
> import com.sun.lwuit.layouts.BoxLayout;
> import com.sun.lwuit.plaf.UIManager;
> import com.sun.lwuit.util.Resources;
> import java.util.Hashtable;
> import javax.microedition.midlet.MIDlet;
>
> /**
> * Bootstraps the UI toolkit demos
> *
> */
> public class ProblemMIDlet extends MIDlet implements ActionListener
> {//, Painter {
>
> boolean TRANSITION_VERTICAL_NOT_HORIZONTAL = false;
>
> private static final Command backCommand = new Command("Back");//
> Label logoLabel, labelLong, labelShort;
> private String[] shortList = {
> "Short list link 1",
> "Short list link 2",
> "Short list link 3"
> };
> private String[] longList = {
> "Long list link 1",
> "Long list link 2",
> "Long list link 3",
> "Long list link 4",
> "Long list link 5",
> "Long list link 6",
> "Long list link 7",
> "Long list link 8",
> "Long list link 9",
> "Long list link 10",
> "Long list link 11",
> "Long list link 12",
> "Long list link 13",
> "Long list link 14",
> "Long list link 15",
> "Long list link 16",
> "Long list link 17",
> "Long list link 18",
> "Long list link 19",
> "Long list link 20",
> "Long list link 21",
> "Long list link 22",
> "Long list link 23",
> "Long list link 24",
> "Long list link 25",
> "Long list link 26"
> };
> Form form;
>
> Container containerLong, containerShort;
> CommonTransitions transition;
> boolean currentContainerIsLong;
>
> Form getInitialisedForm() {
> form = new Form();
> form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
> form.setScrollable(false);
>
> form.addCommand(backCommand);
> return form;
> }
>
> void addLogoImageToTopOfTheForm(Form form) {
> try {
> //Image image = Image.createImage("/logoImage.png");
>
> logoLabel = new Label("image");
> logoLabel.setAlignment(Label.CENTER); // No effect!?
> form.addComponent(logoLabel);
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> }
>
> void initialiseResource() {
> try {
> //Resources r = Resources.open("/client.res");
> //UIManager.getInstance().setThemeProps(r.getTheme
> (r.getThemeResourceNames()[0]));
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> }
>
> Container getInitialiseContainerLong() {
> Container container = new Container();
> Label label = new Label("Title Long list");
> container.addComponent(label);
>
> List list = new List(longList);
>
> int idealWidth = Display.getInstance().getDisplayWidth();
> int idealLongListHeight = list.getPreferredH();
> Dimension dimension = new Dimension(idealWidth,
> idealLongListHeight);//list.getHeight());
>
> System.out.println(" idealLongListHeight:
> "+idealLongListHeight);
>
> list.setPreferredSize(dimension);
> list.setFixedSelection(List.FIXED_NONE_CYCLIC);
> list.addActionListener(this);
> container.addComponent(list);
> return container;
> }
>
> Container getInitialiseContainerShort() {
> Container container = new Container();
> Label label = new Label("Title Short list");
> container.addComponent(label);
>
> List list = new List(shortList);
>
> int idealWidth = Display.getInstance().getDisplayWidth();
> int idealShortListHeight = list.getPreferredH();
> Dimension dimension = new Dimension(idealWidth,
> idealShortListHeight);//idealHeight);//list.getHeight());
>
> System.out.println(" idealShortListHeight:
> "+idealShortListHeight);
>
> list.setPreferredSize(dimension);
> list.addActionListener(this);
> list.setFixedSelection(List.FIXED_NONE_CYCLIC);
> container.addComponent(list);
> return container;
> }
>
> protected void startApp() {
>
> Display.init(this);
> initialiseResource();
>
> form = getInitialisedForm();
>
> addLogoImageToTopOfTheForm(form);
>
> containerLong = getInitialiseContainerLong();
>
> containerShort = getInitialiseContainerShort();
>
>
> form.addComponent(containerLong);
>
> currentContainerIsLong = true;
> form.setCommandListener(this);
> form.show();
>
>
> }
>
> protected void pauseApp() {
> }
>
> protected void destroyApp(boolean arg0) {
> }
>
> public void actionPerformed(ActionEvent evt) {
> Command cmd = evt.getCommand();
>
> if (cmd == backCommand) {
> setNewTransition(false);
> } else { // any other key press
> setNewTransition(true);
> }
>
> if (currentContainerIsLong) {
> form.replace(containerLong, containerShort, transition);
> currentContainerIsLong = false;
> } else {
> form.replace(containerShort, containerLong, transition);
> currentContainerIsLong = true;
> }
> }
>
> void setNewTransition(boolean forward) {
> if (forward) {
> transition = CommonTransitions.createSlide
> (TRANSITION_VERTICAL_NOT_HORIZONTAL ?
> CommonTransitions.SLIDE_VERTICAL :
> CommonTransitions.SLIDE_HORIZONTAL, false, 500);
> } else {
> transition = CommonTransitions.createSlide
> (TRANSITION_VERTICAL_NOT_HORIZONTAL ?
> CommonTransitions.SLIDE_VERTICAL :
> CommonTransitions.SLIDE_HORIZONTAL, true, 500);
> }
> }
> }
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Many thanks,
>
> Qunhuan
>
> From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
> Sent: 05 September 2008 18:24
> To: users@lwuit.dev.java.net
> Subject: Re: Problem handling different size of list when doing
> component transition on form
>
> Hi,
> There is no attachment. Container.replace works as advertised and
> performs exactly that, it just won't work for components of
> differing size.
>
>
>
> Hi Shai,
>
> Thanks for your reply.
>
> We would like the transition to happen only to the middle part
> while keeping both top and bottom parts of the screen. The
> principle here is moving the “dynamic parts” while keeping the
> “constant ones”. This principle leads to more intuitive UI and has
> widely been used in the leading mobile apps, such as iPhone’s.
> Make sense?
>
> Attached please find the source code which reproduces the problem
> (only one user class, the rest are all lwuit source). Hope this helps.
>
> Many thanks,
>
> Qunhuan
>
> From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
> Sent: 04 September 2008 16:12
> To: users@lwuit.dev.java.net
> Subject: Re: Problem handling different size of list when doing
> component transition on form
>
> Hi Qunhuan,
> I'm not exactly sure what the problem is. Performing a transition
> (Container.replace) from a small component to a larger component or
> visa versa isn't currently supported by LWUIT and I personally
> doubt it would be technically feasible and visually appealing. The
> assumption is that you would replace a component with an equal or
> similar preferred size value.
>
>
>
>
> Well done, LWUIT team, original problem scale reduced!
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Hi again,
>
> Just checked out the latest LWUIT code and found the original
> problem reported has been scaled down. But there is still something
> remaining. Here is the description:
>
> 1. For horizontal transition
>
> - Left to right (right is newly created)
>
> (1) Large list size going to small one – no list problem right
> after transition, but first up/down key press has no effect. Only
> second key up/down and after traverses over the list
>
> (2) Small list size going to large one – still have the small
> size (including scrollbar) right after transition. BUT the first up/
> down key press will immediately causing the display of the right
> size of the list to be displayed while having no traverse effect.
> Only second up/down key press and after traverses over the list.
>
> - right to left (left is a saved and old one)
> Same as Left to right.
>
> 2. For vertical transition
>
> - Bottom-up
>
> (1) Large list size to small one – no list problem but clip
> problem (see below), plus the first down/up key press has no
> effect. Only second key up/down and after traverses over the list.
>
> (2) Small size to large one – still have the small size
> (including scrollbar) right after transition. BUT the first down/up
> key will immediately causing the right size of the list to be
> displayed with no traverse effect. Only second key up/down and
> after traverses over the list.
>
> - Top-down
>
> Same as Bottom-up
>
> - Clip problem: The clip size is not using the exact size of
> component’s visible part but may be using the full form’s, causing
> unnecessary part appear on the screen right after transition.
>
> I tried to create problem reproducing code but it appears to be a
> non-trivial task since the problem code is deeply inside a large
> project. However, if the problem reproducing code is really
> required, please let me know.
>
> Many thanks,
>
> Qunhuan
>
>
> -----Original Message-----
> From: Qunhuan Mei [mailto:qunhuan.mei@mfuse.com]
> Sent: 29 August 2008 15:49
> To: users@lwuit.dev.java.net
> Subject: Problem handling different size of list when doing
> component transition on form
>
> Hi LWUIT team,
>
> I have hit a problem.
>
> Here is the description:
>
> I have a Form.
>
> Within the form, I have a list, called current list, which displays
> an array of links.
>
> When new array of links received, I use form’s replace(Component
> current, Component next, Transition t) to show new list.
>
> The problem occurs when current list size is so small that it does
> not cover the rest of the screen (say the list height on screen is
> “l”), but new list is larger, say its size should be “L” on screen.
> The display of the new list will still have the screen height of
> “l” instead of “L” during and after transition. It seems, in this
> case, some parameters are not updated when new list is initialised
> within the replace method. The problem happens for both horizontal
> and vertical transition.
>
> All list items are accessible when problem occurs.
>
> If I stop using replace(Component current, Component next,
> Transition t) but use
> removeComponent(current);
> addComponent(next);
> instead, everything appears to be normal. That is, the new list
> will be displayed as it should be.
>
> I did not prepare the problem code for this since I am currently
> fully occupied. But if it is required, please let me know.
>
> Many thanks,
>
> Qunhuan
>
>
> Shai Almog
> http://lwuit.blogspot.com/
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
> Shai Almog
> http://lwuit.blogspot.com/
>
>
> Shai Almog
> http://lwuit.blogspot.com/
>
>
> Shai Almog
> http://lwuit.blogspot.com/
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Qunhuan Mei

Hi again Shai,
I have made a simple testcase to illustrate some problems related to the problems derived from handling different list size with component transition on form:
Scenario - There are two lists (containers), one short, one long, to simulate a possible content category browsing. Any "Selection"/"Back" key click will switch between the two lists.
(in order to reproduce the image, this is the colour used:
bgColor= e8421d
fgColor= ffffff
bgSelectionColor= ffecec
fgSelectionColor= 761d07
font=Bitmap{arialBold12}
SoftButton.bgColor= a30800
SoftButton.fgColor= f8f8f8

)
Problems:
1. 1. Missing 1st key press after transition - Right after app is started, while focus is on the "Long list link 1" (Fig 1), press selection key, "short list" transits in (Fig 2). The first key press (e.g. "down") will be ignored by the system (should not be ! :()
[cid:image006.png@01C9230D.C9C50890] Fig 1 [cid:image008.png@01C9230D.C9C50890] Fig 2
2. 2. Focus lost - The second "down" key press leads to the focus moved to the short list link 2. Click "Down" again, the focus appears to be lost (Fig 3)
[cid:image010.png@01C9230D.C9C50890] Fig 3
3. 3. Wrong transit items and not all list items displayed when transiting from short list to long - Click any link (e.g. Short list link 1, "long list" transits in. But instead of replacing all 3 Short list links, only first 2 have been replaced, leaving Short list 3 still on screen (Fig 4). At this moment, there are only 3 items on the screen. The scroll bar does not look right either. Click any key (e.g "down"), the full list will be displayed.
[cid:image012.png@01C9230D.C9C50890] Fig 4
4. 4. Ticking is not happening (Fig 4)
Although

label.setTickerEnabled(true)

is in the code, but no tickering is happening.

5. If keep playing around, you may find more problems.

(I am using netbeans 6.5, WTK 2.5.2 on Windows Vista)

Please let me know if any bits need further clarification.

Many thanks,

Qunhuan

~~~~~~~~~~~~~~~~~~~~~~ source code: ~~~~~~~~~~~~~~~~

import com.sun.lwuit.Command;
import com.sun.lwuit.Container;

import com.sun.lwuit.geom.Dimension;
import com.sun.lwuit.Display;
import com.sun.lwuit.Font;
import com.sun.lwuit.Form;
import com.sun.lwuit.Label;
import com.sun.lwuit.Image;

import com.sun.lwuit.animations.Transition;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.events.ActionListener;

import com.sun.lwuit.List;

import com.sun.lwuit.layouts.BorderLayout;
import com.sun.lwuit.layouts.BoxLayout;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;
import java.util.Hashtable;
import javax.microedition.midlet.MIDlet;

/**
* Bootstraps the UI toolkit demos
*
*/
public class ProblemMIDlet extends MIDlet implements ActionListener {//, Painter {

boolean TRANSITION_HORIZONTAL_NOT_VERTICAL = true; // so that we can test vertical transition is required

private static final Command backCommand = new Command("Back");//

private String[] shortList = {
"Short list link 1",
"Short list link 2",
"Short list link 3 ABCDEFG HIJKLADFADFASDFASFDASFDAFAFAadfasd asdf END"
};
private String[] longList = {
"Long list link 1",
"Long list link 2 ABCDEFG HIJKLADFADFASDFASFDASFDAFAFA",
"Long list link 3",
"Long list link 4",
"Long list link 5",
"Long list link 6",
"Long list link 7",
"Long list link 8",
"Long list link 9",
"Long list link 10",
"Long list link 11",
"Long list link 12",
"Long list link 13",
"Long list link 14",
"Long list link 15",
"Long list link 16",
"Long list link 17",
"Long list link 18",
"Long list link 19",
"Long list link 20",
"Long list link 21",
"Long list link 22",
"Long list link 23",
"Long list link 24",
"Long list link 25",
"Long list link 26"
};

Form form;

Container containerLong, containerShort;
CommonTransitions transition;
boolean currentContainerIsLong;

/** return an empty form with one back command */
Form getInitialisedForm() {
form = new Form();
form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
form.addCommand(backCommand);
return form;
}

void initialiseResource() {
try {
Resources r = Resources.open("/client.res");
UIManager.getInstance().setThemeProps(r.getTheme(r.getThemeResourceNames()[0]));
} catch (Exception ex) {
ex.printStackTrace();
}
}

Container getContainer(boolean longListNotShort) {
Container container = new Container();
Label label = new Label(longListNotShort?"Title Long Long Long Long Long Long Long Long list ":
"Title Short list");
label.setTickerEnabled(true);

container.addComponent(label);

List list = new List(longListNotShort?longList:shortList);

list.setFixedSelection(List.FIXED_NONE_CYCLIC);
list.addActionListener(this);
container.addComponent(list);

System.out.println(" is lable's ticker enabled: "+label.isTickerEnabled());

return container;
}

protected void startApp() {

Display.init(this);
initialiseResource();

form = getInitialisedForm();

/* initialise two containers: one long, one short
* but at any one time, only one container will be on screen */
containerLong = getContainer(true);
containerShort = getContainer(false);

form.addComponent(containerLong); // start with long container!

currentContainerIsLong = true;
form.setCommandListener(this);
form.show();
}

protected void pauseApp() {
}

protected void destroyApp(boolean arg0) {
}

public void actionPerformed(ActionEvent evt) {

Command cmd = evt.getCommand();

if (cmd == backCommand) {
setNewTransition(false);
} else { // any other key press
setNewTransition(true);
}

if (currentContainerIsLong) { // carry out transition!
form.replace(containerLong, containerShort, transition);
currentContainerIsLong = false;
} else {
form.replace(containerShort, containerLong, transition);
currentContainerIsLong = true;
}
}

void setNewTransition(boolean forward) {
if (forward) {
transition = CommonTransitions.createSlide(TRANSITION_HORIZONTAL_NOT_VERTICAL ?
CommonTransitions.SLIDE_HORIZONTAL : CommonTransitions.SLIDE_VERTICAL, false, 500);
} else {
transition = CommonTransitions.createSlide(TRANSITION_HORIZONTAL_NOT_VERTICAL ?
CommonTransitions.SLIDE_HORIZONTAL : CommonTransitions.SLIDE_VERTICAL, true, 500);
}
}
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi,
I haven't seen it. If you can provide screenshots it would be helpful.

Shai Almog
http://lwuit.blogspot.com/

[att1.html]
[image006.png]
[image008.png]
[image010.png]
[image012.png]

Attachment not added (too many attachments): "image010.png"
Attachment not added (too many attachments): "image012.png"

Shai Almog

Hi Qunhuan,
I see a couple of issues here with the transition but they are a bit
problematic to fix.
Some of the issues you are experiencing are a result of your code
using a Form that is scrollable and FlowLayout (the default layout
for container). By making the form non-scrollable and the container
use border layout issue 2 was resolved and I think issue 3 was also
resolved.
Issue 4 is not a bug, this is a renderer not a component.

Issue 1 is indeed a LWUIT bug, we need to update focus when the
change completes (the old list still has focus and the first click
fixes that).
I'm not sure which issue relates to that but the target list is
smaller when traveling from short to long, this can't be fixed
properly since it will require reflowing the UI which will cause
"jumpiness".

> Hi again Shai,
> I have made a simple testcase to illustrate some problems related
> to the problems derived from handling different list size with
> component transition on form:
> Scenario - There are two lists (containers), one short, one
> long, to simulate a possible content category browsing. Any
> “Selection”/”Back” key click will switch between the two lists.
> (in order to reproduce the image, this is the colour used:
> bgColor= e8421d
> fgColor= ffffff
> bgSelectionColor= ffecec
> fgSelectionColor= 761d07
> font=Bitmap{arialBold12}
> SoftButton.bgColor= a30800
> SoftButton.fgColor= f8f8f8
>
> )
> Problems:
> 1. 1. Missing 1st key press after transition - Right after app
> is started, while focus is on the “Long list link 1” (Fig 1), press
> selection key, “short list” transits in (Fig 2). The first key
> press (e.g. “down”) will be ignored by the system (should not be ! L)
> Fig 1 Fig 2
> 2. 2. Focus lost – The second “down” key press leads
> to the focus moved to the short list link 2. Click “Down” again,
> the focus appears to be lost (Fig 3)
> Fig 3
> 3. 3. Wrong transit items and not all list items displayed when
> transiting from short list to long - Click any link (e.g. Short
> list link 1, “long list” transits in. But instead of replacing all
> 3 Short list links, only first 2 have been replaced, leaving Short
> list 3 still on screen (Fig 4). At this moment, there are only 3
> items on the screen. The scroll bar does not look right either.
> Click any key (e.g “down”), the full list will be displayed.
> Fig 4
> 4. 4. Ticking is not happening (Fig 4)
> Although
>
> label.setTickerEnabled(true)
>
> is in the code, but no tickering is happening.
>
> 5. If keep playing around, you may find more problems.
>
> (I am using netbeans 6.5, WTK 2.5.2 on Windows Vista)
>
> Please let me know if any bits need further clarification.
>
> Many thanks,
>
> Qunhuan
>
> ~~~~~~~~~~~~~~~~~~~~~~ source code: ~~~~~~~~~~~~~~~~
>
> import com.sun.lwuit.Command;
> import com.sun.lwuit.Container;
>
> import com.sun.lwuit.geom.Dimension;
> import com.sun.lwuit.Display;
> import com.sun.lwuit.Font;
> import com.sun.lwuit.Form;
> import com.sun.lwuit.Label;
> import com.sun.lwuit.Image;
>
> import com.sun.lwuit.animations.Transition;
> import com.sun.lwuit.animations.CommonTransitions;
> import com.sun.lwuit.events.ActionEvent;
> import com.sun.lwuit.events.ActionListener;
>
> import com.sun.lwuit.List;
>
>
> import com.sun.lwuit.layouts.BorderLayout;
> import com.sun.lwuit.layouts.BoxLayout;
> import com.sun.lwuit.plaf.UIManager;
> import com.sun.lwuit.util.Resources;
> import java.util.Hashtable;
> import javax.microedition.midlet.MIDlet;
>
> /**
> * Bootstraps the UI toolkit demos
> *
> */
> public class ProblemMIDlet extends MIDlet implements ActionListener
> {//, Painter {
>
> boolean TRANSITION_HORIZONTAL_NOT_VERTICAL = true; // so that
> we can test vertical transition is required
>
> private static final Command backCommand = new Command("Back");//
>
> private String[] shortList = {
> "Short list link 1",
> "Short list link 2",
> "Short list link 3 ABCDEFG
> HIJKLADFADFASDFASFDASFDAFAFAadfasd asdf END"
> };
> private String[] longList = {
> "Long list link 1",
> "Long list link 2 ABCDEFG HIJKLADFADFASDFASFDASFDAFAFA",
> "Long list link 3",
> "Long list link 4",
> "Long list link 5",
> "Long list link 6",
> "Long list link 7",
> "Long list link 8",
> "Long list link 9",
> "Long list link 10",
> "Long list link 11",
> "Long list link 12",
> "Long list link 13",
> "Long list link 14",
> "Long list link 15",
> "Long list link 16",
> "Long list link 17",
> "Long list link 18",
> "Long list link 19",
> "Long list link 20",
> "Long list link 21",
> "Long list link 22",
> "Long list link 23",
> "Long list link 24",
> "Long list link 25",
> "Long list link 26"
> };
>
> Form form;
>
> Container containerLong, containerShort;
> CommonTransitions transition;
> boolean currentContainerIsLong;
>
> /** return an empty form with one back command */
> Form getInitialisedForm() {
> form = new Form();
> form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
> form.addCommand(backCommand);
> return form;
> }
>
> void initialiseResource() {
> try {
> Resources r = Resources.open("/client.res");
> UIManager.getInstance().setThemeProps(r.getTheme
> (r.getThemeResourceNames()[0]));
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> }
>
> Container getContainer(boolean longListNotShort) {
> Container container = new Container();
> Label label = new Label(longListNotShort?"Title Long Long
> Long Long Long Long Long Long list ":
> "Title Short list");
> label.setTickerEnabled(true);
>
> container.addComponent(label);
>
> List list = new List(longListNotShort?longList:shortList);
>
> list.setFixedSelection(List.FIXED_NONE_CYCLIC);
> list.addActionListener(this);
> container.addComponent(list);
>
> System.out.println(" is lable's ticker enabled:
> "+label.isTickerEnabled());
>
> return container;
> }
>
> protected void startApp() {
>
> Display.init(this);
> initialiseResource();
>
> form = getInitialisedForm();
>
> /* initialise two containers: one long, one short
> * but at any one time, only one container will be on
> screen */
> containerLong = getContainer(true);
> containerShort = getContainer(false);
>
> form.addComponent(containerLong); // start with long
> container!
>
> currentContainerIsLong = true;
> form.setCommandListener(this);
> form.show();
> }
>
> protected void pauseApp() {
> }
>
> protected void destroyApp(boolean arg0) {
> }
>
> public void actionPerformed(ActionEvent evt) {
>
>
> Command cmd = evt.getCommand();
>
> if (cmd == backCommand) {
> setNewTransition(false);
> } else { // any other key press
> setNewTransition(true);
> }
>
> if (currentContainerIsLong) { // carry out transition!
> form.replace(containerLong, containerShort, transition);
> currentContainerIsLong = false;
> } else {
> form.replace(containerShort, containerLong, transition);
> currentContainerIsLong = true;
> }
> }
>
> void setNewTransition(boolean forward) {
> if (forward) {
> transition = CommonTransitions.createSlide
> (TRANSITION_HORIZONTAL_NOT_VERTICAL ?
> CommonTransitions.SLIDE_HORIZONTAL :
> CommonTransitions.SLIDE_VERTICAL, false, 500);
> } else {
> transition = CommonTransitions.createSlide
> (TRANSITION_HORIZONTAL_NOT_VERTICAL ?
> CommonTransitions.SLIDE_HORIZONTAL :
> CommonTransitions.SLIDE_VERTICAL, true, 500);
> }
> }
> }
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Hi,
> I haven't seen it. If you can provide screenshots it would be helpful.
>
> Shai Almog
> http://lwuit.blogspot.com/
>
>
>
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Qunhuan Mei

Hi Shai,

Thank you so much for getting back to us so quickly.

You are right, the issue 2 and 3 can be easily fixed by changing layout (my apologies for not excluding this). I did not quite understand your answer to the issue 4. I thought the tickering is supported by later version of LWUIT. Or do I miss anything to make tickering work?

Seems to me Issue 1 is vital for commercial use in general.

Have a nice day,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 02 October 2008 04:28
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing conponent transition on form

Hi Qunhuan,
I see a couple of issues here with the transition but they are a bit problematic to fix.
Some of the issues you are experiencing are a result of your code using a Form that is scrollable and FlowLayout (the default layout for container). By making the form non-scrollable and the container use border layout issue 2 was resolved and I think issue 3 was also resolved.
Issue 4 is not a bug, this is a renderer not a component.

Issue 1 is indeed a LWUIT bug, we need to update focus when the change completes (the old list still has focus and the first click fixes that).
I'm not sure which issue relates to that but the target list is smaller when traveling from short to long, this can't be fixed properly since it will require reflowing the UI which will cause "jumpiness".

Hi again Shai,
I have made a simple testcase to illustrate some problems related to the problems derived from handling different list size with component transition on form:
Scenario - There are two lists (containers), one short, one long, to simulate a possible content category browsing. Any "Selection"/"Back" key click will switch between the two lists.
(in order to reproduce the image, this is the colour used:
bgColor= e8421d
fgColor= ffffff
bgSelectionColor= ffecec
fgSelectionColor= 761d07
font=Bitmap{arialBold12}
SoftButton.bgColor= a30800
SoftButton.fgColor= f8f8f8

)
Problems:
1. 1. Missing 1st key press after transition - Right after app is started, while focus is on the "Long list link 1" (Fig 1), press selection key, "short list" transits in (Fig 2). The first key press (e.g. "down") will be ignored by the system (should not be ! :()
Fig 1 Fig 2
2. 2. Focus lost - The second "down" key press leads to the focus moved to the short list link 2. Click "Down" again, the focus appears to be lost (Fig 3)
Fig 3
3. 3. Wrong transit items and not all list items displayed when transiting from short list to long - Click any link (e.g. Short list link 1, "long list" transits in. But instead of replacing all 3 Short list links, only first 2 have been replaced, leaving Short list 3 still on screen (Fig 4). At this moment, there are only 3 items on the screen. The scroll bar does not look right either. Click any key (e.g "down"), the full list will be displayed.
Fig 4
4. 4. Ticking is not happening (Fig 4)
Although

label.setTickerEnabled(true)

is in the code, but no tickering is happening.

5. If keep playing around, you may find more problems.

(I am using netbeans 6.5, WTK 2.5.2 on Windows Vista)

Please let me know if any bits need further clarification.

Many thanks,

Qunhuan

~~~~~~~~~~~~~~~~~~~~~~ source code: ~~~~~~~~~~~~~~~~

import com.sun.lwuit.Command;
import com.sun.lwuit.Container;

import com.sun.lwuit.geom.Dimension;
import com.sun.lwuit.Display;
import com.sun.lwuit.Font;
import com.sun.lwuit.Form;
import com.sun.lwuit.Label;
import com.sun.lwuit.Image;

import com.sun.lwuit.animations.Transition;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.events.ActionListener;

import com.sun.lwuit.List;

import com.sun.lwuit.layouts.BorderLayout;
import com.sun.lwuit.layouts.BoxLayout;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;
import java.util.Hashtable;
import javax.microedition.midlet.MIDlet;

/**
* Bootstraps the UI toolkit demos
*
*/
public class ProblemMIDlet extends MIDlet implements ActionListener {//, Painter {

boolean TRANSITION_HORIZONTAL_NOT_VERTICAL = true; // so that we can test vertical transition is required

private static final Command backCommand = new Command("Back");//

private String[] shortList = {
"Short list link 1",
"Short list link 2",
"Short list link 3 ABCDEFG HIJKLADFADFASDFASFDASFDAFAFAadfasd asdf END"
};
private String[] longList = {
"Long list link 1",
"Long list link 2 ABCDEFG HIJKLADFADFASDFASFDASFDAFAFA",
"Long list link 3",
"Long list link 4",
"Long list link 5",
"Long list link 6",
"Long list link 7",
"Long list link 8",
"Long list link 9",
"Long list link 10",
"Long list link 11",
"Long list link 12",
"Long list link 13",
"Long list link 14",
"Long list link 15",
"Long list link 16",
"Long list link 17",
"Long list link 18",
"Long list link 19",
"Long list link 20",
"Long list link 21",
"Long list link 22",
"Long list link 23",
"Long list link 24",
"Long list link 25",
"Long list link 26"
};

Form form;

Container containerLong, containerShort;
CommonTransitions transition;
boolean currentContainerIsLong;

/** return an empty form with one back command */
Form getInitialisedForm() {
form = new Form();
form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
form.addCommand(backCommand);
return form;
}

void initialiseResource() {
try {
Resources r = Resources.open("/client.res");
UIManager.getInstance().setThemeProps(r.getTheme(r.getThemeResourceNames()[0]));
} catch (Exception ex) {
ex.printStackTrace();
}
}

Container getContainer(boolean longListNotShort) {
Container container = new Container();
Label label = new Label(longListNotShort?"Title Long Long Long Long Long Long Long Long list ":
"Title Short list");
label.setTickerEnabled(true);

container.addComponent(label);

List list = new List(longListNotShort?longList:shortList);

list.setFixedSelection(List.FIXED_NONE_CYCLIC);
list.addActionListener(this);
container.addComponent(list);

System.out.println(" is lable's ticker enabled: "+label.isTickerEnabled());

return container;
}

protected void startApp() {

Display.init(this);
initialiseResource();

form = getInitialisedForm();

/* initialise two containers: one long, one short
* but at any one time, only one container will be on screen */
containerLong = getContainer(true);
containerShort = getContainer(false);

form.addComponent(containerLong); // start with long container!

currentContainerIsLong = true;
form.setCommandListener(this);
form.show();
}

protected void pauseApp() {
}

protected void destroyApp(boolean arg0) {
}

public void actionPerformed(ActionEvent evt) {

Command cmd = evt.getCommand();

if (cmd == backCommand) {
setNewTransition(false);
} else { // any other key press
setNewTransition(true);
}

if (currentContainerIsLong) { // carry out transition!
form.replace(containerLong, containerShort, transition);
currentContainerIsLong = false;
} else {
form.replace(containerShort, containerLong, transition);
currentContainerIsLong = true;
}
}

void setNewTransition(boolean forward) {
if (forward) {
transition = CommonTransitions.createSlide(TRANSITION_HORIZONTAL_NOT_VERTICAL ?
CommonTransitions.SLIDE_HORIZONTAL : CommonTransitions.SLIDE_VERTICAL, false, 500);
} else {
transition = CommonTransitions.createSlide(TRANSITION_HORIZONTAL_NOT_VERTICAL ?
CommonTransitions.SLIDE_HORIZONTAL : CommonTransitions.SLIDE_VERTICAL, true, 500);
}
}
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Shai Almog

Hi,
I committed a fix for the focus issue. It was a result of
transitioning between two containers which was not treated.

The ticker support added to LWUIT works for Labels, in a list there
are other complexities related to the renderer implementation:
http://lwuit.blogspot.com/2008/06/implementing-selected-item-ticker-
in.html

The post above was written before we added the ticker support but its
content is still valid for lists.

> Hi Shai,
>
> Thank you so much for getting back to us so quickly.
>
> You are right, the issue 2 and 3 can be easily fixed by changing
> layout (my apologies for not excluding this). I did not quite
> understand your answer to the issue 4. I thought the tickering is
> supported by later version of LWUIT. Or do I miss anything to make
> tickering work?
>
> Seems to me Issue 1 is vital for commercial use in general.
>
> Have a nice day,
>
> Qunhuan
>
> From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
> Sent: 02 October 2008 04:28
> To: users@lwuit.dev.java.net
> Subject: Re: Problem handling different size of list when doing
> conponent transition on form
>
> Hi Qunhuan,
> I see a couple of issues here with the transition but they are a
> bit problematic to fix.
> Some of the issues you are experiencing are a result of your code
> using a Form that is scrollable and FlowLayout (the default layout
> for container). By making the form non-scrollable and the container
> use border layout issue 2 was resolved and I think issue 3 was also
> resolved.
> Issue 4 is not a bug, this is a renderer not a component.
>
> Issue 1 is indeed a LWUIT bug, we need to update focus when the
> change completes (the old list still has focus and the first click
> fixes that).
> I'm not sure which issue relates to that but the target list is
> smaller when traveling from short to long, this can't be fixed
> properly since it will require reflowing the UI which will cause
> "jumpiness".
>
>
>
> Hi again Shai,
> I have made a simple testcase to illustrate some problems related
> to the problems derived from handling different list size with
> component transition on form:
> Scenario - There are two lists (containers), one short, one
> long, to simulate a possible content category browsing. Any
> “Selection”/”Back” key click will switch between the two lists.
> (in order to reproduce the image, this is the colour used:
> bgColor= e8421d
> fgColor= ffffff
> bgSelectionColor= ffecec
> fgSelectionColor= 761d07
> font=Bitmap{arialBold12}
> SoftButton.bgColor= a30800
> SoftButton.fgColor= f8f8f8
>
> )
> Problems:
> 1. 1. Missing 1st key press after transition - Right after app
> is started, while focus is on the “Long list link 1” (Fig 1), press
> selection key, “short list” transits in (Fig 2). The first key
> press (e.g. “down”) will be ignored by the system (should not be ! L)
> Fig 1 Fig 2
> 2. 2. Focus lost – The second “down” key press leads
> to the focus moved to the short list link 2. Click “Down” again,
> the focus appears to be lost (Fig 3)
> Fig 3
> 3. 3. Wrong transit items and not all list items displayed when
> transiting from short list to long - Click any link (e.g. Short
> list link 1, “long list” transits in. But instead of replacing all
> 3 Short list links, only first 2 have been replaced, leaving Short
> list 3 still on screen (Fig 4). At this moment, there are only 3
> items on the screen. The scroll bar does not look right either.
> Click any key (e.g “down”), the full list will be displayed.
> Fig 4
> 4. 4. Ticking is not happening (Fig 4)
> Although
>
> label.setTickerEnabled(true)
>
> is in the code, but no tickering is happening.
>
> 5. If keep playing around, you may find more problems.
>
> (I am using netbeans 6.5, WTK 2.5.2 on Windows Vista)
>
> Please let me know if any bits need further clarification.
>
> Many thanks,
>
> Qunhuan
>
> ~~~~~~~~~~~~~~~~~~~~~~ source code: ~~~~~~~~~~~~~~~~
>
> import com.sun.lwuit.Command;
> import com.sun.lwuit.Container;
>
> import com.sun.lwuit.geom.Dimension;
> import com.sun.lwuit.Display;
> import com.sun.lwuit.Font;
> import com.sun.lwuit.Form;
> import com.sun.lwuit.Label;
> import com.sun.lwuit.Image;
>
> import com.sun.lwuit.animations.Transition;
> import com.sun.lwuit.animations.CommonTransitions;
> import com.sun.lwuit.events.ActionEvent;
> import com.sun.lwuit.events.ActionListener;
>
> import com.sun.lwuit.List;
>
>
> import com.sun.lwuit.layouts.BorderLayout;
> import com.sun.lwuit.layouts.BoxLayout;
> import com.sun.lwuit.plaf.UIManager;
> import com.sun.lwuit.util.Resources;
> import java.util.Hashtable;
> import javax.microedition.midlet.MIDlet;
>
> /**
> * Bootstraps the UI toolkit demos
> *
> */
> public class ProblemMIDlet extends MIDlet implements ActionListener
> {//, Painter {
>
> boolean TRANSITION_HORIZONTAL_NOT_VERTICAL = true; // so that
> we can test vertical transition is required
>
> private static final Command backCommand = new Command("Back");//
>
> private String[] shortList = {
> "Short list link 1",
> "Short list link 2",
> "Short list link 3 ABCDEFG
> HIJKLADFADFASDFASFDASFDAFAFAadfasd asdf END"
> };
> private String[] longList = {
> "Long list link 1",
> "Long list link 2 ABCDEFG HIJKLADFADFASDFASFDASFDAFAFA",
> "Long list link 3",
> "Long list link 4",
> "Long list link 5",
> "Long list link 6",
> "Long list link 7",
> "Long list link 8",
> "Long list link 9",
> "Long list link 10",
> "Long list link 11",
> "Long list link 12",
> "Long list link 13",
> "Long list link 14",
> "Long list link 15",
> "Long list link 16",
> "Long list link 17",
> "Long list link 18",
> "Long list link 19",
> "Long list link 20",
> "Long list link 21",
> "Long list link 22",
> "Long list link 23",
> "Long list link 24",
> "Long list link 25",
> "Long list link 26"
> };
>
> Form form;
>
> Container containerLong, containerShort;
> CommonTransitions transition;
> boolean currentContainerIsLong;
>
> /** return an empty form with one back command */
> Form getInitialisedForm() {
> form = new Form();
> form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
> form.addCommand(backCommand);
> return form;
> }
>
> void initialiseResource() {
> try {
> Resources r = Resources.open("/client.res");
> UIManager.getInstance().setThemeProps(r.getTheme
> (r.getThemeResourceNames()[0]));
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> }
>
> Container getContainer(boolean longListNotShort) {
> Container container = new Container();
> Label label = new Label(longListNotShort?"Title Long Long
> Long Long Long Long Long Long list ":
> "Title Short list");
> label.setTickerEnabled(true);
>
> container.addComponent(label);
>
> List list = new List(longListNotShort?longList:shortList);
>
> list.setFixedSelection(List.FIXED_NONE_CYCLIC);
> list.addActionListener(this);
> container.addComponent(list);
>
> System.out.println(" is lable's ticker enabled:
> "+label.isTickerEnabled());
>
> return container;
> }
>
> protected void startApp() {
>
> Display.init(this);
> initialiseResource();
>
> form = getInitialisedForm();
>
> /* initialise two containers: one long, one short
> * but at any one time, only one container will be on
> screen */
> containerLong = getContainer(true);
> containerShort = getContainer(false);
>
> form.addComponent(containerLong); // start with long
> container!
>
> currentContainerIsLong = true;
> form.setCommandListener(this);
> form.show();
> }
>
> protected void pauseApp() {
> }
>
> protected void destroyApp(boolean arg0) {
> }
>
> public void actionPerformed(ActionEvent evt) {
>
>
> Command cmd = evt.getCommand();
>
> if (cmd == backCommand) {
> setNewTransition(false);
> } else { // any other key press
> setNewTransition(true);
> }
>
> if (currentContainerIsLong) { // carry out transition!
> form.replace(containerLong, containerShort, transition);
> currentContainerIsLong = false;
> } else {
> form.replace(containerShort, containerLong, transition);
> currentContainerIsLong = true;
> }
> }
>
> void setNewTransition(boolean forward) {
> if (forward) {
> transition = CommonTransitions.createSlide
> (TRANSITION_HORIZONTAL_NOT_VERTICAL ?
> CommonTransitions.SLIDE_HORIZONTAL :
> CommonTransitions.SLIDE_VERTICAL, false, 500);
> } else {
> transition = CommonTransitions.createSlide
> (TRANSITION_HORIZONTAL_NOT_VERTICAL ?
> CommonTransitions.SLIDE_HORIZONTAL :
> CommonTransitions.SLIDE_VERTICAL, true, 500);
> }
> }
> }
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> Shai Almog
> http://lwuit.blogspot.com/
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Qunhuan Mei

Brilliant Shai,

Thank you so much!

Cheers,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 02 October 2008 11:45
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing conponent transition on form

Hi,
I committed a fix for the focus issue. It was a result of transitioning between two containers which was not treated.

The ticker support added to LWUIT works for Labels, in a list there are other complexities related to the renderer implementation:
http://lwuit.blogspot.com/2008/06/implementing-selected-item-ticker-in.html

The post above was written before we added the ticker support but its content is still valid for lists.

Hi Shai,

Thank you so much for getting back to us so quickly.

You are right, the issue 2 and 3 can be easily fixed by changing layout (my apologies for not excluding this). I did not quite understand your answer to the issue 4. I thought the tickering is supported by later version of LWUIT. Or do I miss anything to make tickering work?

Seems to me Issue 1 is vital for commercial use in general.

Have a nice day,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 02 October 2008 04:28
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing conponent transition on form

Hi Qunhuan,
I see a couple of issues here with the transition but they are a bit problematic to fix.
Some of the issues you are experiencing are a result of your code using a Form that is scrollable and FlowLayout (the default layout for container). By making the form non-scrollable and the container use border layout issue 2 was resolved and I think issue 3 was also resolved.
Issue 4 is not a bug, this is a renderer not a component.

Issue 1 is indeed a LWUIT bug, we need to update focus when the change completes (the old list still has focus and the first click fixes that).
I'm not sure which issue relates to that but the target list is smaller when traveling from short to long, this can't be fixed properly since it will require reflowing the UI which will cause "jumpiness".

Hi again Shai,
I have made a simple testcase to illustrate some problems related to the problems derived from handling different list size with component transition on form:
Scenario - There are two lists (containers), one short, one long, to simulate a possible content category browsing. Any "Selection"/"Back" key click will switch between the two lists.
(in order to reproduce the image, this is the colour used:
bgColor= e8421d
fgColor= ffffff
bgSelectionColor= ffecec
fgSelectionColor= 761d07
font=Bitmap{arialBold12}
SoftButton.bgColor= a30800
SoftButton.fgColor= f8f8f8

)
Problems:
1. 1. Missing 1st key press after transition - Right after app is started, while focus is on the "Long list link 1" (Fig 1), press selection key, "short list" transits in (Fig 2). The first key press (e.g. "down") will be ignored by the system (should not be ! :()
Fig 1 Fig 2
2. 2. Focus lost - The second "down" key press leads to the focus moved to the short list link 2. Click "Down" again, the focus appears to be lost (Fig 3)
Fig 3
3. 3. Wrong transit items and not all list items displayed when transiting from short list to long - Click any link (e.g. Short list link 1, "long list" transits in. But instead of replacing all 3 Short list links, only first 2 have been replaced, leaving Short list 3 still on screen (Fig 4). At this moment, there are only 3 items on the screen. The scroll bar does not look right either. Click any key (e.g "down"), the full list will be displayed.
Fig 4
4. 4. Ticking is not happening (Fig 4)
Although

label.setTickerEnabled(true)

is in the code, but no tickering is happening.

5. If keep playing around, you may find more problems.

(I am using netbeans 6.5, WTK 2.5.2 on Windows Vista)

Please let me know if any bits need further clarification.

Many thanks,

Qunhuan

~~~~~~~~~~~~~~~~~~~~~~ source code: ~~~~~~~~~~~~~~~~

import com.sun.lwuit.Command;
import com.sun.lwuit.Container;

import com.sun.lwuit.geom.Dimension;
import com.sun.lwuit.Display;
import com.sun.lwuit.Font;
import com.sun.lwuit.Form;
import com.sun.lwuit.Label;
import com.sun.lwuit.Image;

import com.sun.lwuit.animations.Transition;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.events.ActionListener;

import com.sun.lwuit.List;

import com.sun.lwuit.layouts.BorderLayout;
import com.sun.lwuit.layouts.BoxLayout;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;
import java.util.Hashtable;
import javax.microedition.midlet.MIDlet;

/**
* Bootstraps the UI toolkit demos
*
*/
public class ProblemMIDlet extends MIDlet implements ActionListener {//, Painter {

boolean TRANSITION_HORIZONTAL_NOT_VERTICAL = true; // so that we can test vertical transition is required

private static final Command backCommand = new Command("Back");//

private String[] shortList = {
"Short list link 1",
"Short list link 2",
"Short list link 3 ABCDEFG HIJKLADFADFASDFASFDASFDAFAFAadfasd asdf END"
};
private String[] longList = {
"Long list link 1",
"Long list link 2 ABCDEFG HIJKLADFADFASDFASFDASFDAFAFA",
"Long list link 3",
"Long list link 4",
"Long list link 5",
"Long list link 6",
"Long list link 7",
"Long list link 8",
"Long list link 9",
"Long list link 10",
"Long list link 11",
"Long list link 12",
"Long list link 13",
"Long list link 14",
"Long list link 15",
"Long list link 16",
"Long list link 17",
"Long list link 18",
"Long list link 19",
"Long list link 20",
"Long list link 21",
"Long list link 22",
"Long list link 23",
"Long list link 24",
"Long list link 25",
"Long list link 26"
};

Form form;

Container containerLong, containerShort;
CommonTransitions transition;
boolean currentContainerIsLong;

/** return an empty form with one back command */
Form getInitialisedForm() {
form = new Form();
form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
form.addCommand(backCommand);
return form;
}

void initialiseResource() {
try {
Resources r = Resources.open("/client.res");
UIManager.getInstance().setThemeProps(r.getTheme(r.getThemeResourceNames()[0]));
} catch (Exception ex) {
ex.printStackTrace();
}
}

Container getContainer(boolean longListNotShort) {
Container container = new Container();
Label label = new Label(longListNotShort?"Title Long Long Long Long Long Long Long Long list ":
"Title Short list");
label.setTickerEnabled(true);

container.addComponent(label);

List list = new List(longListNotShort?longList:shortList);

list.setFixedSelection(List.FIXED_NONE_CYCLIC);
list.addActionListener(this);
container.addComponent(list);

System.out.println(" is lable's ticker enabled: "+label.isTickerEnabled());

return container;
}

protected void startApp() {

Display.init(this);
initialiseResource();

form = getInitialisedForm();

/* initialise two containers: one long, one short
* but at any one time, only one container will be on screen */
containerLong = getContainer(true);
containerShort = getContainer(false);

form.addComponent(containerLong); // start with long container!

currentContainerIsLong = true;
form.setCommandListener(this);
form.show();
}

protected void pauseApp() {
}

protected void destroyApp(boolean arg0) {
}

public void actionPerformed(ActionEvent evt) {

Command cmd = evt.getCommand();

if (cmd == backCommand) {
setNewTransition(false);
} else { // any other key press
setNewTransition(true);
}

if (currentContainerIsLong) { // carry out transition!
form.replace(containerLong, containerShort, transition);
currentContainerIsLong = false;
} else {
form.replace(containerShort, containerLong, transition);
currentContainerIsLong = true;
}
}

void setNewTransition(boolean forward) {
if (forward) {
transition = CommonTransitions.createSlide(TRANSITION_HORIZONTAL_NOT_VERTICAL ?
CommonTransitions.SLIDE_HORIZONTAL : CommonTransitions.SLIDE_VERTICAL, false, 500);
} else {
transition = CommonTransitions.createSlide(TRANSITION_HORIZONTAL_NOT_VERTICAL ?
CommonTransitions.SLIDE_HORIZONTAL : CommonTransitions.SLIDE_VERTICAL, true, 500);
}
}
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Shai Almog
http://lwuit.blogspot.com/

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Patrick Julien

This has no effect on the Blackberry

On Sun, Aug 31, 2008 at 3:55 AM, Shai Almog wrote:

> Hi,
> I committed something that might workaround this issue into SVN. I'm not
> sure whether it will work for all devices but it was tested on the E90
> device by someone else and might work on the BB as well.
>
> Hi,
> This is not a simple bug, we will try to address this next week.
> In the meantime I would suggest to use TextArea instead.
>
> Regards,
> Chen
>
> lwuit-users@mobileandembedded.org wrote:
>
> Hi,
>
> ok - but, can i do something to get around this?
> [Message sent by forum member 'cknappe' (cknappe)]
>
> http://forums.java.net/jive/thread.jspa?messageID=296197
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
> Shai Almog
> http://lwuit.blogspot.com/
>
>

--
http://www.spectrumdt.com
http://codepimps.org
[att1.html]

Patrick Julien

on the samsung blackjack, it doesn't work either

On Mon, Sep 1, 2008 at 9:24 AM, Patrick Julien
wrote:

> This has no effect on the Blackberry
>
>
> On Sun, Aug 31, 2008 at 3:55 AM, Shai Almog wrote:
>
>> Hi,
>> I committed something that might workaround this issue into SVN. I'm not
>> sure whether it will work for all devices but it was tested on the E90
>> device by someone else and might work on the BB as well.
>>
>> Hi,
>> This is not a simple bug, we will try to address this next week.
>> In the meantime I would suggest to use TextArea instead.
>>
>> Regards,
>> Chen
>>
>> lwuit-users@mobileandembedded.org wrote:
>>
>> Hi,
>>
>> ok - but, can i do something to get around this?
>> [Message sent by forum member 'cknappe' (cknappe)]
>>
>> http://forums.java.net/jive/thread.jspa?messageID=296197
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>
>>
>> Shai Almog
>> http://lwuit.blogspot.com/
>>
>>
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>
>

--
http://www.spectrumdt.com
http://codepimps.org
[att1.html]

Patrick Julien

but on the blackjack, it does have an effect. The keys that show up have
changed, they just aren't the right one.

On Mon, Sep 1, 2008 at 1:22 PM, Patrick Julien
wrote:

> on the samsung blackjack, it doesn't work either
>
>
> On Mon, Sep 1, 2008 at 9:24 AM, Patrick Julien
wrote:
>
>> This has no effect on the Blackberry
>>
>>
>> On Sun, Aug 31, 2008 at 3:55 AM, Shai Almog wrote:
>>
>>> Hi,
>>> I committed something that might workaround this issue into SVN. I'm not
>>> sure whether it will work for all devices but it was tested on the E90
>>> device by someone else and might work on the BB as well.
>>>
>>> Hi,
>>> This is not a simple bug, we will try to address this next week.
>>> In the meantime I would suggest to use TextArea instead.
>>>
>>> Regards,
>>> Chen
>>>
>>> lwuit-users@mobileandembedded.org wrote:
>>>
>>> Hi,
>>>
>>> ok - but, can i do something to get around this?
>>> [Message sent by forum member 'cknappe' (cknappe)]
>>>
>>> http://forums.java.net/jive/thread.jspa?messageID=296197
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>>
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>>
>>>
>>> Shai Almog
>>> http://lwuit.blogspot.com/
>>>
>>>
>>
>>
>> --
>> http://www.spectrumdt.com
>> http://codepimps.org
>>
>>
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>
>

--
http://www.spectrumdt.com
http://codepimps.org
[att1.html]

Shai Almog

Hi,
I committed something that might workaround this issue into SVN. I'm
not sure whether it will work for all devices but it was tested on
the E90 device by someone else and might work on the BB as well.

> Hi,
> This is not a simple bug, we will try to address this next week.
> In the meantime I would suggest to use TextArea instead.
>
> Regards,
> Chen
>
> lwuit-users@mobileandembedded.org wrote:
>> Hi,
>>
>> ok - but, can i do something to get around this?
>> [Message sent by forum member 'cknappe' (cknappe)]
>>
>> http://forums.java.net/jive/thread.jspa?messageID=296197
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

cknappe
Offline
Joined: 2008-08-28

Hi,
i will try using source code from svn.

Thanks,
Christian

sawal_xp
Offline
Joined: 2008-02-12

hi fren...
about some character when typing in textfield not display or cannot input...like in my problem before, like P, G and many more...
i ask to the forum and Shai give some solution, and i make it to my class
here is..: and it work in E90

[code]
import com.sun.lwuit.Display;
import com.sun.lwuit.TextField;

public class NewTextField extends TextField {

public NewTextField(){}

public NewTextField(String _s){
setText(_s);
}

protected boolean isEditingEndTrigger(int keyCode){
int k = Display.getInstance().getGameAction(keyCode);
return keyCode < 0 && (k == Display.GAME_FIRE || k ==Display.GAME_UP || k == Display.GAME_DOWN);
}

protected boolean isEditingTrigger(int keyCode) {
return (keyCode > 0) || (Display.getInstance().getGameAction(keyCode) == Display.GAME_FIRE);
}
}

[/code]

for more detail this is the thread
[url]http://forums.java.net/jive/thread.jspa?messageID=293021񇢝[/url]

cknappe
Offline
Joined: 2008-08-28

Hi,
thanks for the code. This does not work good in BB. The problem is, that i then can't get out the focus from TextField by using the Trackweel. And q and p can not be used. Also the delete or "backspace" does not work properly.

Regards,
Christian

> hi fren...
> about some character when typing in textfield not
> display or cannot input...like in my problem before,
> like P, G and many more...
> i ask to the forum and Shai give some solution, and i
> make it to my class
> here is..: and it work in E90
>
> [code]
> import com.sun.lwuit.Display;
> import com.sun.lwuit.TextField;
>
> public class NewTextField extends TextField {
>
> public NewTextField(){}
>
> public NewTextField(String _s){
> setText(_s);
>
> protected boolean isEditingEndTrigger(int keyCode){
> int k =
> Display.getInstance().getGameAction(keyCode);
> return keyCode < 0 && (k == Display.GAME_FIRE
> || k ==Display.GAME_UP || k == Display.GAME_DOWN);
> }
>
> protected boolean isEditingTrigger(int keyCode) {
> return (keyCode > 0) ||
> (Display.getInstance().getGameAction(keyCode) ==
> Display.GAME_FIRE);
> }
>
> [/code]
>
> for more detail this is the thread
> [url]http://forums.java.net/jive/thread.jspa?messageID
> =293021񇢝[/url]

cknappe
Offline
Joined: 2008-08-28

Hi Chen,

i'll try using TextArea.

Thanks, Christian

cknappe
Offline
Joined: 2008-08-28

Hi,

ok - but, can i do something to get around this?

chen

Hi,
This is not a simple bug, we will try to address this next week.
In the meantime I would suggest to use TextArea instead.

Regards,
Chen

lwuit-users@mobileandembedded.org wrote:
> Hi,
>
> ok - but, can i do something to get around this?
> [Message sent by forum member 'cknappe' (cknappe)]
>
> http://forums.java.net/jive/thread.jspa?messageID=296197
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Qunhuan Mei

Hi LWUIT team,

I may have hit a bug.

Here is the description:

I have a Form.

Within the form, I have a list, called current list, which displays an array of links.

When new array of links received, I use form’s replace(Component current, Component next, Transition t) to show new list.

The problem occurs when current list size is so small that it does not cover the rest of the screen (say the list height on screen is “l”), but new list is larger, say its size should be “L” on screen. The display of the new list will still have the screen height of “l” instead of “L” during and after transition. It seems, in this case, some parameters are not updated when new list is initialised within the replace method. The problem happens for both horizontal and vertical transition.

All list items are accessible when problem occurs.

If I stop using replace(Component current, Component next, Transition t) but use
removeComponent(current);
addComponent(next);
instead, everything appears to be normal. That is, the new list will be displayed as it should be.

I did not prepare the problem code for this since I am currently fully occupied. But if it is required, please let me know.

Many thanks,

Qunhuan

Qunhuan Mei

Well done, LWUIT team, original problem scale reduced!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hi again,

Just checked out the latest LWUIT code and found the original problem reported has been scaled down. But there is still something remaining. Here is the description:

1. For horizontal transition

- Left to right (right is newly created)

(1) Large list size going to small one – no list problem right after transition, but first up/down key press has no effect. Only second key up/down and after traverses over the list

(2) Small list size going to large one – still have the small size (including scrollbar) right after transition. BUT the first up/down key press will immediately causing the display of the right size of the list to be displayed while having no traverse effect. Only second up/down key press and after traverses over the list.

- right to left (left is a saved and old one)
Same as Left to right.

2. For vertical transition

- Bottom-up

(1) Large list size to small one – no list problem but clip problem (see below), plus the first down/up key press has no effect. Only second key up/down and after traverses over the list.

(2) Small size to large one – still have the small size (including scrollbar) right after transition. BUT the first down/up key will immediately causing the right size of the list to be displayed with no traverse effect. Only second key up/down and after traverses over the list.

- Top-down

Same as Bottom-up

- Clip problem: The clip size is not using the exact size of component’s visible part but may be using the full form’s, causing unnecessary part appear on the screen right after transition.

I tried to create problem reproducing code but it appears to be a non-trivial task since the problem code is deeply inside a large project. However, if the problem reproducing code is really required, please let me know.

Many thanks,

Qunhuan

-----Original Message-----
From: Qunhuan Mei [mailto:qunhuan.mei@mfuse.com]
Sent: 29 August 2008 15:49
To: users@lwuit.dev.java.net
Subject: Problem handling different size of list when doing component transition on form

Hi LWUIT team,

I have hit a problem.

Here is the description:

I have a Form.

Within the form, I have a list, called current list, which displays an array of links.

When new array of links received, I use form’s replace(Component current, Component next, Transition t) to show new list.

The problem occurs when current list size is so small that it does not cover the rest of the screen (say the list height on screen is “l”), but new list is larger, say its size should be “L” on screen. The display of the new list will still have the screen height of “l” instead of “L” during and after transition. It seems, in this case, some parameters are not updated when new list is initialised within the replace method. The problem happens for both horizontal and vertical transition.

All list items are accessible when problem occurs.

If I stop using replace(Component current, Component next, Transition t) but use
removeComponent(current);
addComponent(next);
instead, everything appears to be normal. That is, the new list will be displayed as it should be.

I did not prepare the problem code for this since I am currently fully occupied. But if it is required, please let me know.

Many thanks,

Qunhuan

Shai Almog

Hi Qunhuan,
I'm not exactly sure what the problem is. Performing a transition
(Container.replace) from a small component to a larger component or
visa versa isn't currently supported by LWUIT and I personally doubt
it would be technically feasible and visually appealing. The
assumption is that you would replace a component with an equal or
similar preferred size value.

> Well done, LWUIT team, original problem scale reduced!
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Hi again,
>
> Just checked out the latest LWUIT code and found the original
> problem reported has been scaled down. But there is still something
> remaining. Here is the description:
>
> 1. For horizontal transition
>
> - Left to right (right is newly created)
>
> (1) Large list size going to small one – no list problem right
> after transition, but first up/down key press has no effect. Only
> second key up/down and after traverses over the list
>
> (2) Small list size going to large one – still have the small
> size (including scrollbar) right after transition. BUT the first up/
> down key press will immediately causing the display of the right
> size of the list to be displayed while having no traverse effect.
> Only second up/down key press and after traverses over the list.
>
> - right to left (left is a saved and old one)
> Same as Left to right.
>
> 2. For vertical transition
>
> - Bottom-up
>
> (1) Large list size to small one – no list problem but clip
> problem (see below), plus the first down/up key press has no
> effect. Only second key up/down and after traverses over the list.
>
> (2) Small size to large one – still have the small size
> (including scrollbar) right after transition. BUT the first down/up
> key will immediately causing the right size of the list to be
> displayed with no traverse effect. Only second key up/down and
> after traverses over the list.
>
> - Top-down
>
> Same as Bottom-up
>
> - Clip problem: The clip size is not using the exact size of
> component’s visible part but may be using the full form’s, causing
> unnecessary part appear on the screen right after transition.
>
> I tried to create problem reproducing code but it appears to be a
> non-trivial task since the problem code is deeply inside a large
> project. However, if the problem reproducing code is really
> required, please let me know.
>
> Many thanks,
>
> Qunhuan
>
>
> -----Original Message-----
> From: Qunhuan Mei [mailto:qunhuan.mei@mfuse.com]
> Sent: 29 August 2008 15:49
> To: users@lwuit.dev.java.net
> Subject: Problem handling different size of list when doing
> component transition on form
>
> Hi LWUIT team,
>
> I have hit a problem.
>
> Here is the description:
>
> I have a Form.
>
> Within the form, I have a list, called current list, which displays
> an array of links.
>
> When new array of links received, I use form’s replace(Component
> current, Component next, Transition t) to show new list.
>
> The problem occurs when current list size is so small that it does
> not cover the rest of the screen (say the list height on screen is
> “l”), but new list is larger, say its size should be “L” on screen.
> The display of the new list will still have the screen height of
> “l” instead of “L” during and after transition. It seems, in this
> case, some parameters are not updated when new list is initialised
> within the replace method. The problem happens for both horizontal
> and vertical transition.
>
> All list items are accessible when problem occurs.
>
> If I stop using replace(Component current, Component next,
> Transition t) but use
> removeComponent(current);
> addComponent(next);
> instead, everything appears to be normal. That is, the new list
> will be displayed as it should be.
>
> I did not prepare the problem code for this since I am currently
> fully occupied. But if it is required, please let me know.
>
> Many thanks,
>
> Qunhuan
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Qunhuan Mei

Hi Shai,

Thanks for your reply.

We would like the transition to happen only to the middle part while keeping both top and bottom parts of the screen. The principle here is moving the "dynamic parts" while keeping the "constant ones". This principle leads to more intuitive UI and has widely been used in the leading mobile apps, such as iPhone's. Make sense?

Attached please find the source code which reproduces the problem (only one user class, the rest are all lwuit source). Hope this helps.

Many thanks,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 04 September 2008 16:12
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing component transition on form

Hi Qunhuan,
I'm not exactly sure what the problem is. Performing a transition (Container.replace) from a small component to a larger component or visa versa isn't currently supported by LWUIT and I personally doubt it would be technically feasible and visually appealing. The assumption is that you would replace a component with an equal or similar preferred size value.

Well done, LWUIT team, original problem scale reduced!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hi again,

Just checked out the latest LWUIT code and found the original problem reported has been scaled down. But there is still something remaining. Here is the description:

1. For horizontal transition

- Left to right (right is newly created)

(1) Large list size going to small one - no list problem right after transition, but first up/down key press has no effect. Only second key up/down and after traverses over the list

(2) Small list size going to large one - still have the small size (including scrollbar) right after transition. BUT the first up/down key press will immediately causing the display of the right size of the list to be displayed while having no traverse effect. Only second up/down key press and after traverses over the list.

- right to left (left is a saved and old one)
Same as Left to right.

2. For vertical transition

- Bottom-up

(1) Large list size to small one - no list problem but clip problem (see below), plus the first down/up key press has no effect. Only second key up/down and after traverses over the list.

(2) Small size to large one - still have the small size (including scrollbar) right after transition. BUT the first down/up key will immediately causing the right size of the list to be displayed with no traverse effect. Only second key up/down and after traverses over the list.

- Top-down

Same as Bottom-up

- Clip problem: The clip size is not using the exact size of component's visible part but may be using the full form's, causing unnecessary part appear on the screen right after transition.

I tried to create problem reproducing code but it appears to be a non-trivial task since the problem code is deeply inside a large project. However, if the problem reproducing code is really required, please let me know.

Many thanks,

Qunhuan

-----Original Message-----
From: Qunhuan Mei [mailto:qunhuan.mei@mfuse.com]
Sent: 29 August 2008 15:49
To: users@lwuit.dev.java.net
Subject: Problem handling different size of list when doing component transition on form

Hi LWUIT team,

I have hit a problem.

Here is the description:

I have a Form.

Within the form, I have a list, called current list, which displays an array of links.

When new array of links received, I use form's replace(Component current, Component next, Transition t) to show new list.

The problem occurs when current list size is so small that it does not cover the rest of the screen (say the list height on screen is "l"), but new list is larger, say its size should be "L" on screen. The display of the new list will still have the screen height of "l" instead of "L" during and after transition. It seems, in this case, some parameters are not updated when new list is initialised within the replace method. The problem happens for both horizontal and vertical transition.

All list items are accessible when problem occurs.

If I stop using replace(Component current, Component next, Transition t) but use
removeComponent(current);
addComponent(next);
instead, everything appears to be normal. That is, the new list will be displayed as it should be.

I did not prepare the problem code for this since I am currently fully occupied. But if it is required, please let me know.

Many thanks,

Qunhuan

Shai Almog
http://lwuit.blogspot.com/

[att1.html]
[ContainerTransitionProblem.rar]
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Shai Almog

Hi,
There is no attachment. Container.replace works as advertised and
performs exactly that, it just won't work for components of differing
size.

> Hi Shai,
>
>
>
> Thanks for your reply.
>
>
>
> We would like the transition to happen only to the middle part
> while keeping both top and bottom parts of the screen. The
> principle here is moving the “dynamic parts” while keeping the
> “constant ones”. This principle leads to more intuitive UI and has
> widely been used in the leading mobile apps, such as iPhone’s.
> Make sense?
>
>
>
> Attached please find the source code which reproduces the problem
> (only one user class, the rest are all lwuit source). Hope this helps.
>
>
>
> Many thanks,
>
>
>
> Qunhuan
>
>
>
> From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
> Sent: 04 September 2008 16:12
> To: users@lwuit.dev.java.net
> Subject: Re: Problem handling different size of list when doing
> component transition on form
>
>
>
> Hi Qunhuan,
>
> I'm not exactly sure what the problem is. Performing a transition
> (Container.replace) from a small component to a larger component or
> visa versa isn't currently supported by LWUIT and I personally
> doubt it would be technically feasible and visually appealing. The
> assumption is that you would replace a component with an equal or
> similar preferred size value.
>
>
>
>
> Well done, LWUIT team, original problem scale reduced!
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
> Hi again,
>
>
>
> Just checked out the latest LWUIT code and found the original
> problem reported has been scaled down. But there is still something
> remaining. Here is the description:
>
>
>
> 1. For horizontal transition
>
>
>
> - Left to right (right is newly created)
>
>
>
> (1) Large list size going to small one – no list problem right
> after transition, but first up/down key press has no effect. Only
> second key up/down and after traverses over the list
>
>
>
> (2) Small list size going to large one – still have the small
> size (including scrollbar) right after transition. BUT the first up/
> down key press will immediately causing the display of the right
> size of the list to be displayed while having no traverse effect.
> Only second up/down key press and after traverses over the list.
>
>
>
> - right to left (left is a saved and old one)
>
> Same as Left to right.
>
>
>
> 2. For vertical transition
>
>
>
> - Bottom-up
>
>
>
> (1) Large list size to small one – no list problem but clip
> problem (see below), plus the first down/up key press has no
> effect. Only second key up/down and after traverses over the list.
>
>
>
> (2) Small size to large one – still have the small size
> (including scrollbar) right after transition. BUT the first down/up
> key will immediately causing the right size of the list to be
> displayed with no traverse effect. Only second key up/down and
> after traverses over the list.
>
>
>
> - Top-down
>
>
>
> Same as Bottom-up
>
>
>
> - Clip problem: The clip size is not using the exact size of
> component’s visible part but may be using the full form’s, causing
> unnecessary part appear on the screen right after transition.
>
>
>
> I tried to create problem reproducing code but it appears to be a
> non-trivial task since the problem code is deeply inside a large
> project. However, if the problem reproducing code is really
> required, please let me know.
>
>
>
> Many thanks,
>
>
>
> Qunhuan
>
>
>
>
>
> -----Original Message-----
>
> From: Qunhuan Mei [mailto:qunhuan.mei@mfuse.com]
>
> Sent: 29 August 2008 15:49
>
> To: users@lwuit.dev.java.net
>
> Subject: Problem handling different size of list when doing
> component transition on form
>
>
>
> Hi LWUIT team,
>
>
>
> I have hit a problem.
>
>
>
> Here is the description:
>
>
>
> I have a Form.
>
>
>
> Within the form, I have a list, called current list, which displays
> an array of links.
>
>
>
> When new array of links received, I use form’s replace(Component
> current, Component next, Transition t) to show new list.
>
>
>
> The problem occurs when current list size is so small that it does
> not cover the rest of the screen (say the list height on screen is
> “l”), but new list is larger, say its size should be “L” on screen.
> The display of the new list will still have the screen height of
> “l” instead of “L” during and after transition. It seems, in this
> case, some parameters are not updated when new list is initialised
> within the replace method. The problem happens for both horizontal
> and vertical transition.
>
>
>
> All list items are accessible when problem occurs.
>
>
>
> If I stop using replace(Component current, Component next,
> Transition t) but use
>
> removeComponent(current);
>
> addComponent(next);
>
> instead, everything appears to be normal. That is, the new list
> will be displayed as it should be.
>
>
>
> I did not prepare the problem code for this since I am currently
> fully occupied. But if it is required, please let me know.
>
>
>
> Many thanks,
>
>
>
> Qunhuan
>
>
>
>
>
> Shai Almog
>
> http://lwuit.blogspot.com/
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Qunhuan Mei

Hi again, Shai,

This is the source code - it is very straightforward. Page of different number of links appears to be a quite common use case. It would be very useful if LWUIT could support this.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

import com.sun.lwuit.Command;
import com.sun.lwuit.Container;

import com.sun.lwuit.geom.Dimension;
import com.sun.lwuit.Display;
import com.sun.lwuit.Font;
import com.sun.lwuit.Form;
import com.sun.lwuit.Label;
import com.sun.lwuit.Image;

import com.sun.lwuit.animations.Transition;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.events.ActionListener;

import com.sun.lwuit.List;

import com.sun.lwuit.layouts.BorderLayout;
import com.sun.lwuit.layouts.BoxLayout;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;
import java.util.Hashtable;
import javax.microedition.midlet.MIDlet;

/**
* Bootstraps the UI toolkit demos
*
*/
public class ProblemMIDlet extends MIDlet implements ActionListener {//, Painter {

boolean TRANSITION_VERTICAL_NOT_HORIZONTAL = false;

private static final Command backCommand = new Command("Back");//
Label logoLabel, labelLong, labelShort;
private String[] shortList = {
"Short list link 1",
"Short list link 2",
"Short list link 3"
};
private String[] longList = {
"Long list link 1",
"Long list link 2",
"Long list link 3",
"Long list link 4",
"Long list link 5",
"Long list link 6",
"Long list link 7",
"Long list link 8",
"Long list link 9",
"Long list link 10",
"Long list link 11",
"Long list link 12",
"Long list link 13",
"Long list link 14",
"Long list link 15",
"Long list link 16",
"Long list link 17",
"Long list link 18",
"Long list link 19",
"Long list link 20",
"Long list link 21",
"Long list link 22",
"Long list link 23",
"Long list link 24",
"Long list link 25",
"Long list link 26"
};
Form form;

Container containerLong, containerShort;
CommonTransitions transition;
boolean currentContainerIsLong;

Form getInitialisedForm() {
form = new Form();
form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
form.setScrollable(false);

form.addCommand(backCommand);
return form;
}

void addLogoImageToTopOfTheForm(Form form) {
try {
//Image image = Image.createImage("/logoImage.png");

logoLabel = new Label("image");
logoLabel.setAlignment(Label.CENTER); // No effect!?
form.addComponent(logoLabel);
} catch (Exception ex) {
ex.printStackTrace();
}
}

void initialiseResource() {
try {
//Resources r = Resources.open("/client.res");
//UIManager.getInstance().setThemeProps(r.getTheme(r.getThemeResourceNames()[0]));
} catch (Exception ex) {
ex.printStackTrace();
}
}

Container getInitialiseContainerLong() {
Container container = new Container();
Label label = new Label("Title Long list");
container.addComponent(label);

List list = new List(longList);

int idealWidth = Display.getInstance().getDisplayWidth();
int idealLongListHeight = list.getPreferredH();
Dimension dimension = new Dimension(idealWidth, idealLongListHeight);//list.getHeight());

System.out.println(" idealLongListHeight: "+idealLongListHeight);

list.setPreferredSize(dimension);
list.setFixedSelection(List.FIXED_NONE_CYCLIC);
list.addActionListener(this);
container.addComponent(list);
return container;
}

Container getInitialiseContainerShort() {
Container container = new Container();
Label label = new Label("Title Short list");
container.addComponent(label);

List list = new List(shortList);

int idealWidth = Display.getInstance().getDisplayWidth();
int idealShortListHeight = list.getPreferredH();
Dimension dimension = new Dimension(idealWidth, idealShortListHeight);//idealHeight);//list.getHeight());

System.out.println(" idealShortListHeight: "+idealShortListHeight);

list.setPreferredSize(dimension);
list.addActionListener(this);
list.setFixedSelection(List.FIXED_NONE_CYCLIC);
container.addComponent(list);
return container;
}

protected void startApp() {

Display.init(this);
initialiseResource();

form = getInitialisedForm();

addLogoImageToTopOfTheForm(form);

containerLong = getInitialiseContainerLong();

containerShort = getInitialiseContainerShort();

form.addComponent(containerLong);

currentContainerIsLong = true;
form.setCommandListener(this);
form.show();

}

protected void pauseApp() {
}

protected void destroyApp(boolean arg0) {
}

public void actionPerformed(ActionEvent evt) {
Command cmd = evt.getCommand();

if (cmd == backCommand) {
setNewTransition(false);
} else { // any other key press
setNewTransition(true);
}

if (currentContainerIsLong) {
form.replace(containerLong, containerShort, transition);
currentContainerIsLong = false;
} else {
form.replace(containerShort, containerLong, transition);
currentContainerIsLong = true;
}
}

void setNewTransition(boolean forward) {
if (forward) {
transition = CommonTransitions.createSlide(TRANSITION_VERTICAL_NOT_HORIZONTAL ? CommonTransitions.SLIDE_VERTICAL : CommonTransitions.SLIDE_HORIZONTAL, false, 500);
} else {
transition = CommonTransitions.createSlide(TRANSITION_VERTICAL_NOT_HORIZONTAL ? CommonTransitions.SLIDE_VERTICAL : CommonTransitions.SLIDE_HORIZONTAL, true, 500);
}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Many thanks,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 05 September 2008 18:24
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing component transition on form

Hi,
There is no attachment. Container.replace works as advertised and performs exactly that, it just won't work for components of differing size.

Hi Shai,

Thanks for your reply.

We would like the transition to happen only to the middle part while keeping both top and bottom parts of the screen. The principle here is moving the "dynamic parts" while keeping the "constant ones". This principle leads to more intuitive UI and has widely been used in the leading mobile apps, such as iPhone's. Make sense?

Attached please find the source code which reproduces the problem (only one user class, the rest are all lwuit source). Hope this helps.

Many thanks,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 04 September 2008 16:12
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing component transition on form

Hi Qunhuan,
I'm not exactly sure what the problem is. Performing a transition (Container.replace) from a small component to a larger component or visa versa isn't currently supported by LWUIT and I personally doubt it would be technically feasible and visually appealing. The assumption is that you would replace a component with an equal or similar preferred size value.

Well done, LWUIT team, original problem scale reduced!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hi again,

Just checked out the latest LWUIT code and found the original problem reported has been scaled down. But there is still something remaining. Here is the description:

1. For horizontal transition

- Left to right (right is newly created)

(1) Large list size going to small one - no list problem right after transition, but first up/down key press has no effect. Only second key up/down and after traverses over the list

(2) Small list size going to large one - still have the small size (including scrollbar) right after transition. BUT the first up/down key press will immediately causing the display of the right size of the list to be displayed while having no traverse effect. Only second up/down key press and after traverses over the list.

- right to left (left is a saved and old one)
Same as Left to right.

2. For vertical transition

- Bottom-up

(1) Large list size to small one - no list problem but clip problem (see below), plus the first down/up key press has no effect. Only second key up/down and after traverses over the list.

(2) Small size to large one - still have the small size (including scrollbar) right after transition. BUT the first down/up key will immediately causing the right size of the list to be displayed with no traverse effect. Only second key up/down and after traverses over the list.

- Top-down

Same as Bottom-up

- Clip problem: The clip size is not using the exact size of component's visible part but may be using the full form's, causing unnecessary part appear on the screen right after transition.

I tried to create problem reproducing code but it appears to be a non-trivial task since the problem code is deeply inside a large project. However, if the problem reproducing code is really required, please let me know.

Many thanks,

Qunhuan

-----Original Message-----
From: Qunhuan Mei [mailto:qunhuan.mei@mfuse.com]
Sent: 29 August 2008 15:49
To: users@lwuit.dev.java.net
Subject: Problem handling different size of list when doing component transition on form

Hi LWUIT team,

I have hit a problem.

Here is the description:

I have a Form.

Within the form, I have a list, called current list, which displays an array of links.

When new array of links received, I use form's replace(Component current, Component next, Transition t) to show new list.

The problem occurs when current list size is so small that it does not cover the rest of the screen (say the list height on screen is "l"), but new list is larger, say its size should be "L" on screen. The display of the new list will still have the screen height of "l" instead of "L" during and after transition. It seems, in this case, some parameters are not updated when new list is initialised within the replace method. The problem happens for both horizontal and vertical transition.

All list items are accessible when problem occurs.

If I stop using replace(Component current, Component next, Transition t) but use
removeComponent(current);
addComponent(next);
instead, everything appears to be normal. That is, the new list will be displayed as it should be.

I did not prepare the problem code for this since I am currently fully occupied. But if it is required, please let me know.

Many thanks,

Qunhuan

Shai Almog
http://lwuit.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Shai Almog

Hi,
sorry but I don't see the problem. Your sample seems to work as
expected.

> Hi again, Shai,
>
> This is the source code – it is very straightforward. Page of
> different number of links appears to be a quite common use case. It
> would be very useful if LWUIT could support this.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> import com.sun.lwuit.Command;
> import com.sun.lwuit.Container;
>
> import com.sun.lwuit.geom.Dimension;
> import com.sun.lwuit.Display;
> import com.sun.lwuit.Font;
> import com.sun.lwuit.Form;
> import com.sun.lwuit.Label;
> import com.sun.lwuit.Image;
>
> import com.sun.lwuit.animations.Transition;
> import com.sun.lwuit.animations.CommonTransitions;
> import com.sun.lwuit.events.ActionEvent;
> import com.sun.lwuit.events.ActionListener;
>
> import com.sun.lwuit.List;
>
>
> import com.sun.lwuit.layouts.BorderLayout;
> import com.sun.lwuit.layouts.BoxLayout;
> import com.sun.lwuit.plaf.UIManager;
> import com.sun.lwuit.util.Resources;
> import java.util.Hashtable;
> import javax.microedition.midlet.MIDlet;
>
> /**
> * Bootstraps the UI toolkit demos
> *
> */
> public class ProblemMIDlet extends MIDlet implements ActionListener
> {//, Painter {
>
> boolean TRANSITION_VERTICAL_NOT_HORIZONTAL = false;
>
> private static final Command backCommand = new Command("Back");//
> Label logoLabel, labelLong, labelShort;
> private String[] shortList = {
> "Short list link 1",
> "Short list link 2",
> "Short list link 3"
> };
> private String[] longList = {
> "Long list link 1",
> "Long list link 2",
> "Long list link 3",
> "Long list link 4",
> "Long list link 5",
> "Long list link 6",
> "Long list link 7",
> "Long list link 8",
> "Long list link 9",
> "Long list link 10",
> "Long list link 11",
> "Long list link 12",
> "Long list link 13",
> "Long list link 14",
> "Long list link 15",
> "Long list link 16",
> "Long list link 17",
> "Long list link 18",
> "Long list link 19",
> "Long list link 20",
> "Long list link 21",
> "Long list link 22",
> "Long list link 23",
> "Long list link 24",
> "Long list link 25",
> "Long list link 26"
> };
> Form form;
>
> Container containerLong, containerShort;
> CommonTransitions transition;
> boolean currentContainerIsLong;
>
> Form getInitialisedForm() {
> form = new Form();
> form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
> form.setScrollable(false);
>
> form.addCommand(backCommand);
> return form;
> }
>
> void addLogoImageToTopOfTheForm(Form form) {
> try {
> //Image image = Image.createImage("/logoImage.png");
>
> logoLabel = new Label("image");
> logoLabel.setAlignment(Label.CENTER); // No effect!?
> form.addComponent(logoLabel);
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> }
>
> void initialiseResource() {
> try {
> //Resources r = Resources.open("/client.res");
> //UIManager.getInstance().setThemeProps(r.getTheme
> (r.getThemeResourceNames()[0]));
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> }
>
> Container getInitialiseContainerLong() {
> Container container = new Container();
> Label label = new Label("Title Long list");
> container.addComponent(label);
>
> List list = new List(longList);
>
> int idealWidth = Display.getInstance().getDisplayWidth();
> int idealLongListHeight = list.getPreferredH();
> Dimension dimension = new Dimension(idealWidth,
> idealLongListHeight);//list.getHeight());
>
> System.out.println(" idealLongListHeight:
> "+idealLongListHeight);
>
> list.setPreferredSize(dimension);
> list.setFixedSelection(List.FIXED_NONE_CYCLIC);
> list.addActionListener(this);
> container.addComponent(list);
> return container;
> }
>
> Container getInitialiseContainerShort() {
> Container container = new Container();
> Label label = new Label("Title Short list");
> container.addComponent(label);
>
> List list = new List(shortList);
>
> int idealWidth = Display.getInstance().getDisplayWidth();
> int idealShortListHeight = list.getPreferredH();
> Dimension dimension = new Dimension(idealWidth,
> idealShortListHeight);//idealHeight);//list.getHeight());
>
> System.out.println(" idealShortListHeight:
> "+idealShortListHeight);
>
> list.setPreferredSize(dimension);
> list.addActionListener(this);
> list.setFixedSelection(List.FIXED_NONE_CYCLIC);
> container.addComponent(list);
> return container;
> }
>
> protected void startApp() {
>
> Display.init(this);
> initialiseResource();
>
> form = getInitialisedForm();
>
> addLogoImageToTopOfTheForm(form);
>
> containerLong = getInitialiseContainerLong();
>
> containerShort = getInitialiseContainerShort();
>
>
> form.addComponent(containerLong);
>
> currentContainerIsLong = true;
> form.setCommandListener(this);
> form.show();
>
>
> }
>
> protected void pauseApp() {
> }
>
> protected void destroyApp(boolean arg0) {
> }
>
> public void actionPerformed(ActionEvent evt) {
> Command cmd = evt.getCommand();
>
> if (cmd == backCommand) {
> setNewTransition(false);
> } else { // any other key press
> setNewTransition(true);
> }
>
> if (currentContainerIsLong) {
> form.replace(containerLong, containerShort, transition);
> currentContainerIsLong = false;
> } else {
> form.replace(containerShort, containerLong, transition);
> currentContainerIsLong = true;
> }
> }
>
> void setNewTransition(boolean forward) {
> if (forward) {
> transition = CommonTransitions.createSlide
> (TRANSITION_VERTICAL_NOT_HORIZONTAL ?
> CommonTransitions.SLIDE_VERTICAL :
> CommonTransitions.SLIDE_HORIZONTAL, false, 500);
> } else {
> transition = CommonTransitions.createSlide
> (TRANSITION_VERTICAL_NOT_HORIZONTAL ?
> CommonTransitions.SLIDE_VERTICAL :
> CommonTransitions.SLIDE_HORIZONTAL, true, 500);
> }
> }
> }
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Many thanks,
>
> Qunhuan
>
> From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
> Sent: 05 September 2008 18:24
> To: users@lwuit.dev.java.net
> Subject: Re: Problem handling different size of list when doing
> component transition on form
>
> Hi,
> There is no attachment. Container.replace works as advertised and
> performs exactly that, it just won't work for components of
> differing size.
>
>
> Hi Shai,
>
> Thanks for your reply.
>
> We would like the transition to happen only to the middle part
> while keeping both top and bottom parts of the screen. The
> principle here is moving the “dynamic parts” while keeping the
> “constant ones”. This principle leads to more intuitive UI and has
> widely been used in the leading mobile apps, such as iPhone’s.
> Make sense?
>
> Attached please find the source code which reproduces the problem
> (only one user class, the rest are all lwuit source). Hope this helps.
>
> Many thanks,
>
> Qunhuan
>
> From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
> Sent: 04 September 2008 16:12
> To: users@lwuit.dev.java.net
> Subject: Re: Problem handling different size of list when doing
> component transition on form
>
> Hi Qunhuan,
> I'm not exactly sure what the problem is. Performing a transition
> (Container.replace) from a small component to a larger component or
> visa versa isn't currently supported by LWUIT and I personally
> doubt it would be technically feasible and visually appealing. The
> assumption is that you would replace a component with an equal or
> similar preferred size value.
>
>
>
> Well done, LWUIT team, original problem scale reduced!
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Hi again,
>
> Just checked out the latest LWUIT code and found the original
> problem reported has been scaled down. But there is still something
> remaining. Here is the description:
>
> 1. For horizontal transition
>
> - Left to right (right is newly created)
>
> (1) Large list size going to small one – no list problem right
> after transition, but first up/down key press has no effect. Only
> second key up/down and after traverses over the list
>
> (2) Small list size going to large one – still have the small
> size (including scrollbar) right after transition. BUT the first up/
> down key press will immediately causing the display of the right
> size of the list to be displayed while having no traverse effect.
> Only second up/down key press and after traverses over the list.
>
> - right to left (left is a saved and old one)
> Same as Left to right.
>
> 2. For vertical transition
>
> - Bottom-up
>
> (1) Large list size to small one – no list problem but clip
> problem (see below), plus the first down/up key press has no
> effect. Only second key up/down and after traverses over the list.
>
> (2) Small size to large one – still have the small size
> (including scrollbar) right after transition. BUT the first down/up
> key will immediately causing the right size of the list to be
> displayed with no traverse effect. Only second key up/down and
> after traverses over the list.
>
> - Top-down
>
> Same as Bottom-up
>
> - Clip problem: The clip size is not using the exact size of
> component’s visible part but may be using the full form’s, causing
> unnecessary part appear on the screen right after transition.
>
> I tried to create problem reproducing code but it appears to be a
> non-trivial task since the problem code is deeply inside a large
> project. However, if the problem reproducing code is really
> required, please let me know.
>
> Many thanks,
>
> Qunhuan
>
>
> -----Original Message-----
> From: Qunhuan Mei [mailto:qunhuan.mei@mfuse.com]
> Sent: 29 August 2008 15:49
> To: users@lwuit.dev.java.net
> Subject: Problem handling different size of list when doing
> component transition on form
>
> Hi LWUIT team,
>
> I have hit a problem.
>
> Here is the description:
>
> I have a Form.
>
> Within the form, I have a list, called current list, which displays
> an array of links.
>
> When new array of links received, I use form’s replace(Component
> current, Component next, Transition t) to show new list.
>
> The problem occurs when current list size is so small that it does
> not cover the rest of the screen (say the list height on screen is
> “l”), but new list is larger, say its size should be “L” on screen.
> The display of the new list will still have the screen height of
> “l” instead of “L” during and after transition. It seems, in this
> case, some parameters are not updated when new list is initialised
> within the replace method. The problem happens for both horizontal
> and vertical transition.
>
> All list items are accessible when problem occurs.
>
> If I stop using replace(Component current, Component next,
> Transition t) but use
> removeComponent(current);
> addComponent(next);
> instead, everything appears to be normal. That is, the new list
> will be displayed as it should be.
>
> I did not prepare the problem code for this since I am currently
> fully occupied. But if it is required, please let me know.
>
> Many thanks,
>
> Qunhuan
>
>
> Shai Almog
> http://lwuit.blogspot.com/
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
> Shai Almog
> http://lwuit.blogspot.com/
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Qunhuan Mei

(Looks like good news - problem gone ... :))

Here are the steps to expose the problem:

Start the app:

* Problem 1: While focus is on the link 1, press selection key, "short list" transits in. The first "down" key press has been ignored by the system (should not be ! :(). The second "down" key press leads to the focus moved to the link 2. Click link 2, "long list" transits in.

* Problem 2: At this moment, there are only 3 items on the screen - and also the scroll bar looks wired.
Keep playing around, you may find more problems.

If you still can't see any problem, please let me know. I can provide screen copies. (I am using netbeans 6.5, WTK 2.5.2 on Windows Vista, I suppose this won't make any difference)

Many thanks,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 08 September 2008 14:13
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing component transition on form

Hi,
sorry but I don't see the problem. Your sample seems to work as expected.

Hi again, Shai,

This is the source code - it is very straightforward. Page of different number of links appears to be a quite common use case. It would be very useful if LWUIT could support this.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

import com.sun.lwuit.Command;
import com.sun.lwuit.Container;

import com.sun.lwuit.geom.Dimension;
import com.sun.lwuit.Display;
import com.sun.lwuit.Font;
import com.sun.lwuit.Form;
import com.sun.lwuit.Label;
import com.sun.lwuit.Image;

import com.sun.lwuit.animations.Transition;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.events.ActionListener;

import com.sun.lwuit.List;

import com.sun.lwuit.layouts.BorderLayout;
import com.sun.lwuit.layouts.BoxLayout;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;
import java.util.Hashtable;
import javax.microedition.midlet.MIDlet;

/**
* Bootstraps the UI toolkit demos
*
*/
public class ProblemMIDlet extends MIDlet implements ActionListener {//, Painter {

boolean TRANSITION_VERTICAL_NOT_HORIZONTAL = false;

private static final Command backCommand = new Command("Back");//
Label logoLabel, labelLong, labelShort;
private String[] shortList = {
"Short list link 1",
"Short list link 2",
"Short list link 3"
};
private String[] longList = {
"Long list link 1",
"Long list link 2",
"Long list link 3",
"Long list link 4",
"Long list link 5",
"Long list link 6",
"Long list link 7",
"Long list link 8",
"Long list link 9",
"Long list link 10",
"Long list link 11",
"Long list link 12",
"Long list link 13",
"Long list link 14",
"Long list link 15",
"Long list link 16",
"Long list link 17",
"Long list link 18",
"Long list link 19",
"Long list link 20",
"Long list link 21",
"Long list link 22",
"Long list link 23",
"Long list link 24",
"Long list link 25",
"Long list link 26"
};
Form form;

Container containerLong, containerShort;
CommonTransitions transition;
boolean currentContainerIsLong;

Form getInitialisedForm() {
form = new Form();
form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
form.setScrollable(false);

form.addCommand(backCommand);
return form;
}

void addLogoImageToTopOfTheForm(Form form) {
try {
//Image image = Image.createImage("/logoImage.png");

logoLabel = new Label("image");
logoLabel.setAlignment(Label.CENTER); // No effect!?
form.addComponent(logoLabel);
} catch (Exception ex) {
ex.printStackTrace();
}
}

void initialiseResource() {
try {
//Resources r = Resources.open("/client.res");
//UIManager.getInstance().setThemeProps(r.getTheme(r.getThemeResourceNames()[0]));
} catch (Exception ex) {
ex.printStackTrace();
}
}

Container getInitialiseContainerLong() {
Container container = new Container();
Label label = new Label("Title Long list");
container.addComponent(label);

List list = new List(longList);

int idealWidth = Display.getInstance().getDisplayWidth();
int idealLongListHeight = list.getPreferredH();
Dimension dimension = new Dimension(idealWidth, idealLongListHeight);//list.getHeight());

System.out.println(" idealLongListHeight: "+idealLongListHeight);

list.setPreferredSize(dimension);
list.setFixedSelection(List.FIXED_NONE_CYCLIC);
list.addActionListener(this);
container.addComponent(list);
return container;
}

Container getInitialiseContainerShort() {
Container container = new Container();
Label label = new Label("Title Short list");
container.addComponent(label);

List list = new List(shortList);

int idealWidth = Display.getInstance().getDisplayWidth();
int idealShortListHeight = list.getPreferredH();
Dimension dimension = new Dimension(idealWidth, idealShortListHeight);//idealHeight);//list.getHeight());

System.out.println(" idealShortListHeight: "+idealShortListHeight);

list.setPreferredSize(dimension);
list.addActionListener(this);
list.setFixedSelection(List.FIXED_NONE_CYCLIC);
container.addComponent(list);
return container;
}

protected void startApp() {

Display.init(this);
initialiseResource();

form = getInitialisedForm();

addLogoImageToTopOfTheForm(form);

containerLong = getInitialiseContainerLong();

containerShort = getInitialiseContainerShort();

form.addComponent(containerLong);

currentContainerIsLong = true;
form.setCommandListener(this);
form.show();

}

protected void pauseApp() {
}

protected void destroyApp(boolean arg0) {
}

public void actionPerformed(ActionEvent evt) {
Command cmd = evt.getCommand();

if (cmd == backCommand) {
setNewTransition(false);
} else { // any other key press
setNewTransition(true);
}

if (currentContainerIsLong) {
form.replace(containerLong, containerShort, transition);
currentContainerIsLong = false;
} else {
form.replace(containerShort, containerLong, transition);
currentContainerIsLong = true;
}
}

void setNewTransition(boolean forward) {
if (forward) {
transition = CommonTransitions.createSlide(TRANSITION_VERTICAL_NOT_HORIZONTAL ? CommonTransitions.SLIDE_VERTICAL : CommonTransitions.SLIDE_HORIZONTAL, false, 500);
} else {
transition = CommonTransitions.createSlide(TRANSITION_VERTICAL_NOT_HORIZONTAL ? CommonTransitions.SLIDE_VERTICAL : CommonTransitions.SLIDE_HORIZONTAL, true, 500);
}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Many thanks,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 05 September 2008 18:24
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing component transition on form

Hi,
There is no attachment. Container.replace works as advertised and performs exactly that, it just won't work for components of differing size.

Hi Shai,

Thanks for your reply.

We would like the transition to happen only to the middle part while keeping both top and bottom parts of the screen. The principle here is moving the "dynamic parts" while keeping the "constant ones". This principle leads to more intuitive UI and has widely been used in the leading mobile apps, such as iPhone's. Make sense?

Attached please find the source code which reproduces the problem (only one user class, the rest are all lwuit source). Hope this helps.

Many thanks,

Qunhuan

From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM]
Sent: 04 September 2008 16:12
To: users@lwuit.dev.java.net
Subject: Re: Problem handling different size of list when doing component transition on form

Hi Qunhuan,
I'm not exactly sure what the problem is. Performing a transition (Container.replace) from a small component to a larger component or visa versa isn't currently supported by LWUIT and I personally doubt it would be technically feasible and visually appealing. The assumption is that you would replace a component with an equal or similar preferred size value.

Well done, LWUIT team, original problem scale reduced!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hi again,

Just checked out the latest LWUIT code and found the original problem reported has been scaled down. But there is still something remaining. Here is the description:

1. For horizontal transition

- Left to right (right is newly created)

(1) Large list size going to small one - no list problem right after transition, but first up/down key press has no effect. Only second key up/down and after traverses over the list

(2) Small list size going to large one - still have the small size (including scrollbar) right after transition. BUT the first up/down key press will immediately causing the display of the right size of the list to be displayed while having no traverse effect. Only second up/down key press and after traverses over the list.

- right to left (left is a saved and old one)
Same as Left to right.

2. For vertical transition

- Bottom-up

(1) Large list size to small one - no list problem but clip problem (see below), plus the first down/up key press has no effect. Only second key up/down and after traverses over the list.

(2) Small size to large one - still have the small size (including scrollbar) right after transition. BUT the first down/up key will immediately causing the right size of the list to be displayed with no traverse effect. Only second key up/down and after traverses over the list.

- Top-down

Same as Bottom-up

- Clip problem: The clip size is not using the exact size of component's visible part but may be using the full form's, causing unnecessary part appear on the screen right after transition.

I tried to create problem reproducing code but it appears to be a non-trivial task since the problem code is deeply inside a large project. However, if the problem reproducing code is really required, please let me know.

Many thanks,

Qunhuan

-----Original Message-----
From: Qunhuan Mei [mailto:qunhuan.mei@mfuse.com]
Sent: 29 August 2008 15:49
To: users@lwuit.dev.java.net
Subject: Problem handling different size of list when doing component transition on form

Hi LWUIT team,

I have hit a problem.

Here is the description:

I have a Form.

Within the form, I have a list, called current list, which displays an array of links.

When new array of links received, I use form's replace(Component current, Component next, Transition t) to show new list.

The problem occurs when current list size is so small that it does not cover the rest of the screen (say the list height on screen is "l"), but new list is larger, say its size should be "L" on screen. The display of the new list will still have the screen height of "l" instead of "L" during and after transition. It seems, in this case, some parameters are not updated when new list is initialised within the replace method. The problem happens for both horizontal and vertical transition.

All list items are accessible when problem occurs.

If I stop using replace(Component current, Component next, Transition t) but use
removeComponent(current);
addComponent(next);
instead, everything appears to be normal. That is, the new list will be displayed as it should be.

I did not prepare the problem code for this since I am currently fully occupied. But if it is required, please let me know.

Many thanks,

Qunhuan

Shai Almog
http://lwuit.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Shai Almog
http://lwuit.blogspot.com/

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

cknappe
Offline
Joined: 2008-08-28

Hi,

again and again ;-). Is there something new about inline editing on BlackBerry. This feature is very important to me.

Thanks for the reply.

Regards, Christian

Patrick Julien

For the moment, you either don't use it or implement it using the algorithm
I sent to the list.

On Wed, Oct 15, 2008 at 9:17 AM, wrote:

> Hi,
>
> again and again ;-). Is there something new about inline editing on
> BlackBerry. This feature is very important to me.
>
> Thanks for the reply.
>
> Regards, Christian
> [Message sent by forum member 'cknappe' (cknappe)]
>
> http://forums.java.net/jive/thread.jspa?messageID=307464
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>

--
http://www.spectrumdt.com
http://codepimps.org
[att1.html]

cknappe
Offline
Joined: 2008-08-28

Thank you - thats all I wanted to know.

> For the moment, you either don't use it or implement
> it using the algorithm
> I sent to the list.
>
> On Wed, Oct 15, 2008 at 9:17 AM,
> wrote:
>
> > Hi,
> >
> > again and again ;-). Is there something new about
> inline editing on
> > BlackBerry. This feature is very important to me.
> >
> > Thanks for the reply.
> >
> > Regards, Christian
> > [Message sent by forum member 'cknappe' (cknappe)]
> >
> >
> http://forums.java.net/jive/thread.jspa?messageID=3074
> 64
> >
> >
> ------------------------------------------------------
> ---------------
> > To unsubscribe, e-mail:
> users-unsubscribe@lwuit.dev.java.net
> > For additional commands, e-mail:
> users-help@lwuit.dev.java.net
> >
> >
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
> [att1.html]

cknappe
Offline
Joined: 2008-08-28

Hello,

i hava also problems using TextField. I use a BlackBerry device. If i set QuertyInput(true) some keys are written to the TextField. If i press y or t everything is ok - pressing u or h the TextField loses the Focus. If i press, for example "u" again and again until the TextField gets back the Focus - the "u" is printed 2times (i think when it loses and gets the focus the char is printed).

Regards, Chistian

chen

Hi,
This happens because these chars are been translated has UP, DOWN, ...
events , this is our bug, we will have a look into this.

Thanks,
Chen

lwuit-users@mobileandembedded.org wrote:
> Hello,
>
> i hava also problems using TextField. I use a BlackBerry device. If i set QuertyInput(true) some keys are written to the TextField. If i press y or t everything is ok - pressing u or h the TextField loses the Focus. If i press, for example "u" again and again until the TextField gets back the Focus - the "u" is printed 2times (i think when it loses and gets the focus the char is printed).
>
> Regards, Chistian
> [Message sent by forum member 'cknappe' (cknappe)]
>
> http://forums.java.net/jive/thread.jspa?messageID=296083
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Patrick Julien

Are you talking just about the BlackBerry or the samsung too here?

On Fri, Aug 29, 2008 at 8:33 AM, chen wrote:

> Hi,
> This happens because these chars are been translated has UP, DOWN, ...
> events , this is our bug, we will have a look into this.
>
> Thanks,
> Chen
>
>
> lwuit-users@mobileandembedded.org wrote:
>
>> Hello,
>>
>> i hava also problems using TextField. I use a BlackBerry device. If i set
>> QuertyInput(true) some keys are written to the TextField. If i press y or t
>> everything is ok - pressing u or h the TextField loses the Focus. If i
>> press, for example "u" again and again until the TextField gets back the
>> Focus - the "u" is printed 2times (i think when it loses and gets the focus
>> the char is printed).
>>
>> Regards, Chistian
>> [Message sent by forum member 'cknappe' (cknappe)]
>>
>> http://forums.java.net/jive/thread.jspa?messageID=296083
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>

--
http://www.spectrumdt.com
http://codepimps.org
[att1.html]

chen

This bug can effect all qwerty devices not just BB

Chen

Patrick Julien wrote:
> Are you talking just about the BlackBerry or the samsung too here?
>
> On Fri, Aug 29, 2008 at 8:33 AM, chen > > wrote:
>
> Hi,
> This happens because these chars are been translated has UP, DOWN,
> ... events , this is our bug, we will have a look into this.
>
> Thanks,
> Chen
>
>
> lwuit-users@mobileandembedded.org
> wrote:
>
> Hello,
>
> i hava also problems using TextField. I use a BlackBerry
> device. If i set QuertyInput(true) some keys are written to
> the TextField. If i press y or t everything is ok - pressing u
> or h the TextField loses the Focus. If i press, for example
> "u" again and again until the TextField gets back the Focus -
> the "u" is printed 2times (i think when it loses and gets the
> focus the char is printed).
>
> Regards, Chistian
> [Message sent by forum member 'cknappe' (cknappe)]
>
> http://forums.java.net/jive/thread.jspa?messageID=296083
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

chen

Hi,
Yes, it suppose to work, make sure the setConstraint(...) is set to ANY,
if it's not working let me know.

Thanks

Patrick Julien wrote:
> OK, so if I run my app on a samsung blackjack 2 again, even if I set
> qwerty to true, is TextField supposed to work? We can't seem to be
> able to type anything other numbers
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Patrick Julien

thanks, will give it a try

On Wed, Aug 27, 2008 at 7:22 AM, chen wrote:

> Hi,
> Yes, it suppose to work, make sure the setConstraint(...) is set to ANY, if
> it's not working let me know.
>
> Thanks
>
>
>
> Patrick Julien wrote:
>
>> OK, so if I run my app on a samsung blackjack 2 again, even if I set
>> qwerty to true, is TextField supposed to work? We can't seem to be able to
>> type anything other numbers
>>
>>
>> --
>> http://www.spectrumdt.com
>> http://codepimps.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>

--
http://www.spectrumdt.com
http://codepimps.org
[att1.html]

Patrick Julien

Nope, setting the field to ANY has no effect on a samsung blackjack 2.

Typing 'q', 'w', 'e', 'r', 't', 'y' and it produces '1', '2' and '3'.

The construction code is in factory for the application globally which just
does:

TextArea ta;
Display d = Display.getInstance();

if (d.isTouchScreenDevice()) {
ta = new TextArea(1, columns);
} else {
TextField tf = new TextField(columns);

ta = tf;
tf.setQwertyInput(true);
tf.setConstraint(TextArea.ANY);
}

return ta;

On Wed, Aug 27, 2008 at 8:37 AM, Patrick Julien
wrote:

> thanks, will give it a try
>
> On Wed, Aug 27, 2008 at 7:22 AM, chen wrote:
>
>> Hi,
>> Yes, it suppose to work, make sure the setConstraint(...) is set to ANY,
>> if it's not working let me know.
>>
>> Thanks
>>
>>
>>
>> Patrick Julien wrote:
>>
>>> OK, so if I run my app on a samsung blackjack 2 again, even if I set
>>> qwerty to true, is TextField supposed to work? We can't seem to be able to
>>> type anything other numbers
>>>
>>>
>>> --
>>> http://www.spectrumdt.com
>>> http://codepimps.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>
>>
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>
>

--
http://www.spectrumdt.com
http://codepimps.org
[att1.html]

Patrick Julien

Perhaps you meant to say it should work with the latest svn? Just trying
to keep this thread alive here.

On Wed, Aug 27, 2008 at 11:59 AM, Patrick Julien
wrote:

> Nope, setting the field to ANY has no effect on a samsung blackjack 2.
>
> Typing 'q', 'w', 'e', 'r', 't', 'y' and it produces '1', '2' and '3'.
>
> The construction code is in factory for the application globally which just
> does:
>
> TextArea ta;
> Display d = Display.getInstance();
>
> if (d.isTouchScreenDevice()) {
> ta = new TextArea(1, columns);
> } else {
> TextField tf = new TextField(columns);
>
> ta = tf;
> tf.setQwertyInput(true);
> tf.setConstraint(TextArea.ANY);
> }
>
> return ta;
>
>
> On Wed, Aug 27, 2008 at 8:37 AM, Patrick Julien
wrote:
>
>> thanks, will give it a try
>>
>> On Wed, Aug 27, 2008 at 7:22 AM, chen wrote:
>>
>>> Hi,
>>> Yes, it suppose to work, make sure the setConstraint(...) is set to ANY,
>>> if it's not working let me know.
>>>
>>> Thanks
>>>
>>>
>>>
>>> Patrick Julien wrote:
>>>
>>>> OK, so if I run my app on a samsung blackjack 2 again, even if I set
>>>> qwerty to true, is TextField supposed to work? We can't seem to be able to
>>>> type anything other numbers
>>>>
>>>>
>>>> --
>>>> http://www.spectrumdt.com
>>>> http://codepimps.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>>
>>>
>>
>>
>> --
>> http://www.spectrumdt.com
>> http://codepimps.org
>>
>>
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>
>

--
http://www.spectrumdt.com
http://codepimps.org
[att1.html]

Shai Almog

Are you using the PhoneME VM or the VM that came with the phone?
Try PhoneME Feature/Advanced they both generally behave better when
it comes to Java ME spec compliance.

> Perhaps you meant to say it should work with the latest svn? Just
> trying to keep this thread alive here.
>
> On Wed, Aug 27, 2008 at 11:59 AM, Patrick Julien
>
wrote:
> Nope, setting the field to ANY has no effect on a samsung blackjack 2.
>
> Typing 'q', 'w', 'e', 'r', 't', 'y' and it produces '1', '2' and '3'.
>
> The construction code is in factory for the application globally
> which just does:
>
> TextArea ta;
> Display d = Display.getInstance();
>
> if (d.isTouchScreenDevice()) {
> ta = new TextArea(1, columns);
> } else {
> TextField tf = new TextField(columns);
>
> ta = tf;
> tf.setQwertyInput(true);
> tf.setConstraint(TextArea.ANY);
> }
>
> return ta;
>
>
>
> On Wed, Aug 27, 2008 at 8:37 AM, Patrick Julien
>
wrote:
> thanks, will give it a try
>
>
> On Wed, Aug 27, 2008 at 7:22 AM, chen wrote:
> Hi,
> Yes, it suppose to work, make sure the setConstraint(...) is set to
> ANY, if it's not working let me know.
>
> Thanks
>
>
>
> Patrick Julien wrote:
> OK, so if I run my app on a samsung blackjack 2 again, even if I
> set qwerty to true, is TextField supposed to work? We can't seem
> to be able to type anything other numbers
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>
>
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>
>
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Patrick Julien

The one that comes with the phone. Excuse my ignorance here but how does
this help me? How would I distribute PhoneME to customers? Especially
OTA?

On Thu, Aug 28, 2008 at 9:44 AM, Shai Almog wrote:

> Are you using the PhoneME VM or the VM that came with the phone?
> Try PhoneME Feature/Advanced they both generally behave better when it
> comes to Java ME spec compliance.
>
> Perhaps you meant to say it should work with the latest svn? Just trying
> to keep this thread alive here.
>
> On Wed, Aug 27, 2008 at 11:59 AM, Patrick Julien
wrote:
>
>> Nope, setting the field to ANY has no effect on a samsung blackjack 2.
>>
>> Typing 'q', 'w', 'e', 'r', 't', 'y' and it produces '1', '2' and '3'.
>>
>> The construction code is in factory for the application globally which
>> just does:
>>
>> TextArea ta;
>> Display d = Display.getInstance();
>>
>> if (d.isTouchScreenDevice()) {
>> ta = new TextArea(1, columns);
>> } else {
>> TextField tf = new TextField(columns);
>>
>> ta = tf;
>> tf.setQwertyInput(true);
>> tf.setConstraint(TextArea.ANY);
>> }
>>
>> return ta;
>>
>>
>> On Wed, Aug 27, 2008 at 8:37 AM, Patrick Julien
wrote:
>>
>>> thanks, will give it a try
>>>
>>> On Wed, Aug 27, 2008 at 7:22 AM, chen wrote:
>>>
>>>> Hi,
>>>> Yes, it suppose to work, make sure the setConstraint(...) is set to ANY,
>>>> if it's not working let me know.
>>>>
>>>> Thanks
>>>>
>>>>
>>>>
>>>> Patrick Julien wrote:
>>>>
>>>>> OK, so if I run my app on a samsung blackjack 2 again, even if I set
>>>>> qwerty to true, is TextField supposed to work? We can't seem to be able to
>>>>> type anything other numbers
>>>>>
>>>>>
>>>>> --
>>>>> http://www.spectrumdt.com
>>>>> http://codepimps.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>>>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>>>
>>>>
>>>
>>>
>>> --
>>> http://www.spectrumdt.com
>>> http://codepimps.org
>>>
>>>
>>
>>
>> --
>> http://www.spectrumdt.com
>> http://codepimps.org
>>
>>
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>
>
> Shai Almog
> http://lwuit.blogspot.com/
>
>

--
http://www.spectrumdt.com
http://codepimps.org
[att1.html]

Shai Almog

Some WinMo devices have a decent VM but most have a terrible VM. We
don't support the terrible VM since it is unusable.

WinMo users are often savvy enough to install their own VM. If its a
requirement for you to work on existing VM's from the likes of
Esmertec then feel free to use the code and try to get it to work,
you might get somewhere.

> The one that comes with the phone. Excuse my ignorance here but
> how does this help me? How would I distribute PhoneME to
> customers? Especially OTA?
>
> On Thu, Aug 28, 2008 at 9:44 AM, Shai Almog
> wrote:
> Are you using the PhoneME VM or the VM that came with the phone?
> Try PhoneME Feature/Advanced they both generally behave better when
> it comes to Java ME spec compliance.
>
>> Perhaps you meant to say it should work with the latest svn?
>> Just trying to keep this thread alive here.
>>
>> On Wed, Aug 27, 2008 at 11:59 AM, Patrick Julien
>>
wrote:
>> Nope, setting the field to ANY has no effect on a samsung
>> blackjack 2.
>>
>> Typing 'q', 'w', 'e', 'r', 't', 'y' and it produces '1', '2' and '3'.
>>
>> The construction code is in factory for the application globally
>> which just does:
>>
>> TextArea ta;
>> Display d = Display.getInstance();
>>
>> if (d.isTouchScreenDevice()) {
>> ta = new TextArea(1, columns);
>> } else {
>> TextField tf = new TextField(columns);
>>
>> ta = tf;
>> tf.setQwertyInput(true);
>> tf.setConstraint(TextArea.ANY);
>> }
>>
>> return ta;
>>
>>
>>
>> On Wed, Aug 27, 2008 at 8:37 AM, Patrick Julien
>>
wrote:
>> thanks, will give it a try
>>
>>
>> On Wed, Aug 27, 2008 at 7:22 AM, chen wrote:
>> Hi,
>> Yes, it suppose to work, make sure the setConstraint(...) is set
>> to ANY, if it's not working let me know.
>>
>> Thanks
>>
>>
>>
>> Patrick Julien wrote:
>> OK, so if I run my app on a samsung blackjack 2 again, even if I
>> set qwerty to true, is TextField supposed to work? We can't seem
>> to be able to type anything other numbers
>>
>>
>> --
>> http://www.spectrumdt.com
>> http://codepimps.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>
>>
>>
>>
>> --
>> http://www.spectrumdt.com
>> http://codepimps.org
>>
>>
>>
>>
>> --
>> http://www.spectrumdt.com
>> http://codepimps.org
>>
>>
>>
>>
>> --
>> http://www.spectrumdt.com
>> http://codepimps.org
>>
>
> Shai Almog
> http://lwuit.blogspot.com/
>
>
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Patrick Julien

but don't you guys test on a samsung blackjack as one of your core
platforms?

On Thu, Aug 28, 2008 at 10:29 AM, Shai Almog wrote:

> Some WinMo devices have a decent VM but most have a terrible VM. We don't
> support the terrible VM since it is unusable.
>
> WinMo users are often savvy enough to install their own VM. If its a
> requirement for you to work on existing VM's from the likes of Esmertec then
> feel free to use the code and try to get it to work, you might get
> somewhere.
>
> The one that comes with the phone. Excuse my ignorance here but how does
> this help me? How would I distribute PhoneME to customers? Especially
> OTA?
>
> On Thu, Aug 28, 2008 at 9:44 AM, Shai Almog wrote:
>
>> Are you using the PhoneME VM or the VM that came with the phone?
>> Try PhoneME Feature/Advanced they both generally behave better when it
>> comes to Java ME spec compliance.
>>
>> Perhaps you meant to say it should work with the latest svn? Just trying
>> to keep this thread alive here.
>>
>> On Wed, Aug 27, 2008 at 11:59 AM, Patrick Julien
wrote:
>>
>>> Nope, setting the field to ANY has no effect on a samsung blackjack 2.
>>>
>>> Typing 'q', 'w', 'e', 'r', 't', 'y' and it produces '1', '2' and '3'.
>>>
>>> The construction code is in factory for the application globally which
>>> just does:
>>>
>>> TextArea ta;
>>> Display d = Display.getInstance();
>>>
>>> if (d.isTouchScreenDevice()) {
>>> ta = new TextArea(1, columns);
>>> } else {
>>> TextField tf = new TextField(columns);
>>>
>>> ta = tf;
>>> tf.setQwertyInput(true);
>>> tf.setConstraint(TextArea.ANY);
>>> }
>>>
>>> return ta;
>>>
>>>
>>> On Wed, Aug 27, 2008 at 8:37 AM, Patrick Julien
wrote:
>>>
>>>> thanks, will give it a try
>>>>
>>>> On Wed, Aug 27, 2008 at 7:22 AM, chen wrote:
>>>>
>>>>> Hi,
>>>>> Yes, it suppose to work, make sure the setConstraint(...) is set to
>>>>> ANY, if it's not working let me know.
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>>
>>>>> Patrick Julien wrote:
>>>>>
>>>>>> OK, so if I run my app on a samsung blackjack 2 again, even if I set
>>>>>> qwerty to true, is TextField supposed to work? We can't seem to be able to
>>>>>> type anything other numbers
>>>>>>
>>>>>>
>>>>>> --
>>>>>> http://www.spectrumdt.com
>>>>>> http://codepimps.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>>>>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> http://www.spectrumdt.com
>>>> http://codepimps.org
>>>>
>>>>
>>>
>>>
>>> --
>>> http://www.spectrumdt.com
>>> http://codepimps.org
>>>
>>>
>>
>>
>> --
>> http://www.spectrumdt.com
>> http://codepimps.org
>>
>>
>> Shai Almog
>> http://lwuit.blogspot.com/
>>
>>
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>
>
> Shai Almog
> http://lwuit.blogspot.com/
>
>

--
http://www.spectrumdt.com
http://codepimps.org
[att1.html]

Shai Almog

We don't have that device.
We don't consider WinMo a core platform however we do consider
PhoneME as such a platform and it runs on WinMo. We would love to
support any VM out there regardless of the manufacturer and we do our
best to accommodate however as you can tell there is no technical way
for us to get the proper key presses on this device.

Some of these VM's are even worse, completely ignoring translucency/
transparency information... Supporting them would not be feasible.

> but don't you guys test on a samsung blackjack as one of your core
> platforms?
>
> On Thu, Aug 28, 2008 at 10:29 AM, Shai Almog
> wrote:
> Some WinMo devices have a decent VM but most have a terrible VM. We
> don't support the terrible VM since it is unusable.
>
> WinMo users are often savvy enough to install their own VM. If its
> a requirement for you to work on existing VM's from the likes of
> Esmertec then feel free to use the code and try to get it to work,
> you might get somewhere.
>
>> The one that comes with the phone. Excuse my ignorance here but
>> how does this help me? How would I distribute PhoneME to
>> customers? Especially OTA?
>>
>> On Thu, Aug 28, 2008 at 9:44 AM, Shai Almog
>> wrote:
>> Are you using the PhoneME VM or the VM that came with the phone?
>> Try PhoneME Feature/Advanced they both generally behave better
>> when it comes to Java ME spec compliance.
>>
>>> Perhaps you meant to say it should work with the latest svn?
>>> Just trying to keep this thread alive here.
>>>
>>> On Wed, Aug 27, 2008 at 11:59 AM, Patrick Julien
>>>
wrote:
>>> Nope, setting the field to ANY has no effect on a samsung
>>> blackjack 2.
>>>
>>> Typing 'q', 'w', 'e', 'r', 't', 'y' and it produces '1', '2' and
>>> '3'.
>>>
>>> The construction code is in factory for the application globally
>>> which just does:
>>>
>>> TextArea ta;
>>> Display d = Display.getInstance();
>>>
>>> if (d.isTouchScreenDevice()) {
>>> ta = new TextArea(1, columns);
>>> } else {
>>> TextField tf = new TextField(columns);
>>>
>>> ta = tf;
>>> tf.setQwertyInput(true);
>>> tf.setConstraint(TextArea.ANY);
>>> }
>>>
>>> return ta;
>>>
>>>
>>>
>>> On Wed, Aug 27, 2008 at 8:37 AM, Patrick Julien
>>>
wrote:
>>> thanks, will give it a try
>>>
>>>
>>> On Wed, Aug 27, 2008 at 7:22 AM, chen wrote:
>>> Hi,
>>> Yes, it suppose to work, make sure the setConstraint(...) is set
>>> to ANY, if it's not working let me know.
>>>
>>> Thanks
>>>
>>>
>>>
>>> Patrick Julien wrote:
>>> OK, so if I run my app on a samsung blackjack 2 again, even if I
>>> set qwerty to true, is TextField supposed to work? We can't seem
>>> to be able to type anything other numbers
>>>
>>>
>>> --
>>> http://www.spectrumdt.com
>>> http://codepimps.org
>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>>
>>>
>>>
>>>
>>> --
>>> http://www.spectrumdt.com
>>> http://codepimps.org
>>>
>>>
>>>
>>>
>>> --
>>> http://www.spectrumdt.com
>>> http://codepimps.org
>>>
>>>
>>>
>>>
>>> --
>>> http://www.spectrumdt.com
>>> http://codepimps.org
>>>
>>
>> Shai Almog
>> http://lwuit.blogspot.com/
>>
>>
>>
>>
>> --
>> http://www.spectrumdt.com
>> http://codepimps.org
>>
>
> Shai Almog
> http://lwuit.blogspot.com/
>
>
>
>
> --
> http://www.spectrumdt.com
> http://codepimps.org
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]