Re: polygon shape of jcomponent
- From: "Andrey Kuznetsov" <spam0@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 30 Dec 2005 12:07:41 +0100
> 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
> \ /
> \/
> /\
> / \
> 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).
--
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
.
- References:
- polygon shape of jcomponent
- From: ja-news.gazeta.pl
- Re: polygon shape of jcomponent
- From: Andrey Kuznetsov
- Re: polygon shape of jcomponent
- From: ja-news.gazeta.pl
- polygon shape of jcomponent
- Prev by Date: Re: polygon shape of jcomponent
- Next by Date: Re: Variablen in Methode nicht zulaessig
- Previous by thread: Re: polygon shape of jcomponent
- Next by thread: How to add elements to a JList without preventing refresh
- Index(es):
Relevant Pages
|