- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.TabbedPaneUI
-
- javax.swing.plaf.basic.BasicTabbedPaneUI
-
- javax.swing.plaf.metal.MetalTabbedPaneUI
-
- All Implemented Interfaces:
- SwingConstants
public class MetalTabbedPaneUI extends BasicTabbedPaneUI
The Metal subclass of BasicTabbedPaneUI.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the
java.beanspackage. Please seeXMLEncoder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classMetalTabbedPaneUI.TabbedPaneLayoutThis class should be treated as a "protected" inner class.-
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI
BasicTabbedPaneUI.FocusHandler, BasicTabbedPaneUI.MouseHandler, BasicTabbedPaneUI.PropertyChangeHandler, BasicTabbedPaneUI.TabSelectionHandler
-
-
Field Summary
Fields Modifier and Type Field and Description protected intminTabWidthprotected ColorselectColorprotected ColorselectHighlightprotected ColortabAreaBackground-
Fields inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI
calcRect, contentBorderInsets, darkShadow, downKey, focus, focusListener, highlight, leftKey, lightHighlight, maxTabHeight, maxTabWidth, mouseListener, propertyChangeListener, rects, rightKey, runCount, selectedRun, selectedTabPadInsets, shadow, tabAreaInsets, tabChangeListener, tabInsets, tabPane, tabRunOverlay, tabRuns, textIconGap, upKey
-
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
-
-
Constructor Summary
Constructors Constructor and Description MetalTabbedPaneUI()
-
Method Summary
Methods Modifier and Type Method and Description protected intcalculateMaxTabHeight(int tabPlacement)protected LayoutManagercreateLayoutManager()Invoked byinstallUIto create a layout manager object to manage theJTabbedPane.static ComponentUIcreateUI(JComponent x)protected intgetBaselineOffset()Returns the amount the baseline is offset by.protected ColorgetColorForGap(int currentRun, int x, int y)protected intgetTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)Overridden to do nothing for the Java L&F.protected intgetTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)Overridden to do nothing for the Java L&F.protected intgetTabRunOverlay(int tabPlacement)protected voidinstallDefaults()voidpaint(Graphics g, JComponent c)Paints the specified component appropriately for the look and feel.protected voidpaintBottomTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)protected voidpaintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)protected voidpaintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)protected voidpaintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)protected voidpaintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)protected voidpaintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)protected voidpaintHighlightBelowTab()protected voidpaintLeftTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)protected voidpaintRightTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)protected voidpaintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)this function draws the border around each tab note that this function does now draw the background of the tab.protected voidpaintTopTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)protected booleanshouldFillGap(int currentRun, int tabIndex, int x, int y)protected booleanshouldPadTabRun(int tabPlacement, int run)protected booleanshouldRotateTabRuns(int tabPlacement, int selectedRun)voidupdate(Graphics g, JComponent c)Notifies this UI delegate that it is time to paint the specified component.-
Methods inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI
assureRectsCreated, calculateMaxTabWidth, calculateTabAreaHeight, calculateTabAreaWidth, calculateTabHeight, calculateTabWidth, createChangeListener, createFocusListener, createMouseListener, createPropertyChangeListener, createScrollButton, expandTabRunsArray, getBaseline, getBaseline, getBaselineResizeBehavior, getContentBorderInsets, getFocusIndex, getFontMetrics, getIconForTab, getMaximumSize, getMinimumSize, getNextTabIndex, getNextTabIndexInRun, getNextTabRun, getPreviousTabIndex, getPreviousTabIndexInRun, getPreviousTabRun, getRolloverTab, getRunForTab, getSelectedTabPadInsets, getTabAreaInsets, getTabBounds, getTabBounds, getTabInsets, getTabRunCount, getTabRunIndent, getTabRunOffset, getTextViewForTab, getVisibleComponent, installComponents, installKeyboardActions, installListeners, installUI, lastTabInRun, layoutLabel, navigateSelectedTab, paintContentBorder, paintIcon, paintTab, paintTabArea, paintText, rotateInsets, selectAdjacentRunTab, selectNextTab, selectNextTabInRun, selectPreviousTab, selectPreviousTabInRun, setRolloverTab, setVisibleComponent, shouldRotateTabRuns, tabForCoordinate, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getPreferredSize
-
-
-
-
Field Detail
-
minTabWidth
protected int minTabWidth
-
tabAreaBackground
protected Color tabAreaBackground
-
selectColor
protected Color selectColor
-
selectHighlight
protected Color selectHighlight
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent x)
-
createLayoutManager
protected LayoutManager createLayoutManager()
Description copied from class:BasicTabbedPaneUIInvoked byinstallUIto create a layout manager object to manage theJTabbedPane.- Overrides:
createLayoutManagerin classBasicTabbedPaneUI- Returns:
- a layout manager object
- See Also:
BasicTabbedPaneUI.TabbedPaneLayout,JTabbedPane.getTabLayoutPolicy()
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaultsin classBasicTabbedPaneUI
-
paintTabBorder
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
Description copied from class:BasicTabbedPaneUIthis function draws the border around each tab note that this function does now draw the background of the tab. that is done elsewhere- Overrides:
paintTabBorderin classBasicTabbedPaneUI
-
paintTopTabBorder
protected void paintTopTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
-
shouldFillGap
protected boolean shouldFillGap(int currentRun, int tabIndex, int x, int y)
-
getColorForGap
protected Color getColorForGap(int currentRun, int x, int y)
-
paintLeftTabBorder
protected void paintLeftTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
-
paintBottomTabBorder
protected void paintBottomTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
-
paintRightTabBorder
protected void paintRightTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
-
update
public void update(Graphics g, JComponent c)
Description copied from class:ComponentUINotifies this UI delegate that it is time to paint the specified component. This method is invoked byJComponentwhen the specified component is being painted.By default this method fills the specified component with its background color if its
opaqueproperty istrue, and then immediately callspaint. In general this method need not be overridden by subclasses; all look-and-feel rendering code should reside in thepaintmethod.- Overrides:
updatein classComponentUI- Parameters:
g- theGraphicscontext in which to paintc- the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components- See Also:
ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent),JComponent.paintComponent(java.awt.Graphics)
-
paintTabBackground
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
- Overrides:
paintTabBackgroundin classBasicTabbedPaneUI
-
getTabLabelShiftX
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)Overridden to do nothing for the Java L&F.- Overrides:
getTabLabelShiftXin classBasicTabbedPaneUI
-
getTabLabelShiftY
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)Overridden to do nothing for the Java L&F.- Overrides:
getTabLabelShiftYin classBasicTabbedPaneUI
-
getBaselineOffset
protected int getBaselineOffset()
Returns the amount the baseline is offset by. This is typically the same asgetTabLabelShiftY.- Overrides:
getBaselineOffsetin classBasicTabbedPaneUI- Returns:
- amount to offset the baseline by
- Since:
- 1.6
-
paint
public void paint(Graphics g, JComponent c)
Description copied from class:ComponentUIPaints the specified component appropriately for the look and feel. This method is invoked from theComponentUI.updatemethod when the specified component is being painted. Subclasses should override this method and use the specifiedGraphicsobject to render the content of the component.- Overrides:
paintin classBasicTabbedPaneUI- Parameters:
g- theGraphicscontext in which to paintc- the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components- See Also:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
-
paintHighlightBelowTab
protected void paintHighlightBelowTab()
-
paintFocusIndicator
protected void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)
- Overrides:
paintFocusIndicatorin classBasicTabbedPaneUI
-
paintContentBorderTopEdge
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
- Overrides:
paintContentBorderTopEdgein classBasicTabbedPaneUI
-
paintContentBorderBottomEdge
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
- Overrides:
paintContentBorderBottomEdgein classBasicTabbedPaneUI
-
paintContentBorderLeftEdge
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
- Overrides:
paintContentBorderLeftEdgein classBasicTabbedPaneUI
-
paintContentBorderRightEdge
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
- Overrides:
paintContentBorderRightEdgein classBasicTabbedPaneUI
-
calculateMaxTabHeight
protected int calculateMaxTabHeight(int tabPlacement)
- Overrides:
calculateMaxTabHeightin classBasicTabbedPaneUI
-
getTabRunOverlay
protected int getTabRunOverlay(int tabPlacement)
- Overrides:
getTabRunOverlayin classBasicTabbedPaneUI
-
shouldRotateTabRuns
protected boolean shouldRotateTabRuns(int tabPlacement, int selectedRun)
-
shouldPadTabRun
protected boolean shouldPadTabRun(int tabPlacement, int run)- Overrides:
shouldPadTabRunin classBasicTabbedPaneUI
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-javax/swing/plaf/metal/metaltabbedpaneui.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.