org.fit.cssbox.layout
Class BackgroundImage

java.lang.Object
  extended by org.fit.cssbox.layout.ReplacedContent
      extended by org.fit.cssbox.layout.ContentImage
          extended by 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

Field Summary
 
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
 
Fields inherited from class org.fit.cssbox.layout.ReplacedContent
def_height, def_width, owner
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, 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)
           
 
Method Summary
 void computeCoordinates()
          Computes the image coordinates within the padding box of the element.
protected  void computeCoordinates(Rectangle bounds)
           
 void draw(Graphics2D g, int width, int height)
          Draw the contents of the element.
 cz.vutbr.web.css.CSSProperty.BackgroundAttachment getAttachment()
           
 BufferedImage getBufferedImage()
          Gets the loaded image as BufferedImage object.
 int getImgX()
           
 int getImgY()
           
 cz.vutbr.web.css.CSSProperty.BackgroundPosition getPosition()
           
 cz.vutbr.web.css.CSSProperty.BackgroundRepeat getRepeat()
           
 boolean isRepeatX()
           
 boolean isRepeatY()
           
 
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 org.fit.cssbox.layout.ReplacedContent
absolutePositions, doLayout, getOwner, loadSizeDefs, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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)
Method Detail

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 context
width - the required width of the result
height - 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.