Package org.pushingpixels.lafwidget.preview

# Class DefaultPreviewPainter

java.lang.Object
org.pushingpixels.lafwidget.preview.PreviewPainter
org.pushingpixels.lafwidget.preview.DefaultPreviewPainter

Direct Known Subclasses:
  `InternalFramePreviewPainter`

public class DefaultPreviewPainter extends PreviewPainter
Default implementation of the component preview painter. The component preview is a scaled-down (as necessary) thumbnail of the relevant component.

## Constructor Summary

Constructors
Constructor
Description
`DefaultPreviewPainter()`

## Method Summary

Modifier and Type
Method
Description
`Dimension`
`getPreviewWindowDimension(Container parent, Component component, int componentIndex)`
Returns the dimension for the component preview window.
`boolean`
`hasPreview(Container parent, Component component, int componentIndex)`
Checks whether the specified component is previewable.
`boolean`
`hasPreviewWindow(Container parent, Component component, int componentIndex)`
Checks whether the specified component has a preview window.
`void`
`previewComponent(Container parent, Component component, int componentIndex, Graphics g, int x, int y, int w, int h)`
Draws a component preview on the specified graphics.

### Methods inherited from class org.pushingpixels.lafwidget.preview.PreviewPainter

`getPreviewWindowExtraDelay, getUpdateCycle, toUpdatePeriodically`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DefaultPreviewPainter

public DefaultPreviewPainter()

## Method Details

### hasPreview

public boolean hasPreview(Container parent, Component component, int componentIndex)
Description copied from class: `PreviewPainter`
Checks whether the specified component is previewable.

Overrides:
  `hasPreview` in class `PreviewPainter`
Parameters:
  `parent` - Component parent. May be `null`.
  `component` - Component. May be `null`.
  `componentIndex` - Component index in its parent. May be negative.
Returns:
  `true` if the specified component is previewable, `false` otherwise.

### previewComponent

public void previewComponent(Container parent, Component component, int componentIndex, Graphics g, int x, int y, int w, int h)
Description copied from class: `PreviewPainter`
Draws a component preview on the specified graphics.

Overrides:
  `previewComponent` in class `PreviewPainter`
Parameters:
  `parent` - Component parent. May be `null`.
  `component` - Component. May be `null`.
  `componentIndex` - Component index in its parent. May be negative.
  `g` - Graphics context.
  `x` - X coordinate of the preview area.
  `y` - Y coordinate of the preview area.
  `w` - Width of the preview area.
  `h` - Height of the preview area.

### hasPreviewWindow

public boolean hasPreviewWindow(Container parent, Component component, int componentIndex)
Description copied from class: `PreviewPainter`
Checks whether the specified component has a preview window.

Overrides:
  `hasPreviewWindow` in class `PreviewPainter`
Parameters:
  `parent` - Component parent. May be `null`.
  `component` - Component. May be `null`.
  `componentIndex` - Component index in its parent. May be negative.
Returns:
  `true` if the specified component has a preview window, `false` otherwise.

### getPreviewWindowDimension

public Dimension getPreviewWindowDimension(Container parent, Component component, int componentIndex)
Description copied from class: `PreviewPainter`
Returns the dimension for the component preview window.

Overrides:
  `getPreviewWindowDimension` in class `PreviewPainter`
Parameters:
  `parent` - Component parent. May be `null`.
  `component` - Component. May be `null`.
  `componentIndex` - Component index in its parent. May be negative.
Returns:
  Dimension of the component preview window.