Quaqua 7.4.2 2011-07-05

ch.randelshofer.quaqua
Interface VisuallyLayoutable

All Known Implementing Classes:
QuaquaButtonUI, QuaquaCheckBoxUI, QuaquaComboBoxUI, QuaquaEditorPaneUI, QuaquaFormattedTextFieldUI, QuaquaJaguarSeparatorUI, QuaquaJaguarTabbedPaneUI, QuaquaLabelUI, QuaquaPantherSeparatorUI, QuaquaPasswordFieldUI, QuaquaRadioButtonUI, QuaquaScrollPaneUI, QuaquaSliderUI, QuaquaSpinnerUI, QuaquaTextAreaUI, QuaquaTextFieldUI, QuaquaTextPaneUI, QuaquaToggleButtonUI

public interface VisuallyLayoutable

This interface is implemented by user interface delegates, which support layouts based on visual criteria.

Warning: This is an experimental API. Expect substantial changes on each release.

Version:
$Id: VisuallyLayoutable.java 361 2010-11-21 11:19:20Z wrandelshofer $
Author:
Werner Randelshofer

Field Summary
static int CLIP_BOUNDS
          The clip bounds of a component.
static int COMPONENT_BOUNDS
          The visually perceived bounds of a component, e.g.
static int TEXT_BOUNDS
          The visually perceived bounds of the text on the component.
 
Method Summary
 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.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.
 

Field Detail

CLIP_BOUNDS

static final int CLIP_BOUNDS
The clip bounds of a component.

See Also:
Constant Field Values

COMPONENT_BOUNDS

static final int COMPONENT_BOUNDS
The visually perceived bounds of a component, e.g. on a JButton with isBorderDrawn = true: the borderline except cast shadows. e.g. on a JLabel with an icon: the borderline of the icon plus the TEXT_BOUNDS of the text on the JLabel e.g. on a JLabel without an icon: the TEXT_BOUNDS of the text on the JLabel If COMPONENT_BOUNDS is not applicable, CLIP_BOUNDS are used instead.

See Also:
Constant Field Values

TEXT_BOUNDS

static final int TEXT_BOUNDS
The visually perceived bounds of the text on the component. If TEXT_BOUNDS is not applicable, COMPONENT_BOUNDS are used instead.

See Also:
Constant Field Values
Method Detail

getBaseline

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. The baseline is measured from the top of the component.

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

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.

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.