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


Java GroupType.CONCURRENT_STATE属性代码示例

本文整理汇总了Java中net.sourceforge.plantuml.cucadiagram.GroupType.CONCURRENT_STATE属性的典型用法代码示例。如果您正苦于以下问题:Java GroupType.CONCURRENT_STATE属性的具体用法?Java GroupType.CONCURRENT_STATE怎么用?Java GroupType.CONCURRENT_STATE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.sourceforge.plantuml.cucadiagram.GroupType的用法示例。


在下文中一共展示了GroupType.CONCURRENT_STATE属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: concurrentState

public boolean concurrentState(char direction) {
	final IGroup cur = getCurrentGroup();
	// printlink("BEFORE");
	if (EntityUtils.groupRoot(cur) == false && cur.getGroupType() == GroupType.CONCURRENT_STATE) {
		super.endGroup();
	}
	getCurrentGroup().setConcurrentSeparator(direction);
	final IGroup conc1 = getOrCreateGroup(UniqueSequence.getCode(CONCURRENT_PREFIX), Display.create(""),
			GroupType.CONCURRENT_STATE, getCurrentGroup());
	if (EntityUtils.groupRoot(cur) == false && cur.getGroupType() == GroupType.STATE) {
		cur.moveEntitiesTo(conc1);
		super.endGroup();
		getOrCreateGroup(UniqueSequence.getCode(CONCURRENT_PREFIX), Display.create(""), GroupType.CONCURRENT_STATE,
				getCurrentGroup());
	}
	// printlink("AFTER");
	return true;
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:18,代码来源:StateDiagram.java

示例2: concurrentState

public boolean concurrentState() {
	final IGroup cur = getCurrentGroup();
	// printlink("BEFORE");
	if (EntityUtils.groupRoot(cur) == false && cur.getGroupType() == GroupType.CONCURRENT_STATE) {
		super.endGroup();
	}
	final IGroup conc1 = getOrCreateGroup(UniqueSequence.getCode("CONC"), Display.create(""), null,
			GroupType.CONCURRENT_STATE, getCurrentGroup());
	if (EntityUtils.groupRoot(cur) == false && cur.getGroupType() == GroupType.STATE) {
		cur.moveEntitiesTo(conc1);
		super.endGroup();
		getOrCreateGroup(UniqueSequence.getCode("CONC"), Display.create(""), null, GroupType.CONCURRENT_STATE,
				getCurrentGroup());
	}
	// printlink("AFTER");
	return true;
}
 
开发者ID:mar9000,项目名称:plantuml,代码行数:17,代码来源:StateDiagram.java

示例3: printGroup

private void printGroup(DotStringFactory dotStringFactory, IGroup g) {
	if (g.getGroupType() == GroupType.CONCURRENT_STATE) {
		return;
	}
	int titleAndAttributeWidth = 0;
	int titleAndAttributeHeight = 0;

	final TextBlock title = getTitleBlock(g);
	final TextBlock stereo = getStereoBlock(g);
	final TextBlock stereoAndTitle = TextBlockUtils.mergeTB(stereo, title, HorizontalAlignment.CENTER);
	final Dimension2D dimLabel = stereoAndTitle.calculateDimension(stringBounder);
	if (dimLabel.getWidth() > 0) {
		final List<Member> members = ((IEntity) g).getBodier().getFieldsToDisplay();
		final TextBlockWidth attribute;
		if (members.size() == 0) {
			attribute = new TextBlockEmpty();
		} else {
			attribute = new MethodsOrFieldsArea(members, FontParam.STATE_ATTRIBUTE, dotData.getSkinParam(),
					g.getStereotype());
		}
		final Dimension2D dimAttribute = attribute.calculateDimension(stringBounder);
		final double attributeHeight = dimAttribute.getHeight();
		final double attributeWidth = dimAttribute.getWidth();
		final double marginForFields = attributeHeight > 0 ? IEntityImage.MARGIN : 0;
		final USymbol uSymbol = g.getUSymbol();
		final int suppHeightBecauseOfShape = uSymbol == null ? 0 : uSymbol.suppHeightBecauseOfShape();
		final int suppWidthBecauseOfShape = uSymbol == null ? 0 : uSymbol.suppWidthBecauseOfShape();

		titleAndAttributeWidth = (int) Math.max(dimLabel.getWidth(), attributeWidth) + suppWidthBecauseOfShape;
		titleAndAttributeHeight = (int) (dimLabel.getHeight() + attributeHeight + marginForFields + suppHeightBecauseOfShape);
	}

	dotStringFactory.openCluster(g, titleAndAttributeWidth, titleAndAttributeHeight, title, stereo);
	this.printEntities(dotStringFactory, g.getLeafsDirect());

	printGroups(dotStringFactory, g);

	dotStringFactory.closeCluster();
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:39,代码来源:DotDataImageBuilder.java

示例4: printGroup

private void printGroup(IGroup g) {
	if (g.getGroupType() == GroupType.CONCURRENT_STATE) {
		return;
	}
	int titleAndAttributeWidth = 0;
	int titleAndAttributeHeight = 0;

	final TextBlock title = getTitleBlock(g);
	final TextBlock stereo = getStereoBlock(g);
	final TextBlock stereoAndTitle = TextBlockUtils.mergeTB(stereo, title, HorizontalAlignment.CENTER);
	final Dimension2D dimLabel = stereoAndTitle.calculateDimension(stringBounder);
	if (dimLabel.getWidth() > 0) {
		final List<Member> members = ((IEntity) g).getBodier().getFieldsToDisplay();
		final TextBlockWidth attribute;
		if (members.size() == 0) {
			attribute = new TextBlockEmpty();
		} else {
			attribute = new MethodsOrFieldsArea(members, FontParam.STATE_ATTRIBUTE, diagram.getSkinParam(),
					g.getStereotype());
		}
		final Dimension2D dimAttribute = attribute.calculateDimension(stringBounder);
		final double attributeHeight = dimAttribute.getHeight();
		final double attributeWidth = dimAttribute.getWidth();
		final double marginForFields = attributeHeight > 0 ? IEntityImage.MARGIN : 0;
		final USymbol uSymbol = g.getUSymbol();
		final int suppHeightBecauseOfShape = uSymbol == null ? 0 : uSymbol.suppHeightBecauseOfShape();
		final int suppWidthBecauseOfShape = uSymbol == null ? 0 : uSymbol.suppWidthBecauseOfShape();

		titleAndAttributeWidth = (int) Math.max(dimLabel.getWidth(), attributeWidth) + suppWidthBecauseOfShape;
		titleAndAttributeHeight = (int) (dimLabel.getHeight() + attributeHeight + marginForFields + suppHeightBecauseOfShape);
	}

	dotStringFactory.openCluster(g, titleAndAttributeWidth, titleAndAttributeHeight, title, stereo);
	this.printEntities(g.getLeafsDirect());

	printGroups(g);

	dotStringFactory.closeCluster();
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:39,代码来源:CucaDiagramFileMakerJDot.java

示例5: checkConcurrentStateOk

public boolean checkConcurrentStateOk(Code code) {
	if (leafExist(code) == false) {
		return true;
	}
	final IEntity existing = this.getLeafsget(code);
	if (getCurrentGroup().getGroupType() == GroupType.CONCURRENT_STATE
			&& getCurrentGroup() != existing.getParentContainer()) {
		return false;
	}
	if (existing.getParentContainer().getGroupType() == GroupType.CONCURRENT_STATE
			&& getCurrentGroup() != existing.getParentContainer()) {
		return false;
	}
	return true;
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:15,代码来源:StateDiagram.java

示例6: endGroup

@Override
public void endGroup() {
	final IGroup cur = getCurrentGroup();
	if (EntityUtils.groupRoot(cur) == false && cur.getGroupType() == GroupType.CONCURRENT_STATE) {
		super.endGroup();
	}
	super.endGroup();
}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:8,代码来源:StateDiagram.java

示例7: getGroupParentIfItIsConcurrentState

private static IGroup getGroupParentIfItIsConcurrentState(IEntity ent) {
	IGroup parent = ent.getParentContainer();
	while (parent != null) {
		if (parent.getGroupType() == GroupType.CONCURRENT_STATE) {
			return parent;
		}
		parent = parent.getParentContainer();
	}
	return null;

}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:11,代码来源:StateDiagram.java

示例8: printGroup

private void printGroup(IGroup g) throws IOException {
	if (g.getGroupType() == GroupType.CONCURRENT_STATE) {
		return;
	}
	int titleAndAttributeWidth = 0;
	int titleAndAttributeHeight = 0;

	final TextBlock title = getTitleBlock(g);
	final TextBlock stereo = getStereoBlock(g);
	final TextBlock stereoAndTitle = TextBlockUtils.mergeTB(stereo, title, HorizontalAlignment.CENTER);
	final Dimension2D dimLabel = stereoAndTitle.calculateDimension(stringBounder);
	if (dimLabel.getWidth() > 0) {
		final List<Member> members = ((IEntity) g).getFieldsToDisplay();
		final TextBlockWidth attribute;
		if (members.size() == 0) {
			attribute = new TextBlockEmpty();
		} else {
			attribute = new MethodsOrFieldsArea(members, FontParam.STATE_ATTRIBUTE, dotData.getSkinParam());
		}
		final Dimension2D dimAttribute = attribute.calculateDimension(stringBounder);
		final double attributeHeight = dimAttribute.getHeight();
		final double attributeWidth = dimAttribute.getWidth();
		final double marginForFields = attributeHeight > 0 ? IEntityImage.MARGIN : 0;

		titleAndAttributeWidth = (int) Math.max(dimLabel.getWidth(), attributeWidth);
		titleAndAttributeHeight = (int) (dimLabel.getHeight() + attributeHeight + marginForFields);
	}

	dotStringFactory.openCluster(g, titleAndAttributeWidth, titleAndAttributeHeight, title, stereo);
	this.printEntities(g.getLeafsDirect());

	printGroups(g);

	dotStringFactory.closeCluster();
}
 
开发者ID:mar9000,项目名称:plantuml,代码行数:35,代码来源:CucaDiagramFileMakerSvek2.java

示例9: putConcurrentStateAtEnd

private Collection<IGroup> putConcurrentStateAtEnd(Collection<IGroup> groups) {
	final List<IGroup> result = new ArrayList<IGroup>();
	final List<IGroup> end = new ArrayList<IGroup>();
	for (IGroup g : groups) {
		if (g.getGroupType() == GroupType.CONCURRENT_STATE) {
			end.add(g);
		} else {
			result.add(g);
		}
	}
	result.addAll(end);
	return result;
}
 
开发者ID:mar9000,项目名称:plantuml,代码行数:13,代码来源:CucaDiagramSimplifierState.java

示例10: getGroupParentIfItIsConcurrentState

private IGroup getGroupParentIfItIsConcurrentState(IEntity ent) {
	IGroup parent = ent.getParentContainer();
	while (parent != null) {
		if (parent.getGroupType() == GroupType.CONCURRENT_STATE) {
			return parent;
		}
		parent = parent.getParentContainer();
	}
	return null;

}
 
开发者ID:mar9000,项目名称:plantuml,代码行数:11,代码来源:StateDiagramFactory.java

示例11: getImage

public IEntityImage getImage() {
	final Display display = group.getDisplay();
	final ISkinParam skinParam = diagram.getSkinParam();
	final TextBlock title = display.create(
			new FontConfiguration(skinParam, FontParam.STATE, group.getStereotype()), HorizontalAlignment.CENTER,
			diagram.getSkinParam());

	if (group.size() == 0 && group.getChildren().size() == 0) {
		return new EntityImageState(group, diagram.getSkinParam());
	}
	final List<Link> links = getPureInnerLinks();

	final DotData dotData = new DotData(group, links, group.getLeafsDirect(), diagram.getUmlDiagramType(),
			skinParam, new InnerGroupHierarchy(), diagram.getColorMapper(), diagram.getEntityFactory(),
			diagram.isHideEmptyDescriptionForState(), DotMode.NORMAL, diagram.getNamespaceSeparator(),
			diagram.getPragma());

	final DotDataImageBuilder svek2 = new DotDataImageBuilder(dotData, diagram.getEntityFactory(),
			diagram.getSource(), diagram.getPragma(), stringBounder);
	
	if (group.getGroupType() == GroupType.CONCURRENT_STATE) {
		// return new InnerStateConcurrent(svek2.createFile());
		return svek2.buildImage(null, new String[0]);
	}

	if (group.getGroupType() != GroupType.STATE) {
		throw new UnsupportedOperationException(group.getGroupType().toString());
	}

	HtmlColor borderColor = group.getColors(skinParam).getColor(ColorType.LINE);
	if (borderColor == null) {
		borderColor = getColor(ColorParam.stateBorder, group.getStereotype());
	}
	final Stereotype stereo = group.getStereotype();
	final HtmlColor backColor = group.getColors(skinParam).getColor(ColorType.BACK) == null ? getColor(
			ColorParam.stateBackground, stereo) : group.getColors(skinParam).getColor(ColorType.BACK);
	final List<Member> members = ((IEntity) group).getBodier().getFieldsToDisplay();
	final TextBlockWidth attribute;
	if (members.size() == 0) {
		attribute = new TextBlockEmpty();
	} else {
		attribute = new MethodsOrFieldsArea(members, FontParam.STATE_ATTRIBUTE, diagram.getSkinParam(),
				group.getStereotype());
	}

	final Stereotype stereotype = group.getStereotype();
	final boolean withSymbol = stereotype != null && stereotype.isWithOOSymbol();

	final boolean containsOnlyConcurrentStates = containsOnlyConcurrentStates(dotData);
	final IEntityImage image = containsOnlyConcurrentStates ? buildImageForConcurrentState(dotData) : svek2
			.buildImage(null, new String[0]);
	UStroke stroke = group.getColors(skinParam).getSpecificLineStroke();
	if (stroke == null) {
		stroke = new UStroke(1.5);
	}
	return new InnerStateAutonom(image, title, attribute, borderColor, backColor, skinParam.shadowing(),
			group.getUrl99(), withSymbol, stroke);

}
 
开发者ID:Banno,项目名称:sbt-plantuml-plugin,代码行数:59,代码来源:GroupPngMakerState.java

示例12: getImage

public IEntityImage getImage() throws IOException, InterruptedException {
	final Display display = group.getDisplay();
	final TextBlock title = TextBlockUtils.create(display, new FontConfiguration(getFont(FontParam.STATE),
			HtmlColorUtils.BLACK, HtmlColorUtils.BLUE), HorizontalAlignment.CENTER, diagram.getSkinParam());

	if (group.size() == 0) {
		return new EntityImageState(group, diagram.getSkinParam());
	}
	final List<Link> links = getPureInnerLinks();
	final ISkinParam skinParam = diagram.getSkinParam();

	boolean hasVerticalLine = false;
	for (ILeaf leaf : group.getLeafsDirect()) {
		if (leaf.getEntityType() == LeafType.STATE_CONCURRENT) {
			hasVerticalLine = true;
		}
	}

	final DotData dotData = new DotData(group, links, group.getLeafsDirect(), diagram.getUmlDiagramType(),
			skinParam, group.getRankdir(), new InnerGroupHierarchy(), diagram.getColorMapper(),
			diagram.getEntityFactory(), diagram.isHideEmptyDescriptionForState(), DotMode.NORMAL,
			diagram.getNamespaceSeparator(), diagram.getPragma());

	final CucaDiagramFileMakerSvek2 svek2 = new CucaDiagramFileMakerSvek2(dotData, diagram.getEntityFactory(),
			hasVerticalLine, diagram.getSource(), diagram.getPragma());
	UStroke stroke = group.getSpecificLineStroke();
	if (stroke == null) {
		stroke = new UStroke(1.5);
	}

	if (group.getGroupType() == GroupType.CONCURRENT_STATE) {
		// return new InnerStateConcurrent(svek2.createFile());
		return svek2.createFile();
	} else if (group.getGroupType() == GroupType.STATE) {
		HtmlColor borderColor = group.getSpecificLineColor();
		if (borderColor == null) {
			borderColor = getColor(ColorParam.stateBorder, null);
		}
		final Stereotype stereo = group.getStereotype();
		final HtmlColor backColor = group.getSpecificBackColor() == null ? getColor(ColorParam.stateBackground,
				stereo) : group.getSpecificBackColor();
		final List<Member> members = ((IEntity) group).getFieldsToDisplay();
		final TextBlockWidth attribute;
		if (members.size() == 0) {
			attribute = new TextBlockEmpty();
		} else {
			attribute = new MethodsOrFieldsArea(members, FontParam.STATE_ATTRIBUTE, diagram.getSkinParam());
		}

		final Stereotype stereotype = group.getStereotype();
		final boolean withSymbol = stereotype != null && stereotype.isWithOOSymbol();

		return new InnerStateAutonom(svek2.createFile(), title, attribute, borderColor, backColor,
				skinParam.shadowing(), group.getUrl99(), withSymbol, stroke);
	}

	throw new UnsupportedOperationException(group.getGroupType().toString());

}
 
开发者ID:mar9000,项目名称:plantuml,代码行数:59,代码来源:GroupPngMakerState.java


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