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