You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by JohnRodey <ti...@yahoo.com> on 2010/03/08 16:53:42 UTC

Altering the skin

Is there any detailed information about changing skins?

I'm trying to set an image as my background and have not been able to find
much.
-- 
View this message in context: http://n3.nabble.com/Altering-the-skin-tp435450p435450.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Altering the skin

Posted by Sandro Martini <sa...@gmail.com>.
Hi John,
Greg already gave you the answer to your question, but I suggest a little
trick: 
in some cases, instead to change the skin, you can change all the skin
colors in your applications, passing to the VM the following (optional)
argument:
-Dorg.apache.pivot.wtk.skin.terra.location=org/apache/pivot/tutorials/TerraTheme_dark.json
where the value must point to a valid JSON file like the alternative (dark)
colors json file already shipped with Pivot, or you can provide yours.

Bye,
Sandro

-- 
View this message in context: http://n3.nabble.com/Altering-the-skin-tp435450p443160.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Altering the skin

Posted by JohnRodey <ti...@yahoo.com>.
Awesome, that worked great.  Thanks a lot for the help from both of you. 
This forum has definitely helped me get over my hurdles.
-- 
View this message in context: http://n3.nabble.com/Altering-the-skin-tp435450p436537.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Altering the skin

Posted by Greg Brown <gk...@mac.com>.
For a container, you can do this:

styles="{backgroundColor:null}"

However, not all components support a null background color. For those components, you'll need to specify a color with an alpha channel (the last byte is the opacity):

styles="{backgroundColor:'0xffffffcc'}"

On Mar 8, 2010, at 5:23 PM, JohnRodey wrote:

> 
> How do I set my background color to be transparent in the wtkx file?
> 
> thanks!
> -- 
> View this message in context: http://n3.nabble.com/Altering-the-skin-tp435450p436504.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: Altering the skin

Posted by JohnRodey <ti...@yahoo.com>.
How do I set my background color to be transparent in the wtkx file?

thanks!
-- 
View this message in context: http://n3.nabble.com/Altering-the-skin-tp435450p436504.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Altering the skin

Posted by Greg Brown <gk...@mac.com>.
OK. Then I would suggest using the StackPane approach. However, if your image is a simple gradient, you might just want to set a gradient paint as the "backgroundPaint" style of your main window.

On Mar 8, 2010, at 4:23 PM, JohnRodey wrote:

> 
> My application looks very similar to the itunes sample application.  I
> thought that it would look more professional with an image (that scales with
> the page being resized) under all of the components
> -- 
> View this message in context: http://n3.nabble.com/Altering-the-skin-tp435450p436415.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: Altering the skin

Posted by JohnRodey <ti...@yahoo.com>.
My application looks very similar to the itunes sample application.  I
thought that it would look more professional with an image (that scales with
the page being resized) under all of the components
-- 
View this message in context: http://n3.nabble.com/Altering-the-skin-tp435450p436415.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Altering the skin

Posted by Greg Brown <gk...@mac.com>.
That is one I hadn't thought of. I was thinking of either using a StackPane, which could contain an ImageView as the bottom-most component, or using a Decorator, which could paint under the decorated component (assuming that the component was either partially or fully transparent, which could be accomplished by setting a background color with an alpha channel).

On Mar 8, 2010, at 11:49 AM, Todd Volkert wrote:

> It's probably not the best way (like Greg says, there are other ways to do this), but FYI, ContainerSkin supports a "backgroundPaint" style, which could be used to set an instance of java.awt.TexturePaint...
> 
> -T
> 
> On Mon, Mar 8, 2010 at 11:32 AM, Greg Brown <gk...@mac.com> wrote:
> I don't think any of the skins support an image as a background. However, there are a couple of ways you could do this. Can you describe your use case a little more specifically?
> 
> On Mar 8, 2010, at 10:53 AM, JohnRodey wrote:
> 
> >
> > Is there any detailed information about changing skins?
> >
> > I'm trying to set an image as my background and have not been able to find
> > much.
> > --
> > View this message in context: http://n3.nabble.com/Altering-the-skin-tp435450p435450.html
> > Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
> 
> 


Re: Altering the skin

Posted by Todd Volkert <tv...@gmail.com>.
It's probably not the best way (like Greg says, there are other ways to do
this), but FYI, ContainerSkin supports a "backgroundPaint" style, which
could be used to set an instance of java.awt.TexturePaint...

-T

On Mon, Mar 8, 2010 at 11:32 AM, Greg Brown <gk...@mac.com> wrote:

> I don't think any of the skins support an image as a background. However,
> there are a couple of ways you could do this. Can you describe your use case
> a little more specifically?
>
> On Mar 8, 2010, at 10:53 AM, JohnRodey wrote:
>
> >
> > Is there any detailed information about changing skins?
> >
> > I'm trying to set an image as my background and have not been able to
> find
> > much.
> > --
> > View this message in context:
> http://n3.nabble.com/Altering-the-skin-tp435450p435450.html
> > Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>
>

Re: Altering the skin

Posted by Greg Brown <gk...@mac.com>.
I don't think any of the skins support an image as a background. However, there are a couple of ways you could do this. Can you describe your use case a little more specifically?

On Mar 8, 2010, at 10:53 AM, JohnRodey wrote:

> 
> Is there any detailed information about changing skins?
> 
> I'm trying to set an image as my background and have not been able to find
> much.
> -- 
> View this message in context: http://n3.nabble.com/Altering-the-skin-tp435450p435450.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.