|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.SliderUI
javax.swing.plaf.basic.BasicSliderUI
public class BasicSliderUI
SliderUI 的基本 L&F 實作。
| 巢狀類別摘要 | |
|---|---|
class |
BasicSliderUI.ActionScroller
從 Java 2 平臺 v1.3 開始,不再使用這種以前沒有記錄的類別。 |
class |
BasicSliderUI.ChangeHandler
資料模型偵聽器。 |
class |
BasicSliderUI.ComponentHandler
調整事件大小的偵聽器。 |
class |
BasicSliderUI.FocusHandler
焦點更改偵聽器。 |
class |
BasicSliderUI.PropertyChangeHandler
|
class |
BasicSliderUI.ScrollListener
滾動事件偵聽器。 |
class |
BasicSliderUI.TrackListener
追蹤鼠標移動。 |
| 欄位摘要 | |
|---|---|
protected ChangeListener |
changeListener
|
protected ComponentListener |
componentListener
|
protected Rectangle |
contentRect
|
protected Insets |
focusInsets
|
protected FocusListener |
focusListener
|
protected Rectangle |
focusRect
|
protected Insets |
insetCache
|
protected Rectangle |
labelRect
|
protected boolean |
leftToRightCache
|
static int |
MAX_SCROLL
|
static int |
MIN_SCROLL
|
static int |
NEGATIVE_SCROLL
|
static int |
POSITIVE_SCROLL
|
protected PropertyChangeListener |
propertyChangeListener
|
protected BasicSliderUI.ScrollListener |
scrollListener
|
protected Timer |
scrollTimer
|
protected JSlider |
slider
|
protected Rectangle |
thumbRect
|
protected Rectangle |
tickRect
|
protected int |
trackBuffer
|
protected BasicSliderUI.TrackListener |
trackListener
|
protected Rectangle |
trackRect
|
| 建構子摘要 | |
|---|---|
BasicSliderUI(JSlider b)
|
|
| 從類別 javax.swing.plaf.ComponentUI 繼承的方法 |
|---|
contains, getAccessibleChild, getAccessibleChildrenCount, update |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 欄位詳細資訊 |
|---|
public static final int POSITIVE_SCROLL
public static final int NEGATIVE_SCROLL
public static final int MIN_SCROLL
public static final int MAX_SCROLL
protected Timer scrollTimer
protected JSlider slider
protected Insets focusInsets
protected Insets insetCache
protected boolean leftToRightCache
protected Rectangle focusRect
protected Rectangle contentRect
protected Rectangle labelRect
protected Rectangle tickRect
protected Rectangle trackRect
protected Rectangle thumbRect
protected int trackBuffer
protected BasicSliderUI.TrackListener trackListener
protected ChangeListener changeListener
protected ComponentListener componentListener
protected FocusListener focusListener
protected BasicSliderUI.ScrollListener scrollListener
protected PropertyChangeListener propertyChangeListener
| 建構子詳細資訊 |
|---|
public BasicSliderUI(JSlider b)
| 方法詳細資訊 |
|---|
protected Color getShadowColor()
protected Color getHighlightColor()
protected Color getFocusColor()
protected boolean isDragging()
public static ComponentUI createUI(JComponent b)
public void installUI(JComponent c)
ComponentUI 複製的描述ComponentUI 實例將作為 UI 委託安裝在指定元件上時,可調用此方法。此方法應該為外觀完整地配置元件,包括以下方面:
LayoutManager。
PropertyChangeListener。
ComponentUI 中的 installUIc - 將安裝此 UI 委託的元件ComponentUI.uninstallUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()public void uninstallUI(JComponent c)
ComponentUI 複製的描述installUI 期間,在指定元件上反向執行的配置操作。當此 UIComponent 實例將作為 UI 委託從指定元件上移除時,可調用此方法。此方法應該取消在 installUI 中執行的配置操作,非常小心地使 JComponent 實例處於某種潔淨狀態(沒有額外的偵聽器、沒有特定於外觀的屬性物件等等)。配置內容應該套件括以下方面:
ComponentUI 中的 uninstallUIc - 從中移除此 UI 委託的元件;此參數常被忽略,但如果 UI 物件是無狀態的並由多個元件共享,則可以使用該參數ComponentUI.installUI(javax.swing.JComponent),
JComponent.updateUI()protected void installDefaults(JSlider slider)
protected BasicSliderUI.TrackListener createTrackListener(JSlider slider)
protected ChangeListener createChangeListener(JSlider slider)
protected ComponentListener createComponentListener(JSlider slider)
protected FocusListener createFocusListener(JSlider slider)
protected BasicSliderUI.ScrollListener createScrollListener(JSlider slider)
protected PropertyChangeListener createPropertyChangeListener(JSlider slider)
protected void installListeners(JSlider slider)
protected void uninstallListeners(JSlider slider)
protected void installKeyboardActions(JSlider slider)
protected void uninstallKeyboardActions(JSlider slider)
public int getBaseline(JComponent c,
int width,
int height)
ComponentUI 中的 getBaselinec - 為其請求基線的 JComponentwidth - 為其獲取基線的寬度height - 為其獲取基線的高度
NullPointerException - 如果 c 為 null
IllegalArgumentException - 如果寬度或高度 < 0JComponent.getBaseline(int, int)public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
ComponentUI 中的 getBaselineResizeBehaviorc - 為其返回調整大小行為的 JComponent
NullPointerException - 如果 c 為 nullJComponent.getBaseline(int, int)protected boolean labelsHaveSameBaselines()
public Dimension getPreferredHorizontalSize()
public Dimension getPreferredVerticalSize()
public Dimension getMinimumHorizontalSize()
public Dimension getMinimumVerticalSize()
public Dimension getPreferredSize(JComponent c)
ComponentUI 複製的描述null,則首選大小將由元件的佈局管理器計算(對於安裝了特定佈局管理器的元件而言,這是首選方法)。此方法的預設實作返回 null。
ComponentUI 中的 getPreferredSizec - 將查詢其首選大小的元件;此參數常被忽略,但如果 UI 物件是無狀態的並由多個元件共享,則可以使用該參數JComponent.getPreferredSize(),
LayoutManager.preferredLayoutSize(java.awt.Container)public Dimension getMinimumSize(JComponent c)
ComponentUI 複製的描述null,則最小大小將由元件的佈局管理器計算(對於安裝了特定佈局管理器的元件而言,這是首選方法)。此方法的預設實作調用 getPreferredSize 並返回該值。
ComponentUI 中的 getMinimumSizec - 將查詢其最小大小的元件;此參數常被忽略,但如果 UI 物件是無狀態的並由多個元件共享,則可以使用該參數
Dimension 物件或 nullJComponent.getMinimumSize(),
LayoutManager.minimumLayoutSize(java.awt.Container),
ComponentUI.getPreferredSize(javax.swing.JComponent)public Dimension getMaximumSize(JComponent c)
ComponentUI 複製的描述null,則最大大小將由元件的佈局管理器計算(對於安裝了特定佈局管理器的元件而言,這是首選方法)。此方法的預設實作調用 getPreferredSize 並返回該值。
ComponentUI 中的 getMaximumSizec - 將查詢其最大大小的元件;此參數常被忽略,但如果 UI 物件是無狀態的並由多個元件共享,則可以使用該參數
Dimension 物件或 nullJComponent.getMaximumSize(),
LayoutManager2.maximumLayoutSize(java.awt.Container)protected void calculateGeometry()
protected void calculateFocusRect()
protected void calculateThumbSize()
protected void calculateContentRect()
protected void calculateThumbLocation()
protected void calculateTrackBuffer()
protected void calculateTrackRect()
protected int getTickLength()
protected void calculateTickRect()
protected void calculateLabelRect()
protected Dimension getThumbSize()
protected int getWidthOfWidestLabel()
protected int getHeightOfTallestLabel()
protected int getWidthOfHighValueLabel()
protected int getWidthOfLowValueLabel()
protected int getHeightOfHighValueLabel()
protected int getHeightOfLowValueLabel()
protected boolean drawInverted()
protected Integer getHighestValue()
protected Integer getLowestValue()
protected Component getLowestValueLabel()
JSlider.setLabelTable(java.util.Dictionary)protected Component getHighestValueLabel()
JSlider.setLabelTable(java.util.Dictionary)
public void paint(Graphics g,
JComponent c)
ComponentUI 複製的描述ComponentUI.update 方法中調用此方法。子類別應該覆寫此方法並使用指定 Graphics 物件來呈現元件的內容。
ComponentUI 中的 paintg - 將在其中進行繪製的 Graphics 上下文c - 將繪製的元件;此參數常被忽略,但如果 UI 物件是無狀態的並由多個元件共享,則可以使用該參數ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)protected void recalculateIfInsetsChanged()
protected void recalculateIfOrientationChanged()
public void paintFocus(Graphics g)
public void paintTrack(Graphics g)
public void paintTicks(Graphics g)
protected void paintMinorTickForHorizSlider(Graphics g,
Rectangle tickBounds,
int x)
protected void paintMajorTickForHorizSlider(Graphics g,
Rectangle tickBounds,
int x)
protected void paintMinorTickForVertSlider(Graphics g,
Rectangle tickBounds,
int y)
protected void paintMajorTickForVertSlider(Graphics g,
Rectangle tickBounds,
int y)
public void paintLabels(Graphics g)
protected void paintHorizontalLabel(Graphics g,
int value,
Component label)
JSlider.setLabelTable(java.util.Dictionary)
protected void paintVerticalLabel(Graphics g,
int value,
Component label)
JSlider.setLabelTable(java.util.Dictionary)public void paintThumb(Graphics g)
public void setThumbLocation(int x,
int y)
public void scrollByBlock(int direction)
public void scrollByUnit(int direction)
protected void scrollDueToClickInTrack(int dir)
protected int xPositionForValue(int value)
protected int yPositionForValue(int value)
protected int yPositionForValue(int value,
int trackY,
int trackHeight)
trackHeight 負數,則結果是不確定的。
value - 要獲取其位置的滑塊值trackY - 滑道 y 原點trackHeight - 滑道高度public int valueForYPosition(int yPos)
public int valueForXPosition(int xPos)
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。