Package kiyut.sketsa.canvas
Class CanvasBackground
- java.lang.Object
-
- kiyut.sketsa.canvas.CanvasBackground
-
public class CanvasBackground extends Object
Canvas Background.- Author:
- KIYUT
-
-
Field Summary
Fields Modifier and Type Field Description protected inthorizontalAlignmentHorizontal alignmentprotected Imageimagebackground imageprotected ImageimageCachebackground image cacheprotected StringimagePathimage pathprotected intverticalAlignmentVertical alignment
-
Constructor Summary
Constructors Constructor Description CanvasBackground()Creates a new instance of CanvasBackground
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHorizontalAlignment()Return horizontal alignment.ImagegetImage()Return background ImageStringgetImagePath()Return image pathintgetVerticalAlignment()Return vertical alignment.booleanisVisible()Return visible property, true or falsevoidpaint(Graphics2D g2d)PaintvoidsetHorizontalAlignment(int alignment)set horizontal alignmentvoidsetImage(Image image)Set background ImagevoidsetImagePath(String path)set ImagePath.voidsetVectorCanvas(VectorCanvas canvas)Sets the canvas associated with this CanvasSelection.voidsetVerticalAlignment(int alignment)set vertical alignmentvoidsetVisible(boolean visible)set visible propertyprotected voidupdateImageCache()Update the ImageCache for canvas zoom
-
-
-
Field Detail
-
image
protected Image image
background image
-
imageCache
protected Image imageCache
background image cache
-
horizontalAlignment
protected int horizontalAlignment
Horizontal alignment
-
verticalAlignment
protected int verticalAlignment
Vertical alignment
-
imagePath
protected String imagePath
image path
-
-
Method Detail
-
paint
public void paint(Graphics2D g2d)
Paint- Parameters:
g2d- Graphics2D
-
setVectorCanvas
public void setVectorCanvas(VectorCanvas canvas)
Sets the canvas associated with this CanvasSelection.- Parameters:
canvas-VectorCanvas
-
updateImageCache
protected void updateImageCache()
Update the ImageCache for canvas zoom
-
setVisible
public void setVisible(boolean visible)
set visible property- Parameters:
visible- true or false- See Also:
isVisible()
-
isVisible
public boolean isVisible()
Return visible property, true or false- Returns:
- visible property, true or false
- See Also:
setVisible(boolean)
-
setImage
public void setImage(Image image)
Set background Image- Parameters:
image- Image- See Also:
getImage()
-
getImage
public Image getImage()
Return background Image- Returns:
- image
- See Also:
setImage(Image)
-
setImagePath
public void setImagePath(String path)
set ImagePath. This is for information only, not required- Parameters:
path- ImagePath- See Also:
setImage(Image),getImagePath()
-
getImagePath
public String getImagePath()
Return image path- Returns:
- image path
- See Also:
setImagePath(String),setImage(Image)
-
setHorizontalAlignment
public void setHorizontalAlignment(int alignment)
set horizontal alignment- Parameters:
alignment- one of the value in SwingConstants- See Also:
getHorizontalAlignment()
-
getHorizontalAlignment
public int getHorizontalAlignment()
Return horizontal alignment.- Returns:
- horizontal alignment
-
setVerticalAlignment
public void setVerticalAlignment(int alignment)
set vertical alignment- Parameters:
alignment- one of the value in SwingConstants- See Also:
getVerticalAlignment()
-
getVerticalAlignment
public int getVerticalAlignment()
Return vertical alignment.- Returns:
- vertical alignment
-
-