| /********************************************************************* |
| * Copyright (c) 2005, 2019 SAP SE |
| * |
| * This program and the accompanying materials are made |
| * available under the terms of the Eclipse Public License 2.0 |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * Contributors: |
| * SAP SE - initial API, implementation and documentation |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| **********************************************************************/ |
| package org.eclipse.graphiti.datatypes; |
| |
| /** |
| * An interface for the rectangle data type. |
| * |
| * @noimplement This interface is not intended to be implemented by clients. |
| * @noextend This interface is not intended to be extended by clients. |
| */ |
| public interface IRectangle extends IDimension, ILocation { |
| |
| /** |
| * |
| * @return An exact copy of the current rectangle instance. |
| */ |
| public IRectangle getRectangleCopy(); |
| |
| /** |
| * Sets the location and dimension of the rectangle. |
| * |
| * @param x |
| * the x coordinate of the rectangle |
| * @param y |
| * the y coordinate of the rectangle |
| * @param width |
| * the width of the rectangle |
| * @param height |
| * the height of the rectangle |
| */ |
| public void setRectangle(int x, int y, int width, int height); |
| |
| /** |
| * Sets the location and dimension of the rectangle to the values of the |
| * given rectangle. |
| * |
| * @param rectangle |
| * The rectangle which contains new location and dimension. |
| */ |
| public void setRectangle(IRectangle rectangle); |
| |
| /** |
| * Checks whether the point with (x,y) is inside the rectangle. |
| * |
| * @param x |
| * the x coordinate of the point to be tested |
| * @param y |
| * the y coordinate of the point to be tested |
| * @return TRUE, if the point with (x,y) is inside the rectangle; FALSE |
| * otherwise |
| */ |
| public boolean contains(int x, int y); |
| |
| /** |
| * Checks whether the point with the given location is inside the rectangle. |
| * |
| * @param location |
| * the location of the point to be tested |
| * @return TRUE, if the location is inside the rectangle; FALSE otherwise |
| */ |
| public boolean contains(ILocation location); |
| } |