©
本文檔使用 php中文網手册 發布
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.AbstractButton javax.swing.JButton javax.swing.plaf.basic.BasicArrowButton
public class BasicArrowButton
一个 JButton 对象,它绘制朝某个基本方向的缩放箭头。
警告:此类的序列化对象将与以后的 Swing 版本不兼容。当前序列化支持适用于短期存储,或适用于在运行相同 Swing 版本的应用程序之间进行 RMI(Remote Method Invocation,远程方法调用)。从 1.4 版本开始,已在 java.beans
包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder
。
嵌套类摘要 |
---|
从类 javax.swing.JButton 继承的嵌套类/接口 |
---|
JButton.AccessibleJButton |
从类 javax.swing.AbstractButton 继承的嵌套类/接口 |
---|
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
从类 javax.swing.JComponent 继承的嵌套类/接口 |
---|
JComponent.AccessibleJComponent |
从类 java.awt.Container 继承的嵌套类/接口 |
---|
Container.AccessibleAWTContainer |
从类 java.awt.Component 继承的嵌套类/接口 |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
字段摘要 | |
---|---|
protected int |
direction
箭头的方向。 |
从类 javax.swing.AbstractButton 继承的字段 |
---|
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY |
从类 javax.swing.JComponent 继承的字段 |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
从类 java.awt.Component 继承的字段 |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
从接口 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 |
从接口 java.awt.image.ImageObserver 继承的字段 |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
构造方法摘要 | |
---|---|
BasicArrowButton(int direction)
创建一个在指定方向上绘制其箭头的 BasicArrowButton 。 |
|
BasicArrowButton(int direction,
Color background,
Color shadow,
Color darkShadow,
Color highlight)
创建一个在指定方向上绘制其箭头并具有指定颜色的 BasicArrowButton 。 |
方法摘要 | |
---|---|
int |
getDirection()
返回箭头的方向。 |
Dimension |
getMaximumSize()
返回 BasicArrowButton 的最大大小。 |
Dimension |
getMinimumSize()
返回 BasicArrowButton 的最小大小。 |
Dimension |
getPreferredSize()
返回 BasicArrowButton 的首选大小。 |
boolean |
isFocusTraversable()
返回箭头按钮是否应该获取焦点。 |
void |
paint(Graphics g)
由 Swing 调用,以绘制组件。 |
void |
paintTriangle(Graphics g,
int x,
int y,
int size,
int direction,
boolean isEnabled)
绘制一个三角形。 |
void |
setDirection(int dir)
设置箭头的方向。 |
从类 javax.swing.JButton 继承的方法 |
---|
getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable, updateUI |
从类 javax.swing.AbstractButton 继承的方法 |
---|
actionPropertyChanged, addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, configurePropertiesFromAction, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setEnabled, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition |
从类 javax.swing.JComponent 继承的方法 |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
从类 java.awt.Container 继承的方法 |
---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
从类 java.awt.Component 继承的方法 |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
字段详细信息 |
---|
protected int direction
SwingConstants.NORTH
、SwingConstants.SOUTH
、SwingConstants.EAST
或 SwingConstants.WEST
之一。
构造方法详细信息 |
---|
public BasicArrowButton(int direction, Color background, Color shadow, Color darkShadow, Color highlight)
BasicArrowButton
。
direction
- 箭头的方向;SwingConstants.NORTH
、SwingConstants.SOUTH
、SwingConstants.EAST
或 SwingConstants.WEST
之一background
- 按钮的背景色shadow
- 阴影的颜色darkShadow
- 黑阴影的颜色highlight
- 高亮显示的颜色public BasicArrowButton(int direction)
BasicArrowButton
。
direction
- 箭头的方向;SwingConstants.NORTH
、SwingConstants.SOUTH
、SwingConstants.EAST
或 SwingConstants.WEST
之一方法详细信息 |
---|
public int getDirection()
direction
- 箭头的方向;SwingConstants.NORTH
、SwingConstants.SOUTH
、SwingConstants.EAST
或 SwingConstants.WEST
之一public void setDirection(int dir)
direction
- 箭头的方向;SwingConstants.NORTH
、SwingConstants.SOUTH
、SwingConstants.EAST
或 SwingConstants.WEST
之一public void paint(Graphics g)
JComponent
复制的描述paint
,而是应该使用 repaint
方法来安排重绘组件。
此方法实际上将绘制工作委托给三个受保护的方法:paintComponent
、paintBorder
和 paintChildren
。按列出的顺序调用这些方法,以确保子组件出现在组件本身的顶部。一般来说,不应在分配给边框的 insets 区域绘制组件及其子组件。子类可以始终重写此方法。只想特殊化 UI(外观)委托的 paint
方法的子类只需重写 paintComponent
。
JComponent
中的 paint
g
- 在其中进行绘制的 Graphics
上下文JComponent.paintComponent(java.awt.Graphics)
,
JComponent.paintBorder(java.awt.Graphics)
,
JComponent.paintChildren(java.awt.Graphics)
,
JComponent.getComponentGraphics(java.awt.Graphics)
,
JComponent.repaint(long, int, int, int, int)
public Dimension getPreferredSize()
BasicArrowButton
的首选大小。
JComponent
中的 getPreferredSize
JComponent.setPreferredSize(java.awt.Dimension)
,
ComponentUI
public Dimension getMinimumSize()
BasicArrowButton
的最小大小。
JComponent
中的 getMinimumSize
JComponent.setMinimumSize(java.awt.Dimension)
,
ComponentUI
public Dimension getMaximumSize()
BasicArrowButton
的最大大小。
JComponent
中的 getMaximumSize
JComponent.setMaximumSize(java.awt.Dimension)
,
ComponentUI
public boolean isFocusTraversable()
BasicArrowButton
用作复合组件(如 JScrollBar
和 JComboBox
)的子组件。因为通常是复合组件获取焦点,所以重写此方法以返回 false
。
Component
中的 isFocusTraversable
false
Component.setFocusable(boolean)
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled)
g
- 要在其上进行绘制的 Graphics
x
- x 坐标y
- y 坐标size
- 要绘制的三角形的大小direction
- 绘制箭头的方向;SwingConstants.NORTH
、SwingConstants.SOUTH
、SwingConstants.EAST
或 SwingConstants.WEST
之一isEnabled
- 是否已启用绘制箭头
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。