jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java
changeset 23697 e556a715949f
parent 23010 6dadb192ad81
child 26012 36ecb579dbc8
equal deleted inserted replaced
23696:7deff68428ef 23697:e556a715949f
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
  3447                               "tabViewPosition=" + tabViewPosition;
  3447                               "tabViewPosition=" + tabViewPosition;
  3448         }
  3448         }
  3449 
  3449 
  3450     }
  3450     }
  3451 
  3451 
       
  3452     @SuppressWarnings("serial") // Superclass is not serializable across versions
  3452     private class ScrollableTabViewport extends JViewport implements UIResource {
  3453     private class ScrollableTabViewport extends JViewport implements UIResource {
  3453         public ScrollableTabViewport() {
  3454         public ScrollableTabViewport() {
  3454             super();
  3455             super();
  3455             setName("TabbedPane.scrollableViewport");
  3456             setName("TabbedPane.scrollableViewport");
  3456             setScrollMode(SIMPLE_SCROLL_MODE);
  3457             setScrollMode(SIMPLE_SCROLL_MODE);
  3461             }
  3462             }
  3462             setBackground(bgColor);
  3463             setBackground(bgColor);
  3463         }
  3464         }
  3464     }
  3465     }
  3465 
  3466 
       
  3467     @SuppressWarnings("serial") // Superclass is not serializable across versions
  3466     private class ScrollableTabPanel extends JPanel implements UIResource {
  3468     private class ScrollableTabPanel extends JPanel implements UIResource {
  3467         public ScrollableTabPanel() {
  3469         public ScrollableTabPanel() {
  3468             super(null);
  3470             super(null);
  3469             setOpaque(tabPane.isOpaque());
  3471             setOpaque(tabPane.isOpaque());
  3470             Color bgColor = UIManager.getColor("TabbedPane.tabAreaBackground");
  3472             Color bgColor = UIManager.getColor("TabbedPane.tabAreaBackground");
  3491                 child.setBounds(0, 0, getWidth(), getHeight());
  3493                 child.setBounds(0, 0, getWidth(), getHeight());
  3492             }
  3494             }
  3493         }
  3495         }
  3494     }
  3496     }
  3495 
  3497 
       
  3498     @SuppressWarnings("serial") // Superclass is not serializable across versions
  3496     private class ScrollableTabButton extends BasicArrowButton implements UIResource,
  3499     private class ScrollableTabButton extends BasicArrowButton implements UIResource,
  3497                                                                             SwingConstants {
  3500                                                                             SwingConstants {
  3498         public ScrollableTabButton(int direction) {
  3501         public ScrollableTabButton(int direction) {
  3499             super(direction,
  3502             super(direction,
  3500                   UIManager.getColor("TabbedPane.selected"),
  3503                   UIManager.getColor("TabbedPane.selected"),
  3816             }
  3819             }
  3817         }
  3820         }
  3818         return htmlViews;
  3821         return htmlViews;
  3819     }
  3822     }
  3820 
  3823 
       
  3824     @SuppressWarnings("serial") // Superclass is not serializable across versions
  3821     private class TabContainer extends JPanel implements UIResource {
  3825     private class TabContainer extends JPanel implements UIResource {
  3822         private boolean notifyTabbedPane = true;
  3826         private boolean notifyTabbedPane = true;
  3823 
  3827 
  3824         public TabContainer() {
  3828         public TabContainer() {
  3825             super(null);
  3829             super(null);
  3860                 tabPane.repaint(getBounds());
  3864                 tabPane.repaint(getBounds());
  3861             }
  3865             }
  3862         }
  3866         }
  3863     }
  3867     }
  3864 
  3868 
       
  3869     @SuppressWarnings("serial") // Superclass is not serializable across versions
  3865     private class CroppedEdge extends JPanel implements UIResource {
  3870     private class CroppedEdge extends JPanel implements UIResource {
  3866         private Shape shape;
  3871         private Shape shape;
  3867         private int tabIndex;
  3872         private int tabIndex;
  3868         private int cropline;
  3873         private int cropline;
  3869         private int cropx, cropy;
  3874         private int cropx, cropy;