javax.swing.plaf.basic
public class BasicArrowButton extends JButton implements SwingConstants
See Also: BasicComboBoxUI
Field Summary | |
---|---|
protected int | direction
The direction that the arrow points.
|
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: {@link #NORTH},
{@link #SOUTH}, {@link #EAST} and {@link #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.
|
See Also: getDirection
BasicArrowButton
object with an arrow pointing
in the specified direction. If the direction
is not one of
the specified constants, no arrow is drawn.
Parameters: direction The direction the arrow points in (one of: {@link #NORTH}, {@link #SOUTH}, {@link #EAST} and {@link #WEST}).
Parameters: direction The direction to point in (one of: {@link #NORTH}, {@link #SOUTH}, {@link #EAST} and {@link #WEST}). background The background color. shadow The shadow color. darkShadow The dark shadow color. highlight The highlight color.
Returns: The direction of the arrow.
Returns: The maximum size (always Integer.MAX_VALUE x Integer.MAX_VALUE).
Returns: The minimum size (always 5 x 5).
Returns: The preferred size (always 16 x 16).
false
.
Returns: false
.
Parameters: g The Graphics object to paint with.
Parameters: 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: {@link #NORTH},
{@link #SOUTH}, {@link #EAST} and {@link #WEST}). isEnabled if true
the arrow is drawn in the enabled
state, otherwise it is drawn in the disabled state.
Parameters: dir The new direction of the arrow (one of: {@link #NORTH}, {@link #SOUTH}, {@link #EAST} and {@link #WEST}).