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 int` | `horizontalAlignment` | Horizontal alignment
    `protected Image` | `image` | background image
    `protected Image` | `imageCache` | background image cache
    `protected String` | `imagePath` | image path
    `protected int` | `verticalAlignment` | Vertical 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
    --- | --- | ---
    `int` | `getHorizontalAlignment()` | Return horizontal alignment.
    `Image` | `getImage()` | Return background Image
    `String` | `getImagePath()` | Return image path
    `int` | `getVerticalAlignment()` | Return vertical alignment.
    `boolean` | `isVisible()` | Return visible property, true or false
    `void` | `paint​(Graphics2D g2d)` | Paint
    `void` | `setHorizontalAlignment​(int alignment)` | set horizontal alignment
    `void` | `setImage​(Image image)` | Set background Image
    `void` | `setImagePath​(String path)` | set ImagePath.
    `void` | `setVectorCanvas​(VectorCanvas canvas)` | Sets the canvas associated with this CanvasSelection.
    `void` | `setVerticalAlignment​(int alignment)` | set vertical alignment
    `void` | `setVisible​(boolean visible)` | set visible property
    `protected void` | `updateImageCache()` | Update the ImageCache for canvas zoom

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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

  - ### Constructor Detail

    - #### CanvasBackground

          public CanvasBackground()

      Creates a new instance of CanvasBackground

  - ### 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