public class ImageBackground extends AbstractBackground
TNetwork network = new TNetwork(); ImageBackground background = new ImageBackground("/image/background.png"); network.setNetworkBackground(background);
TextureBackground
,
Serialized FormSVG_BACKGROUND_ID
Constructor and Description |
---|
ImageBackground() |
ImageBackground(java.awt.Image image)
Input your image as the background image.
|
ImageBackground(java.awt.Image image,
boolean resizable)
Constructs a bitmap background with given image object,
and specify whether the image is resizable when network
zoom factor is changed.
|
ImageBackground(java.lang.String imageURL)
Constructs a bitmap background with given image URL string.
|
ImageBackground(java.lang.String imageURL,
boolean resizable)
Constructs a bitmap background with given image URL string,
and specify whether the image is resizable when network
zoom factor is changed.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Dimension |
getBackgroundSize()
Get the size of this background.
|
java.awt.Color |
getColor() |
java.awt.Color |
getGradientColor()
Gets the the gradient color.
|
int |
getGradientFactory()
Gets the gradient factory.
|
java.awt.Image |
getImage()
Get the network bitmap of the background.
|
java.lang.String |
getImageURL()
Get the image URL string of the background.
|
java.awt.Dimension |
getSpecificSize() |
java.lang.String |
getTextureURL() |
boolean |
isGradient()
Determines whether to draw gradient background.
|
void |
paintContent(java.awt.Graphics2D g,
double zoom,
java.awt.Rectangle viewportRect)
This class paint background image without stretch.
|
void |
setColor(java.awt.Color color) |
void |
setGradient(boolean gradient)
Sets whether to draw gradient background.
|
void |
setGradientColor(java.awt.Color gradientColor)
Sets the the gradient color.
|
void |
setGradientFactory(int gradientFactory)
Sets the gradient factory.
|
void |
setImageURL(java.lang.String imageURL)
Set the image URL string of the background.
|
void |
setSpecificSize(java.awt.Dimension specificSize) |
void |
setTexture(java.awt.TexturePaint texture) |
void |
setTextureURL(java.lang.String textureURL) |
SVGStruct |
toSVG(SVGContext context) |
getAlpha, paint, setAlpha
public ImageBackground()
public ImageBackground(java.lang.String imageURL)
imageURL
- String the URL of the bitmap.public ImageBackground(java.lang.String imageURL, boolean resizable)
imageURL
- String the URL string of the bitmapresizable
- boolean whether bitmap is resizable when network
zoom is changed.public ImageBackground(java.awt.Image image, boolean resizable)
image
- Image the bitmap image instance.resizable
- boolean whether bitmap is resizable when network
zoom is changed.public ImageBackground(java.awt.Image image)
image
- background image.public java.awt.Image getImage()
public void paintContent(java.awt.Graphics2D g, double zoom, java.awt.Rectangle viewportRect)
paintContent
in class AbstractBackground
g
- network map graphics object.zoom
- current network map zooming factor.viewportRect
- current map scroll's viewpoint rectangle.public java.awt.Dimension getBackgroundSize()
public java.lang.String getImageURL()
public void setImageURL(java.lang.String imageURL)
imageURL
- public java.awt.Dimension getSpecificSize()
public void setSpecificSize(java.awt.Dimension specificSize)
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
public java.lang.String getTextureURL()
public void setTextureURL(java.lang.String textureURL)
public void setTexture(java.awt.TexturePaint texture)
public SVGStruct toSVG(SVGContext context)
public boolean isGradient()
public void setGradient(boolean gradient)
gradient
- True to draw gradient background, false otherwise.public java.awt.Color getGradientColor()
public void setGradientColor(java.awt.Color gradientColor)
gradientColor
- the the gradient color.public int getGradientFactory()
public void setGradientFactory(int gradientFactory)
gradientFactory
- the gradient factory.Copyright © 2002 - 2010 Serva Software. All Rights Reserved.