public class TextureBackground extends AbstractBackground
network.setNetworkBackground()
to change the network background.Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
imageURL |
protected java.awt.TexturePaint |
texture |
SVG_BACKGROUND_ID
Constructor and Description |
---|
TextureBackground() |
TextureBackground(java.awt.Image image)
Constructs a texture background with an Image.
|
TextureBackground(java.lang.String imageURL)
constructs a texture background with an image URL string.
|
TextureBackground(java.awt.TexturePaint texture)
Constructor with a input TexturePaint object instead of using
createDefaultTexture() to create default one. |
Modifier and Type | Method and Description |
---|---|
java.awt.Dimension |
getBackgroundSize()
There is no exactly size for a texture background.
|
java.lang.String |
getImageURL() |
void |
paintContent(java.awt.Graphics2D g,
double zoom,
java.awt.Rectangle viewportRect)
The
Network uses a Background to paint network
map background. |
void |
setImageURL(java.lang.String imageURL) |
SVGStruct |
toSVG(SVGContext context) |
getAlpha, paint, setAlpha
protected transient java.awt.TexturePaint texture
protected java.lang.String imageURL
public TextureBackground()
public TextureBackground(java.awt.TexturePaint texture)
createDefaultTexture()
to create default one.texture
- background's texture.public TextureBackground(java.awt.Image image)
image
- Image image object.public TextureBackground(java.lang.String imageURL)
imageURL
- String the image URL string.public void paintContent(java.awt.Graphics2D g, double zoom, java.awt.Rectangle viewportRect)
Network
uses a Background
to paint network
map background. Network object call this method to paint background, input
the map graphics, zoom factor, and map scroll's viewpoint rectangle. We can
paint anything you want in this method.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)
public SVGStruct toSVG(SVGContext context)
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.