All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.bpmn.editor.model.visual.VNamedNode Maven / Gradle / Ivy

There is a newer version: 4.0.267
Show newest version
package jadex.bpmn.editor.model.visual;

import com.mxgraph.view.mxGraph;

import jadex.bpmn.model.MIdElement;
import jadex.bpmn.model.MNamedIdElement;

/**
 *  This class represents a named visual node.
 *
 */
public class VNamedNode extends VNode
{
	
	/**
	 *  Creates a new visual representation of a named node.
	 *  
	 *  @param graph The BPMN graph.
	 *  @param style The style.
	 */
	public VNamedNode(mxGraph graph, String style)
	{
		super(graph, style);
	}
	
	/**
	 *  Gets the value.
	 *  
	 *  @return The value.
	 */
	public Object getValue()
	{
		if (getBpmnElement() != null)
		{
			return ((MNamedIdElement) getBpmnElement()).getName();
		}
		
		return super.getValue();
	}
	
	/**
	 *  Sets the value.
	 *  
	 *  @param value The value.
	 */
	public void setValue(Object value)
	{
		if (getBpmnElement() != null)
		{
			((MNamedIdElement) getBpmnElement()).setName((String) value);
		}
	}
	
	/**
	 *  Sets the BPMN element.
	 *  
	 *  @param bpmnelement The BPMN element.
	 */
	public void setBpmnElement(MIdElement bpmnelement)
	{
		super.setBpmnElement(bpmnelement);
		((MNamedIdElement) bpmnelement).setName((String) getValue());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy