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