public class DeferredImageReplacedElement extends ImageReplacedElement
ReplacedElement that contains a Image
which by default is simply a transparent image scaled to the size provided to the constructor. The DeferredImageReplacedElement
also has a reference to an ImageResource which points to the image which will be returned for this replaced element.
That Image may be loaded some time after this DeferredImageReplacedElement is created. Calling getImage() on
instances of DeferredImageReplacedElement will return either the original dummy image, or the actual image
loaded into the ImageResource._image| 构造器和说明 |
|---|
DeferredImageReplacedElement(ImageResource imageResource,
RepaintListener repaintListener,
int w,
int h)
Creates a new ImageReplacedElement and scales it to the size specified if either width or height has a valid
value (values are > -1), otherwise original size is preserved.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
detach(LayoutContext c) |
int |
getBaseline() |
Image |
getImage()
The image we're replacing.
|
int |
getIntrinsicHeight() |
int |
getIntrinsicWidth() |
Point |
getLocation()
Returns the current location where the element will be rendered on the canvas
|
boolean |
hasBaseline() |
boolean |
isRequiresInteractivePaint() |
void |
setLocation(int x,
int y)
Assigns the new locations where the element will be rendered.
|
public DeferredImageReplacedElement(ImageResource imageResource, RepaintListener repaintListener, int w, int h)
imageResource - repaintListener - public void detach(LayoutContext c)
detach 在接口中 ReplacedElementdetach 在类中 ImageReplacedElementpublic int getIntrinsicHeight()
getIntrinsicHeight 在接口中 ReplacedElementgetIntrinsicHeight 在类中 ImageReplacedElementpublic int getIntrinsicWidth()
getIntrinsicWidth 在接口中 ReplacedElementgetIntrinsicWidth 在类中 ImageReplacedElementpublic Point getLocation()
getLocation 在接口中 ReplacedElementgetLocation 在类中 ImageReplacedElementpublic boolean isRequiresInteractivePaint()
public void setLocation(int x,
int y)
setLocation 在接口中 ReplacedElementsetLocation 在类中 ImageReplacedElementx - new horizontal posy - new vertical pospublic Image getImage()
getImage 在类中 ImageReplacedElementpublic int getBaseline()
getBaseline 在接口中 ReplacedElementgetBaseline 在类中 ImageReplacedElementpublic boolean hasBaseline()
hasBaseline 在接口中 ReplacedElementhasBaseline 在类中 ImageReplacedElementCopyright © 2019. All Rights Reserved.