public class CommandDispatcherImpl extends java.lang.Object implements CommandDispatcher, FIBSMessages
CommandDispatcher.Command
ToolbarHandler.Button
CLIP_KIBITZES, CLIP_LOGIN, CLIP_LOGOUT, CLIP_MESSAGE, CLIP_MESSAGE_DELIVERED, CLIP_MESSAGE_SAVED, CLIP_MOTD_BEGIN, CLIP_MOTD_END, CLIP_OWN_INFO, CLIP_SAYS, CLIP_SHOUTS, CLIP_VERSION, CLIP_WELCOME, CLIP_WHISPERS, CLIP_WHO_END, CLIP_WHO_INFO, CLIP_YOU_KIBITZ, CLIP_YOU_SAY, CLIP_YOU_SHOUT, CLIP_YOU_WHISPER, FIBS_AcceptRejectDouble, FIBS_AcceptWins, FIBS_AllowpipFalse, FIBS_AllowpipTrue, FIBS_AlreadyPlaying, FIBS_ATTENTION, FIBS_AutoboardFalse, FIBS_AutoboardTrue, FIBS_AutodoubleFalse, FIBS_AutodoubleTrue, FIBS_AutomoveFalse, FIBS_AutomoveTrue, FIBS_Average, FIBS_AwayListHeader, FIBS_BAD_AcceptDouble, FIBS_BAD_Board, FIBS_BAD_COOKIE, FIBS_BadMove, FIBS_BearingOff, FIBS_BellFalse, FIBS_BellTrue, FIBS_Board, FIBS_Boardstyle, FIBS_BoardstyleSetTo, FIBS_CantBlindYourself, FIBS_CantGagYourself, FIBS_CantInviteSelf, FIBS_CantMove, FIBS_CantMoveFirstMove, FIBS_CantShout, FIBS_CantTalk, FIBS_CantWatch, FIBS_CantWatchSelf, FIBS_ClearScreen, FIBS_CrawfordFalse, FIBS_CrawfordTrue, FIBS_DiceTest, FIBS_DidntDoubleOrResign, FIBS_DidntInvite, FIBS_DoesntWantYouToWatch, FIBS_Done, FIBS_DontKnowUser, FIBS_DoubleFalse, FIBS_Doubles, FIBS_DoubleTrue, FIBS_DoublingCubeNow, FIBS_EchoJunk, FIBS_EmailAddress, FIBS_Empty, FIBS_EnterPassword, FIBS_EnterUsername, FIBS_FailedLogin, FIBS_FirstRoll, FIBS_GamesWillBeSaved, FIBS_GameWasSaved, FIBS_GivePassword, FIBS_Goodbye, FIBS_GreedyFalse, FIBS_GreedyTrue, FIBS_HasNoSavedGames, FIBS_HasSavedGames, FIBS_IsAway, FIBS_IsPlayingWith, FIBS_JoinNextGame, FIBS_Junk, FIBS_LastLogin, FIBS_LastLogout, FIBS_Linelength, FIBS_ListOfGames, FIBS_LoginPrompt, FIBS_MakesFirstMove, FIBS_MatchLength, FIBS_MatchResult, FIBS_MatchStart, FIBS_MessagesForYou, FIBS_MessageUsage, FIBS_MoreboardsFalse, FIBS_MoreboardsTrue, FIBS_MOTD, FIBS_MovesFalse, FIBS_MovesTrue, FIBS_MustComeIn, FIBS_MustMove, FIBS_NewMatchAck10, FIBS_NewMatchAck2, FIBS_NewMatchAck9, FIBS_NewMatchRequest, FIBS_NobodyHeardYou, FIBS_NoEmail, FIBS_NoInfo, FIBS_NoOne, FIBS_NoOneIsAway, FIBS_NoSavedGames, FIBS_NoSavedMatch, FIBS_NotifyFalse, FIBS_NotifyTrue, FIBS_NotInteresting, FIBS_NotLoggedIn, FIBS_NotPlaying, FIBS_NotWatching, FIBS_NotWatchingPlaying, FIBS_NotYourTurnToMove, FIBS_NotYourTurnToRoll, FIBS_NoUser, FIBS_ONEUSERNAME, FIBS_OneUserPerPerson, FIBS_OnlyMove, FIBS_OnlyPossibleMove, FIBS_OpponentLeftGame, FIBS_OpponentLogsOut, FIBS_Pagelength, FIBS_PlayerAcceptsDouble, FIBS_PlayerBannedWatch, FIBS_PlayerInfoStart, FIBS_PlayerIsWaitingForYou, FIBS_PlayerIsWatching, FIBS_PlayerLeftGame, FIBS_PlayerListHeader, FIBS_PlayerMoves, FIBS_PlayerNotPlaying, FIBS_PlayerRefusingGames, FIBS_PlayerRolls, FIBS_PlayersStartingMatch, FIBS_PlayersStartingUnlimitedMatch, FIBS_PlayerStartsWatching, FIBS_PlayerStopsWatching, FIBS_PlayerWantsToResign, FIBS_PlayerWinsGame, FIBS_PlayerWinsMatch, FIBS_PleaseMove, FIBS_PleaseWaitForJoin, FIBS_PointsFor, FIBS_PostGoodbye, FIBS_PreLogin, FIBS_RatingCalcInfo, FIBS_RatingCalcStart, FIBS_RatingExperience, FIBS_Ratings, FIBS_RatingsFalse, FIBS_RatingsHeader, FIBS_RatingsTrue, FIBS_ReadyFalse, FIBS_ReadyTrue, FIBS_ReadyWatchingPlaying, FIBS_Rebooting, FIBS_Redoubles, FIBS_RedoublesSetTo, FIBS_Registered, FIBS_ReportFalse, FIBS_ReportLimitedMatch, FIBS_ReportTrue, FIBS_ReportUnlimitedMatch, FIBS_ResignRefused, FIBS_ResignWins, FIBS_ResignYouWin, FIBS_ResumeMatchAck0, FIBS_ResumeMatchAck5, FIBS_ResumeMatchRequest, FIBS_ResumingLimitedMatch, FIBS_ResumingUnlimitedMatch, FIBS_RetypePassword, FIBS_RollBeforeMove, FIBS_RollOrDouble, FIBS_SavedMatch, FIBS_SavedMatchesHeader, FIBS_SavedMatchPlaying, FIBS_SavedMatchReady, FIBS_SavedScoreHeader, FIBS_ScoreUpdate, FIBS_Settings, FIBS_SettingsHeader, FIBS_ShowMovesAccepts, FIBS_ShowMovesDoubles, FIBS_ShowMovesOther, FIBS_ShowMovesRejects, FIBS_ShowMovesRoll, FIBS_ShowMovesStart, FIBS_ShowMovesWins, FIBS_ShuttingDown, FIBS_SilentFalse, FIBS_SilentTrue, FIBS_Sortwho, FIBS_StartingNewGame, FIBS_StartingNewGameInMatch, FIBS_Stat, FIBS_StillLoggedIn, FIBS_TalkToSelf, FIBS_TelnetFalse, FIBS_TelnetTrue, FIBS_Timeout, FIBS_Timezone, FIBS_Turn, FIBS_TypeBack, FIBS_TypeInNo, FIBS_TypeJoin, FIBS_Unknown, FIBS_UnknownCommand, FIBS_UnlimitedInvite, FIBS_UseAnotherName, FIBS_Username, FIBS_UsersHeardYou, FIBS_UseToggleReady, FIBS_WaitForAcceptResign, FIBS_WaitForLastInvitation, FIBS_WantedToResign, FIBS_WARNINGSavedMatch, FIBS_WatchGameWins, FIBS_WatchingHeader, FIBS_WatchResign, FIBS_Waves, FIBS_WavesAgain, FIBS_WelcomeToFibs, FIBS_Why, FIBS_WontListen, FIBS_WrapFalse, FIBS_WrapTrue, FIBS_YouAcceptAndWin, FIBS_YouAcceptDouble, FIBS_YouAlreadyPlaying, FIBS_YouAlreadyRolled, FIBS_YouAreRegistered, FIBS_YouAreWatching, FIBS_YouBannedWatch, FIBS_YouBlind, FIBS_YouCantMove, FIBS_YouDouble, FIBS_YouGag, FIBS_YouGiveUp, FIBS_YouInvited, FIBS_YouReject, FIBS_YourEmailChanged, FIBS_YouResign, FIBS_YourLastLogin, FIBS_YouRoll, FIBS_YourTurnToMove, FIBS_YouStopWatching, FIBS_YouTerminated, FIBS_YouUnblind, FIBS_YouUngag, FIBS_YouWinGame, FIBS_YouWinMatch
Constructor and Description |
---|
CommandDispatcherImpl() |
Modifier and Type | Method and Description |
---|---|
void |
buttonPressed(ToolbarHandler.Button button)
Method to call when a button is pressed
|
void |
dispatch(CommandDispatcher.Command command)
Primary entry point to the command dispatcher
|
void |
dispatch(CommandDispatcher.Command command,
java.lang.Object obj)
Primary entry point to the command dispatcher
what takes an Object as an argument
|
void |
dispatch(CommandDispatcher.Command command,
java.lang.String arg1)
Primary entry point to the command dispatcher
what takes a single string as an argument
|
void |
dispatch(CommandDispatcher.Command command,
java.lang.String arg1,
java.lang.String arg2)
Primary entry point to the command dispatcher
what takes two strings as an argument
|
MainDialog |
getMainDialog()
Fetch the reference to the MainDialog
|
BFProperties |
getProperties()
Get a reference to our properties
|
void |
ropChanged(boolean[] rop)
User has changed the state of the Ready, Online, or Playing button
|
void |
setMainDialog(MainDialog mainDialog)
Set the reference to the instance of MainDialog
|
void |
setProperties(BFProperties properties)
Set the Properties/User preferences
|
void |
writeChatMessageln(java.lang.String name,
int cookie,
java.lang.String text)
Write a message to the chat message pane in the normal color.
|
void |
writeGameErrorln(java.lang.String s)
Write a message in the error color (red) to the game pane appending a crlf to the end.
|
void |
writeGameMessageln(java.lang.String s)
Write a message to the game pane appending a crlf to the end.
|
boolean |
writeNetworkMessage(java.lang.String s)
Send a message to the fibs server
|
boolean |
writeNetworkMessageln(java.lang.String s)
Send a message to the fibs server appending a crlf to the end
|
void |
writeRegisterUserMessage(java.lang.String s)
Write a message to the status widget in the registerUser dialog
|
void |
writeSystemMessage(int type,
java.lang.String s)
Write a message to the System message pane in the specified color.
|
void |
writeSystemMessage(java.lang.String s)
Write a message to the System message pane in the normal color
|
void |
writeSystemMessageln(int type,
java.lang.String s)
Write a message to the System message pane in the specified color.
|
void |
writeSystemMessageln(java.lang.String s)
Write a message to the System message pane in the normal color.
|
public void setMainDialog(MainDialog mainDialog)
setMainDialog
in interface CommandDispatcher
mainDialog
- The MainDialog that is runningpublic MainDialog getMainDialog()
getMainDialog
in interface CommandDispatcher
public void setProperties(BFProperties properties)
setProperties
in interface CommandDispatcher
properties
- The loaded propertiespublic BFProperties getProperties()
getProperties
in interface CommandDispatcher
public void dispatch(CommandDispatcher.Command command)
dispatch
in interface CommandDispatcher
command
- The command to executepublic void dispatch(CommandDispatcher.Command command, java.lang.String arg1)
dispatch
in interface CommandDispatcher
command
- The Command to Executearg1
- A string that the dispatched function wantspublic void dispatch(CommandDispatcher.Command command, java.lang.String arg1, java.lang.String arg2)
dispatch
in interface CommandDispatcher
command
- The Command to Executearg1
- A string that the dispatched function wantsarg2
- Another string that the dispatched function wantspublic void dispatch(CommandDispatcher.Command command, java.lang.Object obj)
dispatch
in interface CommandDispatcher
command
- The Command to Executeobj
- An Object that the dispatched function wantspublic void writeSystemMessage(java.lang.String s)
s
- The message to writepublic void writeSystemMessageln(java.lang.String s)
writeSystemMessageln
in interface CommandDispatcher
s
- The message to writepublic void writeRegisterUserMessage(java.lang.String s)
writeRegisterUserMessage
in interface CommandDispatcher
s
- The message to writepublic void writeSystemMessage(int type, java.lang.String s)
writeSystemMessage
in interface CommandDispatcher
type
- The style of the texts
- The message to writepublic void writeSystemMessageln(int type, java.lang.String s)
writeSystemMessageln
in interface CommandDispatcher
type
- The style of the texts
- The message to writepublic void writeChatMessageln(java.lang.String name, int cookie, java.lang.String text)
writeChatMessageln
in interface CommandDispatcher
name
- The user what sent the messagecookie
- The mode used to send the message (shout, whisper, kibitz, etc)text
- The message to writepublic void writeGameMessageln(java.lang.String s)
CommandDispatcher
writeGameMessageln
in interface CommandDispatcher
s
- The message to writepublic void writeGameErrorln(java.lang.String s)
CommandDispatcher
writeGameErrorln
in interface CommandDispatcher
s
- The message to writepublic boolean writeNetworkMessage(java.lang.String s)
s
- The message to sendpublic boolean writeNetworkMessageln(java.lang.String s)
writeNetworkMessageln
in interface CommandDispatcher
s
- The message to sendpublic void buttonPressed(ToolbarHandler.Button button)
ToolbarHandler
buttonPressed
in interface ToolbarHandler
button
- The Buttonpublic void ropChanged(boolean[] rop)
CommandDispatcher
ropChanged
in interface CommandDispatcher
rop
- The current/new state of the Ready[0], Online[1], and Playing[2] buttons.