diff options
Diffstat (limited to 'src/cppcheckplus/tab/MyTabPanelUI1.java')
-rw-r--r-- | src/cppcheckplus/tab/MyTabPanelUI1.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/cppcheckplus/tab/MyTabPanelUI1.java b/src/cppcheckplus/tab/MyTabPanelUI1.java new file mode 100644 index 0000000..f98c5f9 --- /dev/null +++ b/src/cppcheckplus/tab/MyTabPanelUI1.java | |||
@@ -0,0 +1,53 @@ | |||
1 | |||
2 | package cppcheckplus.tab; | ||
3 | |||
4 | import java.awt.FontMetrics; | ||
5 | import java.awt.Graphics; | ||
6 | import java.awt.Rectangle; | ||
7 | import javax.swing.plaf.metal.MetalTabbedPaneUI; | ||
8 | |||
9 | import cppcheckplus.control.MyContorlUtil; | ||
10 | |||
11 | public class MyTabPanelUI1 extends MetalTabbedPaneUI | ||
12 | { | ||
13 | private MyTabPanel1 tab; | ||
14 | private int firstTabIndent; | ||
15 | |||
16 | public MyTabPanelUI1(MyTabPanel1 tab) | ||
17 | { | ||
18 | this.tab = null; | ||
19 | firstTabIndent = 5; | ||
20 | this.tab = tab; | ||
21 | } | ||
22 | |||
23 | protected Rectangle getTabBounds(int tabIndex, Rectangle dest) | ||
24 | { | ||
25 | Rectangle bounds = super.getTabBounds(tabIndex, dest); | ||
26 | bounds.x += firstTabIndent; | ||
27 | return bounds; | ||
28 | } | ||
29 | |||
30 | protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, | ||
31 | boolean isSelected) | ||
32 | { | ||
33 | g.setColor(MyContorlUtil.TAB_BOTTOM_LINE_COLOR); | ||
34 | int lineY = tab.getPreferredTabHeight() - 1; | ||
35 | g.drawLine(0, lineY, firstTabIndent, lineY); | ||
36 | } | ||
37 | |||
38 | protected void paintTabBackground(Graphics g1, int i, int j, int k, int l, int i1, int j1, | ||
39 | boolean flag) | ||
40 | { | ||
41 | } | ||
42 | |||
43 | protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) | ||
44 | { | ||
45 | int width = super.calculateTabWidth(tabPlacement, tabIndex, metrics); | ||
46 | return width - 5; | ||
47 | } | ||
48 | |||
49 | protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) | ||
50 | { | ||
51 | return tab.getPreferredTabHeight(); | ||
52 | } | ||
53 | } | ||