How to customize components?

Discuss here any questions about the WebLaF library.
Bugs can be posted directly to GitHub issues tracker.

How to customize components?

Postby petermacgonagan » Thu Sep 04, 2014 1:33 pm

Hello,

Like many others, I would like to customize the look and feel of my software. I would like to get a theme more like sublime text or photoshop...
http://bassultra.deviantart.com/art/eGTK-Mockup-Kit-339505098

So, how to customize, by example a WebToolBar, a WebSplitter or a WebDocumentPane to set a background color of by example Color(38,38,38). I tried .setBackground but it doesn't work. Sometimes, I got a gradient with WebDocumentPane. Sometimes the object has .setUndecorated properties, sometimes not...
I don't see how to use .setPainter

I'm aware that you're working for the moment on StyleManager and I read your article on the Wiki about it but I don't see how to do it.

Thank you in advance!
petermacgonagan
 
Posts: 9
Joined: Wed Sep 03, 2014 10:57 pm

Re: How to customize components?

Postby mgarin » Fri Sep 05, 2014 3:03 pm

So far it is possible to fully customize only a few components because StyleManager is still being developed. Some other components also support custom painters which doesn't affect the whole component but only its parts (for example background painting) - later on this will also be changed.

At the moment styling each component requires some experience with that component UI and also experience with Graphics2D used for painting all components and it is different for each specific component - this is what I am basically trying to change and simplify and already changed for some of components.

I strongly recommend to wait the final release of the StyleManager and guides about styling components to avoid rewriting that code/changing style twice.

About the specific components you have asked about:

1. WebToolBar
So far you can change styling type:
Code: Select all
final WebToolBar toolBar = new WebToolBar ();
toolBar.setToolbarStyle ( ToolbarStyle.attached );

And some colors and settings by changing static values in class WebToolBarStyle:
Code: Select all
WebToolBarStyle.round = 0;
WebToolBarStyle.topBgColor = Color.RED;


2. WebSplitter
There is no such component, so no idea :)

3. WebDocumentPane
That component is not the real tabbed pane (or panes) which is being displayed. You can provide customizers to modify split pane and tabbed pane style:
Code: Select all
final WebDocumentPane documentPane = new WebDocumentPane (  );
documentPane.setSplitPaneCustomizer ( new Customizer<WebSplitPane> ()
{
    public void customize ( WebSplitPane object )
    {
       
    }
} );
documentPane.setTabbedPaneCustomizer ( new Customizer<WebTabbedPane> ()
{
    public void customize ( WebTabbedPane object )
    {
       
    }
} );


Also each Web-component has a similar-named style class with static values which can be modified, for example: WebTabbedPaneStyle, WebSplitPaneStyle or WebButtonStyle. All those settings may be changed to provide custom styling for all components of that type.
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg

Re: How to customize components?

Postby petermacgonagan » Sun Sep 07, 2014 6:39 pm

Ok, thank your for your answers. I think that I'll wait a little bit before using StyleManager ;)
petermacgonagan
 
Posts: 9
Joined: Wed Sep 03, 2014 10:57 pm

Re: How to customize components?

Postby mgarin » Mon Sep 08, 2014 9:30 am

I will leave this topic open until StyleManager and its guides are released.
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg


Return to Questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron