Wednesday, October 12, 2005

A simple Java program to do Rectangle Placement

A simple java program to place some rectangles given their coodinates and sizes.

The input file should follow the format of

x1, y1 , width1, height1
x2, y2 , width2, height2
...


or if a label is attached to each rectangle, the format change to

label1, x1, y1 , width1, height1
lable2, x2, y2 , width2, height2
...

A simple test case

A 0 0 5 5
B 6 6 4 7
C 1 5 3 5


Output is




Try to increase the scale asked by the program if the graph squeezed together.

Download the executable jar file here.
Download source code here.


2 Comments:

At February 19, 2007 11:35 AM, Anonymous Anonymous said...

But as Daly approaches his 41st birthday, he's determined to respond to his latest year of turbulence with an updated chapter to a career that began with a stunning, storybook triumph at the 1991 PGA Championship. fantasy golf Of course, TaylorMade doesn't make a square driver; its competitors Callaway and Nike do. He missed the cut at the Buick Invitational, which he won in 2004 in another one of his comebacks, and didn't make it to the weekend at the FBR Open in Phoenix. The sponsor exemptions have been going great.

 
At March 04, 2007 11:38 AM, Anonymous Anonymous said...

free incoming call




Hi, great blog by the way - didn't think you'd mind me posting this anonymously - as you do allow anonymous posts ;-).

Anyone tried this Skype program yet for free telephone calls over the internet? A guy at work uses it all the time and because he signed all his friends and relatives up he saves a fortune on his calls. Might be worth a go.

Good luck with the blog






.

 

Post a Comment

<< Home