flipping an Icon within java

R

Ralph Boland

I am trying to flip the thumb on a horizontal slider so that it points
down instead of up.
To do this I need to flip the icon representing the thumb
(I am using MetalSliderUI which uses an Icon for the thumb).
I tried rotating the icon 180 degrees but it proved to be very slow.

Any suggestions as to how to just flip an Icon horizontally.

Thanks

Ralph Boland

P.S. I originally posted this on comp.lang.java.guis
and someone proposed that I flip my icon using
paint show pro.
But I much prefer/need a solution that works within Java.

Solutions most welcome.
 
D

Daniele Futtorovic

I am trying to flip the thumb on a horizontal slider so that it
points down instead of up. To do this I need to flip the icon
representing the thumb (I am using MetalSliderUI which uses an Icon
for the thumb). I tried rotating the icon 180 degrees but it proved
to be very slow.

Any suggestions as to how to just flip an Icon horizontally.

Thanks

Ralph Boland

P.S. I originally posted this on comp.lang.java.guis and someone
proposed that I flip my icon using paint show pro. But I much
prefer/need a solution that works within Java.

Solutions most welcome.

As an idea:

- Extend MetalSliderUI

- Override the bit where it paints the thumb

- Just before it paints the thumb, apply an AffineTransform which flips
180 deg. (storing the previous AT, and concatenating the new one with
the old one, if any)

- After it's painted the icon, restore the previous AT.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top