javax.swing.plaf.metal

Class MetalScrollButton

public class MetalScrollButton extends BasicArrowButton

A button used by the {@link MetalScrollBarUI}. The button appearance varies according to the button direction, whether or not it is part of a "free standing" scroll bar, and the current state of the button.
Constructor Summary
MetalScrollButton(int direction, int width, boolean freeStanding)
Creates a new button.
Method Summary
intgetButtonWidth()
Returns the button width.
DimensiongetMaximumSize()
Returns the maximum size for the button.
DimensiongetMinimumSize()
Returns the minimum size for the button.
DimensiongetPreferredSize()
Returns the preferred size for the button, which varies depending on the direction of the button and whether or not it is free standing.
voidpaint(Graphics g)
Paints the button.
voidsetFreeStanding(boolean freeStanding)
Sets the free standing flag.

Constructor Detail

MetalScrollButton

public MetalScrollButton(int direction, int width, boolean freeStanding)
Creates a new button.

Parameters: direction the direction (this should be one of {@link #NORTH}, {@link #SOUTH}, {@link #EAST} and {@link #WEST}, but this is not enforced). width the button width. freeStanding a flag indicating whether the scroll button is free standing or not.

Method Detail

getButtonWidth

public int getButtonWidth()
Returns the button width.

Returns: The button width.

getMaximumSize

public Dimension getMaximumSize()
Returns the maximum size for the button.

Returns: Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE).

getMinimumSize

public Dimension getMinimumSize()
Returns the minimum size for the button.

Returns: The minimum size for the button.

getPreferredSize

public Dimension getPreferredSize()
Returns the preferred size for the button, which varies depending on the direction of the button and whether or not it is free standing.

Returns: The preferred size.

paint

public void paint(Graphics g)
Paints the button.

Parameters: g the graphics device.

setFreeStanding

public void setFreeStanding(boolean freeStanding)
Sets the free standing flag. This controls how the button border is drawn.

Parameters: freeStanding the new value of the flag.