All Downloads are FREE. Search and download functionalities are using the official Maven repository.

examples.Life.src.main.gosu.life.AbstractHandler.gs Maven / Gradle / Ivy

There is a newer version: 1.18.1
Show newest version
package life

uses java.awt.event.MouseAdapter
uses java.awt.Point

abstract class AbstractHandler extends MouseAdapter {
  var _board: Board as Board
  var _enabled: boolean as Enabled

  construct( board: Board ) {
    _board = board
  }

  property get Enabled() : boolean {
    return _enabled
  }
  property set Enabled( enabled: boolean ) {
    _enabled = enabled
    if( enabled ) {
      _board.addMouseListener( this )
      _board.addMouseMotionListener( this )
    }
    else {
      _board.removeMouseListener( this )
      _board.removeMouseMotionListener( this )
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy