blob: d697987819908319a6a049151ab5a8d2ad4a8c91 [file] [log] [blame]
/*********************************************************************
* 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.ICustomContext;
import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
/**
* The Class CustomContext.
*/
public class CustomContext extends LocationContext implements ICustomContext {
private GraphicsAlgorithm innerGraphicsAlgorithm;
private PictogramElement innerPictogramElement;
private PictogramElement pictogramElements[];
/**
* Creates a new {@link CustomContext}.
*/
public CustomContext() {
super();
}
/**
* Creates a new {@link CustomContext}.
*
* @param pictogramElements
* the pictogram elements
*/
public CustomContext(PictogramElement[] pictogramElements) {
this();
setPictogramElements(pictogramElements);
}
public GraphicsAlgorithm getInnerGraphicsAlgorithm() {
return this.innerGraphicsAlgorithm;
}
public PictogramElement getInnerPictogramElement() {
return this.innerPictogramElement;
}
public PictogramElement[] getPictogramElements() {
return this.pictogramElements;
}
/**
* Sets the inner graphics algorithm.
*
* @param innerGraphicsAlgorithm
* the new inner graphics algorithm
*/
public void setInnerGraphicsAlgorithm(GraphicsAlgorithm innerGraphicsAlgorithm) {
this.innerGraphicsAlgorithm = innerGraphicsAlgorithm;
}
/**
* Sets the inner pictogram element.
*
* @param innerPictogramElement
* the new inner pictogram element
*/
public void setInnerPictogramElement(PictogramElement innerPictogramElement) {
this.innerPictogramElement = innerPictogramElement;
}
/**
* Sets the pictogram elements.
*
* @param pictogramElements
* The pictogramElements to set.
*/
public void setPictogramElements(PictogramElement[] pictogramElements) {
this.pictogramElements = pictogramElements;
}
@Override
public String toString() {
String ret = super.toString();
return ret + " innerGraphicsAlgorithm: " + getInnerGraphicsAlgorithm() + " innerPictogramElement: " + getInnerPictogramElement() //$NON-NLS-1$ //$NON-NLS-2$
+ " pictogramElements: " + getPictogramElements(); //$NON-NLS-1$
}
}