当前位置: 首页>>代码示例>>Java>>正文


Java Chatter.DisplayText方法代码示例

本文整理汇总了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;
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:20,代码来源:DeckGlobalKeyCommand.java

示例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);
  }
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:17,代码来源:ChangePropertyButton.java

示例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;
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:44,代码来源:GlobalCommand.java

示例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;
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:14,代码来源:Deck.java

示例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);
  }
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:11,代码来源:EchoClient.java

示例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);
    }
  }
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:12,代码来源:TurnGlobalHotkey.java

示例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;
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:28,代码来源:SecretNotesController.java

示例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;
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:6,代码来源:MainRoomFilter.java

示例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();
  }
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:20,代码来源:TurnTracker.java

示例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);
}
 
开发者ID:bdgza,项目名称:coin,代码行数:7,代码来源:COINBot.java

示例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);
}
 
开发者ID:bdgza,项目名称:coin,代码行数:7,代码来源:AIWindow.java

示例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);
}
 
开发者ID:bdgza,项目名称:coin,代码行数:7,代码来源:BotScriptEngine.java


注:本文中的VASSAL.build.module.Chatter.DisplayText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。