public class SpriteReferenceOccurrence extends SpriteDirectiveOccurrence
SpriteReferenceDirective in a specific CSS file.| Modifier and Type | Field and Description |
|---|---|
String |
imagePath
CSS file relative path to the individual image to be added to a sprite.
|
boolean |
important
Indicates whether the original css property has been marked as important
|
SpriteReferenceDirective |
spriteReferenceDirective
The directive
|
cssFile, line| Constructor and Description |
|---|
SpriteReferenceOccurrence(SpriteReferenceDirective spriteReferenceDirective,
String imageFile,
String cssFile,
int line,
boolean important) |
| Modifier and Type | Method and Description |
|---|---|
SpriteReferenceReplacement |
buildReplacement(SpriteImageDirective.SpriteImageLayout layout,
int offset)
Returns the
SpriteReferenceReplacement corresponding to the occurrence,
taking into account the layout the the enclosing sprite and the offset at which the
individual image was rendered. |
int |
getRequiredHeight(BufferedImage image,
SpriteImageDirective.SpriteImageLayout layout)
Computes the minimum height the individual image will need when rendering.
|
int |
getRequiredWidth(BufferedImage image,
SpriteImageDirective.SpriteImageLayout layout)
Computes the minimum width the individual image will need when rendering.
|
BufferedImage |
render(BufferedImage image,
SpriteImageDirective.SpriteImageLayout layout,
int dimension)
Renders the individual image, including margins and repeats if any.
|
public final SpriteReferenceDirective spriteReferenceDirective
public final String imagePath
public final boolean important
public SpriteReferenceOccurrence(SpriteReferenceDirective spriteReferenceDirective, String imageFile, String cssFile, int line, boolean important)
public int getRequiredWidth(BufferedImage image, SpriteImageDirective.SpriteImageLayout layout)
public int getRequiredHeight(BufferedImage image, SpriteImageDirective.SpriteImageLayout layout)
public BufferedImage render(BufferedImage image, SpriteImageDirective.SpriteImageLayout layout, int dimension)
image - the individual image as read from the filelayout - the layout the enclosing spritedimension - height/width of a horizontal/vertical spritepublic SpriteReferenceReplacement buildReplacement(SpriteImageDirective.SpriteImageLayout layout, int offset)
SpriteReferenceReplacement corresponding to the occurrence,
taking into account the layout the the enclosing sprite and the offset at which the
individual image was rendered.Copyright © 2013 Carrot Search s.c.. All Rights Reserved.