01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: * See the GNU Lesser General Public License for more details at gnu.org.
11: */
12:
13: package com.eviware.soapui.support.components;
14:
15: import java.awt.FontMetrics;
16: import java.awt.Insets;
17:
18: import javax.swing.Icon;
19: import javax.swing.plaf.metal.MetalTabbedPaneUI;
20:
21: public class VerticalTabbedPaneUI extends MetalTabbedPaneUI {
22: protected void installDefaults() {
23: super .installDefaults();
24:
25: textIconGap = 0;
26: tabInsets = new Insets(0, 0, 0, 0);
27: }
28:
29: protected int calculateTabWidth(int tabPlacement, int tabIndex,
30: FontMetrics metrics) {
31: Icon icon = getIconForTab(tabIndex);
32: return icon == null ? 2 : icon.getIconWidth() + 2;
33: }
34: }
|