| /********************************************************************* |
| * 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.features.context.impl; |
| |
| import org.eclipse.graphiti.features.context.IAreaContext; |
| |
| /** |
| * The Class AreaContext. |
| */ |
| public class AreaContext extends LocationContext implements IAreaContext { |
| |
| private int height = -1; |
| |
| private int width = -1; |
| |
| /** |
| * Creates a new {@link AreaContext}. |
| */ |
| public AreaContext() { |
| } |
| |
| public int getHeight() { |
| return this.height; |
| } |
| |
| public int getWidth() { |
| return this.width; |
| } |
| |
| /** |
| * Sets the height. |
| * |
| * @param height |
| * The height to set. |
| */ |
| public void setHeight(int height) { |
| this.height = height; |
| } |
| |
| /** |
| * Sets the size. |
| * |
| * @param width |
| * the width |
| * @param height |
| * the height |
| */ |
| public void setSize(int width, int height) { |
| this.width = width; |
| this.height = height; |
| } |
| |
| /** |
| * Sets the width. |
| * |
| * @param width |
| * The width to set. |
| */ |
| public void setWidth(int width) { |
| this.width = width; |
| } |
| |
| @Override |
| public String toString() { |
| String ret = super.toString(); |
| ret = ret + "(width=" + getWidth() + ", height=" + getHeight() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| return ret; |
| } |
| } |