declare namespace javax {
namespace swing {
namespace plaf {
/**
* The base class for all UI delegate objects in the Swing pluggable
* look and feel architecture. The UI delegate object for a Swing
* component is responsible for implementing the aspects of the
* component that depend on the look and feel.
* The JComponent
class
* invokes methods from this class in order to delegate operations
* (painting, layout calculations, etc.) that may vary depending on the
* look and feel installed. Client programs should not invoke methods
* on this class directly.
* @see javax.swing.JComponent
* @see javax.swing.UIManager
*/
// @ts-ignore
abstract class ComponentUI extends java.lang.Object {
/**
* Sole constructor. (For invocation by subclass constructors,
* typically implicit.)
*/
// @ts-ignore
constructor()
/**
* 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:
*
LayoutManager
on the component if necessary.
* PropertyChangeListener
on the component in order
* to detect and respond to component property changes appropriately.
* 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:
* ComponentUI.update
method when
* the specified component is being painted. Subclasses should override
* this method and use the specified Graphics
object to
* render the content of the component.
* @param g the Graphics
context in which to paint
* @param c the component being painted;
* this argument is often ignored,
* but might be used if the UI object is stateless
* and shared by multiple components
* @see #update
*/
// @ts-ignore
public paint(g: java.awt.Graphics, c: javax.swing.JComponent): void
/**
* Notifies this UI delegate that it is time to paint the specified
* component. This method is invoked by JComponent
* when the specified component is being painted.
* By default this method fills the specified component with
* its background color if its {@code opaque} property is {@code true},
* and then immediately calls {@code paint}. In general this method need
* not be overridden by subclasses; all look-and-feel rendering code should
* reside in the {@code paint} method.
* @param g the Graphics
context in which to paint
* @param c the component being painted;
* this argument is often ignored,
* but might be used if the UI object is stateless
* and shared by multiple components
* @see #paint
* @see javax.swing.JComponent#paintComponent
*/
// @ts-ignore
public update(g: java.awt.Graphics, c: javax.swing.JComponent): void
/**
* 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
.
* @param c the component whose preferred size is being queried;
* this argument is often ignored,
* but might be used if the UI object is stateless
* and shared by multiple components
* @see javax.swing.JComponent#getPreferredSize
* @see java.awt.LayoutManager#preferredLayoutSize
*/
// @ts-ignore
public getPreferredSize(c: javax.swing.JComponent): java.awt.Dimension
/**
* 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.
* @param c the component whose minimum size is being queried;
* this argument is often ignored,
* but might be used if the UI object is stateless
* and shared by multiple components
* @return a Dimension
object or null
* @see javax.swing.JComponent#getMinimumSize
* @see java.awt.LayoutManager#minimumLayoutSize
* @see #getPreferredSize
*/
// @ts-ignore
public getMinimumSize(c: javax.swing.JComponent): java.awt.Dimension
/**
* 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.
* @param c the component whose maximum size is being queried;
* this argument is often ignored,
* but might be used if the UI object is stateless
* and shared by multiple components
* @return a Dimension
object or null
* @see javax.swing.JComponent#getMaximumSize
* @see java.awt.LayoutManager2#maximumLayoutSize
*/
// @ts-ignore
public getMaximumSize(c: javax.swing.JComponent): java.awt.Dimension
/**
* Returns true
if the specified x,y location is
* contained within the look and feel's defined shape of the specified
* component. x
and y
are defined to be relative
* to the coordinate system of the specified component. Although
* a component's bounds
is constrained to a rectangle,
* this method provides the means for defining a non-rectangular
* shape within those bounds for the purpose of hit detection.
* @param c the component where the x,y location is being queried;
* this argument is often ignored,
* but might be used if the UI object is stateless
* and shared by multiple components
* @param x the x coordinate of the point
* @param y the y coordinate of the point
* @see javax.swing.JComponent#contains
* @see java.awt.Component#contains
*/
// @ts-ignore
public contains(c: javax.swing.JComponent, x: number /*int*/, y: number /*int*/): boolean
/**
* Returns an instance of the UI delegate for the specified component.
* Each subclass must provide its own static createUI
* method that returns an instance of that UI delegate subclass.
* If the UI delegate subclass is stateless, it may return an instance
* that is shared by multiple components. If the UI delegate is
* stateful, then it should return a new instance per component.
* The default implementation of this method throws an error, as it
* should never be invoked.
*/
// @ts-ignore
public static createUI(c: javax.swing.JComponent): javax.swing.plaf.ComponentUI
/**
* Returns the baseline. The baseline is measured from the top of
* the component. This method is primarily meant for
* LayoutManager
s to align components along their
* baseline. A return value less than 0 indicates this component
* does not have a reasonable baseline and that
* LayoutManager
s should not align this component on
* its baseline.
*
* This method returns -1. Subclasses that have a meaningful baseline
* should override appropriately.
* @param c JComponent
baseline is being requested for
* @param width the width to get the baseline for
* @param height the height to get the baseline for
* @throws NullPointerException if c
is null
* @throws IllegalArgumentException if width or height is < 0
* @return baseline or a value < 0 indicating there is no reasonable
* baseline
* @see javax.swing.JComponent#getBaseline(int,int)
* @since 1.6
*/
// @ts-ignore
public getBaseline(c: javax.swing.JComponent, width: number /*int*/, height: number /*int*/): number /*int*/
/**
* Returns an enum indicating how the baseline of he component
* changes as the size changes. This method is primarily meant for
* layout managers and GUI builders.
*
* This method returns BaselineResizeBehavior.OTHER
.
* Subclasses that support a baseline should override appropriately.
* @param c JComponent
to return baseline resize behavior for
* @return an enum indicating how the baseline changes as the component
* size changes
* @throws NullPointerException if c
is null
* @see javax.swing.JComponent#getBaseline(int, int)
* @since 1.6
*/
// @ts-ignore
public getBaselineResizeBehavior(c: javax.swing.JComponent): java.awt.Component.BaselineResizeBehavior
/**
* Returns the number of accessible children in the object. If all
* of the children of this object implement Accessible
,
* this
* method should return the number of children of this object.
* UIs might wish to override this if they present areas on the
* screen that can be viewed as components, but actual components
* are not used for presenting those areas.
* Note: As of v1.3, it is recommended that developers call
* Component.AccessibleAWTComponent.getAccessibleChildrenCount()
instead
* of this method.
* @see #getAccessibleChild
* @return the number of accessible children in the object
*/
// @ts-ignore
public getAccessibleChildrenCount(c: javax.swing.JComponent): number /*int*/
/**
* Returns the i
th Accessible
child of the object.
* UIs might need to override this if they present areas on the
* screen that can be viewed as components, but actual components
* are not used for presenting those areas.
*
* Note: As of v1.3, it is recommended that developers call
* Component.AccessibleAWTComponent.getAccessibleChild()
instead of
* this method.
* @see #getAccessibleChildrenCount
* @param i zero-based index of child
* @return the i
th Accessible
child of the object
*/
// @ts-ignore
public getAccessibleChild(c: javax.swing.JComponent, i: number /*int*/): javax.accessibility.Accessible
}
}
}
}