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