Class PuzzleComponent

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
webb.client.ui.screens.puzzlescreen.PuzzleComponent
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class PuzzleComponent extends JComponent
See Also:
  • Constructor Details

    • PuzzleComponent

      public PuzzleComponent()
  • Method Details

    • setPuzzle

      public void setPuzzle(CreatePuzzleLevelDTO puzzle)
      Set the puzzle to be displayed
      Parameters:
      puzzle - Puzzle to be displayed
    • onClick

      public void onClick(CellComponent c, boolean rightClick, boolean visible)
      Mirrors changeType from CellDTO while also clearing adjacently marked cells if c is cleared.
      Parameters:
      c -
      rightClick -
      visible -
    • checkBoard

      public void checkBoard(boolean visible)
      Primary method for checking and setting if stars are in valid locations
      Parameters:
      visible -
    • printBoard

      public void printBoard()
    • paintComponent

      protected void paintComponent(Graphics g)
      Paints the component
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - the Graphics object
    • getCell

      public CellComponent getCell(int col, int row)
      Get a cell at a specific position
      Parameters:
      col - Column of the cell
      row - Row of the cell
      Returns:
      The cell at the specified position
      Throws:
      IllegalArgumentException - if the position is invalid
    • setHintVisible

      public void setHintVisible(boolean b)
      Shows all the AMARKERS and VMarkers on the board given a boolean
      Parameters:
      b - do we show the markers?