本文整理匯總了Java中org.eclipse.dd.dc.Bounds.setX方法的典型用法代碼示例。如果您正苦於以下問題:Java Bounds.setX方法的具體用法?Java Bounds.setX怎麽用?Java Bounds.setX使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.dd.dc.Bounds
的用法示例。
在下文中一共展示了Bounds.setX方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateShapeBoundsInSubprocessInLanes
import org.eclipse.dd.dc.Bounds; //導入方法依賴的package包/類
public void updateShapeBoundsInSubprocessInLanes(BPMNPlane plane,
BaseElement ele,
SubProcess sub,
float parentX,
float parentY) {
for (FlowElement subEle : sub.getFlowElements()) {
Bounds subEleBounds = getBoundsForElement(subEle,
plane);
if (subEleBounds != null) {
subEleBounds.setX(subEleBounds.getX() + parentX);
subEleBounds.setY(subEleBounds.getY() + parentY);
}
if (subEle instanceof SubProcess) {
updateShapeBoundsInSubprocessInLanes(plane,
ele,
(SubProcess) subEle,
subEleBounds.getX(),
subEleBounds.getY());
}
}
}
示例2: updateShapeBoundsInLanes
import org.eclipse.dd.dc.Bounds; //導入方法依賴的package包/類
public void updateShapeBoundsInLanes(BPMNPlane plane,
BaseElement ele,
Lane lane,
float parentX,
float parentY) {
for (FlowNode fn : lane.getFlowNodeRefs()) {
Bounds fnBounds = getBoundsForElement(fn,
plane);
if (fnBounds != null) {
fnBounds.setX(fnBounds.getX() + parentX);
fnBounds.setY(fnBounds.getY() + parentY);
// if flownode is a subprocess update it too
if (fn instanceof SubProcess) {
updateShapeBoundsInSubprocessInLanes(plane,
ele,
(SubProcess) fn,
fnBounds.getX(),
fnBounds.getY());
} else if (fn instanceof Lane) {
updateShapeBoundsInLanes(plane,
ele,
(Lane) fn,
fnBounds.getX(),
fnBounds.getY());
}
}
}
}
示例3: readShapeDI
import org.eclipse.dd.dc.Bounds; //導入方法依賴的package包/類
/**
* 處理圖形元素
* @param objectNode
* @param parentX
* @param parentY
* @param shapeMap
* @param sourceRefMap
* @param bpmnModel
*/
private void readShapeDI(JsonNode objectNode, double parentX, double parentY,
Map<String, JsonNode> shapeMap, Map<String, JsonNode> sourceRefMap, Definitions bpmnModel) {
if (objectNode.get(EDITOR_CHILD_SHAPES) != null) {
for (JsonNode jsonChildNode : objectNode.get(EDITOR_CHILD_SHAPES)) {
String stencilId = BpmnJsonConverterUtil.getStencilId(jsonChildNode);
if (STENCIL_SEQUENCE_FLOW.equals(stencilId) == false) {
String elementId = BpmnJsonConverterUtil.getElementId(jsonChildNode);
Bounds graphicInfo=DcFactory.eINSTANCE.createBounds();
BPMNShape bpmnShape=BpmnDiFactory.eINSTANCE.createBPMNShape();
bpmnShape.setBounds(graphicInfo);
bpmnShape.setId(BpmnJsonConverterUtil.getFormatShapeId(elementId));
JsonNode boundsNode = jsonChildNode.get(EDITOR_BOUNDS);
ObjectNode upperLeftNode = (ObjectNode) boundsNode.get(EDITOR_BOUNDS_UPPER_LEFT);
double upLeftX = upperLeftNode.get(EDITOR_BOUNDS_X).asDouble();
double upLeftY = upperLeftNode.get(EDITOR_BOUNDS_Y).asDouble();
//坐標修正
if(DI_CIRCLES.contains(stencilId)){
upLeftX -= REVERSION_X;
upLeftY -= REVERSION_Y;
}
graphicInfo.setX((float)(upLeftX + parentX ));
graphicInfo.setY((float)(upLeftY + parentY ));
ObjectNode lowerRightNode = (ObjectNode) boundsNode.get(EDITOR_BOUNDS_LOWER_RIGHT);
graphicInfo.setWidth((float)(lowerRightNode.get(EDITOR_BOUNDS_X).asDouble() - graphicInfo.getX() + parentX));
graphicInfo.setHeight((float)(lowerRightNode.get(EDITOR_BOUNDS_Y).asDouble() - graphicInfo.getY() + parentY));
String childShapeId = jsonChildNode.get(EDITOR_SHAPE_ID).asText();
//bpmnShape.setBpmnElement(BpmnModelUtil.getBaseElement(bpmnModel, BpmnJsonConverterUtil.getElementId(jsonChildNode)));
//這裏注釋掉的以後需要實現 bpmnModel.addGraphicInfo(BpmnJsonConverterUtil.getElementId(jsonChildNode), graphicInfo);
bpmnModel.getDiagrams().get(0).getPlane().getPlaneElement().add(bpmnShape);
shapeMap.put(childShapeId, jsonChildNode);
ArrayNode outgoingNode = (ArrayNode) jsonChildNode.get("outgoing");
if (outgoingNode != null && outgoingNode.size() > 0) {
for (JsonNode outgoingChildNode : outgoingNode) {
JsonNode resourceNode = outgoingChildNode.get(EDITOR_SHAPE_ID);
if (resourceNode != null) {
sourceRefMap.put(resourceNode.asText(), jsonChildNode);
}
}
}
readShapeDI(jsonChildNode, graphicInfo.getX(), graphicInfo.getY(), shapeMap, sourceRefMap, bpmnModel);
}
}
}
}