X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Felement%2Fhandler%2FScale.java;h=ab4b1191c03b30241cd517fb50a0445b1e8758b9;hb=refs%2Fchanges%2F38%2F238%2F2;hp=c33ad087f598083b2721326e63b2a26ec9d99fc7;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/Scale.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/Scale.java index c33ad087f..ab4b1191c 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/Scale.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/Scale.java @@ -1,66 +1,66 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.g2d.element.handler; - -import java.awt.geom.Point2D; - -import org.simantics.g2d.element.IElement; -import org.simantics.g2d.element.ElementClass.Single; -import org.simantics.g2d.element.handler.impl.DefaultTransform; -import org.simantics.g2d.element.handler.impl.Scaleable; - -/** - * Interface that tags that the element is scalable. Scaling modifies the - * transform of the element (on canvas), where as resizeing modifies the internal - * size of the element. - * - * @see DefaultTransform default impl - * @see Scaleable default impl - * @author Toni Kalajainen - */ -@Single -public interface Scale extends ElementHandler { - - /** - * Get scale of the element - * @param e - * @return - */ - Point2D getScale(IElement e); - - /** - * Set scale of the element - * @param e - * @param newScale - */ - void setScale(IElement e, Point2D newScale); - - /** - * Returns fixed width/height ratio of dimensions if there is one - * - * @return aspect ratio or null - */ - Double getFixedAspectRatio(IElement e); - - /** - * Return minimum scale if there is one - * @return minimum scale or null - */ - Point2D getMinimumScale(IElement e); - - /** - * return maximum scale if one exists - * @return max scale or null - */ - Point2D getMaximumScale(IElement e); - +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.g2d.element.handler; + +import java.awt.geom.Point2D; + +import org.simantics.g2d.element.IElement; +import org.simantics.g2d.element.ElementClass.Single; +import org.simantics.g2d.element.handler.impl.DefaultTransform; +import org.simantics.g2d.element.handler.impl.Scaleable; + +/** + * Interface that tags that the element is scalable. Scaling modifies the + * transform of the element (on canvas), where as resizeing modifies the internal + * size of the element. + * + * @see DefaultTransform default impl + * @see Scaleable default impl + * @author Toni Kalajainen + */ +@Single +public interface Scale extends ElementHandler { + + /** + * Get scale of the element + * @param e + * @return + */ + Point2D getScale(IElement e); + + /** + * Set scale of the element + * @param e + * @param newScale + */ + void setScale(IElement e, Point2D newScale); + + /** + * Returns fixed width/height ratio of dimensions if there is one + * + * @return aspect ratio or null + */ + Double getFixedAspectRatio(IElement e); + + /** + * Return minimum scale if there is one + * @return minimum scale or null + */ + Point2D getMinimumScale(IElement e); + + /** + * return maximum scale if one exists + * @return max scale or null + */ + Point2D getMaximumScale(IElement e); + } \ No newline at end of file