Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

Help: Could you help me understand this Java GUI project?

Thread view: 
Leo Smith - 25 May 2006 22:28 GMT
Dear All,

I have received a small Java GUI project. I am a Java programmer. But I
don't fully understand the requirement. The project is:

Using J2SE 5.0, develop a JPanel that draws a list of semi-transparent
(alpha = 128) rectangles with a border. The control must have the
following public API:

public void enableZoom (boolean  enabled)

When set to true (default value), the panel draws its contents 10 times
as big as the screen resolution. Similar to the “View - Zoom - Large
Size” menu option in Windows Paint*.

public bool AddRectangle (java.awt.Rectangle r)

Adds a rectangle to the list.

Also the panel must handle Mouse Events so that you can click inside of
it and create rectangles. Much like you do in Paint* when the
"Rectangle" tool is selected.

End of project description.

Major points I don't understand:
1. "..the panel draws its contents 10 times as big as the screen
resolution. Similar to the “View - Zoom - Large Size” menu option in
Windows Paint*."
What does this mean?

2. "a JPanel that draws a list of semi-transparent (alpha = 128)
rectangles with a border"
What does this mean?

If you can give me some hints to tackle this project, I would be greatly
appreciative for that.

Thank you very much.
Oliver Wong - 25 May 2006 22:44 GMT
> Dear All,
>
[quoted text clipped - 26 lines]
> Windows Paint*."
> What does this mean?

   Why don't you ask the client/teacher for clarification? I'd imagine it
means where-ever you would draw something 1 pixel tall by 1 pixel wide, you
would instead draw something 10 pixels tall by 10 pixels wide.

> 2. "a JPanel that draws a list of semi-transparent (alpha = 128)
> rectangles with a border"
> What does this mean?

   You have a list of rectangles via the addRectangle method, right? So
draw them with alpha transparency. The client/teacher/whatever is probably
assuming a scale of 0 to 255 (again, ask for clarification), so this means
50% transparent.

http://en.wikipedia.org/wiki/Alpha_transparency

   - Oliver
Leo Smith - 25 May 2006 23:17 GMT
Thank you very much. That helps a lot.

One more thing I am not clear: "a list of rectangles". Does it mean the
following:

I have a list, currently with two rectangles. So the window shows two
rectangles in it. If the method AddRectangle is called and one rectangle
is added to the list, the window shows three rectangles.

Is my understanding correct? Thank you.
Oliver Wong - 26 May 2006 14:44 GMT
> Thank you very much. That helps a lot.
>
[quoted text clipped - 6 lines]
>
> Is my understanding correct? Thank you.

   Ask for clarification from your client/teacher/whatever.

   - Oliver
Leo Smith - 26 May 2006 15:19 GMT
This is a job interview related tech testing project. I avoid to bother
the interview manager.

If you could explain a little or even provide some hints/guidance, I
would be greatly appreciative for that.

>> Thank you very much. That helps a lot.
>>
[quoted text clipped - 10 lines]
>
>    - Oliver
Oliver Wong - 26 May 2006 15:41 GMT
[post re-ordered]

>>    Ask for clarification from your client/teacher/whatever.
>
[quoted text clipped - 3 lines]
> If you could explain a little or even provide some hints/guidance, I would
> be greatly appreciative for that.

   Perhaps part of the test is to see if you would, when given insufficient
information, actively seek out that information, or just randomly guess what
the information should be.

   E.g. let's say someone hires you to build a house. So you start building
it, and then you realize you don't know how many floors the person wants for
their house. Would you ask them how many floors, or would you just decide 2
is a good number and built a 2-story house?

   - Oliver


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.