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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.g2d.element.handler;
\r
14 import java.awt.geom.Rectangle2D;
\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
23 * This interface is used for handling elements internal size.
\r
25 * See default implementations:
\r
27 * @See {@link FixedSize} size is fixed
\r
28 * @See {@link Resizeable} size can be changed by user
\r
30 * @author Toni Kalajainen
\r
34 public interface InternalSize extends ElementHandler {
\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
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
47 Rectangle2D getBounds(IElement e, Rectangle2D size);
\r