Class ConsoleCheckerboardViewerImpl<P extends Player<P,​S>,​S>

java.lang.Object
org.refcodes.checkerboard.AbstractCheckerboardViewer<P,​S,​String,​ConsoleSpriteFactory<S>,​ConsoleCheckerboardViewer<P,​S>>
org.refcodes.checkerboard.ConsoleCheckerboardViewerImpl<P,​S>
Type Parameters:
P - the generic type of the Player
S - The type which's instances represent a Player state.
All Implemented Interfaces:
CheckerboardObserver<P,​S>, CheckerboardViewer<P,​S,​ConsoleCheckerboardViewer<P,​S>>, ConsoleCheckerboardViewer<P,​S>, org.refcodes.component.Component, org.refcodes.component.Destroyable, org.refcodes.component.Initializable, org.refcodes.component.Initializable.InitializeBuilder<ConsoleCheckerboardViewer<P,​S>>, org.refcodes.component.InitializableComponent, org.refcodes.graphical.GridDimension, org.refcodes.graphical.GridHeightAccessor, org.refcodes.graphical.GridModeAccessor, org.refcodes.graphical.GridWidthAccessor, org.refcodes.graphical.MinViewportDimension, org.refcodes.graphical.MinViewportDimension.MinViewportDimensionBuilder<ConsoleCheckerboardViewer<P,​S>>, org.refcodes.graphical.MinViewportDimension.MinViewportDimensionMutator, org.refcodes.graphical.MinViewportDimension.MinViewportDimensionProperty, org.refcodes.graphical.ViewportDimension, org.refcodes.graphical.ViewportDimension.ViewportDimensionBuilder<ConsoleCheckerboardViewer<P,​S>>, org.refcodes.graphical.ViewportDimension.ViewportDimensionMutator, org.refcodes.graphical.ViewportDimension.ViewportDimensionProperty, org.refcodes.graphical.ViewportHeightAccessor, org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightBuilder<ConsoleCheckerboardViewer<P,​S>>, org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightMutator, org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightProperty, org.refcodes.graphical.ViewportOffset, org.refcodes.graphical.ViewportOffset.ViewportOffsetBuilder<ConsoleCheckerboardViewer<P,​S>>, org.refcodes.graphical.ViewportOffset.ViewportOffsetMutator, org.refcodes.graphical.ViewportOffset.ViewportOffsetProperty, org.refcodes.graphical.ViewportOffsetXAccessor, org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXBuilder<ConsoleCheckerboardViewer<P,​S>>, org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXMutator, org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXProperty, org.refcodes.graphical.ViewportOffsetYAccessor, org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYBuilder<ConsoleCheckerboardViewer<P,​S>>, org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYMutator, org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYProperty, org.refcodes.graphical.ViewportWidthAccessor, org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthBuilder<ConsoleCheckerboardViewer<P,​S>>, org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthMutator, org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthProperty, org.refcodes.mixin.ColumnWidthAccessor, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<ConsoleCheckerboardViewer<P,​S>>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty, org.refcodes.observer.ObservableObserver<Checkerboard<P,​S>>

public class ConsoleCheckerboardViewerImpl<P extends Player<P,​S>,​S>
extends AbstractCheckerboardViewer<P,​S,​String,​ConsoleSpriteFactory<S>,​ConsoleCheckerboardViewer<P,​S>>
implements ConsoleCheckerboardViewer<P,​S>
Most basic implementation of the CheckerboardViewer interface printing the current checkerboard as good as it gets. Call initialize() when everything is setup correctly. When a redraw time <= 0 is set upon construction, then the Checkerboard is printed out upon any according events from the underlying Checkerboard or, in case the refresh time is > 0 the Checkerboard is redrawn as of the refresh loop time. Attention: The Checkerboard is only redrawn in case the Checkerboard changed compared to the last redraw process.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.refcodes.mixin.ColumnWidthAccessor

    org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B extends org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B>>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty

    Nested classes/interfaces inherited from interface org.refcodes.component.Destroyable

    org.refcodes.component.Destroyable.DestroyAutomaton

    Nested classes/interfaces inherited from interface org.refcodes.graphical.GridDimension

    org.refcodes.graphical.GridDimension.GridDimensionBuilder<B extends org.refcodes.graphical.GridDimension.GridDimensionBuilder<B>>, org.refcodes.graphical.GridDimension.GridDimensionMutator, org.refcodes.graphical.GridDimension.GridDimensionProperty

    Nested classes/interfaces inherited from interface org.refcodes.graphical.GridHeightAccessor

    org.refcodes.graphical.GridHeightAccessor.GridHeightBuilder<B extends org.refcodes.graphical.GridHeightAccessor.GridHeightBuilder<B>>, org.refcodes.graphical.GridHeightAccessor.GridHeightMutator, org.refcodes.graphical.GridHeightAccessor.GridHeightProperty

    Nested classes/interfaces inherited from interface org.refcodes.graphical.GridModeAccessor

    org.refcodes.graphical.GridModeAccessor.GridModeBuilder<B extends org.refcodes.graphical.GridModeAccessor.GridModeBuilder<B>>, org.refcodes.graphical.GridModeAccessor.GridModeMutator, org.refcodes.graphical.GridModeAccessor.GridModeProperty

    Nested classes/interfaces inherited from interface org.refcodes.graphical.GridWidthAccessor

    org.refcodes.graphical.GridWidthAccessor.GridWidthBuilder<B extends org.refcodes.graphical.GridWidthAccessor.GridWidthBuilder<B>>, org.refcodes.graphical.GridWidthAccessor.GridWidthMutator, org.refcodes.graphical.GridWidthAccessor.GridWidthProperty

    Nested classes/interfaces inherited from interface org.refcodes.component.Initializable

    org.refcodes.component.Initializable.InitializeAutomaton, org.refcodes.component.Initializable.InitializeBuilder<B extends org.refcodes.component.Initializable.InitializeBuilder<B>>, org.refcodes.component.Initializable.UncheckedInitializable

    Nested classes/interfaces inherited from interface org.refcodes.graphical.MinViewportDimension

    org.refcodes.graphical.MinViewportDimension.MinViewportDimensionBuilder<B extends org.refcodes.graphical.MinViewportDimension.MinViewportDimensionBuilder<B>>, org.refcodes.graphical.MinViewportDimension.MinViewportDimensionMutator, org.refcodes.graphical.MinViewportDimension.MinViewportDimensionProperty

    Nested classes/interfaces inherited from interface org.refcodes.graphical.ViewportDimension

    org.refcodes.graphical.ViewportDimension.ViewportDimensionBuilder<B extends org.refcodes.graphical.ViewportDimension.ViewportDimensionBuilder<B>>, org.refcodes.graphical.ViewportDimension.ViewportDimensionMutator, org.refcodes.graphical.ViewportDimension.ViewportDimensionProperty

    Nested classes/interfaces inherited from interface org.refcodes.graphical.ViewportHeightAccessor

    org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightBuilder<B extends org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightBuilder<B>>, org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightMutator, org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightProperty

    Nested classes/interfaces inherited from interface org.refcodes.graphical.ViewportOffset

    org.refcodes.graphical.ViewportOffset.ViewportOffsetBuilder<B extends org.refcodes.graphical.ViewportOffset.ViewportOffsetBuilder<B>>, org.refcodes.graphical.ViewportOffset.ViewportOffsetMutator, org.refcodes.graphical.ViewportOffset.ViewportOffsetProperty

    Nested classes/interfaces inherited from interface org.refcodes.graphical.ViewportOffsetXAccessor

    org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXBuilder<B extends org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXBuilder<B>>, org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXMutator, org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXProperty

    Nested classes/interfaces inherited from interface org.refcodes.graphical.ViewportOffsetYAccessor

    org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYBuilder<B extends org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYBuilder<B>>, org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYMutator, org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYProperty

    Nested classes/interfaces inherited from interface org.refcodes.graphical.ViewportWidthAccessor

    org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthBuilder<B extends org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthBuilder<B>>, org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthMutator, org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthProperty
  • Constructor Summary

    Constructors
    Constructor Description
    ConsoleCheckerboardViewerImpl​(Checkerboard<P,​S> aCheckerboard, ConsoleSpriteFactory<S> aSpriteFactory)
    Constructs the ConsoleCheckerboardViewer with the provided SpriteFactory creating "Sprites" (in this case String instances) for visualizing the playground's state.
    ConsoleCheckerboardViewerImpl​(Checkerboard<P,​S> aCheckerboard, ConsoleSpriteFactory<S> aSpriteFactory, int aRedrawLoopTimeInMillis)
    Constructs the ConsoleCheckerboardViewer with the provided SpriteFactory creating "Sprites" (in this case String instances) for visualizing the playground's state.
    ConsoleCheckerboardViewerImpl​(Checkerboard<P,​S> aCheckerboard, ConsoleSpriteFactory<S> aSpriteFactory, int aColumnWidth, int aRedrawLoopTimeInMillis)
    Constructs the ConsoleCheckerboardViewer with the provided SpriteFactory creating "Sprites" (in this case String instances) for visualizing the playground's state.
  • Method Summary

    Modifier and Type Method Description
    int getColumnWidth()
    int getRedrawLoopTimeInMillis()
    Retrieves the refresh loop time between two redraw cycles of the Checkerboard.
    void initialize()
    boolean isRedrawOnEvent()
    Determines whether the Checkerboard is printed out upon any according events from the underlying Checkerboard or as of the refresh loop time (see ConsoleCheckerboardViewer.getRedrawLoopTimeInMillis()).
    void onChangePositionEvent​(ChangePositionEvent<P> aPlayerEvent, Checkerboard<P,​S> aSource)
    This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
    void onCheckerboardEvent​(CheckerboardEvent<P,​S> aCheckerboardEvent)
    This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
    void onDraggabilityChangedEvent​(DraggabilityChangedEvent<P> aPlayerEvent, Checkerboard<P,​S> aSource)
    This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
    protected void onEventPrintPlayground()
    Prints the playground upon an according Checkerboard event in case the
    void onGridDimensionChangedEvent​(GridDimensionChangedEvent<P,​S> aCheckerboardEvent)
    This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
    void onGridModeChangedEvent​(GridModeChangedEvent<P,​S> aCheckerboardEvent)
    This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
    void onPlayerAddedEvent​(PlayerAddedEvent<P,​S> aCheckerboardEvent)
    This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
    void onPlayerEvent​(PlayerEvent<P> aPlayerEvent, Checkerboard<P,​S> aSource)
    This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
    void onPlayerRemovedEvent​(PlayerRemovedEvent<P,​S> aCheckerboardEvent)
    This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
    void onPositionChangedEvent​(PositionChangedEvent<P> aPlayerEvent, Checkerboard<P,​S> aSource)
    This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
    void onStateChangedEvent​(StateChangedEvent<P,​S> aPlayerEvent, Checkerboard<P,​S> aSource)
    This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
    void onViewportDimensionChangedEvent​(ViewportDimensionChangedEvent<P,​S> aCheckerboardEvent)
    This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
    void onViewportOffsetChangedEvent​(ViewportOffsetChangedEvent<P,​S> aCheckerboardEvent)
    This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
    void onVisibilityChangedEvent​(VisibilityChangedEvent<P> aPlayerEvent, Checkerboard<P,​S> aSource)
    This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
    protected void printPlaygroundDaemon()
    Loops the playground printing via printPlayground().
    void setColumnWidth​(int aColumnWidth)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty

    letColumnWidth

    Methods inherited from interface org.refcodes.checkerboard.ConsoleCheckerboardViewer

    withColumnWidth

    Methods inherited from interface org.refcodes.component.Destroyable

    destroy

    Methods inherited from interface org.refcodes.graphical.GridDimension

    isInBounds, isInBounds, isInHeight, isInWidth

    Methods inherited from interface org.refcodes.graphical.GridHeightAccessor

    getGridHeight

    Methods inherited from interface org.refcodes.graphical.GridModeAccessor

    getGridMode

    Methods inherited from interface org.refcodes.graphical.GridWidthAccessor

    getGridWidth

    Methods inherited from interface org.refcodes.component.Initializable

    initializeUnchecked

    Methods inherited from interface org.refcodes.component.Initializable.InitializeBuilder

    withInitialize, withInitializeUnchecked

    Methods inherited from interface org.refcodes.graphical.MinViewportDimension

    getMinViewportDimension

    Methods inherited from interface org.refcodes.graphical.MinViewportDimension.MinViewportDimensionBuilder

    withMinViewportDimension, withMinViewportDimension, withMinViewportDimension

    Methods inherited from interface org.refcodes.graphical.MinViewportDimension.MinViewportDimensionMutator

    setMinViewportDimension, setMinViewportDimension, setMinViewportDimension

    Methods inherited from interface org.refcodes.graphical.MinViewportDimension.MinViewportDimensionProperty

    letMinViewportDimension, letMinViewportDimension, letMinViewportDimension

    Methods inherited from interface org.refcodes.observer.ObservableObserver

    onSubscribe, onUnsubscribe

    Methods inherited from interface org.refcodes.graphical.ViewportDimension.ViewportDimensionBuilder

    withViewportDimension, withViewportDimension, withViewportDimension

    Methods inherited from interface org.refcodes.graphical.ViewportDimension.ViewportDimensionMutator

    setViewportDimension, setViewportDimension, setViewportDimension

    Methods inherited from interface org.refcodes.graphical.ViewportHeightAccessor

    getViewportHeight

    Methods inherited from interface org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightBuilder

    withViewportHeight

    Methods inherited from interface org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightMutator

    setViewportHeight

    Methods inherited from interface org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightProperty

    letViewportHeight

    Methods inherited from interface org.refcodes.graphical.ViewportOffset.ViewportOffsetBuilder

    withViewportOffset, withViewportOffset, withViewportOffset, withViewportOffset

    Methods inherited from interface org.refcodes.graphical.ViewportOffset.ViewportOffsetMutator

    setViewportOffset, setViewportOffset, setViewportOffset, setViewportOffset

    Methods inherited from interface org.refcodes.graphical.ViewportOffsetXAccessor

    getViewportOffsetX

    Methods inherited from interface org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXBuilder

    withViewportOffsetX

    Methods inherited from interface org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXMutator

    setViewportOffsetX

    Methods inherited from interface org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXProperty

    letViewportOffsetX

    Methods inherited from interface org.refcodes.graphical.ViewportOffsetYAccessor

    getViewportOffsetY

    Methods inherited from interface org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYBuilder

    withViewportOffsetY

    Methods inherited from interface org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYMutator

    setViewportOffsetY

    Methods inherited from interface org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYProperty

    letViewportOffsetY

    Methods inherited from interface org.refcodes.graphical.ViewportWidthAccessor

    getViewportWidth

    Methods inherited from interface org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthBuilder

    withViewportWidth

    Methods inherited from interface org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthMutator

    setViewportWidth

    Methods inherited from interface org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthProperty

    letViewportWidth
  • Constructor Details

  • Method Details

    • initialize

      public void initialize() throws org.refcodes.component.InitializeException
      Specified by:
      initialize in interface org.refcodes.component.Initializable
      Throws:
      org.refcodes.component.InitializeException
    • onCheckerboardEvent

      public void onCheckerboardEvent​(CheckerboardEvent<P,​S> aCheckerboardEvent)
      This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
      Specified by:
      onCheckerboardEvent in interface CheckerboardObserver<P extends Player<P,​S>,​S>
      Parameters:
      aCheckerboardEvent - the checkerboard event
    • onPlayerAddedEvent

      public void onPlayerAddedEvent​(PlayerAddedEvent<P,​S> aCheckerboardEvent)
      This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
      Specified by:
      onPlayerAddedEvent in interface CheckerboardObserver<P extends Player<P,​S>,​S>
      Parameters:
      aCheckerboardEvent - the checkerboard event
    • onPlayerRemovedEvent

      public void onPlayerRemovedEvent​(PlayerRemovedEvent<P,​S> aCheckerboardEvent)
      This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
      Specified by:
      onPlayerRemovedEvent in interface CheckerboardObserver<P extends Player<P,​S>,​S>
      Parameters:
      aCheckerboardEvent - the checkerboard event
    • onGridModeChangedEvent

      public void onGridModeChangedEvent​(GridModeChangedEvent<P,​S> aCheckerboardEvent)
      This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
      Specified by:
      onGridModeChangedEvent in interface CheckerboardObserver<P extends Player<P,​S>,​S>
      Parameters:
      aCheckerboardEvent - the checkerboard event
    • onGridDimensionChangedEvent

      public void onGridDimensionChangedEvent​(GridDimensionChangedEvent<P,​S> aCheckerboardEvent)
      This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
      Specified by:
      onGridDimensionChangedEvent in interface CheckerboardObserver<P extends Player<P,​S>,​S>
      Parameters:
      aCheckerboardEvent - the checkerboard event
    • onViewportOffsetChangedEvent

      public void onViewportOffsetChangedEvent​(ViewportOffsetChangedEvent<P,​S> aCheckerboardEvent)
      This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
      Specified by:
      onViewportOffsetChangedEvent in interface CheckerboardObserver<P extends Player<P,​S>,​S>
      Parameters:
      aCheckerboardEvent - the checkerboard event
    • onViewportDimensionChangedEvent

      public void onViewportDimensionChangedEvent​(ViewportDimensionChangedEvent<P,​S> aCheckerboardEvent)
      This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
      Specified by:
      onViewportDimensionChangedEvent in interface CheckerboardObserver<P extends Player<P,​S>,​S>
      Parameters:
      aCheckerboardEvent - the checkerboard event
    • onPlayerEvent

      public void onPlayerEvent​(PlayerEvent<P> aPlayerEvent, Checkerboard<P,​S> aSource)
      This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
      Specified by:
      onPlayerEvent in interface CheckerboardObserver<P extends Player<P,​S>,​S>
      Parameters:
      aPlayerEvent - the player event
      aSource - The according source (origin).
    • onChangePositionEvent

      public void onChangePositionEvent​(ChangePositionEvent<P> aPlayerEvent, Checkerboard<P,​S> aSource) throws org.refcodes.exception.VetoException
      This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
      Specified by:
      onChangePositionEvent in interface CheckerboardObserver<P extends Player<P,​S>,​S>
      Parameters:
      aPlayerEvent - the player event
      aSource - The according source (origin).
      Throws:
      org.refcodes.exception.VetoException - the veto exception
    • onPositionChangedEvent

      public void onPositionChangedEvent​(PositionChangedEvent<P> aPlayerEvent, Checkerboard<P,​S> aSource)
      This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
      Specified by:
      onPositionChangedEvent in interface CheckerboardObserver<P extends Player<P,​S>,​S>
      Parameters:
      aPlayerEvent - the player event
      aSource - The according source (origin).
    • onStateChangedEvent

      public void onStateChangedEvent​(StateChangedEvent<P,​S> aPlayerEvent, Checkerboard<P,​S> aSource)
      This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
      Specified by:
      onStateChangedEvent in interface CheckerboardObserver<P extends Player<P,​S>,​S>
      Parameters:
      aPlayerEvent - the player event
      aSource - The according source (origin).
    • onVisibilityChangedEvent

      public void onVisibilityChangedEvent​(VisibilityChangedEvent<P> aPlayerEvent, Checkerboard<P,​S> aSource)
      This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
      Specified by:
      onVisibilityChangedEvent in interface CheckerboardObserver<P extends Player<P,​S>,​S>
      Parameters:
      aPlayerEvent - the player event
      aSource - The according source (origin).
    • onDraggabilityChangedEvent

      public void onDraggabilityChangedEvent​(DraggabilityChangedEvent<P> aPlayerEvent, Checkerboard<P,​S> aSource)
      This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.
      Specified by:
      onDraggabilityChangedEvent in interface CheckerboardObserver<P extends Player<P,​S>,​S>
      Parameters:
      aPlayerEvent - the player event
      aSource - The according source (origin).
    • getRedrawLoopTimeInMillis

      public int getRedrawLoopTimeInMillis()
      Retrieves the refresh loop time between two redraw cycles of the Checkerboard. This is the delay time between succeeding print outs of the Checkerboard states to the console. If the refresh loop time is > 0, then the Checkerboard is redrawn at most with intervals of the given refresh loop time. Attention: The Checkerboard is only redrawn in case the Checkerboard changed compared to the last redraw process.
      Specified by:
      getRedrawLoopTimeInMillis in interface ConsoleCheckerboardViewer<P extends Player<P,​S>,​S>
      Returns:
      The according time in milliseconds.
    • isRedrawOnEvent

      public boolean isRedrawOnEvent()
      Determines whether the Checkerboard is printed out upon any according events from the underlying Checkerboard or as of the refresh loop time (see ConsoleCheckerboardViewer.getRedrawLoopTimeInMillis()). Attention: The Checkerboard is only redrawn in case the Checkerboard changed compared to the last redraw process.
      Specified by:
      isRedrawOnEvent in interface ConsoleCheckerboardViewer<P extends Player<P,​S>,​S>
      Returns:
      True in case the Checkerboard is redrawn upon an event from the Checkerboard or upon the refresh loop time.
    • printPlaygroundDaemon

      protected void printPlaygroundDaemon()
      Loops the playground printing via printPlayground().
    • onEventPrintPlayground

      protected void onEventPrintPlayground()
      Prints the playground upon an according Checkerboard event in case the
    • getColumnWidth

      public int getColumnWidth()
      Specified by:
      getColumnWidth in interface org.refcodes.mixin.ColumnWidthAccessor
    • setColumnWidth

      public void setColumnWidth​(int aColumnWidth)
      Specified by:
      setColumnWidth in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator