Tuesday, August 18, 2009

Substance with VLDocking Framework


Here is a simple UI integration of the VLDocking Framework with Substance 5.2.

In main do:

DockingUISettings.getInstance().installUI();
//and start customizing... MyDockViewTitleBarUI
UIManager.put("DockViewTitleBarUI", "MyDockViewTitleBarUI");


public class MyDockViewTitleBarUI extends DockViewTitleBarUI {

public MyDockViewTitleBarUI(DockViewTitleBar tb) {
super(tb);
SubstanceLookAndFeel.setDecorationType(tb,
DecorationAreaType.PRIMARY_TITLE_PANE);
tb.setForeground(SubstanceColorUtilities
.getForegroundColor(SubstanceColorSchemeUtilities
.getColorScheme(tb, ComponentState.ACTIVE)));
}



static public MyDockViewTitleBarUI createUI(JComponent tb) {
return new MyDockViewTitleBarUI((DockViewTitleBar) tb);
}

@Override
public void paint(Graphics g, JComponent c) {
DockViewTitleBar tb = (DockViewTitleBar) c;

SubstanceSkin skin = SubstanceCoreUtilities.getSkin(tb);
if (skin != null) {
SubstanceDecorationUtilities
.paintDecorationBackground(g, tb, false);
} else {
super.paint(g, tb);
}
}
}

No comments:

Live Traffic Map