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 / GUI / December 2005

Tip: Looking for answers? Try searching our database.

polygon shape of jcomponent

Thread view: 
ja-news.gazeta.pl - 30 Dec 2005 08:38 GMT
polygon shape of jcomponent, is it possible?
Andrey Kuznetsov - 30 Dec 2005 09:24 GMT
> polygon shape of jcomponent, is it possible?
yes, any shape is possible.

Signature

Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities

ja-news.gazeta.pl - 30 Dec 2005 09:56 GMT
Subject: Re: polygon shape of jcomponent

>> polygon shape of jcomponent, is it possible?
> yes, any shape is possible.

Can you give me any adivce, please? :-)

I've seen only .setSize(width, height)
and setBounds(x,y,w,h) :(

and - imho - i really afraid that if i have 2 line
like this
\  /
\/
/\
/  \

will I be able to recognize which (Lines extends JComponent) I clicked,
dragged, moved, etc
Andrey Kuznetsov - 30 Dec 2005 11:07 GMT
> Can you give me any adivce, please? :-)
yes

> I've seen only .setSize(width, height)
> and setBounds(x,y,w,h) :(
you should decide what to do on resize. You can:
a) ignore
b)scale your shape

> and - imho - i really afraid that if i have 2 line
> like this
[quoted text clipped - 4 lines]
> will I be able to recognize which (Lines extends JComponent) I clicked,
> dragged, moved, etc

override JComponent#contains(int x, int y) so that it returns
polygon#contains()
or write <yourComponent>UI and override ComponentUI#contains(JComponent c,
int x, int y)

Download source of JGui 1.38 (here:
http://jgui.imagero.com/download/JGuiSrc138.zip)
and look at JShape, BasicShapeUI and ShapeUnit.
Note that this is spen source version of JGui and contains bugs (which are
fixed in full version).

Signature

Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities



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.