The Source for Java Technology Collaboration

Home » java.net Forums » Mobile & Embedded » LWUIT

Thread: Why make so difficult to port J2me component?

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 1 - Last Post: Nov 5, 2008 9:21 PM by: Shai Almog
tomsoft2

Posts: 3
Why make so difficult to port J2me component?
Posted: Nov 3, 2008 8:55 AM
  Click to reply to this thread Reply

I've, just made some tests to port an existing J2me component to lwtui, but why have you make things so difficult?

You where close to the goal, the Graphics class is nearly complete, except a few things:

- why did you remove the anchor fields? (in drawString, drawImage, etc...)
- why did you remove the setColor(r,g,b)
(these are just example, I am sure that there are more examples like this)

Because the signature of these methods changes, it's not possible to replace jaxax.microdeition.lcdui.Graphics with the lwtui one, and then require to do an extra layer of abstraction! (one more)

It would be fearly easy to add these functions and the associated code, and then , allowing the support LWtui with a simple recompilation of a library

Is this something planned in the near future?

Shai Almog
Re: Why make so difficult to port J2me component?
Posted: Nov 5, 2008 9:21 PM   in response to: tomsoft2
  Click to reply to this thread Reply

Hi,
MIDP is different from CDC and SE. We tried to create a more unified
and sensible layer which allows porting to all platforms (and future
platforms) rather than target MIDP developers only.

> - why did you remove the anchor fields? (in drawString, drawImage,
> etc...)

They aren't very helpful, they confuse most developers and provided
an advantage only in very limited situations. There are some bugs
associated with some anchor point combinations in some situations.

> - why did you remove the setColor(r,g,b)

It isn't supported by some platforms and isn't essential. setColor
(int) accepts an RGB value.

> (these are just example, I am sure that there are more examples
> like this)
>
> Because the signature of these methods changes, it's not possible
> to replace jaxax.microdeition.lcdui.Graphics with the lwtui one,
> and then require to do an extra layer of abstraction! (one more)

You don't need an additional layer of abstraction since LWUIT is the
layer of abstraction, you need to pick and choose between LWUIT or MIDP.

> It would be fearly easy to add these functions and the associated
> code, and then , allowing the support LWtui with a simple
> recompilation of a library
>
> Is this something planned in the near future?

No. Porting of custom items or MIDP code to LWUIT was never a goal of
LWUIT, it is a new approach that aims to clean up some of the
confusing API's that exist in the different platforms. Adding such
methods will make the LWUIT API confusing to everyone else.

> [Message sent by forum member 'tomsoft2' (tomsoft2)]
>
> http://forums.java.net/jive/thread.jspa?messageID=314585
>
> ---------------------------------------------------------------------
> 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]





 XML java.net RSS