Class CanvasBackground


  • public class CanvasBackground
    extends Object
    Canvas Background.
    Author:
    KIYUT
    • 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()
      • 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