Skip to content
Snippets Groups Projects
Commit cf6ba315 authored by Andreas Wandinger's avatar Andreas Wandinger
Browse files

Scanned files for illegal characters and replaced them with ascii surrogates.

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