Ejemplo n.º 1
0
 @Override
 protected CommandExecutionResult executeArg(SequenceDiagram diagram, List<String> arg) {
   final LifeEventType type = LifeEventType.valueOf(StringUtils.goUpperCase(arg.get(0)));
   final Participant p =
       diagram.getOrCreateParticipant(
           StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get(1)));
   final HtmlColor backColor =
       diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get(2));
   final HtmlColor lineColor =
       diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get(3));
   final String error = diagram.activate(p, type, backColor, lineColor);
   if (error == null) {
     return CommandExecutionResult.ok();
   }
   return CommandExecutionResult.error(error);
 }
  private CommandExecutionResult executeInternal(
      SequenceDiagram system, final RegexResult line0, final List<String> in) {
    final AbstractMessage m = system.getLastMessage();
    if (m != null) {
      final NotePosition position = NotePosition.valueOf(line0.get("POSITION", 0).toUpperCase());
      List<CharSequence> strings = StringUtils.manageEmbededDiagrams(in);
      final Url url;
      if (strings.size() > 0) {
        url =
            StringUtils.extractUrl(
                system.getSkinParam().getValue("topurl"), strings.get(0).toString(), true);
      } else {
        url = null;
      }
      if (url != null) {
        strings = strings.subList(1, strings.size());
      }

      m.setNote(strings, position, line0.get("COLOR", 0), url);
    }

    return CommandExecutionResult.ok();
  }
Ejemplo n.º 3
0
 @Override
 protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, List<String> arg) {
   final Display strings = Display.getWithNewlines(arg.get(0));
   sequenceDiagram.divider(strings);
   return CommandExecutionResult.ok();
 }