本文整理汇总了Java中VASSAL.build.module.Chatter.DisplayText方法的典型用法代码示例。如果您正苦于以下问题:Java Chatter.DisplayText方法的具体用法?Java Chatter.DisplayText怎么用?Java Chatter.DisplayText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VASSAL.build.module.Chatter
的用法示例。
在下文中一共展示了Chatter.DisplayText方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import VASSAL.build.module.Chatter; //导入方法依赖的package包/类
public Command apply(Deck d, PieceFilter filter) {
String reportText = reportFormat.getText(source);
Command c;
if (reportText.length() > 0) {
c = new Chatter.DisplayText(GameModule.getGameModule().getChatter(), "*" + reportText);
c.execute();
}
else {
c = new NullCommand();
}
Visitor visitor = new Visitor(c, filter, keyStroke);
DeckVisitorDispatcher dispatcher = new DeckVisitorDispatcher(visitor);
dispatcher.accept(d);
visitor.getTracker().repaint();
c = visitor.getCommand();
return c;
}
示例2: launch
import VASSAL.build.module.Chatter; //导入方法依赖的package包/类
public void launch() {
String oldValue = property.getPropertyValue();
String newValue = getNewValue();
if (newValue != null && !newValue.equals(oldValue)) {
Command c = property.setPropertyValue(newValue);
if (report.getFormat().length() > 0) {
report.setProperty(OLD_VALUE_FORMAT, oldValue);
report.setProperty(NEW_VALUE_FORMAT, property.getPropertyValue());
report.setProperty(DESCRIPTION_FORMAT, property.getDescription());
Chatter.DisplayText chatCommand = new Chatter.DisplayText(GameModule.getGameModule().getChatter(), "* "+report.getLocalizedText());
chatCommand.execute();
c.append(chatCommand);
}
GameModule.getGameModule().sendAndLog(c);
}
}
示例3: apply
import VASSAL.build.module.Chatter; //导入方法依赖的package包/类
/**
* Apply the key command to all pieces that pass the given filter on all the given maps
*
* @param m
* @param filter
* @return a the corresponding {@link Command}
*/
public Command apply(Map[] m, PieceFilter filter) {
Command c = new NullCommand();
try {
if (reportSingle) {
Map.setChangeReportingEnabled(false);
}
RecursionLimiter.startExecution(owner);
String reportText = reportFormat.getLocalizedText(source);
if (reportText.length() > 0) {
c = new Chatter.DisplayText(
GameModule.getGameModule().getChatter(), "*" + reportText);
c.execute();
}
for (int mapI = 0; mapI < m.length; ++mapI) {
Visitor visitor = new Visitor(c, filter, keyStroke);
DeckVisitorDispatcher dispatcher = new DeckVisitorDispatcher(visitor);
GamePiece[] p = m[mapI].getPieces();
for (int i = 0; i < p.length; ++i) {
dispatcher.accept(p[i]);
}
visitor.getTracker().repaint();
c = visitor.getCommand();
}
}
catch (RecursionLimitException e) {
RecursionLimiter.infiniteLoop(e);
}
finally {
RecursionLimiter.endExecution();
if (reportSingle) {
Map.setChangeReportingEnabled(true);
}
}
return c;
}
示例4: reportCommand
import VASSAL.build.module.Chatter; //导入方法依赖的package包/类
protected Command reportCommand(String format, String commandName) {
Command c = null;
FormattedString reportFormat = new FormattedString(format);
reportFormat.setProperty(DrawPile.DECK_NAME, getLocalizedDeckName());
reportFormat.setProperty(DrawPile.COMMAND_NAME, commandName);
String rep = reportFormat.getLocalizedText();
if (rep.length() > 0) {
c = new Chatter.DisplayText(GameModule.getGameModule().getChatter(), "* " + rep); //$NON-NLS-1$
c.execute();
}
return c;
}
示例5: showCHAT
import VASSAL.build.module.Chatter; //导入方法依赖的package包/类
public synchronized void showCHAT(PeerInfo pPeerInfo, String msg) {
Player sender = new P2PPlayer(pPeerInfo);
if (!sender.getName().startsWith(NAME)
&& msg.startsWith("CHAT")) { //$NON-NLS-1$
msg = "<" + client.getUserInfo().getName() //$NON-NLS-1$
+ msg.substring(msg.indexOf("> -")); //$NON-NLS-1$
Command c = new Chatter.DisplayText(null,msg);
client.sendTo(sender, c);
}
}
示例6: apply
import VASSAL.build.module.Chatter; //导入方法依赖的package包/类
public void apply() {
if (match.isNull() || match.accept(checkPiece)) {
GameModule.getGameModule().fireKeyStroke(hotkey);
String reportText = format.getLocalizedText();
if (reportText.length() > 0) {
Command c = new Chatter.DisplayText(GameModule.getGameModule().getChatter(), "* " + reportText);
c.execute();
GameModule.getGameModule().sendAndLog(c);
}
}
}
示例7: save
import VASSAL.build.module.Chatter; //导入方法依赖的package包/类
public Command save() {
Command comm = null;
for (SecretNote secretNote : notes) {
int index = lastSavedNotes.indexOf(secretNote);
if (index < 0 ||
lastSavedNotes.get(index).isHidden() != secretNote.isHidden()) {
Command c = new AddSecretNoteCommand(this, secretNote);
if (comm == null) {
comm = c;
}
else {
comm.append(c);
}
String msg;
if (index < 0) {
msg = "* " + Resources.getString("Notes.has_created", GlobalOptions.getInstance().getPlayerId(), secretNote.getName()) + " *"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
else {
msg = "* " + Resources.getString("Notes.has_revealed", GlobalOptions.getInstance().getPlayerId(), secretNote.getName()) + " *"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
c = new Chatter.DisplayText(GameModule.getGameModule().getChatter(), msg);
c.execute();
comm.append(c);
}
}
return comm;
}
示例8: accept
import VASSAL.build.module.Chatter; //导入方法依赖的package包/类
protected boolean accept(Command c) {
return c instanceof Chatter.DisplayText
|| c instanceof PrivMsgCommand
|| c instanceof SoundEncoder.Cmd;
}
示例9: save
import VASSAL.build.module.Chatter; //导入方法依赖的package包/类
protected void save() {
if (!savedState.equals(getState())) {
reportFormat.setProperty(OLD_TURN, savedTurn);
reportFormat.setProperty(NEW_TURN, getTurnString());
String s = updateString(reportFormat.getText(), new String[] { "\\n", "\\t" }, new String[] { " - ", " " }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
Command c = new Chatter.DisplayText(GameModule.getGameModule().getChatter(), "* "+s);
c.execute();
c.append(new SetTurn(this, savedState));
GameModule.getGameModule().sendAndLog(c);
setLaunchToolTip();
}
captureState();
}
示例10: WriteLine
import VASSAL.build.module.Chatter; //导入方法依赖的package包/类
private void WriteLine(String msgLine) {
FormattedString cStr = new FormattedString(msgLine);
final Command cc = new Chatter.DisplayText(mod.getChatter(), cStr.getLocalizedText());
cc.execute();
mod.sendAndLog(cc);
}
示例11: WriteLine
import VASSAL.build.module.Chatter; //导入方法依赖的package包/类
protected void WriteLine(String msgLine) {
FormattedString cStr = new FormattedString(" <COINBot> - " + msgLine);
final Command cc = new Chatter.DisplayText(mod.getChatter(), cStr.getLocalizedText());
cc.execute();
mod.sendAndLog(cc);
}
示例12: WriteLine
import VASSAL.build.module.Chatter; //导入方法依赖的package包/类
private static void WriteLine(String msgLine, String prefix, boolean raw) {
FormattedString cStr = new FormattedString((raw ? "" : " " + prefix + " <COINBot> - ") + msgLine);
final Command cc = new Chatter.DisplayText(_mod.getChatter(), cStr.getLocalizedText());
cc.execute();
_mod.sendAndLog(cc);
}