org.fit.cssbox.layout
Class BackgroundImage
java.lang.Object
org.fit.cssbox.layout.ReplacedContent
org.fit.cssbox.layout.ContentImage
org.fit.cssbox.layout.BackgroundImage
- All Implemented Interfaces:
- ImageObserver
public class BackgroundImage
- extends ContentImage
An image placed at the element background together with its position and repeating.
- Author:
- burgetr
Fields inherited from class org.fit.cssbox.layout.ContentImage |
abort, caching, container, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, height, image, loadImages, loadTimeout, observer, toolkit, url, width |
Constructor Summary |
BackgroundImage(ElementBox owner,
URL url,
cz.vutbr.web.css.CSSProperty.BackgroundPosition position,
cz.vutbr.web.css.TermList positionValues,
cz.vutbr.web.css.CSSProperty.BackgroundRepeat repeat,
cz.vutbr.web.css.CSSProperty.BackgroundAttachment attachment)
|
Methods inherited from class org.fit.cssbox.layout.ContentImage |
abort, dispose, getContainer, getImage, getImageObserver, getIntrinsicRatio, getIntrinsicWidth, getIntrinsicHeight, getUrl, imageUpdate, isCaching, loadImage, repaint, reset, setCaching, setContainer, setImageObserver |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BackgroundImage
public BackgroundImage(ElementBox owner,
URL url,
cz.vutbr.web.css.CSSProperty.BackgroundPosition position,
cz.vutbr.web.css.TermList positionValues,
cz.vutbr.web.css.CSSProperty.BackgroundRepeat repeat,
cz.vutbr.web.css.CSSProperty.BackgroundAttachment attachment)
getPosition
public cz.vutbr.web.css.CSSProperty.BackgroundPosition getPosition()
getRepeat
public cz.vutbr.web.css.CSSProperty.BackgroundRepeat getRepeat()
getAttachment
public cz.vutbr.web.css.CSSProperty.BackgroundAttachment getAttachment()
draw
public void draw(Graphics2D g,
int width,
int height)
- Description copied from class:
ReplacedContent
- Draw the contents of the element.
- Specified by:
draw
in class ReplacedContent
- Parameters:
g
- graphics contextwidth
- the required width of the resultheight
- the required height of the result
getBufferedImage
public BufferedImage getBufferedImage()
- Description copied from class:
ContentImage
- Gets the loaded image as BufferedImage object. May return null if no data
available.
- Overrides:
getBufferedImage
in class ContentImage
- Returns:
- the buffered image.
isRepeatX
public boolean isRepeatX()
- Returns:
true
if the image is repeated in the X direction
isRepeatY
public boolean isRepeatY()
- Returns:
true
if the image is repeated in the Y direction
getImgX
public int getImgX()
- Returns:
- the imgx
getImgY
public int getImgY()
- Returns:
- the imgy
computeCoordinates
public void computeCoordinates()
- Computes the image coordinates within the padding box of the element.
After this, the coordinates may be obtained using
getImgX()
and getImgY()
.
computeCoordinates
protected void computeCoordinates(Rectangle bounds)
Copyright © 2014. All rights reserved.