javax.swing.plaf.basic

Class BasicSeparatorUI

public class BasicSeparatorUI extends SeparatorUI

The Basic Look and Feel UI delegate for JSeparator.
Field Summary
protected Colorhighlight
The highlight color.
protected Colorshadow
The shadow color.
Method Summary
static ComponentUIcreateUI(JComponent c)
Creates a new UI delegate for the given JComponent.
DimensiongetMaximumSize(JComponent c)
This method returns the maximum size of the JComponent.
DimensiongetMinimumSize(JComponent c)
This method returns the minimum size of the JComponent.
DimensiongetPreferredSize(JComponent c)
This method returns the preferred size of the JComponent.
protected voidinstallDefaults(JSeparator s)
This method installs the defaults that are given by the Basic Look and Feel.
protected voidinstallListeners(JSeparator s)
This method installs any listeners that need to be attached to the JSeparator or any of its components.
voidinstallUI(JComponent c)
This method installs the UI for the given JComponent.
voidpaint(Graphics g, JComponent c)
The separator is made of two lines.
protected voiduninstallDefaults(JSeparator s)
This method removes the defaults that were given by the Basic Look and Feel.
protected voiduninstallListeners(JSeparator s)
This method uninstalls any listeners that were installed during the install UI process.
voiduninstallUI(JComponent c)
Uninstalls the UI for the given JComponent.

Field Detail

highlight

protected Color highlight
The highlight color.

shadow

protected Color shadow
The shadow color.

Method Detail

createUI

public static ComponentUI createUI(JComponent c)
Creates a new UI delegate for the given JComponent.

Parameters: c The JComponent to create a delegate for.

Returns: A new BasicSeparatorUI.

getMaximumSize

public Dimension getMaximumSize(JComponent c)
This method returns the maximum size of the JComponent.

Parameters: c The JComponent to measure.

Returns: The maximum size.

getMinimumSize

public Dimension getMinimumSize(JComponent c)
This method returns the minimum size of the JComponent.

Parameters: c The JComponent to measure.

Returns: The minimum size.

getPreferredSize

public Dimension getPreferredSize(JComponent c)
This method returns the preferred size of the JComponent.

Parameters: c The JComponent to measure.

Returns: The preferred size.

installDefaults

protected void installDefaults(JSeparator s)
This method installs the defaults that are given by the Basic Look and Feel.

Parameters: s The JSeparator that is being installed.

installListeners

protected void installListeners(JSeparator s)
This method installs any listeners that need to be attached to the JSeparator or any of its components.

Parameters: s The JSeparator that is being installed.

installUI

public void installUI(JComponent c)
This method installs the UI for the given JComponent. This can include installing defaults, listeners, and initializing any instance data.

Parameters: c The JComponent that is having this UI installed.

paint

public void paint(Graphics g, JComponent c)
The separator is made of two lines. The top line will be the shadow color (or left line if it's vertical). The bottom or right line will be the highlight color. The two lines will be centered inside the bounds box. If the separator is horizontal, then it will be vertically centered, or if it's vertical, it will be horizontally centered.

Parameters: g The Graphics object to paint with c The JComponent to paint.

uninstallDefaults

protected void uninstallDefaults(JSeparator s)
This method removes the defaults that were given by the Basic Look and Feel.

Parameters: s The JSeparator that is being uninstalled.

uninstallListeners

protected void uninstallListeners(JSeparator s)
This method uninstalls any listeners that were installed during the install UI process.

Parameters: s The JSeparator that is being uninstalled.

uninstallUI

public void uninstallUI(JComponent c)
Uninstalls the UI for the given JComponent. This method reverses what was done when installing the UI on the JComponent.

Parameters: c The JComponent that is having this UI uninstalled.