Class MyCanvas

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

class MyCanvas extends Canvas
  • Field Details

    • field_size

      int field_size
    • num_fields

      int num_fields
    • x_offset

      int x_offset
    • y_offset

      int y_offset
    • def_font

      final Font def_font
    • array

      final int[][] array
    • off_dimension

      Dimension off_dimension
    • off_image

      Image off_image
    • off_graphics

      Graphics off_graphics
    • def_font2

      final Font def_font2
    • checksum_col

      static final Color checksum_col
    • checksum

      int checksum
  • Constructor Details

    • MyCanvas

      public MyCanvas(int num_fields, int field_size, int x_offset, int y_offset)
  • Method Details

    • setFieldSize

      public void setFieldSize(int fs)
    • setNumFields

      public void setNumFields(int nf)
    • setXOffset

      public void setXOffset(int o)
    • setYOffset

      public void setYOffset(int o)
    • addValueTo

      public void addValueTo(int x, int y, int value)
    • subtractValueFrom

      public void subtractValueFrom(int x, int y, int value)
    • multiplyValueWith

      public void multiplyValueWith(int x, int y, int value)
    • divideValueBy

      public void divideValueBy(int x, int y, int value)
    • setValueAt

      public void setValueAt(int x, int y, int value)
    • getValueAt

      public int getValueAt(int x, int y)
    • clear

      public void clear()
    • getState

      public int[][] getState()
    • getCopyOfState

      public int[][] getCopyOfState()
    • update

      public void update()
    • setState

      public void setState(Object new_state)
    • checksum

      public int checksum()
    • update

      public void update(Graphics g)
      Overrides:
      update in class Canvas
    • paint

      public void paint(Graphics g)
      Overrides:
      paint in class Canvas
    • drawEmptyBoard

      void drawEmptyBoard(Graphics g)
      Draws the empty board, no pieces on it yet, just grid lines
    • drawNumbers

      void drawNumbers(Graphics g)
    • coord2Index

      Point coord2Index(int x, int y)
    • index2Coord

      Point index2Coord(int i, int j)