APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.plaf.synth

public Class SynthSeparatorUI

extends SeparatorUI
implements PropertyChangeListener, SynthUI
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.synth.SynthUI, javax.swing.plaf.synth.SynthConstants, java.beans.PropertyChangeListener, java.util.EventListener
Imports
java.beans.*, javax.swing.*, java.awt.Dimension, .Graphics, .Insets, javax.swing.plaf.ComponentUI, .SeparatorUI, .UIResource, .DimensionUIResource

Provides the Synth L&F UI delegate for javax.swing.JSeparator.
Authors
Shannon Hickey, Joshua Outwater
Since
1.7

Field Summary

Modifier and TypeField and Description
private SynthStyle

Constructor Summary

AccessConstructor and Description
public
SynthSeparatorUI()

Constructs a SynthSeparatorUI.

Method Summary

Modifier and TypeMethod and Description
public static ComponentUI

Returns:

the UI object
createUI
(JComponent
component to create UI object for
c
)

Hides javax.swing.plaf.ComponentUI.createUI.

Creates a new UI object for the given component.

public SynthContext
getContext(JComponent c)

Implements javax.swing.plaf.synth.SynthUI.getContext.

Returns the Context for the specified component.

private SynthContext
getContext(JComponent c, int state)

public Dimension
getMaximumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMaximumSize.

Returns the specified component's maximum size appropriate for the look and feel.

public Dimension
getMinimumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMinimumSize.

Returns the specified component's minimum size appropriate for the look and feel.

public Dimension
getPreferredSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getPreferredSize.

Returns the specified component's preferred size appropriate for the look and feel.

public void
installDefaults(JSeparator
specifies the JSeparator for the installed LookAndFeel.
c
)

Installs default setting.

public void
installListeners(JSeparator
specifies the JSeparator for the installed LookAndFeel.
c
)

Installs listeners.

public void
installUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel.

public void
paint(Graphics
the Graphics object used for painting
g
,
JComponent
the component being painted
c
)

Overrides javax.swing.plaf.ComponentUI.paint.

Paints the specified component according to the Look and Feel.

protected void
paint(SynthContext
context for the component being painted
context
,
Graphics
the Graphics object used for painting
g
)

Paints the specified component.

public void
paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthUI.paintBorder.

Paints the border.

public void
propertyChange(PropertyChangeEvent evt)

Implements java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

public void
uninstallDefaults(JSeparator
specifies the JSeparator for the (un)installed LookAndFeel.
c
)

Uninstalls default setting.

public void
uninstallListeners(JSeparator
specifies the JSeparator for the (un)installed LookAndFeel.
c
)

Uninstalls listeners.

public void
uninstallUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

Reverses configuration which was done on the specified component during installUI.

public void
update(Graphics
the Graphics object used for painting
g
,
JComponent
the component being painted
c
)

Overrides javax.swing.plaf.ComponentUI.update.

Notifies this UI delegate to repaint the specified component.

private void

Field Detail

styleback to summary
private SynthStyle style

Constructor Detail

SynthSeparatorUIback to summary
public SynthSeparatorUI()

Constructs a SynthSeparatorUI.

Method Detail

createUIback to summary
public static ComponentUI createUI(JComponent c)

Hides javax.swing.plaf.ComponentUI.createUI.

Creates a new UI object for the given component.

Parameters
c:JComponent

component to create UI object for

Returns:ComponentUI

the UI object

getContextback to summary
public SynthContext getContext(JComponent c)

Implements javax.swing.plaf.synth.SynthUI.getContext.

Doc from javax.swing.plaf.synth.SynthUI.getContext.

Returns the Context for the specified component.

Annotations
@Override
getContextback to summary
private SynthContext getContext(JComponent c, int state)
getMaximumSizeback to summary
public Dimension getMaximumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMaximumSize.

Doc from javax.swing.plaf.ComponentUI.getMaximumSize.

Returns the specified component's maximum size appropriate for the look and feel. If null is returned, the maximum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokes getPreferredSize and returns that value.

Annotations
@Override
getMinimumSizeback to summary
public Dimension getMinimumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMinimumSize.

Doc from javax.swing.plaf.ComponentUI.getMinimumSize.

Returns the specified component's minimum size appropriate for the look and feel. If null is returned, the minimum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokes getPreferredSize and returns that value.

Annotations
@Override
getPreferredSizeback to summary
public Dimension getPreferredSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getPreferredSize.

Doc from javax.swing.plaf.ComponentUI.getPreferredSize.

Returns the specified component's preferred size appropriate for the look and feel. If null is returned, the preferred size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method returns null.

Annotations
@Override
installDefaultsback to summary
public void installDefaults(JSeparator c)

Installs default setting. This method is called when a LookAndFeel is installed.

Parameters
c:JSeparator

specifies the JSeparator for the installed LookAndFeel.

installListenersback to summary
public void installListeners(JSeparator c)

Installs listeners. This method is called when a LookAndFeel is installed.

Parameters
c:JSeparator

specifies the JSeparator for the installed LookAndFeel.

installUIback to summary
public void installUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.installUI.

Doc from javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel. This method is invoked when the ComponentUI instance is being installed as the UI delegate on the specified component. This method should completely configure the component for the look and feel, including the following:

  1. Install default property values for color, fonts, borders, icons, opacity, etc. on the component. Whenever possible, property values initialized by the client program should not be overridden.
  2. Install a LayoutManager on the component if necessary.
  3. Create/add any required sub-components to the component.
  4. Create/install event listeners on the component.
  5. Create/install a PropertyChangeListener on the component in order to detect and respond to component property changes appropriately.
  6. Install keyboard UI (mnemonics, traversal, etc.) on the component.
  7. Initialize any appropriate instance data.
Annotations
@Override
paintback to summary
public void paint(Graphics g, JComponent c)

Overrides javax.swing.plaf.ComponentUI.paint.

Paints the specified component according to the Look and Feel.

This method is not used by Synth Look and Feel. Painting is handled by the paint(SynthContext, Graphics) method.

Parameters
g:Graphics

the Graphics object used for painting

c:JComponent

the component being painted

Annotations
@Override
See Also
paint(SynthContext, Graphics)
paintback to summary
protected void paint(SynthContext context, Graphics g)

Paints the specified component.

Parameters
context:SynthContext

context for the component being painted

g:Graphics

the Graphics object used for painting

See Also
update(Graphics, JComponent)
paintBorderback to summary
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthUI.paintBorder.

Doc from javax.swing.plaf.synth.SynthUI.paintBorder.

Paints the border.

Annotations
@Override
propertyChangeback to summary
public void propertyChange(PropertyChangeEvent evt)

Implements java.beans.PropertyChangeListener.propertyChange.

Doc from java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

uninstallDefaultsback to summary
public void uninstallDefaults(JSeparator c)

Uninstalls default setting. This method is called when a LookAndFeel is uninstalled.

Parameters
c:JSeparator

specifies the JSeparator for the (un)installed LookAndFeel.

uninstallListenersback to summary
public void uninstallListeners(JSeparator c)

Uninstalls listeners. This method is called when a LookAndFeel is uninstalled.

Parameters
c:JSeparator

specifies the JSeparator for the (un)installed LookAndFeel.

uninstallUIback to summary
public void uninstallUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

Doc from javax.swing.plaf.ComponentUI.uninstallUI.

Reverses configuration which was done on the specified component during installUI. This method is invoked when this UIComponent instance is being removed as the UI delegate for the specified component. This method should undo the configuration performed in installUI, being careful to leave the JComponent instance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:

  1. Remove any UI-set borders from the component.
  2. Remove any UI-set layout managers on the component.
  3. Remove any UI-added sub-components from the component.
  4. Remove any UI-added event/property listeners from the component.
  5. Remove any UI-installed keyboard UI from the component.
  6. Nullify any allocated instance data objects to allow for GC.
Annotations
@Override
updateback to summary
public void update(Graphics g, JComponent c)

Overrides javax.swing.plaf.ComponentUI.update.

Notifies this UI delegate to repaint the specified component. This method paints the component background, then calls the paint(SynthContext, Graphics) method.

In general, this method does not need to be overridden by subclasses. All Look and Feel rendering code should reside in the paint method.

Parameters
g:Graphics

the Graphics object used for painting

c:JComponent

the component being painted

Annotations
@Override
See Also
paint(SynthContext, Graphics)
updateStyleback to summary
private void updateStyle(JSeparator sep)