35
35
import resources .Icons ;
36
36
37
37
/**
38
- * Panel to show a "tab" for an object. ChangeListeners are notified when a tab is selected.
38
+ * Panel to show a "tab" for an object. ChangeListeners are notified when a tab is selected.
39
39
*/
40
40
public class MultiTabPanel extends JPanel {
41
41
private static final String FONT_TABS_ID = "font.plugin.tabs" ;
@@ -49,17 +49,13 @@ public class MultiTabPanel extends JPanel {
49
49
private final static Icon HIGHLIGHT_CLOSE_ICON = new GIcon ("icon.plugin.programmanager.close.highlight" );
50
50
private final static Icon LIST_ICON = new GIcon ("icon.plugin.programmanager.list" );
51
51
private final static Icon TRANSIENT_ICON = new GIcon ("icon.plugin.programmanager.transient" );
52
- //@formatter:on
53
52
54
- private final static Color TEXT_SELECTION_COLOR =
55
- new GColor ("color.fg.listing.tabs.text.selected" );
56
- private final static Color TEXT_NON_SELECTION_COLOR =
57
- new GColor ("color.fg.listing.tabs.text.unselected" );
53
+ private final static Color TEXT_SELECTION_COLOR = new GColor ("color.fg.listing.tabs.text.selected" );
54
+ private final static Color TEXT_NON_SELECTION_COLOR = new GColor ("color.fg.listing.tabs.text.unselected" );
58
55
private final static Color BG_SELECTION_COLOR = SELECTED_TAB_COLOR ;
59
- private final static Color BG_NON_SELECTION_COLOR =
60
- new GColor ("color.bg.listing.tabs.unselected" );
61
- private static final Color BG_COLOR_MORE_TABS_HOVER =
62
- new GColor ("color.bg.listing.tabs.more.tabs.hover" );
56
+ private final static Color BG_NON_SELECTION_COLOR = new GColor ("color.bg.listing.tabs.unselected" );
57
+ private static final Color BG_COLOR_MORE_TABS_HOVER = new GColor ("color.bg.listing.tabs.more.tabs.hover" );
58
+ //@formatter:on
63
59
64
60
private static final String DEFAULT_HIDDEN_COUNT_STR = "99" ;
65
61
@@ -85,7 +81,6 @@ public class MultiTabPanel extends JPanel {
85
81
private boolean ignoreFocus ;
86
82
87
83
MultiTabPanel (MultiTabPlugin multiTabPlugin ) {
88
- super ();
89
84
this .multiTabPlugin = multiTabPlugin ;
90
85
setLayout (new HorizontalLayout (0 ));
91
86
@@ -145,7 +140,7 @@ Program getSelectedProgram() {
145
140
}
146
141
147
142
/**
148
- * Refresh label displayed in the tab for the given object.
143
+ * Refresh label displayed in the tab for the given object.
149
144
* @param program object associated with a tab
150
145
*/
151
146
void refresh (Program program ) {
@@ -555,8 +550,8 @@ private List<TabPanel> getTabsThatFitInView() {
555
550
newVisibleTabList .add (panel );
556
551
}
557
552
558
- // check for the boundary condition where all elements would fit in the display if we
559
- // don't show the label indicating tabs are hidden. The boundary case is when there
553
+ // check for the boundary condition where all elements would fit in the display if we
554
+ // don't show the label indicating tabs are hidden. The boundary case is when there
560
555
// is only one hidden element that could potentially be put into the view
561
556
if (allTabsList .size () - newVisibleTabList .size () == 1 ) {
562
557
TabPanel lastPanel = allTabsList .get (allTabsList .size () - 1 );
@@ -599,7 +594,7 @@ private List<TabPanel> ensureCurrentProgramTabInView(Program activeProgram,
599
594
usedWidth += panel .getPreferredSize ().width ;
600
595
}
601
596
602
- // remove items from the end of the visible list until we have room for the current tab
597
+ // remove items from the end of the visible list until we have room for the current tab
603
598
for (int i = newVisibleTabList .size () - 1 ; i >= 0 ; i --) {
604
599
TabPanel lastPanel = newVisibleTabList .remove (i );
605
600
int width = lastPanel .getPreferredSize ().width ;
@@ -790,7 +785,7 @@ else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
790
785
list .addFocusListener (new FocusAdapter () {
791
786
@ Override
792
787
public void focusLost (FocusEvent focusEvent ) {
793
- // close the window when the user focuses another component
788
+ // close the window when the user focuses another component
794
789
if (focusEvent .getOppositeComponent () != filterField ) {
795
790
hideListWindowDueToFocusChange ();
796
791
}
@@ -912,7 +907,7 @@ private String getProgramName(Program program) {
912
907
913
908
//==================================================================================================
914
909
// Inner Classes
915
- //==================================================================================================
910
+ //==================================================================================================
916
911
917
912
private class TabPanel extends JPanel {
918
913
private Color defaultBgColor ;
@@ -963,7 +958,7 @@ void paintHighlightedColor(boolean paintHighlight) {
963
958
}
964
959
}
965
960
966
- // a panel that paints below it's bounds in order to connect the panel and the border
961
+ // a panel that paints below it's bounds in order to connect the panel and the border
967
962
// below it visually
968
963
private class SelectedPanel extends TabPanel {
969
964
private SelectedPanel (Color backgroundColor , Program program , JLabel nameLabel ,
@@ -1005,16 +1000,16 @@ void paintHighlightedColor(boolean paintHighlight) {
1005
1000
}
1006
1001
}
1007
1002
1008
- // This class doesn't paint the bottom border in order to make the object appear to be
1009
- // connected to the component below. This class also paints its side borders below its
1003
+ // This class doesn't paint the bottom border in order to make the object appear to be
1004
+ // connected to the component below. This class also paints its side borders below its
1010
1005
// bounds for the same reason.
1011
1006
class BottomlessBevelBorder extends BevelBorder {
1012
1007
public BottomlessBevelBorder () {
1013
1008
super (RAISED );
1014
1009
}
1015
1010
1016
1011
@ Override
1017
- // overridden to reduce the space below, since there is no component
1012
+ // overridden to reduce the space below, since there is no component
1018
1013
public Insets getBorderInsets (Component c ) {
1019
1014
Insets borderInsets = super .getBorderInsets (c );
1020
1015
borderInsets .bottom = 0 ;
@@ -1079,7 +1074,7 @@ protected void paintRaisedBevel(Component c, Graphics g, int x, int y, int width
1079
1074
g .setColor (getHighlightOuterColor (c ));
1080
1075
g .drawLine (0 , h - 1 , w - 1 , h - 1 );
1081
1076
1082
- // bottom inner
1077
+ // bottom inner
1083
1078
g .setColor (getShadowInnerColor (c ));
1084
1079
1085
1080
g .translate (-x , -y );
0 commit comments