Quaqua 8.0 2011-10-02

ch.randelshofer.quaqua.jaguar
Class QuaquaJaguarSeparatorUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.SeparatorUI
          extended by javax.swing.plaf.basic.BasicSeparatorUI
              extended by ch.randelshofer.quaqua.jaguar.QuaquaJaguarSeparatorUI
All Implemented Interfaces:
VisuallyLayoutable

public class QuaquaJaguarSeparatorUI
extends javax.swing.plaf.basic.BasicSeparatorUI
implements VisuallyLayoutable

A replacement for the AquaSeparatorUI.

This class provides the following workaround for an issue in Apple's implementation of the Aqua Look and Feel in Java 1.4.1:

Version:
$Id: QuaquaJaguarSeparatorUI.java 362 2010-11-21 17:35:47Z wrandelshofer $
Author:
Werner Randelshofer, Hausmatt 10, CH-6405 Immensee, Switzerland

Field Summary
 
Fields inherited from class javax.swing.plaf.basic.BasicSeparatorUI
highlight, shadow
 
Fields inherited from interface ch.randelshofer.quaqua.VisuallyLayoutable
CLIP_BOUNDS, COMPONENT_BOUNDS, TEXT_BOUNDS
 
Constructor Summary
QuaquaJaguarSeparatorUI()
          Creates a new instance of QuaquaSeparatorUI
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
           
 int getBaseline(javax.swing.JComponent c, int width, int height)
          Returns the baseline for the specified component, or -1 if the baseline can not be determined.
 java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
           
 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
           
 java.awt.Rectangle getVisualBounds(javax.swing.JComponent c, int type, int width, int height)
          Returns the visual bounds for the specified component, or null if the visual bounds can not be determined.
 java.awt.Insets getVisualMargin(javax.swing.JSeparator tc)
           
protected  void installDefaults(javax.swing.JSeparator s)
           
 void paint(java.awt.Graphics gr, javax.swing.JComponent c)
           
 
Methods inherited from class javax.swing.plaf.basic.BasicSeparatorUI
getMaximumSize, installListeners, installUI, uninstallDefaults, uninstallListeners, uninstallUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaselineResizeBehavior, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuaquaJaguarSeparatorUI

public QuaquaJaguarSeparatorUI()
Creates a new instance of QuaquaSeparatorUI

Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)

installDefaults

protected void installDefaults(javax.swing.JSeparator s)
Overrides:
installDefaults in class javax.swing.plaf.basic.BasicSeparatorUI

paint

public void paint(java.awt.Graphics gr,
                  javax.swing.JComponent c)
Overrides:
paint in class javax.swing.plaf.basic.BasicSeparatorUI

getMinimumSize

public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
Overrides:
getMinimumSize in class javax.swing.plaf.basic.BasicSeparatorUI

getPreferredSize

public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
Overrides:
getPreferredSize in class javax.swing.plaf.basic.BasicSeparatorUI

getVisualMargin

public java.awt.Insets getVisualMargin(javax.swing.JSeparator tc)

getBaseline

public int getBaseline(javax.swing.JComponent c,
                       int width,
                       int height)
Description copied from interface: VisuallyLayoutable
Returns the baseline for the specified component, or -1 if the baseline can not be determined. The baseline is measured from the top of the component.

Specified by:
getBaseline in interface VisuallyLayoutable
Overrides:
getBaseline in class javax.swing.plaf.ComponentUI
Parameters:
c - JComponent to calculate baseline for
width - Width of the component to determine baseline for.
height - Height of the component to determine baseline for.
Returns:
baseline for the specified component

getVisualBounds

public java.awt.Rectangle getVisualBounds(javax.swing.JComponent c,
                                          int type,
                                          int width,
                                          int height)
Description copied from interface: VisuallyLayoutable
Returns the visual bounds for the specified component, or null if the visual bounds can not be determined.

Specified by:
getVisualBounds in interface VisuallyLayoutable
Parameters:
c - JComponent to calculate visual margin for
type - The type of the visual margin.
width - Width of the component
height - Height of the component
Returns:
The visual bounds in component coordinates.

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.