Class BoardPanel

All Implemented Interfaces:
MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class BoardPanel extends JLayeredPane implements MouseMotionListener, MouseListener
The type Board panel.
See Also:
  • Constructor Details

    • BoardPanel

      public BoardPanel(int rows, int columns)
      Instantiates a new Board panel.
      Parameters:
      rows - the rows
      columns - the columns
  • Method Details

    • setLocationListener

      public void setLocationListener(LocationListener locationListener)
      Sets location listener.
      Parameters:
      locationListener - the location listener
    • addPiecePanel

      public void addPiecePanel(PiecePanel piecePanel, Location location)
      Add piece panel.
      Parameters:
      piecePanel - the piece panel
      location - the location
    • removePiecePanels

      public void removePiecePanels()
      Remove piece panels.
    • resetLocationStates

      public void resetLocationStates()
      Reset location states.
    • setLocationState

      public void setLocationState(Location location, LocationState state)
      Sets location state.
      Parameters:
      location - the location
      state - the state
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      Mouse dragged.
      Specified by:
      mouseDragged in interface MouseMotionListener
      Parameters:
      e - the e
    • mouseMoved

      public void mouseMoved(MouseEvent e)
      Mouse moved.
      Specified by:
      mouseMoved in interface MouseMotionListener
      Parameters:
      e - the e
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      Mouse clicked.
      Specified by:
      mouseClicked in interface MouseListener
      Parameters:
      e - the e
    • mousePressed

      public void mousePressed(MouseEvent e)
      Mouse pressed.
      Specified by:
      mousePressed in interface MouseListener
      Parameters:
      e - the e
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Mouse released.
      Specified by:
      mouseReleased in interface MouseListener
      Parameters:
      e - the e
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Mouse entered.
      Specified by:
      mouseEntered in interface MouseListener
      Parameters:
      e - the e
    • mouseExited

      public void mouseExited(MouseEvent e)
      Mouse exited.
      Specified by:
      mouseExited in interface MouseListener
      Parameters:
      e - the e