|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JButton
javax.swing.plaf.basic.BasicArrowButton
public class BasicArrowButton
A button that displays an arrow (triangle) that points SwingConstants.NORTH
,
SwingConstants.SOUTH
, SwingConstants.EAST
or SwingConstants.WEST
. This button is used by
the BasicComboBoxUI
class.
BasicComboBoxUI.createArrowButton()
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JButton |
---|
JButton.AccessibleJButton |
Nested classes/interfaces inherited from class javax.swing.AbstractButton |
---|
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected int |
direction
The direction that the arrow points. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
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 |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
BasicArrowButton(int direction)
Creates a new BasicArrowButton object with an arrow pointing
in the specified direction. |
|
BasicArrowButton(int direction,
Color background,
Color shadow,
Color darkShadow,
Color highlight)
Creates a new BasicArrowButton object with the given colors and direction. |
Method Summary | |
---|---|
int |
getDirection()
Returns the direction of the arrow (one of: SwingConstants.NORTH ,
SwingConstants.SOUTH , SwingConstants.EAST and SwingConstants.WEST ). |
Dimension |
getMaximumSize()
Returns the maximum size of the arrow button. |
Dimension |
getMinimumSize()
Returns the minimum size of the arrow button. |
Dimension |
getPreferredSize()
Returns the preferred size of the arrow button. |
boolean |
isFocusTraversable()
Returns whether the focus can traverse to this component. |
void |
paint(Graphics g)
Paints the arrow button. |
void |
paintTriangle(Graphics g,
int x,
int y,
int size,
int direction,
boolean isEnabled)
Paints a triangle with the given size, location and direction. |
void |
setDirection(int dir)
Sets the direction of the arrow. |
Methods inherited from class javax.swing.JButton |
---|
configurePropertiesFromAction, getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int direction
getDirection()
Constructor Detail |
---|
public BasicArrowButton(int direction)
BasicArrowButton
object with an arrow pointing
in the specified direction. If the direction
is not one of
the specified constants, no arrow is drawn.
direction
- The direction the arrow points in (one of:
SwingConstants.NORTH
, SwingConstants.SOUTH
, SwingConstants.EAST
and SwingConstants.WEST
).public BasicArrowButton(int direction, Color background, Color shadow, Color darkShadow, Color highlight)
direction
- The direction to point in (one of:
SwingConstants.NORTH
, SwingConstants.SOUTH
, SwingConstants.EAST
and SwingConstants.WEST
).background
- The background color.shadow
- The shadow color.darkShadow
- The dark shadow color.highlight
- The highlight color.Method Detail |
---|
public boolean isFocusTraversable()
false
.
isFocusTraversable
in class Component
false
.Component.setFocusable(boolean)
public int getDirection()
SwingConstants.NORTH
,
SwingConstants.SOUTH
, SwingConstants.EAST
and SwingConstants.WEST
).
public void setDirection(int dir)
dir
- The new direction of the arrow (one of: SwingConstants.NORTH
,
SwingConstants.SOUTH
, SwingConstants.EAST
and SwingConstants.WEST
).public void paint(Graphics g)
paint
in class JComponent
g
- The Graphics object to paint with.JComponent.paintImmediately(Rectangle)
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
Component.setPreferredSize(java.awt.Dimension)
,
Component.getPreferredSize()
,
Component.isPreferredSizeSet()
,
ComponentUI.getPreferredSize(JComponent)
public Dimension getMinimumSize()
getMinimumSize
in class JComponent
Component.setMinimumSize(java.awt.Dimension)
,
Component.getMinimumSize()
,
Component.isMinimumSizeSet()
,
ComponentUI.getMinimumSize(JComponent)
public Dimension getMaximumSize()
getMaximumSize
in class JComponent
Component.setMaximumSize(java.awt.Dimension)
,
Component.getMaximumSize()
,
Component.isMaximumSizeSet()
,
ComponentUI.getMaximumSize(JComponent)
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled)
g
- the graphics device.x
- the x-coordinate for the triangle's location.y
- the y-coordinate for the triangle's location.size
- the arrow size (depth).direction
- the direction of the arrow (one of: SwingConstants.NORTH
,
SwingConstants.SOUTH
, SwingConstants.EAST
and SwingConstants.WEST
).isEnabled
- if true
the arrow is drawn in the enabled
state, otherwise it is drawn in the disabled state.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |