Projects >> bpmn2-modeler >>2e5f47e665ac4eb99f29588c13a4f89255e39067

Chunk
Conflicting content
		Shape textShape = getChildElementOfType(container, TEXT_ELEMENT, Boolean.toString(true), Shape.class);
		if (textShape!=null) {
<<<<<<< HEAD
			String oldLabel = ModelUtil.getName(element);
			if (oldLabel==null || oldLabel.isEmpty())
				oldLabel = "";
			String newLabel = "";
			if (textShape.getGraphicsAlgorithm() instanceof AbstractText) {
				AbstractText text = (AbstractText) textShape.getGraphicsAlgorithm();
				newLabel = text.getValue();
			}
			if (newLabel==null || newLabel.isEmpty())
				newLabel = "";
			
			return oldLabel.equals(newLabel) ? Reason.createFalseReason() : Reason.createTrueReason();
=======
			String elementName = ModelUtil.getName(element);
			if (elementName==null || elementName.isEmpty())
				elementName = "";
			String name = "";
			if (textShape.getGraphicsAlgorithm() instanceof AbstractText) {
				AbstractText text = (AbstractText) textShape.getGraphicsAlgorithm();
				name = text.getValue();
			}
			return elementName.equals(name) ? Reason.createFalseReason() : Reason.createTrueReason();
>>>>>>> 0d3f20aef7728788203657f67475e2656ea5764d
		}
		return Reason.createFalseReason();
	}
Solution content
		Shape textShape = getChildElementOfType(container, TEXT_ELEMENT, Boolean.toString(true), Shape.class);
		if (textShape!=null) {
			String oldLabel = ModelUtil.getName(element);
			if (oldLabel==null || oldLabel.isEmpty())
				oldLabel = "";
			String newLabel = "";
			if (textShape.getGraphicsAlgorithm() instanceof AbstractText) {
				AbstractText text = (AbstractText) textShape.getGraphicsAlgorithm();
				newLabel = text.getValue();
			}
			if (newLabel==null || newLabel.isEmpty())
				newLabel = "";
			
			return oldLabel.equals(newLabel) ? Reason.createFalseReason() : Reason.createTrueReason();
		}
		return Reason.createFalseReason();
	}
File
UpdateBaseElementNameFeature.java
Developer's decision
Version 1
Kind of conflict
If statement
Method invocation
Return statement
Variable
Chunk
Conflicting content
	@Override
	public boolean update(IUpdateContext context) {
<<<<<<< HEAD
		PictogramElement pe = (PictogramElement) context.getPictogramElement();
=======
		ContainerShape container = (ContainerShape) context.getPictogramElement();
>>>>>>> 0d3f20aef7728788203657f67475e2656ea5764d
		BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
		        BaseElement.class);
		Shape textShape = getChildElementOfType(pe, TEXT_ELEMENT, Boolean.toString(true), Shape.class);
Solution content
	@Override
	public boolean update(IUpdateContext context) {
		PictogramElement pe = (PictogramElement) context.getPictogramElement();
		BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
		        BaseElement.class);
		Shape textShape = getChildElementOfType(pe, TEXT_ELEMENT, Boolean.toString(true), Shape.class);
File
UpdateBaseElementNameFeature.java
Developer's decision
Version 1
Kind of conflict
Cast expression
Variable
Chunk
Conflicting content
			layoutPictogramElement(context.getPictogramElement());
		}

<<<<<<< HEAD
		if (pe instanceof ContainerShape) {
			IGaService gaService = Graphiti.getGaService();
			ContainerShape container = (ContainerShape)pe;
			
			Shape shape = container.getChildren().get(0); // Otherwise, this would never be reached!
			
			GraphicsAlgorithm textGA = container.getGraphicsAlgorithm();
			AbstractText text = (AbstractText) shape.getGraphicsAlgorithm();
			
			int oldWidth = textGA.getWidth() - GraphicsUtil.SHAPE_PADDING;
			int x = textGA.getX() + ((oldWidth + GraphicsUtil.SHAPE_PADDING) / 2);
			int y = textGA.getY();
			
			BaseElement o = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BaseElement.class);
			String name = ModelUtil.getName(o);
			
			if (name == null) {
				gaService.setLocationAndSize(textGA, x, y, 0, 0);
				gaService.setLocationAndSize(text, 0, 0, 0, 0);
				container.setVisible(false);
			} else {
				int newWidth = GraphicsUtil.getLabelWidth(text);
				int newHeight = GraphicsUtil.getLabelHeight(text);
				x = x - ((newWidth + GraphicsUtil.SHAPE_PADDING) / 2);
				gaService.setLocationAndSize(textGA, x, y, newWidth + GraphicsUtil.SHAPE_PADDING, newHeight + GraphicsUtil.SHAPE_PADDING);
				gaService.setLocationAndSize(text, 0, 0, newWidth + GraphicsUtil.TEXT_PADDING, newHeight + GraphicsUtil.TEXT_PADDING);
				container.setVisible(true);
			}
		}
		
=======
		IGaService gaService = Graphiti.getGaService();
		
		Shape shape = container.getChildren().get(0); // Otherwise, this would never be reached!
		
		GraphicsAlgorithm textGA = container.getGraphicsAlgorithm();
		AbstractText text = (AbstractText) shape.getGraphicsAlgorithm();
		
		int oldWidth = textGA.getWidth() - GraphicsUtil.SHAPE_PADDING;
		int x = textGA.getX() + ((oldWidth + GraphicsUtil.SHAPE_PADDING) / 2);
		int y = textGA.getY();
		
		BaseElement o = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BaseElement.class);
		String name = ModelUtil.getName(o);
		
		if (name == null) {
			gaService.setLocationAndSize(textGA, x, y, 0, 0);
			gaService.setLocationAndSize(text, 0, 0, 0, 0);
			container.setVisible(false);
		} else {
			int newWidth = GraphicsUtil.getLabelWidth(text);
			int newHeight = GraphicsUtil.getLabelHeight(text);
			x = x - ((newWidth + GraphicsUtil.SHAPE_PADDING) / 2);
			gaService.setLocationAndSize(textGA, x, y, newWidth + GraphicsUtil.SHAPE_PADDING, newHeight + GraphicsUtil.SHAPE_PADDING);
			gaService.setLocationAndSize(text, 0, 0, newWidth + GraphicsUtil.TEXT_PADDING, newHeight + GraphicsUtil.TEXT_PADDING);
			container.setVisible(true);
		}
>>>>>>> 0d3f20aef7728788203657f67475e2656ea5764d
		return true;
	}
}
Solution content
			layoutPictogramElement(context.getPictogramElement());
		}

		if (pe instanceof ContainerShape) {
			IGaService gaService = Graphiti.getGaService();
				ContainerShape container = (ContainerShape)pe;
			
			Shape shape = container.getChildren().get(0); // Otherwise, this would never be reached!
			
			GraphicsAlgorithm textGA = container.getGraphicsAlgorithm();
			AbstractText text = (AbstractText) shape.getGraphicsAlgorithm();
			
			int oldWidth = textGA.getWidth() - GraphicsUtil.SHAPE_PADDING;
			int x = textGA.getX() + ((oldWidth + GraphicsUtil.SHAPE_PADDING) / 2);
			int y = textGA.getY();
			
			BaseElement o = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), BaseElement.class);
			String name = ModelUtil.getName(o);
			
			if (name == null) {
				gaService.setLocationAndSize(textGA, x, y, 0, 0);
				gaService.setLocationAndSize(text, 0, 0, 0, 0);
				container.setVisible(false);
			} else {
				int newWidth = GraphicsUtil.getLabelWidth(text);
				int newHeight = GraphicsUtil.getLabelHeight(text);
				x = x - ((newWidth + GraphicsUtil.SHAPE_PADDING) / 2);
				gaService.setLocationAndSize(textGA, x, y, newWidth + GraphicsUtil.SHAPE_PADDING, newHeight + GraphicsUtil.SHAPE_PADDING);
				gaService.setLocationAndSize(text, 0, 0, newWidth + GraphicsUtil.TEXT_PADDING, newHeight + GraphicsUtil.TEXT_PADDING);
				container.setVisible(true);
			}
		}
		
		return true;
	}
}
File
UpdateBaseElementNameFeature.java
Developer's decision
Version 1
Kind of conflict
Cast expression
Comment
If statement
Method invocation
Variable