View Javadoc

1   package org.telscenter.pas.common.ui.tab;
2   
3   import java.awt.Color;
4   import java.awt.Font;
5   import java.awt.FontMetrics;
6   import java.awt.Insets;
7   
8   /***
9    * @author Archana
10   *
11   */
12  
13  
14  public class PasProjInfoTabbedPaneUI extends PasTabbedPaneUI{
15  	private Font boldFont;
16  	private FontMetrics boldFontMetrics; 
17  	private Color selectedColor;
18  	private Color unselectedColor;
19  	
20  	/***
21  	 * 
22  	 */
23  	public PasProjInfoTabbedPaneUI() {
24  		// TODO Auto-generated constructor stub
25  	}
26  
27  	protected void installDefaults()
28  	{
29  		super.installDefaults();
30  		tabAreaInsets.left = (calculateTabHeight(0, 0, tabPane.getFont().getSize()) / 4) + 1;
31  		selectedTabPadInsets = new Insets(0, 0, 0, 0);
32  
33  		selectedColor = tabPane.getBackground();
34  		unselectedColor = tabPane.getBackground().darker();
35  		
36  		boldFont = tabPane.getFont().deriveFont(Font.BOLD);
37  		boldFontMetrics = tabPane.getFontMetrics(boldFont);
38  		tabPane.setFont(boldFont.deriveFont(Font.BOLD,16.0f));
39  	}
40  	
41  	
42  	//@override
43  	protected int calculateTabHeight(final int tabPlacement, final int tabIndex, final int fontHeight)
44  	{
45  		int vHeight = fontHeight + 8;
46  		if (vHeight % 2 == 0)
47  			vHeight += 1;
48  		return vHeight;
49  	}
50  
51  
52  
53  	
54  }