jacek99 / javabuilders

Max productivity with minimum code for Java desktop UI development
Other
50 stars 15 forks source link

Support for absolute layout and java.awt.Point #5

Open luca-domenichini opened 8 years ago

luca-domenichini commented 8 years ago

I see that support for absolute layout is missing in the project. In my case I would find it very useful in order to provide customers with a simple embedded swing editor in my application, oriented to only particular components (like SCADAs).

I think it would be enough to support a syntax for the Component#setLocation(Point p) or Component#setLocation(int x, int y) methods. All other stuffs are already working.. (more generally speaking, as you already support a special syntax for Dimension (like 800x600), a similar syntax should be fine for Point as well..). In addition, Container#setLayout(null) must be called somewhere.. something like this:

JFrame(name=frame, title=frame.title, size=800x600, defaultCloseOperation=exitOnClose):
    - AbsoluteLayout()
    - JButton(name=button, text=button.acton, location=100;50)

(I don't know which char to use to separate x from y in location... ; should fit be maybe..)

what do you think about that?

luca-domenichini commented 8 years ago

Visit my fork at https://github.com/mimmoz81/javabuilders to get what i've done...

Also, I introduced the RectangleAsValueHandler class to handle type Rectangle (as of method Component#setBounds(Rectangle))

I was not able to pull a request to you.. I'm new to github so maybe I don't get all the mechanics..

luca-domenichini commented 8 years ago

Actually it does need for AbsoluteLayout tag to be placed at the end of the yml file.. i need to check more... I'll update when improved.

luca-domenichini commented 8 years ago

It seems that the layoutmanager must be always the last tag to be declared in yml.

Is that true? If this is correct, my commit is already done and absolute layout is working properly..

jacek99 commented 8 years ago

Yes, if I recall correctly. It's been many years since I coded it :-)

I think it is covered in the PDF explicitly if memory serves me right.

On Tue, Nov 3, 2015 at 9:41 AM, mimmoz81 notifications@github.com wrote:

It seems that the layoutmanager must be always the last tag to be declared in yml.

Is that true? If this is correct, my commit is already done and absolute layout is working properly..

— Reply to this email directly or view it on GitHub https://github.com/jacek99/javabuilders/issues/5#issuecomment-153393005.

luca-domenichini commented 8 years ago

Ok, so if you have time to spend, take a look at my fork and tell me what you think.. many thanks