Skip to content
Snippets Groups Projects
Commit c577f8b8 authored by Christoph Döbber's avatar Christoph Döbber
Browse files

finished review of tooling.base.ui

refs 311
parent dbbcd51a
No related branches found
No related tags found
No related merge requests found
Showing
with 89 additions and 78 deletions
...@@ -32,7 +32,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase; ...@@ -32,7 +32,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
* @author ratiu * @author ratiu
* @author $Author: hoelzl $ * @author $Author: hoelzl $
* @version $Rev: 18709 $ * @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 3386CF920FA51BB64D0B8035BB9EB721 * @ConQAT.Rating RED Hash: 658C6CE7721FC82AA7DF76FC0A1CE6F0
*/ */
public abstract class PropertySectionWithCopyPasteBase<T extends IModelElementSpecification> public abstract class PropertySectionWithCopyPasteBase<T extends IModelElementSpecification>
extends PropertySectionBase implements SelectionListener { extends PropertySectionBase implements SelectionListener {
...@@ -61,6 +61,8 @@ public abstract class PropertySectionWithCopyPasteBase<T extends IModelElementSp ...@@ -61,6 +61,8 @@ public abstract class PropertySectionWithCopyPasteBase<T extends IModelElementSp
createFormEntry(copyPasteComposite, "Clipboard"); createFormEntry(copyPasteComposite, "Clipboard");
} }
// TODO @review CD: why not use SelectionAdapter and thus save the empty
// method?
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public void widgetDefaultSelected(SelectionEvent e) { public void widgetDefaultSelected(SelectionEvent e) {
......
...@@ -29,7 +29,7 @@ import org.eclipse.jface.viewers.TableViewer; ...@@ -29,7 +29,7 @@ import org.eclipse.jface.viewers.TableViewer;
* @author hoelzl * @author hoelzl
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: A39EE0F9184DD86FD5FC5D46A164976A * @ConQAT.Rating GREEN Hash: 0E48EDEDD7575A54341D6BE6926F0792
*/ */
public abstract class CheckBoxEditingSupport extends EditingSupport { public abstract class CheckBoxEditingSupport extends EditingSupport {
......
...@@ -38,8 +38,13 @@ import org.eclipse.swt.widgets.Shell; ...@@ -38,8 +38,13 @@ import org.eclipse.swt.widgets.Shell;
* @author hoelzl * @author hoelzl
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: BDA0B84E86A88AC31CFF2B2C1B367A98 * @ConQAT.Rating RED Hash: 74220EAB8C4432DC0ABDACC754751490
*/ */
// TODO @review CD: Very interesting, but is this really necessary? Don't SWT
// checkboxes work as good or even better? During testing these checkboxes seem
// to react slower and additionally they have an ugly gray background.
public abstract class CheckBoxLabelProvider extends ColumnLabelProvider { public abstract class CheckBoxLabelProvider extends ColumnLabelProvider {
/** {@link JFaceResources} id for checked image. */ /** {@link JFaceResources} id for checked image. */
private static final String CHECKED_KEY = "CHECKED"; private static final String CHECKED_KEY = "CHECKED";
......
...@@ -33,8 +33,11 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService; ...@@ -33,8 +33,11 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author hoelzl * @author hoelzl
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: 3F8CFB07632A14D29A38168BB1D15D76 * @ConQAT.Rating RED Hash: 358A7180C7CC44420271B76CD80E8450
*/ */
// TODO @review CD: Imprecise class name. I expected elements with error/warning
// decorations rather than simply an icon.
public class DecoratedIconNameLabelProvider implements IStyledLabelProvider { public class DecoratedIconNameLabelProvider implements IStyledLabelProvider {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
......
...@@ -26,7 +26,7 @@ import org.eclipse.jface.resource.ImageDescriptor; ...@@ -26,7 +26,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
* @author hoelzl * @author hoelzl
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: 4F5DBBB7032E0A60CA00568B358750A4 * @ConQAT.Rating GREEN Hash: 2CF844E52ABEFC0EF8EF0A639EA10D5F
*/ */
public class ActionUtils { public class ActionUtils {
......
...@@ -40,7 +40,7 @@ import org.fortiss.tooling.base.model.layout.ILayoutedModelElement; ...@@ -40,7 +40,7 @@ import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
* @author hoelzl * @author hoelzl
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: 9BDB7D27FC9B1917E41C3DFD44C0FF23 * @ConQAT.Rating GREEN Hash: 6A74D01004722B0E1A9FA610890C601B
*/ */
public final class EllipseLayoutUtils { public final class EllipseLayoutUtils {
/** /**
......
...@@ -17,16 +17,40 @@ $Id$ ...@@ -17,16 +17,40 @@ $Id$
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.utils; package org.fortiss.tooling.base.ui.utils;
import static org.eclipse.gef.EditPart.SELECTED_NONE;
import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_HEIGHT;
import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_WIDTH;
import static org.fortiss.tooling.base.layout.LayoutKeyConstants.CONNECTION_POINTS;
import static org.fortiss.tooling.base.layout.LayoutKeyConstants.CONNECTOR_ANGLE;
import static org.fortiss.tooling.base.layout.LayoutKeyConstants.CONNECTOR_OFFSET;
import static org.fortiss.tooling.base.layout.LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION;
import static org.fortiss.tooling.base.layout.LayoutKeyConstants.CONNECTOR_POSITION;
import static org.fortiss.tooling.base.layout.LayoutKeyConstants.NODE_DIMENSION;
import static org.fortiss.tooling.base.layout.LayoutKeyConstants.NODE_POSITION;
import static org.fortiss.tooling.base.model.layout.EOrientation.NORTH;
import static org.fortiss.tooling.base.utils.AngleUtils.getAngle;
import static org.fortiss.tooling.base.utils.AngleUtils.setAngle;
import static org.fortiss.tooling.base.utils.DimensionUtils.getDimension;
import static org.fortiss.tooling.base.utils.DimensionUtils.setDimension;
import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createAngle;
import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createOffsetOrientation;
import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createPoint;
import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createPoints;
import static org.fortiss.tooling.base.utils.OffsetOrientationUtils.getOffsetOrientation;
import static org.fortiss.tooling.base.utils.OffsetOrientationUtils.setOffsetOrientation;
import static org.fortiss.tooling.base.utils.PointUtils.getPosition;
import static org.fortiss.tooling.base.utils.PointUtils.setPoint;
import static org.fortiss.tooling.base.utils.PointsUtils.getPoints;
import static org.fortiss.tooling.base.utils.PointsUtils.setPoints;
import java.util.List; import java.util.List;
import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gef.EditPart; import org.eclipse.gef.EditPart;
import org.fortiss.tooling.base.layout.DefaultLayoutConstants;
import org.fortiss.tooling.base.layout.LayoutKeyConstants; import org.fortiss.tooling.base.layout.LayoutKeyConstants;
import org.fortiss.tooling.base.model.layout.Angle; import org.fortiss.tooling.base.model.layout.Angle;
import org.fortiss.tooling.base.model.layout.Dimension; import org.fortiss.tooling.base.model.layout.Dimension;
import org.fortiss.tooling.base.model.layout.EOrientation;
import org.fortiss.tooling.base.model.layout.ILayoutData; import org.fortiss.tooling.base.model.layout.ILayoutData;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement; import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.base.model.layout.Offset; import org.fortiss.tooling.base.model.layout.Offset;
...@@ -36,12 +60,7 @@ import org.fortiss.tooling.base.model.layout.Points; ...@@ -36,12 +60,7 @@ import org.fortiss.tooling.base.model.layout.Points;
import org.fortiss.tooling.base.ui.editpart.ConnectionEditPartBase; import org.fortiss.tooling.base.ui.editpart.ConnectionEditPartBase;
import org.fortiss.tooling.base.ui.editpart.ConnectorEditPartBase; import org.fortiss.tooling.base.ui.editpart.ConnectorEditPartBase;
import org.fortiss.tooling.base.ui.editpart.ElementEditPartBase; import org.fortiss.tooling.base.ui.editpart.ElementEditPartBase;
import org.fortiss.tooling.base.utils.AngleUtils;
import org.fortiss.tooling.base.utils.DimensionUtils;
import org.fortiss.tooling.base.utils.LayoutModelElementFactory; import org.fortiss.tooling.base.utils.LayoutModelElementFactory;
import org.fortiss.tooling.base.utils.OffsetOrientationUtils;
import org.fortiss.tooling.base.utils.PointUtils;
import org.fortiss.tooling.base.utils.PointsUtils;
/** /**
* Utility methods for {@link ILayoutedModelElement} and {@link ILayoutData}. * Utility methods for {@link ILayoutedModelElement} and {@link ILayoutData}.
...@@ -56,7 +75,7 @@ import org.fortiss.tooling.base.utils.PointsUtils; ...@@ -56,7 +75,7 @@ import org.fortiss.tooling.base.utils.PointsUtils;
* @author hummel * @author hummel
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: 2AC0495B10FD6EC5AF6DC8480D0BB126 * @ConQAT.Rating GREEN Hash: BA085FEB69C66332C246D33F24D7D240
*/ */
public class LayoutDataUtils { public class LayoutDataUtils {
...@@ -79,14 +98,13 @@ public class LayoutDataUtils { ...@@ -79,14 +98,13 @@ public class LayoutDataUtils {
/** Returns the position of the given layouted node. */ /** Returns the position of the given layouted node. */
public static Point getNodePosition(ILayoutedModelElement layouted) { public static Point getNodePosition(ILayoutedModelElement layouted) {
return PointUtils.getPosition(layouted, return getPosition(layouted, NODE_POSITION);
LayoutKeyConstants.NODE_POSITION);
} }
/** Sets the layouted node's position. */ /** Sets the layouted node's position. */
public static void setNodePosition(ILayoutedModelElement layouted, int x, public static void setNodePosition(ILayoutedModelElement layouted, int x,
int y) { int y) {
PointUtils.setPoint(layouted, LayoutKeyConstants.NODE_POSITION, x, y); setPoint(layouted, NODE_POSITION, x, y);
} }
/** /**
...@@ -94,14 +112,12 @@ public class LayoutDataUtils { ...@@ -94,14 +112,12 @@ public class LayoutDataUtils {
* the given element a new dimension with the default size is returned. * the given element a new dimension with the default size is returned.
*/ */
public static Dimension getNodeSize(ILayoutedModelElement layouted) { public static Dimension getNodeSize(ILayoutedModelElement layouted) {
Dimension size = DimensionUtils.getDimension(layouted, Dimension size = getDimension(layouted, NODE_DIMENSION);
LayoutKeyConstants.NODE_DIMENSION);
if (size == null) { if (size == null) {
Dimension result = LayoutModelElementFactory.createDimension( Dimension result = LayoutModelElementFactory.createDimension(
DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_WIDTH, DEFAULT_SHAPE_MINIMUM_WIDTH, DEFAULT_SHAPE_MINIMUM_HEIGHT,
DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_HEIGHT, NODE_DIMENSION);
LayoutKeyConstants.NODE_DIMENSION);
return result; return result;
} }
return EcoreUtil.copy(size); return EcoreUtil.copy(size);
...@@ -109,24 +125,23 @@ public class LayoutDataUtils { ...@@ -109,24 +125,23 @@ public class LayoutDataUtils {
/** Sets the layouted node's size. */ /** Sets the layouted node's size. */
public static void setNodeSize(ILayoutedModelElement layouted, int w, int h) { public static void setNodeSize(ILayoutedModelElement layouted, int w, int h) {
DimensionUtils.setDimension(layouted, setDimension(layouted, NODE_DIMENSION, w, h);
LayoutKeyConstants.NODE_DIMENSION, w, h);
} }
/** Moves the given node. */ /** Moves the given node. */
public static void moveNode(ILayoutedModelElement layouted, int dx, int dy) { public static void moveNode(ILayoutedModelElement layouted, int dx, int dy) {
Point p = LayoutDataUtils.getNodePosition(layouted); Point p = getNodePosition(layouted);
LayoutDataUtils.setNodePosition(layouted, p.getX() + dx, p.getY() + dy); setNodePosition(layouted, p.getX() + dx, p.getY() + dy);
} }
/** Moves and resizes the given node. */ /** Moves and resizes the given node. */
public static void moveAndResizeNode(ILayoutedModelElement layouted, public static void moveAndResizeNode(ILayoutedModelElement layouted,
int dx, int dy, int dw, int dh, int minWidth, int minHeight) { int dx, int dy, int dw, int dh, int minWidth, int minHeight) {
Point pos = LayoutDataUtils.getNodePosition(layouted); Point pos = getNodePosition(layouted);
int posX = pos.getX() + dx; int posX = pos.getX() + dx;
int posY = pos.getY() + dy; int posY = pos.getY() + dy;
Dimension dim = LayoutDataUtils.getNodeSize(layouted); Dimension dim = getNodeSize(layouted);
int dimW = dim.getWidth() + dw; int dimW = dim.getWidth() + dw;
int dimH = dim.getHeight() + dh; int dimH = dim.getHeight() + dh;
...@@ -144,32 +159,29 @@ public class LayoutDataUtils { ...@@ -144,32 +159,29 @@ public class LayoutDataUtils {
dimH = minHeight; dimH = minHeight;
} }
LayoutDataUtils.setNodePosition(layouted, posX, posY); setNodePosition(layouted, posX, posY);
LayoutDataUtils.setNodeSize(layouted, dimW, dimH); setNodeSize(layouted, dimW, dimH);
} }
/** Returns the layouted connector's position. */ /** Returns the layouted connector's position. */
public static Point getConnectorPosition(ILayoutedModelElement layouted) { public static Point getConnectorPosition(ILayoutedModelElement layouted) {
return PointUtils.getPosition(layouted, return getPosition(layouted, CONNECTOR_POSITION);
LayoutKeyConstants.CONNECTOR_POSITION);
} }
/** Sets the layouted connector's position. */ /** Sets the layouted connector's position. */
public static void setConnectorPosition(ILayoutedModelElement layouted, public static void setConnectorPosition(ILayoutedModelElement layouted,
int x, int y) { int x, int y) {
PointUtils.setPoint(layouted, LayoutKeyConstants.CONNECTOR_POSITION, x, setPoint(layouted, CONNECTOR_POSITION, x, y);
y);
} }
/** Returns the layouted connector's orientation. */ /** Returns the layouted connector's orientation. */
public static OffsetOrientation getConnectorOffsetOrientation( public static OffsetOrientation getConnectorOffsetOrientation(
ILayoutedModelElement layouted) { ILayoutedModelElement layouted) {
OffsetOrientation oo = OffsetOrientationUtils.getOffsetOrientation( OffsetOrientation oo = getOffsetOrientation(layouted,
layouted, LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION); CONNECTOR_OFFSET_ORIENTATION);
if (oo == null) { if (oo == null) {
return LayoutModelElementFactory.createOffsetOrientation(0, return createOffsetOrientation(0, NORTH,
EOrientation.NORTH, CONNECTOR_OFFSET_ORIENTATION);
LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION);
} }
return oo; return oo;
} }
...@@ -177,18 +189,16 @@ public class LayoutDataUtils { ...@@ -177,18 +189,16 @@ public class LayoutDataUtils {
/** Sets the layouted connector's offset and orientation. */ /** Sets the layouted connector's offset and orientation. */
public static void setConnectorOffsetOrientation( public static void setConnectorOffsetOrientation(
ILayoutedModelElement layouted, OffsetOrientation orientation) { ILayoutedModelElement layouted, OffsetOrientation orientation) {
OffsetOrientationUtils.setOffsetOrientation(layouted, setOffsetOrientation(layouted, CONNECTOR_OFFSET_ORIENTATION,
LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION,
orientation.getOffset(), orientation.getOrientation()); orientation.getOffset(), orientation.getOrientation());
} }
/** Returns the layouted connector's offset. */ /** Returns the layouted connector's offset. */
public static Offset getConnectorOffset(ILayoutedModelElement layouted) { public static Offset getConnectorOffset(ILayoutedModelElement layouted) {
OffsetOrientation offset = OffsetOrientationUtils.getOffsetOrientation( OffsetOrientation offset = getOffsetOrientation(layouted,
layouted, LayoutKeyConstants.CONNECTOR_OFFSET); CONNECTOR_OFFSET);
if (offset == null) { if (offset == null) {
return LayoutModelElementFactory.createOffsetOrientation(0, return createOffsetOrientation(0, NORTH, CONNECTOR_OFFSET);
EOrientation.NORTH, LayoutKeyConstants.CONNECTOR_OFFSET);
} }
return offset; return offset;
} }
...@@ -196,17 +206,14 @@ public class LayoutDataUtils { ...@@ -196,17 +206,14 @@ public class LayoutDataUtils {
/** Sets the layouted connector's angle. */ /** Sets the layouted connector's angle. */
public static void setConnectorAngle(ILayoutedModelElement layouted, public static void setConnectorAngle(ILayoutedModelElement layouted,
double angle) { double angle) {
AngleUtils setAngle(layouted, CONNECTOR_ANGLE, angle);
.setAngle(layouted, LayoutKeyConstants.CONNECTOR_ANGLE, angle);
} }
/** Returns the layouted connector's angle. */ /** Returns the layouted connector's angle. */
public static Angle getConnectorAngle(ILayoutedModelElement layouted) { public static Angle getConnectorAngle(ILayoutedModelElement layouted) {
Angle angle = AngleUtils.getAngle(layouted, Angle angle = getAngle(layouted, CONNECTOR_ANGLE);
LayoutKeyConstants.CONNECTOR_ANGLE);
if (angle == null) { if (angle == null) {
return LayoutModelElementFactory.createAngle(0.0, return createAngle(0.0, CONNECTOR_ANGLE);
LayoutKeyConstants.CONNECTOR_ANGLE);
} }
return angle; return angle;
} }
...@@ -219,7 +226,7 @@ public class LayoutDataUtils { ...@@ -219,7 +226,7 @@ public class LayoutDataUtils {
/** Return the absolute position for a given offset, orientation and insets. */ /** Return the absolute position for a given offset, orientation and insets. */
public static Point getAbsolute(OffsetOrientation oo, Dimension parentSize, public static Point getAbsolute(OffsetOrientation oo, Dimension parentSize,
int parentInsets) { int parentInsets) {
Point pos = LayoutModelElementFactory.createPoint(0, 0, null); Point pos = createPoint(0, 0, null);
int offsetValue = oo.getOffset(); int offsetValue = oo.getOffset();
switch (oo.getOrientation()) { switch (oo.getOrientation()) {
case NORTH: case NORTH:
...@@ -244,43 +251,38 @@ public class LayoutDataUtils { ...@@ -244,43 +251,38 @@ public class LayoutDataUtils {
/** Returns the {@link Points} layout data object for the given connection. */ /** Returns the {@link Points} layout data object for the given connection. */
public static Points getConnectionPoints(ILayoutedModelElement lobject) { public static Points getConnectionPoints(ILayoutedModelElement lobject) {
return PointsUtils.getPoints(lobject, return getPoints(lobject, CONNECTION_POINTS);
LayoutKeyConstants.CONNECTION_POINTS);
} }
/** Adds the given x/y point to the layout data of the given element. */ /** Adds the given x/y point to the layout data of the given element. */
public static void addConnectionPoint(ILayoutedModelElement lobject, public static void addConnectionPoint(ILayoutedModelElement lobject,
int index, int x, int y) { int index, int x, int y) {
Points existingPoints = getConnectionPoints(lobject); Points existingPoints = getConnectionPoints(lobject);
Point newPoint = LayoutModelElementFactory.createPoint(x, y, null); Point newPoint = createPoint(x, y, null);
existingPoints.getPointsList().add(index, newPoint); existingPoints.getPointsList().add(index, newPoint);
PointsUtils.setPoints(lobject, LayoutKeyConstants.CONNECTION_POINTS, setPoints(lobject, CONNECTION_POINTS, existingPoints);
existingPoints);
} }
/** Changes the point of the layout data at the given index. */ /** Changes the point of the layout data at the given index. */
public static void changeConnectionPoint(ILayoutedModelElement lobject, public static void changeConnectionPoint(ILayoutedModelElement lobject,
int index, int x, int y) { int index, int x, int y) {
Points pts = getConnectionPoints(lobject); Points pts = getConnectionPoints(lobject);
Point np = LayoutModelElementFactory.createPoint(x, y, null); Point np = createPoint(x, y, null);
pts.getPointsList().set(index, np); pts.getPointsList().set(index, np);
PointsUtils.setPoints(lobject, LayoutKeyConstants.CONNECTION_POINTS, setPoints(lobject, CONNECTION_POINTS, pts);
pts);
} }
/** Changes all the point layout data of the given element. */ /** Changes all the point layout data of the given element. */
public static void changeAllConnectionPoints(ILayoutedModelElement lobject, public static void changeAllConnectionPoints(ILayoutedModelElement lobject,
int dx, int dy) { int dx, int dy) {
Points pts = getConnectionPoints(lobject); Points pts = getConnectionPoints(lobject);
Points newPoints = LayoutModelElementFactory.createPoints(null); Points newPoints = createPoints(null);
if (pts != null) { if (pts != null) {
for (Point p : pts.getPointsList()) { for (Point p : pts.getPointsList()) {
Point np = LayoutModelElementFactory.createPoint(p.getX() + dx, Point np = createPoint(p.getX() + dx, p.getY() + dy, null);
p.getY() + dy, null);
newPoints.getPointsList().add(np); newPoints.getPointsList().add(np);
} }
PointsUtils.setPoints(lobject, setPoints(lobject, CONNECTION_POINTS, newPoints);
LayoutKeyConstants.CONNECTION_POINTS, newPoints);
} }
} }
...@@ -292,8 +294,7 @@ public class LayoutDataUtils { ...@@ -292,8 +294,7 @@ public class LayoutDataUtils {
int index) { int index) {
Points pts = getConnectionPoints(lobject); Points pts = getConnectionPoints(lobject);
pts.getPointsList().remove(index); pts.getPointsList().remove(index);
PointsUtils.setPoints(lobject, LayoutKeyConstants.CONNECTION_POINTS, setPoints(lobject, CONNECTION_POINTS, pts);
pts);
} }
...@@ -320,8 +321,8 @@ public class LayoutDataUtils { ...@@ -320,8 +321,8 @@ public class LayoutDataUtils {
// IF two states where selected, OR IF the 'connection' is a // IF two states where selected, OR IF the 'connection' is a
// self-transition, THEN move also the bendpoints of the // self-transition, THEN move also the bendpoints of the
// connections between these states. // connections between these states.
if ((connection.getTarget().getSelected() != EditPart.SELECTED_NONE) if ((connection.getTarget().getSelected() != SELECTED_NONE)
|| (connection.getTarget().getParent().getSelected() != EditPart.SELECTED_NONE)) { || (connection.getTarget().getParent().getSelected() != SELECTED_NONE)) {
changeAllConnectionPoints(connection.getModel(), deltaX, changeAllConnectionPoints(connection.getModel(), deltaX,
deltaY); deltaY);
} }
...@@ -338,8 +339,8 @@ public class LayoutDataUtils { ...@@ -338,8 +339,8 @@ public class LayoutDataUtils {
if (parts.size() == 1 && parts.get(0) instanceof ElementEditPartBase) { if (parts.size() == 1 && parts.get(0) instanceof ElementEditPartBase) {
ElementEditPartBase element = (ElementEditPartBase) parts.get(0); ElementEditPartBase element = (ElementEditPartBase) parts.get(0);
Point partPos = PointUtils.getPosition(layouted, "pos"); Point partPos = getPosition(layouted, "pos");
Dimension partDim = DimensionUtils.getDimension(layouted, "dim"); Dimension partDim = getDimension(layouted, "dim");
for (ConnectorEditPartBase connector : (List<ConnectorEditPartBase>) element for (ConnectorEditPartBase connector : (List<ConnectorEditPartBase>) element
.getChildren()) { .getChildren()) {
...@@ -347,9 +348,9 @@ public class LayoutDataUtils { ...@@ -347,9 +348,9 @@ public class LayoutDataUtils {
.getSourceConnections()) { .getSourceConnections()) {
// IF it is a self-transition/self-channel, THEN move also // IF it is a self-transition/self-channel, THEN move also
// the bendpoints of the connections/channels. // the bendpoints of the connections/channels.
if ((connection.getTarget().getParent().getSelected() != EditPart.SELECTED_NONE) if ((connection.getTarget().getParent().getSelected() != SELECTED_NONE)
&& (connection.getSource().getParent() && (connection.getSource().getParent()
.getSelected() != EditPart.SELECTED_NONE)) { .getSelected() != SELECTED_NONE)) {
// get list of all bendpoints of the connections // get list of all bendpoints of the connections
Points points = getConnectionPoints(connection Points points = getConnectionPoints(connection
......
...@@ -52,7 +52,7 @@ import org.fortiss.tooling.base.ui.dnd.gef.ElementDropContext; ...@@ -52,7 +52,7 @@ import org.fortiss.tooling.base.ui.dnd.gef.ElementDropContext;
* @author hoelzl * @author hoelzl
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: 80F0CE6BDF08AD19CD6F1A664995CE02 * @ConQAT.Rating GREEN Hash: 4AC211E8ED3669B184AEB530916A8A5C
*/ */
public class RectangleLayoutUtils { public class RectangleLayoutUtils {
...@@ -164,9 +164,8 @@ public class RectangleLayoutUtils { ...@@ -164,9 +164,8 @@ public class RectangleLayoutUtils {
// do border clamping // do border clamping
org.fortiss.tooling.base.model.layout.Dimension nd = getNodeSize(container); org.fortiss.tooling.base.model.layout.Dimension nd = getNodeSize(container);
Dimension d = new Dimension(nd.getWidth(), nd.getHeight()); Dimension d = new Dimension(nd.getWidth(), nd.getHeight());
OffsetOrientation orient = RectangleLayoutUtils OffsetOrientation orient = calculateRectangleBorderOrientation(
.calculateRectangleBorderOrientation(position, d, position, d, DEFAULT_SHAPE_INSETS);
DEFAULT_SHAPE_INSETS);
// snap to grid and store the value in the model // snap to grid and store the value in the model
orient.setOffset(snapToGrid(orient.getOffset())); orient.setOffset(snapToGrid(orient.getOffset()));
setConnectorOffsetOrientation(layouted, orient); setConnectorOffsetOrientation(layouted, orient);
......
...@@ -34,7 +34,7 @@ import org.eclipse.swt.widgets.Composite; ...@@ -34,7 +34,7 @@ import org.eclipse.swt.widgets.Composite;
* @author hoelzl * @author hoelzl
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: D72A875CBFB2BC8DFAB51FCCEE910F0A * @ConQAT.Rating GREEN Hash: 877B1F139CCBFED05771E43F31FA489F
*/ */
public class TableViewerUtils { public class TableViewerUtils {
...@@ -108,6 +108,7 @@ public class TableViewerUtils { ...@@ -108,6 +108,7 @@ public class TableViewerUtils {
CellEditor ce = new TextCellEditor(parent); CellEditor ce = new TextCellEditor(parent);
ce.setValidator(new ICellEditorValidator() { ce.setValidator(new ICellEditorValidator() {
/** {@inheritDoc} */
@Override @Override
public String isValid(Object value) { public String isValid(Object value) {
try { try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment