當前位置: 首頁>>代碼示例>>Java>>正文


Java ParticipantType類代碼示例

本文整理匯總了Java中net.sourceforge.plantuml.sequencediagram.ParticipantType的典型用法代碼示例。如果您正苦於以下問題:Java ParticipantType類的具體用法?Java ParticipantType怎麽用?Java ParticipantType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ParticipantType類屬於net.sourceforge.plantuml.sequencediagram包,在下文中一共展示了ParticipantType類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: LivingSpace

import net.sourceforge.plantuml.sequencediagram.ParticipantType; //導入依賴的package包/類
public LivingSpace(Participant p, ParticipantEnglober englober, Skin skin, ISkinParam skinParam, Real position,
		List<Event> events) {
	this.eventsHistory = new EventsHistory(p, events);
	this.p = p;
	this.skin = skin;
	this.skinParam = skinParam;
	this.englober = englober;
	this.posB = position;
	if (p.getType() == ParticipantType.PARTICIPANT) {
		headType = ComponentType.PARTICIPANT_HEAD;
		tailType = ComponentType.PARTICIPANT_TAIL;
	} else if (p.getType() == ParticipantType.ACTOR) {
		headType = ComponentType.ACTOR_HEAD;
		tailType = ComponentType.ACTOR_TAIL;
	} else if (p.getType() == ParticipantType.BOUNDARY) {
		headType = ComponentType.BOUNDARY_HEAD;
		tailType = ComponentType.BOUNDARY_TAIL;
	} else if (p.getType() == ParticipantType.CONTROL) {
		headType = ComponentType.CONTROL_HEAD;
		tailType = ComponentType.CONTROL_TAIL;
	} else if (p.getType() == ParticipantType.ENTITY) {
		headType = ComponentType.ENTITY_HEAD;
		tailType = ComponentType.ENTITY_TAIL;
	} else if (p.getType() == ParticipantType.DATABASE) {
		headType = ComponentType.DATABASE_HEAD;
		tailType = ComponentType.DATABASE_TAIL;
	} else {
		throw new IllegalArgumentException();
	}
	// this.stairs2.addStep2(0, p.getInitialLife());
	// this.stairs2.addStep2(0, 0);
	this.useContinueLineBecauseOfDelay = useContinueLineBecauseOfDelay(events);
	this.mutingLine = new MutingLine(skin, skinParam, events);
	this.liveBoxes = new LiveBoxes(eventsHistory, skin, skinParam, p);
}
 
開發者ID:Banno,項目名稱:sbt-plantuml-plugin,代碼行數:36,代碼來源:LivingSpace.java

示例2: LivingSpace

import net.sourceforge.plantuml.sequencediagram.ParticipantType; //導入依賴的package包/類
public LivingSpace(Participant p, ParticipantEnglober englober, Skin skin, ISkinParam skinParam, Real position,
		List<Event> events) {
	this.eventsHistory = new EventsHistory(p, events);
	this.p = p;
	this.skin = skin;
	this.skinParam = skinParam;
	this.posB = position;
	if (p.getType() == ParticipantType.PARTICIPANT) {
		headType = ComponentType.PARTICIPANT_HEAD;
		tailType = ComponentType.PARTICIPANT_TAIL;
	} else if (p.getType() == ParticipantType.ACTOR) {
		headType = ComponentType.ACTOR_HEAD;
		tailType = ComponentType.ACTOR_TAIL;
	} else if (p.getType() == ParticipantType.BOUNDARY) {
		headType = ComponentType.BOUNDARY_HEAD;
		tailType = ComponentType.BOUNDARY_TAIL;
	} else if (p.getType() == ParticipantType.CONTROL) {
		headType = ComponentType.CONTROL_HEAD;
		tailType = ComponentType.CONTROL_TAIL;
	} else if (p.getType() == ParticipantType.ENTITY) {
		headType = ComponentType.ENTITY_HEAD;
		tailType = ComponentType.ENTITY_TAIL;
	} else if (p.getType() == ParticipantType.DATABASE) {
		headType = ComponentType.DATABASE_HEAD;
		tailType = ComponentType.DATABASE_TAIL;
	} else {
		throw new IllegalArgumentException();
	}
	this.stairs.addStep(0, p.getInitialLife());
	this.useContinueLineBecauseOfDelay = useContinueLineBecauseOfDelay(events);
	this.mutingLine = new MutingLine(skin, skinParam, events);

}
 
開發者ID:mar9000,項目名稱:plantuml,代碼行數:34,代碼來源:LivingSpace.java

示例3: addParticipant

import net.sourceforge.plantuml.sequencediagram.ParticipantType; //導入依賴的package包/類
private void addParticipant(final String actorName, final Participant participant) {
    final PlantUmlParticipantDescriptor plantUmlParticipantDescriptor = store.create(PlantUmlParticipantDescriptor.class);

    final ParticipantType type = participant.getType();
    plantUmlParticipantDescriptor.setType(type.name());
    plantUmlParticipantDescriptor.setName(actorName);

    final Stereotype stereotype = participant.getStereotype();
    if(stereotype != null) {
        plantUmlParticipantDescriptor.setStereotype(stereotype.getLabel(true));
    }

    participantDescriptors.put(actorName, plantUmlParticipantDescriptor);
}
 
開發者ID:kontext-e,項目名稱:jqassistant-plugins,代碼行數:15,代碼來源:PumlLineParser.java

示例4: executeArg

import net.sourceforge.plantuml.sequencediagram.ParticipantType; //導入依賴的package包/類
@Override
final protected CommandExecutionResult executeArg(SequenceDiagram diagram, RegexResult arg) {
	final String code = arg.get("CODE", 0);
	if (diagram.participants().containsKey(code)) {
		diagram.putParticipantInLast(code);
		return CommandExecutionResult.ok();
	}

	Display strings = Display.NULL;
	if (arg.get("FULL", 0) != null) {
		strings = Display.getWithNewlines(arg.get("FULL", 0));
	}

	final String typeString1 = arg.get("TYPE", 0);
	final String typeCreate1 = arg.get("CREATE", 0);
	final ParticipantType type;
	final boolean create;
	if (typeCreate1 != null) {
		type = ParticipantType.valueOf(StringUtils.goUpperCase(typeCreate1));
		create = true;
	} else if (typeString1.equalsIgnoreCase("CREATE")) {
		type = ParticipantType.PARTICIPANT;
		create = true;
	} else {
		type = ParticipantType.valueOf(StringUtils.goUpperCase(typeString1));
		create = false;
	}
	final Participant participant = diagram.createNewParticipant(type, code, strings);

	final String stereotype = arg.get("STEREO", 0);

	if (stereotype != null) {
		final ISkinParam skinParam = diagram.getSkinParam();
		final boolean stereotypePositionTop = skinParam.stereotypePositionTop();
		final UFont font = skinParam.getFont(null, false, FontParam.CIRCLED_CHARACTER);
		participant.setStereotype(new Stereotype(stereotype, skinParam.getCircledCharacterRadius(), font, diagram
				.getSkinParam().getIHtmlColorSet()), stereotypePositionTop);
	}
	participant
			.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));

	final String urlString = arg.get("URL", 0);
	if (urlString != null) {
		final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
		final Url url = urlBuilder.getUrl(urlString);
		participant.setUrl(url);
	}

	if (create) {
		final String error = diagram.activate(participant, LifeEventType.CREATE, null);
		if (error != null) {
			return CommandExecutionResult.error(error);
		}

	}

	return CommandExecutionResult.ok();
}
 
開發者ID:Banno,項目名稱:sbt-plantuml-plugin,代碼行數:59,代碼來源:CommandParticipant.java

示例5: prepareParticipant

import net.sourceforge.plantuml.sequencediagram.ParticipantType; //導入依賴的package包/類
private void prepareParticipant(StringBounder stringBounder, Participant p) {
	final ComponentType headType;
	final ComponentType tailType;
	if (p.getType() == ParticipantType.PARTICIPANT) {
		headType = ComponentType.PARTICIPANT_HEAD;
		tailType = ComponentType.PARTICIPANT_TAIL;
	} else if (p.getType() == ParticipantType.ACTOR) {
		headType = ComponentType.ACTOR_HEAD;
		tailType = ComponentType.ACTOR_TAIL;
	} else if (p.getType() == ParticipantType.BOUNDARY) {
		headType = ComponentType.BOUNDARY_HEAD;
		tailType = ComponentType.BOUNDARY_TAIL;
	} else if (p.getType() == ParticipantType.CONTROL) {
		headType = ComponentType.CONTROL_HEAD;
		tailType = ComponentType.CONTROL_TAIL;
	} else if (p.getType() == ParticipantType.ENTITY) {
		headType = ComponentType.ENTITY_HEAD;
		tailType = ComponentType.ENTITY_TAIL;
	} else if (p.getType() == ParticipantType.DATABASE) {
		headType = ComponentType.DATABASE_HEAD;
		tailType = ComponentType.DATABASE_TAIL;
	} else if (p.getType() == ParticipantType.COLLECTIONS) {
		headType = ComponentType.COLLECTIONS_HEAD;
		tailType = ComponentType.COLLECTIONS_TAIL;
	} else {
		throw new IllegalArgumentException();
	}

	final ISkinParam skinParam = p.getSkinParamBackcolored(drawableSet.getSkinParam());
	final Display participantDisplay = p.getDisplay(skinParam.forceSequenceParticipantUnderlined());
	final Component head = drawableSet.getSkin().createComponent(headType, null, skinParam, participantDisplay);
	final Component tail = drawableSet.getSkin().createComponent(tailType, null, skinParam, participantDisplay);
	final Component line = drawableSet.getSkin().createComponent(this.defaultLineType, null,
			drawableSet.getSkinParam(), participantDisplay);
	final Component delayLine = drawableSet.getSkin().createComponent(ComponentType.DELAY_LINE, null,
			drawableSet.getSkinParam(), participantDisplay);
	final ParticipantBox box = new ParticipantBox(head, line, tail, delayLine, this.freeX,
			skinParam.maxAsciiMessageLength() > 0 ? 1 : 5);

	final Component comp = drawableSet.getSkin().createComponent(ComponentType.ALIVE_BOX_CLOSE_CLOSE, null,
			drawableSet.getSkinParam(), null);

	final LifeLine lifeLine = new LifeLine(box, comp.getPreferredWidth(stringBounder), drawableSet.getSkinParam()
			.shadowing());
	drawableSet.setLivingParticipantBox(p, new LivingParticipantBox(box, lifeLine));

	this.freeX = box.getMaxX(stringBounder);
}
 
開發者ID:Banno,項目名稱:sbt-plantuml-plugin,代碼行數:49,代碼來源:DrawableSetInitializer.java

示例6: executeArg

import net.sourceforge.plantuml.sequencediagram.ParticipantType; //導入依賴的package包/類
@Override
final protected CommandExecutionResult executeArg(SequenceDiagram diagram, RegexResult arg) {
	final String code = arg.get("CODE", 0);
	if (diagram.participants().containsKey(code)) {
		diagram.putParticipantInLast(code);
		return CommandExecutionResult.ok();
	}

	Display strings = null;
	if (arg.get("FULL", 0) != null) {
		strings = Display.getWithNewlines(arg.get("FULL", 0));
	}

	final String typeString1 = arg.get("TYPE", 0);
	final String typeCreate1 = arg.get("CREATE", 0);
	final ParticipantType type;
	final boolean create;
	if (typeCreate1 != null) {
		type = ParticipantType.valueOf(typeCreate1.toUpperCase());
		create = true;
	} else if (typeString1.equalsIgnoreCase("CREATE")) {
		type = ParticipantType.PARTICIPANT;
		create = true;
	} else {
		type = ParticipantType.valueOf(typeString1.toUpperCase());
		create = false;
	}
	final Participant participant = diagram.createNewParticipant(type, code, strings);

	final String stereotype = arg.get("STEREO", 0);

	if (stereotype != null) {
		final ISkinParam skinParam = diagram.getSkinParam();
		final boolean stereotypePositionTop = skinParam.stereotypePositionTop();
		final UFont font = skinParam.getFont(FontParam.CIRCLED_CHARACTER, null, false);
		participant.setStereotype(new Stereotype(stereotype, skinParam.getCircledCharacterRadius(), font, diagram
				.getSkinParam().getIHtmlColorSet()), stereotypePositionTop);
	}
	participant
			.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));

	final String urlString = arg.get("URL", 0);
	if (urlString != null) {
		final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
		final Url url = urlBuilder.getUrl(urlString);
		participant.setUrl(url);
	}

	if (create) {
		final String error = diagram.activate(participant, LifeEventType.CREATE, null);
		if (error != null) {
			return CommandExecutionResult.error(error);
		}

	}

	return CommandExecutionResult.ok();
}
 
開發者ID:mar9000,項目名稱:plantuml,代碼行數:59,代碼來源:CommandParticipant.java

示例7: prepareParticipant

import net.sourceforge.plantuml.sequencediagram.ParticipantType; //導入依賴的package包/類
private void prepareParticipant(StringBounder stringBounder, Participant p) {
	final ComponentType headType;
	final ComponentType tailType;
	if (p.getType() == ParticipantType.PARTICIPANT) {
		headType = ComponentType.PARTICIPANT_HEAD;
		tailType = ComponentType.PARTICIPANT_TAIL;
	} else if (p.getType() == ParticipantType.ACTOR) {
		headType = ComponentType.ACTOR_HEAD;
		tailType = ComponentType.ACTOR_TAIL;
	} else if (p.getType() == ParticipantType.BOUNDARY) {
		headType = ComponentType.BOUNDARY_HEAD;
		tailType = ComponentType.BOUNDARY_TAIL;
	} else if (p.getType() == ParticipantType.CONTROL) {
		headType = ComponentType.CONTROL_HEAD;
		tailType = ComponentType.CONTROL_TAIL;
	} else if (p.getType() == ParticipantType.ENTITY) {
		headType = ComponentType.ENTITY_HEAD;
		tailType = ComponentType.ENTITY_TAIL;
	} else if (p.getType() == ParticipantType.DATABASE) {
		headType = ComponentType.DATABASE_HEAD;
		tailType = ComponentType.DATABASE_TAIL;
	} else {
		throw new IllegalArgumentException();
	}
	HtmlColor specificBackColor = p.getSpecificBackColor();
	final boolean clickable = p.getUrl() != null;
	final HtmlColor stereoBackColor = drawableSet.getSkinParam().getHtmlColor(p.getBackgroundColorParam(),
			p.getStereotype(), clickable);
	if (stereoBackColor != null && specificBackColor == null) {
		specificBackColor = stereoBackColor;
	}

	final ISkinParam skinParam = new SkinParamBackcolored(drawableSet.getSkinParam(), specificBackColor, clickable);
	final Display participantDisplay = p.getDisplay(skinParam.forceSequenceParticipantUnderlined());
	final Component head = drawableSet.getSkin().createComponent(headType, null, skinParam, participantDisplay);
	final Component tail = drawableSet.getSkin().createComponent(tailType, null, skinParam, participantDisplay);
	final Component line = drawableSet.getSkin().createComponent(this.defaultLineType, null,
			drawableSet.getSkinParam(), participantDisplay);
	final Component delayLine = drawableSet.getSkin().createComponent(ComponentType.DELAY_LINE, null,
			drawableSet.getSkinParam(), participantDisplay);
	final ParticipantBox box = new ParticipantBox(head, line, tail, delayLine, this.freeX);

	final Component comp = drawableSet.getSkin().createComponent(ComponentType.ALIVE_BOX_CLOSE_CLOSE, null,
			drawableSet.getSkinParam(), null);

	final LifeLine lifeLine = new LifeLine(box, comp.getPreferredWidth(stringBounder), drawableSet.getSkinParam()
			.shadowing());
	drawableSet.setLivingParticipantBox(p, new LivingParticipantBox(box, lifeLine));

	this.freeX = box.getMaxX(stringBounder);
}
 
開發者ID:mar9000,項目名稱:plantuml,代碼行數:52,代碼來源:DrawableSetInitializer.java


注:本文中的net.sourceforge.plantuml.sequencediagram.ParticipantType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。