View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2009 eviware.com 
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the 
5    *  terms of version 2.1 of the GNU Lesser General Public License as published by 
6    *  the Free Software Foundation.
7    *
8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
9    *  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  {
23  	protected void installDefaults()
24  	{
25  		super.installDefaults();
26  
27  		textIconGap = 0;
28  		tabInsets = new Insets( 0, 0, 0, 0 );
29  	}
30  
31  	protected int calculateTabWidth( int tabPlacement, int tabIndex, FontMetrics metrics )
32  	{
33  		Icon icon = getIconForTab( tabIndex );
34  		return icon == null ? 2 : icon.getIconWidth() + 2;
35  	}
36  }