Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Compositing every component on Component?

 
Chris Dancy
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What i've got so far is a component which is set on a layeredPane, this component fades in and out when activated or triggered. The problem is that I can't figure out how to alter the composite of each component, the only thing which is being affected is the background ( which fades in and out as it should ). The individual components themselves simply appear and disappear. Here is the code so far...



Any ideas would be great. I assumed I had to get the graphics object for each component on this component, yet when I did that it didnt work, so I assume I'm missing something.
 
Chris Dancy
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I eventually found the answer to my problem...or at least how to approach it and come out with the answer. Here is the link in case anyone else is interested...

http://forums.sun.com/thread.jspa?threadID=5379385&tstart=0
 
Campbell Ritchie
Marshal
Posts: 52621
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done

You ought to have said (as you did on the other forum) that you were posting elsewhere.
 
Chris Dancy
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes..... I posted elsewhere after I did not get a response here. I was under a bit of time constraint and was looking for a solution rather quickly or at least how to approach a possible solution. And I found the answer. And if anyone comes across this and does not want to read the link...This is what I did. In the Panel or component which holds a number of components that all need to be composited in some fashion it's actually quite simple, and I'm kicking myself for not thinking of it sooner. Simply over ride paintChildren(g), then set whatever composites or whatever on that graphics object and pass that graphics object back up with super.paintChildren(g). And wala... everything is as it should be. Easy as pie.
 
Campbell Ritchie
Marshal
Posts: 52621
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for telling us the solution. It is helpful to know in case somebody else has a similar problem in the future.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!