From cf6ba315a9f4ecc58979ffa3e90249633ea9c9ea Mon Sep 17 00:00:00 2001
From: Andreas Wandinger <wandinger@fortiss.org>
Date: Fri, 25 May 2012 15:43:37 +0000
Subject: [PATCH] Scanned files for illegal characters and replaced them with
 ascii surrogates. refs 587

---
 .../base/ui/utils/EllipseLayoutUtils.java     | 86 ++++++++-----------
 .../kernel/service/IPersistencyService.java   |  8 +-
 2 files changed, 41 insertions(+), 53 deletions(-)

diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/EllipseLayoutUtils.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/EllipseLayoutUtils.java
index 2ddf04630..77ebd3fcd 100644
--- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/EllipseLayoutUtils.java
+++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/EllipseLayoutUtils.java
@@ -40,7 +40,7 @@ import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
  * @author hoelzl
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating GREEN Hash: 6A74D01004722B0E1A9FA610890C601B
+ * @ConQAT.Rating GREEN Hash: E2895E7B8A9CD147E9DC3EBA967CA0DA
  */
 public final class EllipseLayoutUtils {
 	/**
@@ -55,14 +55,11 @@ public final class EllipseLayoutUtils {
 	 *            the insets of the ellipse figure
 	 * @return the polar coordinates
 	 */
-	public static Polar calculateEllipseBorderPolar(double angle,
-			Dimension ellipseSize, int inset) {
+	public static Polar calculateEllipseBorderPolar(double angle, Dimension ellipseSize, int inset) {
 		double a = ellipseSize.width / 2 - inset;
 		double b = ellipseSize.height / 2 - inset;
 		double epsilon = Math.sqrt(a * a - b * b) / a;
-		double r = b
-				/ Math.sqrt(1 - epsilon * epsilon * Math.cos(angle)
-						* Math.cos(angle));
+		double r = b / Math.sqrt(1 - epsilon * epsilon * Math.cos(angle) * Math.cos(angle));
 		return new Polar(angle, r);
 	}
 
@@ -78,8 +75,7 @@ public final class EllipseLayoutUtils {
 	 *            the insets of the ellipse figure
 	 * @return the point coordinates
 	 */
-	public static Point calculateEllipseBorderPoint(double angle,
-			Dimension ellipseSize, int inset) {
+	public static Point calculateEllipseBorderPoint(double angle, Dimension ellipseSize, int inset) {
 		Polar polar = calculateEllipseBorderPolar(angle, ellipseSize, inset);
 		return polar.toCartesian().translate(ellipseSize.getScaled(.5));
 	}
@@ -129,11 +125,9 @@ public final class EllipseLayoutUtils {
 	 *            the resize direction
 	 * @return the clamped shape size
 	 */
-	public static Dimension clampEllipseShapeSize(Dimension oldSize,
-			int direction) {
-		return clampEllipseShapeSize(oldSize, direction,
-				DEFAULT_SHAPE_MINIMUM_WIDTH, DEFAULT_SHAPE_MINIMUM_HEIGHT,
-				DEFAULT_SHAPE_ASPECT_RATIO);
+	public static Dimension clampEllipseShapeSize(Dimension oldSize, int direction) {
+		return clampEllipseShapeSize(oldSize, direction, DEFAULT_SHAPE_MINIMUM_WIDTH,
+				DEFAULT_SHAPE_MINIMUM_HEIGHT, DEFAULT_SHAPE_ASPECT_RATIO);
 	}
 
 	/**
@@ -152,34 +146,30 @@ public final class EllipseLayoutUtils {
 	 *            the aspect ratio
 	 * @return the clamped shape size
 	 */
-	public static Dimension clampEllipseShapeSize(Dimension oldSize,
-			int direction, int minimumWidth, int minimumHeight,
-			double aspectRatio) {
+	public static Dimension clampEllipseShapeSize(Dimension oldSize, int direction,
+			int minimumWidth, int minimumHeight, double aspectRatio) {
 		Dimension newSize;
 
 		// check for minimum size
-		newSize = new Dimension(oldSize.width < minimumWidth ? minimumWidth
-				: oldSize.width, oldSize.height < minimumHeight ? minimumHeight
-				: oldSize.height);
+		newSize =
+				new Dimension(oldSize.width < minimumWidth ? minimumWidth : oldSize.width,
+						oldSize.height < minimumHeight ? minimumHeight : oldSize.height);
 
 		// ensure that the aspect ratio is redeemed
-		switch (direction) {
-		case SOUTH_EAST:
-			int aspectHeight = (int) (newSize.width / aspectRatio);
-			int aspectWidth = (int) (newSize.height * aspectRatio);
-			newSize.setSize(new Dimension(
-					newSize.width > aspectWidth ? aspectWidth : newSize.width,
-					newSize.height > aspectHeight ? aspectHeight
-							: newSize.height));
-			break;
-		case SOUTH:
-			newSize.setSize(new Dimension((int) (newSize.height * aspectRatio),
-					newSize.height));
-			break;
-		case EAST:
-			newSize.setSize(new Dimension(newSize.width,
-					(int) (newSize.width / aspectRatio)));
-			break;
+		switch(direction) {
+			case SOUTH_EAST:
+				int aspectHeight = (int)(newSize.width / aspectRatio);
+				int aspectWidth = (int)(newSize.height * aspectRatio);
+				newSize.setSize(new Dimension(newSize.width > aspectWidth ? aspectWidth
+						: newSize.width, newSize.height > aspectHeight ? aspectHeight
+						: newSize.height));
+				break;
+			case SOUTH:
+				newSize.setSize(new Dimension((int)(newSize.height * aspectRatio), newSize.height));
+				break;
+			case EAST:
+				newSize.setSize(new Dimension(newSize.width, (int)(newSize.width / aspectRatio)));
+				break;
 		}
 
 		return newSize;
@@ -194,19 +184,17 @@ public final class EllipseLayoutUtils {
 	 *            the parent element
 	 * @return the connector bounds
 	 */
-	public static Rectangle getAbsoluteConnectorBounds(
-			ILayoutedModelElement connector, ILayoutedModelElement parent) {
+	public static Rectangle getAbsoluteConnectorBounds(ILayoutedModelElement connector,
+			ILayoutedModelElement parent) {
 
-		Rectangle result = new Rectangle(0, 0, DEFAULT_CONNECTOR_SIZE,
-				DEFAULT_CONNECTOR_SIZE);
+		Rectangle result = new Rectangle(0, 0, DEFAULT_CONNECTOR_SIZE, DEFAULT_CONNECTOR_SIZE);
 		double angle = getConnectorAngleAsDouble(connector);
 		org.fortiss.tooling.base.model.layout.Dimension parentSize = getNodeSize(parent);
 
-		Dimension parentDim = new Dimension(parentSize.getWidth(),
-				parentSize.getHeight());
-		Point position = calculateEllipseBorderPoint(angle, parentDim,
-				DEFAULT_CONNECTOR_SIZE / 2).translate(
-				-DEFAULT_CONNECTOR_SIZE / 2, -DEFAULT_CONNECTOR_SIZE / 2);
+		Dimension parentDim = new Dimension(parentSize.getWidth(), parentSize.getHeight());
+		Point position =
+				calculateEllipseBorderPoint(angle, parentDim, DEFAULT_CONNECTOR_SIZE / 2)
+						.translate(-DEFAULT_CONNECTOR_SIZE / 2, -DEFAULT_CONNECTOR_SIZE / 2);
 		org.fortiss.tooling.base.model.layout.Point parentPos = getNodePosition(parent);
 		result.x = position.x + parentPos.getX();
 		result.y = position.y + parentPos.getY();
@@ -217,8 +205,8 @@ public final class EllipseLayoutUtils {
 	/**
 	 * Class for storing polar coordinates.
 	 * 
-	 * The angles are interpreted clockwise in the following way: 0¡: East;
-	 * 90¡(pi/2): South; 180¡(pi): West; 270¡(3/2pi): North
+	 * The angles are interpreted clockwise in the following way: 0deg: East;
+	 * 90deg(pi/2): South; 180deg(pi): West; 270deg(3/2pi): North
 	 * 
 	 * @author wandinger
 	 * @author hummel
@@ -248,8 +236,8 @@ public final class EllipseLayoutUtils {
 
 		/** Returns a cartesian representation. */
 		public Point toCartesian() {
-			int x = (int) (distance * Math.cos(angle));
-			int y = (int) (distance * Math.sin(angle));
+			int x = (int)(distance * Math.cos(angle));
+			int y = (int)(distance * Math.sin(angle));
 			return new Point(x, y);
 		}
 	}
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java
index 9b7db028a..dfcf3ea28 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java
@@ -41,7 +41,7 @@ import org.fortiss.tooling.kernel.service.listener.IPersistencyServiceListener;
  * @author hoelzl
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating GREEN Hash: 3F68893AC08F697E595173204DAE4772
+ * @ConQAT.Rating GREEN Hash: A76C6B0A18E77C3F05A731AE11FAA0E0
  */
 public interface IPersistencyService {
 
@@ -49,8 +49,8 @@ public interface IPersistencyService {
 	public static final IPersistencyService INSTANCE = new PersistencyService();
 
 	/**
-	 * Returns the list of top level {@link ITopLevelElement}s provided by
-	 * {@link IStorageProvider}s. All storage providers are requested to load
+	 * Returns the list of top level {@link ITopLevelElement}s provided by {@link IStorageProvider}
+	 * s. All storage providers are requested to load
 	 * and provide their models during the persistency initialization. Therefore
 	 * this method does not have a progress monitor.
 	 */
@@ -92,7 +92,7 @@ public interface IPersistencyService {
 
 	/**
 	 * Removes the given EObject from the dummy top-level elements. This method
-	 * is intended for JUnit testing purposes only.²
+	 * is intended for JUnit testing purposes only.
 	 */
 	public void removeDummyTopLevelElement(EObject dummy);
 }
-- 
GitLab