Class BlockModel


  • public class BlockModel
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      BlockModel​(java.awt.Color color)  
      BlockModel​(java.awt.Color color, java.awt.image.BufferedImage base_image, java.awt.Dimension size, java.awt.Point standAlonePos, PieceModel parent)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      BlockModel clone()  
      void recalculate()
      Recalculate the piece color based on the stored color variable
      (package private) void setBaseImage()
      Load the image of the block
      void setParent​(PieceModel parent)
      Set to which piece this perticular block is linked
      void setSize​(java.awt.Dimension size)
      Change the size of the block (used for the image calculation)
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • color

        public java.awt.Color color
      • image

        public java.awt.image.BufferedImage image
      • base_image

        public java.awt.image.BufferedImage base_image
      • size

        public java.awt.Dimension size
      • standAlonePos

        public java.awt.Point standAlonePos
    • Constructor Detail

      • BlockModel

        public BlockModel​(java.awt.Color color)
      • BlockModel

        public BlockModel​(java.awt.Color color,
                          java.awt.image.BufferedImage base_image,
                          java.awt.Dimension size,
                          java.awt.Point standAlonePos,
                          PieceModel parent)
    • Method Detail

      • setSize

        public void setSize​(java.awt.Dimension size)
        Change the size of the block (used for the image calculation)
        Parameters:
        size - the size
      • setParent

        public void setParent​(PieceModel parent)
        Set to which piece this perticular block is linked
        Parameters:
        parent - the piece
      • setBaseImage

        void setBaseImage()
        Load the image of the block
      • recalculate

        public void recalculate()
        Recalculate the piece color based on the stored color variable
      • clone

        public BlockModel clone()
        Overrides:
        clone in class java.lang.Object