public class BasicThumbnail extends Thumbnail
A BasicThumbnail consists of a series of z-ordered layers, where each layer is rendered above the previous. Each layer is a BasicThumbnail.Layer object, and has an associated set of insets. Although most layers support a variable degree of curvature (for rounded corners), the insets reflect the official size of the layer. When scaling an image to fit within a maximum thumbnail size: these insets are combined to calculate the size the source image has to be scaled to. (For example: if the maximum thumbnail size is 64x64, but each side of this thumbnail has 5 pixels of padding, then the image will be scaled to fit within a 54x54 area.)
| Modifier and Type | Class and Description |
|---|---|
static class |
BasicThumbnail
A is a border of varying thickness and curvature.
|
static class |
BasicThumbnail
This layer paints the actual scaled source image.
|
static interface |
BasicThumbnail
A layer of this thumbnail.
|
static class |
BasicThumbnail
This is a set of concentric rounded rectangles used to paint a shadow.
|
Thumbnail.ImageSource | Modifier and Type | Field and Description |
|---|---|
static BasicThumbnail |
Aqua
A thumbnail format that resembles the icon observed on Mac 10.7.4 in the Finder for image thumbnails.
|
protected BasicThumbnail |
layers
The layers of this thumbnail.
|
float |
theta
The rotation (in radians) of this thumbnail.
|
protected Insets |
totalInsets
A cached record of the total insets of all the layers.
|
Plain, qualityHints| Constructor and Description |
|---|
BasicThumbnail(BasicThumbnail
Create a BasicThumbnail with no rotation.
|
BasicThumbnail(BasicThumbnail
Create a BasicThumbnail.
|
BasicThumbnail(BasicThumbnail
Create a BasicThumbnail.
|
| Modifier and Type | Method and Description |
|---|---|
protected BufferedImage |
create(Thumbnail
Create a thumbnail from an
ImageSource.
|
boolean |
equals(Object
|
BasicThumbnail |
getElement(int index)
Returns a specific layer.
|
int |
getLayerCount()
Return the number of layers in this thumbnail.
|
BasicThumbnail |
getLayers()
Returns a copy of all the layers in this object.
|
static BasicThumbnail |
getShadow(int thickness)
Create a very simple thumbnail with a subtle shadow.
|
int |
hashCode()
|
String |
toString()
|
public static BasicThumbnailAqua
Specifically: this consists of a light 2-pixel shadow, 1-pixel a gray frame, then 2 pixels of white, then another 1-pixel frame. This is not intended to be a perfect replica, but it is similar in appearance.
protected final BasicThumbnail.Layer [] layers
protected final InsetstotalInsets
public final float theta
public BasicThumbnail(BasicThumbnail.Layer [] e)
If there isn't an Image layer in the list of layers provided: then a plain Image layer (with no curvature and a white background) is added.
public BasicThumbnail(BasicThumbnail.Layer [] e, float theta)
If there isn't an Image layer in the list of layers provided: then a plain Image layer (with no curvature and a white background) is added.
theta - the rotation of this thumbnail.
public BasicThumbnail(BasicThumbnail.Layer [] e, float theta, boolean addImageIfMissing)
theta - the rotation of this thumbnail.
addImageIfMissing - if an Image layer is missing and this boolean is true: a plain Image layer is added. This is generally to be true except in certain (rare) debugging instances.
public static BasicThumbnailgetShadow(int thickness)
thickness - the width of the shadow.
public boolean equals(Objectobj)
protected BufferedImagecreate(Thumbnail .ImageSource source, Dimension maxSize)
Thumbnail
ImageSource.
create in class
Thumbnail
source - the image source.
maxSize - the maximum dimensions of the thumbnail. Note the returned thumbnail may be smaller than these bounds. For example: if you have a 4:3 landscape-oriented picture and the maximum size is 64x64 pixels, then the return image will be 64 pixels wide and approximately 48 pixels tall. (It may not be exactly 48 pixels tall, depending on the decorations this thumbnail format may add.)
If the source image is already smaller than the maxSize, then the source image is not scaled to create this thumbnail.
public int hashCode()
public StringtoString()
public int getLayerCount()
public BasicThumbnail.Layer getElement(int index)
public BasicThumbnail.Layer [] getLayers()