public static class ImageShape.Builder extends Object
Constructor and Description |
---|
Builder(File imageFile)
Constructs a builder of a shape from an image file.
|
Builder(String imageLocation)
Constructs a builder of a shape from a file at the given location
(resource or file).
|
Builder(String packageName,
String fileName)
Constructs a builder of a shape from a resource located in specified
package and given filename.
|
Builder(URL imageURL)
Constructs a builder of a shape from image with given URL.
|
Modifier and Type | Method and Description |
---|---|
boolean |
areFramesInRows()
Returns orientation of animation frames in the input image.
|
ImageShape |
createShape()
Creates an instance of the ImageTurtleShape according to current
setting of this builder.
|
int |
getFrameCount()
Returns the number of animation frames.
|
Long |
getFrameDuration()
Returns the frame duration in milliseconds for views with multiple
frames.
|
Point2D |
getShapeCenter()
Returns position of the shape center or null if it is not defined.
|
URL |
getURL()
Returns URL of the image.
|
int |
getViewCount()
Returns the number of views in the image.
|
boolean |
isTopLeftToTransparentColor()
Returns whether color of the pixel in the top-left corner of the
image is considered as a transparent color.
|
boolean |
isTransparentExcludedFromShape()
Returns whether transparent pixels of the shape image are considered
as excluded from the shape in sense of the isPointOfShape method.
|
ImageShape.Builder |
setFrameCount(int frameCount)
Sets the number of animation frames in the image.
|
ImageShape.Builder |
setFrameDuration(long frameDuration)
Sets the frame duration in milliseconds for views with multiple
frames.
|
ImageShape.Builder |
setFramesInRows(boolean framesInRows)
Sets orientation of animation frames in the input image.
|
ImageShape.Builder |
setShapeCenter(double x,
double y)
Sets the position of shape center.
|
ImageShape.Builder |
setTopLeftToTransparentColor(boolean recolor)
Sets whether color of the pixel in the top-left corner of the image
is considered as a transparent color.
|
ImageShape.Builder |
setTransparentExcludedFromShape(boolean excluded)
SetsReturns whether transparent pixels of the shape image are
considered as excluded from the shape in sense of the isPointOfShape
method.
|
ImageShape.Builder |
setViewCount(int viewCount)
Sets the number of views in the image.
|
public Builder(URL imageURL)
imageURL
- the URL of the image filepublic Builder(File imageFile)
imageFile
- the image filepublic Builder(String imageLocation)
imageLocation
- the string with location of an image (file or resource)public ImageShape.Builder setShapeCenter(double x, double y)
x
- the X-coordinate of the shape centery
- the Y-coordinate of the shape centerpublic Point2D getShapeCenter()
public ImageShape.Builder setFrameCount(int frameCount)
frameCount
- the number of animation framespublic int getFrameCount()
public ImageShape.Builder setViewCount(int viewCount)
viewCount
- the number of shape viewspublic int getViewCount()
public ImageShape.Builder setFrameDuration(long frameDuration)
frameDuration
- the frame duration in millisecondspublic Long getFrameDuration()
public URL getURL()
public ImageShape.Builder setFramesInRows(boolean framesInRows)
framesInRows
- true, if frames of a view are placed horizontally, false,
if verticallypublic boolean areFramesInRows()
public ImageShape createShape()
public boolean isTopLeftToTransparentColor()
public ImageShape.Builder setTopLeftToTransparentColor(boolean recolor)
recolor
- true, if recoloring has to be applied, false otherwisepublic boolean isTransparentExcludedFromShape()
public ImageShape.Builder setTransparentExcludedFromShape(boolean excluded)
excluded
- true, if transparent pixels are excluded from the shape,
false otherwise.Copyright © 2017. All rights reserved.