Skip to main content

A Painter with Flare

21 replies [Last post]
mattnathan
Offline
Joined: 2005-02-20

Hello,

I've just committed into the incubator the first draft of a new painter that I think could add a bit of sparkle to an application: LensFlarePainter.

[url https://jdnc-incubator.dev.java.net/demos/mattnathan/LensFlareDemo.jnlp ]Here's a demo[/url] (requires Java 6 due to the radial painting and things like that).
[url https://jdnc-incubator.dev.java.net/documentation/mattnathan/images/Lens... ]Here's a picture[/url] for those that don't have Java 6 installed.

Click or drag in the window to move the flare around.

As this is the first time I've ever tried to create this type of effect please post comments as to how you think it can be improved.

Cheers

Matt

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
headw01
Offline
Joined: 2005-05-13

While you are at it, could you look at SwingX issue #521 (https://swingx.dev.java.net/issues/show_bug.cgi?id=521) for inclusion? That issue is related to "AbstractPainter cache management". Essentially, it requests that the cachedImage be reused instead of creating a new Image in the paint method (even when caching is not enabled).

When I reported it, I put it under "Misc" (since there doesn't appear to be a "Painters" subcomponent). There was a thread about it way back when as well.

I have the changes in my checked out version and I wouldn't want another change to the AbstractPainter to break what I am currently using if you know what I mean.

Thanks.

rah003
Offline
Joined: 2004-05-26

Thanks for pointer. Missed that one before. I'll see what I can do.

Matt Nathan

> Matt, do you think you would be willing to help me take care of this new
swinglabs baby and keep it alive once it's all setup?
I can certainly try :)
[att1.html]

Kleopatra

jdnc-interest@javadesktop.org schrieb:
>> This is exactly as I imagined it might work. We have
>> painters or graphics subproject and swingx will have
>> dependency on it ... same way as we have for
>> swing-layout and swing-worker when running on 1.5
>>
>
> Sounds reasonable to me. I only ever worry about the overhead of managing additional projects, but since Jan has been doing most of the managing lately, it doesn't bother me quite as much :-). Jeanette, what do you think? Karl?
>
>
hmm ... can do if we are sure that all references are strictly
one-directional (as they should ;-). And it would be hard dependency,
SwingX relying on the graphics thingies. This would be a bit different
from the other two, which I thought that both swing-layout and
swing-worker were optional? Which doesn't seem to be the case right now
(loginService uses swingworker and JXErrorPaneDemo in the demo hierarchy
uses the grouplayout) even though both still reside in the lib/optional ...

Jeanette

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

kschaefe
Offline
Joined: 2006-06-08

> hmm ... can do if we are sure that all references are
> strictly
> one-directional (as they should ;-). And it would be
> hard dependency,
> SwingX relying on the graphics thingies. This would
> be a bit different
> from the other two, which I thought that both
> swing-layout and
> swing-worker were optional? Which doesn't seem to be
> the case right now
> (loginService uses swingworker and JXErrorPaneDemo in
> the demo hierarchy
> uses the grouplayout) even though both still reside
> in the lib/optional ...
You are correct the the swingworker is required for the LoginService. I tried to supply a dual compilation approach, but it was rejected. Until we go to 1.6, it's a hard requirement for JXLoginPane, etc.

Karl

rah003
Offline
Joined: 2004-05-26

> You are correct the the swingworker is required for the LoginService. I tried to supply a dual
> compilation approach, but it was rejected. Until we go to 1.6, it's a hard requirement for JXLoginPane,
> etc.
... and I'm extremely unhappy about it. Anyway we are side tracking.

As for the painter/graphics addon thing it's settled then. I'll take few days to think it over since there needs to be downstream build dependency for this and possibly extra feedback (i.e. if GraphicsAddon build breaks swingx tests it should fails, etc), once I'm done I'll write it somewhere (wiki?) for review and then move all the code around.
Matt, do you think you would be willing to help me take care of this new swinglabs baby and keep it alive once it's all setup?

Kleopatra

jdnc-interest@javadesktop.org schrieb:
> As for the painter/graphics addon thing it's settled then.
just to sure I didn't misunderstand: the graphics sub will be mandatory
lib for SwingX, correct? It's a must for fancy highlighters

Cheers
Jeanette

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

rah003
Offline
Joined: 2004-05-26

> jdnc-interest@javadesktop.org schrieb:
> > As for the painter/graphics addon thing it's settled then.
> just to sure I didn't misunderstand: the graphics sub will be mandatory
> lib for SwingX, correct? It's a must for fancy highlighters
>
Absolutely. It is a must for more then just highlighters ... which is a reason why any changes to it must not break swingx itself. On the other hand this piece have more potential and can be used outside of swingx and have perhaps even it's own release lifecycle.

Kleopatra

Jan,
> Absolutely. It is a must for more then just highlighters ...
sure, should have known - today my horizon is fairly
limited ;-)

Thanks
Jeanette

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

Matt Nathan

I've just updated [url
https://jdnc-incubator.dev.java.net/demos/mattnathan/LensFlareDemo.jnlp
]the above demo[/url] to include a bit more of a flashy demo with
layering (now built into the painter) and some animation (thanks to
the timing framework).

Let me know what you think...

Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

Matt Nathan

Updated [url
https://jdnc-incubator.dev.java.net/demos/mattnathan/LensFlareDemo.jnlp
]the demo[/url] again but this time added a little bit more more bling to it.

[url https://jdnc-incubator.dev.java.net/documentation/mattnathan/images/Lens...
]This is[/url] what it looks like now, hope you like it :)

Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

rbair
Offline
Joined: 2003-07-08

Cool :-)

rbair
Offline
Joined: 2003-07-08

We need to get this (and other painters) listed on SwingLabs.org in some way such that people googling for a specific painter could see the demo, and grab the code for use in their own projects. That would be cool.

Richard

rah003
Offline
Joined: 2004-05-26

> We need to get this (and other painters) listed on SwingLabs.org in some way such that people googling
> for a specific painter could see the demo, and grab the code for use in their own projects. That would be
> cool.
>
> Richard

screenshots can be added to the screenshot applet which has already painters section. Apart from that we can have extra page about painters listing all of them ... maybe even release PainterPowerPack.jar or something like that or just pack them all inside SwingX.jar ... each of those have it's own pros and cons. Since painters are not really a components, I would be more in favor to have specific subproject just for painters with independent release cycle. Why? because same as with image filters people tend to use/include those in other apps and smaller it is and with less dependencies, easier it is to integrate. Opinions?

Matt Nathan

It would be nice to have painters as a power-pack add-on as you suggest but
there are dependencies on swingx, namely GraphicsUtilities and the likes.

In fact, just thinking aloud here, could we have painters as a sub project
of a more general umbrella project devoted to graphics; including things
like GraphicsUtilities and BlendComposite and other non-swingx specific bits
of code like effects and things like that (maybe even Icons and Borders).
[att1.html]

rah003
Offline
Joined: 2004-05-26

> It would be nice to have painters as a power-pack add-on as you suggest but
> there are dependencies on swingx, namely GraphicsUtilities and the likes.
>
> In fact, just thinking aloud here, could we have painters as a sub project
> of a more general umbrella project devoted to graphics; including things
> like GraphicsUtilities and BlendComposite and other non-swingx specific bits
> of code like effects and things like that (maybe even Icons and Borders).
> [att1.html]

This is exactly as I imagined it might work. We have painters or graphics subproject and swingx will have dependency on it ... same way as we have for swing-layout and swing-worker when running on 1.5

rbair
Offline
Joined: 2003-07-08

> > It would be nice to have painters as a power-pack
> add-on as you suggest but
> > there are dependencies on swingx, namely
> GraphicsUtilities and the likes.
> >
> > In fact, just thinking aloud here, could we have
> painters as a sub project
> > of a more general umbrella project devoted to
> graphics; including things
> > like GraphicsUtilities and BlendComposite and other
> non-swingx specific bits
> > of code like effects and things like that (maybe
> even Icons and Borders).
> > [att1.html]
>
> This is exactly as I imagined it might work. We have
> painters or graphics subproject and swingx will have
> dependency on it ... same way as we have for
> swing-layout and swing-worker when running on 1.5

Sounds reasonable to me. I only ever worry about the overhead of managing additional projects, but since Jan has been doing most of the managing lately, it doesn't bother me quite as much :-). Jeanette, what do you think? Karl?

Richard

kschaefe
Offline
Joined: 2006-06-08

> > > It would be nice to have painters as a
> power-pack
> > add-on as you suggest but
> > > there are dependencies on swingx, namely
> > GraphicsUtilities and the likes.
[snip]
> Sounds reasonable to me. I only ever worry about the
> overhead of managing additional projects, but since
> Jan has been doing most of the managing lately, it
> doesn't bother me quite as much :-). Jeanette, what
> do you think? Karl?
I'm fine with it. Doesn't bother me how we package it.

Karl

javakiddy
Offline
Joined: 2004-01-23

A minor gripe, but shouldn't the halo around the star change depending upon the background pixels? Eg: on a plain blue background should it not be light blue?

Matt Nathan

> Slick!
> [Message sent by forum member 'sumitkishore' (sumitkishore)]

Cheers :)

> A minor gripe, but shouldn't the halo around the star change depending upon the background pixels? Eg: on a plain blue background should it not be light blue?
> [Message sent by forum member 'javakiddy' (javakiddy)]

Minor gripes are most welcome :)

I have tried it with a simple lightening halo around the flare but I
thought it looked better with the spectrum version you see in the
demo, but as always this is a matter of opinion ;). I could prepare a
number of options so we can try and decide between them if needed.

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

sumitkishore
Offline
Joined: 2003-06-10

Slick!