DefaultPreviewPainter
public abstract class PreviewPainter extends Object
Constructor | Description |
---|---|
PreviewPainter() |
Modifier and Type | Method | Description |
---|---|---|
Dimension |
getPreviewWindowDimension(Container parent,
Component component,
int componentIndex) |
Returns the dimension for the component preview window.
|
int |
getPreviewWindowExtraDelay(Container parent,
Component component,
int componentIndex) |
Returns extra delay (in milliseconds) for showing the component preview
window.
|
int |
getUpdateCycle(Container parent,
Component component,
int componentIndex) |
If the result of
toUpdatePeriodically(Container, Component, int)
is true , returns the update cycle length in milliseconds. |
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.
|
boolean |
toUpdatePeriodically(Container parent,
Component component,
int componentIndex) |
Returns indication whether the thumbnail preview should be updated
periodically.
|
public void previewComponent(Container parent, Component component, int componentIndex, Graphics g, int x, int y, int w, int h)
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.public boolean hasPreview(Container parent, Component component, int componentIndex)
parent
- Component parent. May be null
.component
- Component. May be null
.componentIndex
- Component index in its parent. May be negative.true
if the specified component is previewable,
false
otherwise.public boolean hasPreviewWindow(Container parent, Component component, int componentIndex)
parent
- Component parent. May be null
.component
- Component. May be null
.componentIndex
- Component index in its parent. May be negative.true
if the specified component has a preview
window, false
otherwise.public Dimension getPreviewWindowDimension(Container parent, Component component, int componentIndex)
parent
- Component parent. May be null
.component
- Component. May be null
.componentIndex
- Component index in its parent. May be negative.public int getPreviewWindowExtraDelay(Container parent, Component component, int componentIndex)
parent
- Component parent. May be null
.component
- Component. May be null
.componentIndex
- Component index in its parent. May be negative.public boolean toUpdatePeriodically(Container parent, Component component, int componentIndex)
true
, then the
implementation of getUpdateCycle(Container, Component, int)
returns the refresh cycle length in milliseconds.parent
- Component parent. May be null
.component
- Component. May be null
.componentIndex
- Component index in its parent. May be negative.true
if the thumbnail preview of the specified
component should be updated periodically, false
otherwise.public int getUpdateCycle(Container parent, Component component, int componentIndex)
toUpdatePeriodically(Container, Component, int)
is true
, returns the update cycle length in milliseconds.parent
- Component parent. May be null
.component
- Component. May be null
.componentIndex
- Component index in its parent. May be negative.