]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/InternalSize.java
Sync git svn branch with SVN repository r33324.
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / element / handler / InternalSize.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.g2d.element.handler;\r
13 \r
14 import java.awt.geom.Rectangle2D;\r
15 \r
16 import org.simantics.g2d.element.IElement;\r
17 import org.simantics.g2d.element.ElementClass.Required;\r
18 import org.simantics.g2d.element.ElementClass.Single;\r
19 import org.simantics.g2d.element.handler.impl.FixedSize;\r
20 import org.simantics.g2d.element.handler.impl.Resizeable;\r
21 \r
22 /**\r
23  * This interface is used for handling elements internal size.\r
24  * \r
25  * See default implementations:\r
26  * \r
27  * @See {@link FixedSize} size is fixed\r
28  * @See {@link Resizeable} size can be changed by user\r
29  * \r
30  * @author Toni Kalajainen\r
31  */\r
32 @Single\r
33 @Required\r
34 public interface InternalSize extends ElementHandler {\r
35 \r
36     /**\r
37      * Return the size of the element (in element coordinates). It is possible\r
38      * for an element to not have bounds. See return value specification for how\r
39      * to notice this.\r
40      * \r
41      * @param e element to get bounds for\r
42      * @param size size to be written to, or null (instantiates new)\r
43      * @return internal size of the element or the size argument as is if the\r
44      *         specified element does not have bounds (i.e. is hidden or\r
45      *         otherwise does not have a visual representation)\r
46      */\r
47     Rectangle2D getBounds(IElement e, Rectangle2D size);\r
48 \r
49 }\r