//----------------------------BEGIN LICENSE----------------------------
/* 
 * Willow : the Open Source WorkFlow Project
 * Distributable under GNU LGPL license by gun.org
 *
 * Copyright (C) 2004-2010 huihoo.org 
 * Copyright (C) 2004-2010  ZosaTapo <dertyang@hotmail.com> 
 * 
 * ====================================================================
 * Project Homepage : http://www.huihoo.org/god4j
 * Source Forge     : http://sourceforge.net/projects/huihoo
 * Mailing list     : god4j@lists.sourceforge.net 
 */
//----------------------------END  LICENSE-----------------------------
package org.huihoo.god4j.jgraph;

import org.jgraph.JGraph;
import org.jgraph.graph.CellMapper;
import org.jgraph.graph.CellViewRenderer;
import org.jgraph.graph.VertexView;

/**
 * @author reic
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class RouteActivityView extends VertexView
{
	public static RouteActivityRenderer renderer = new RouteActivityRenderer();
	
	public RouteActivityView(Object cell, JGraph graph, CellMapper mapper)
	{
		super(cell, graph, mapper);
	}

	public CellViewRenderer getRenderer()
	{
		return renderer;
	}
	public static int getArcSize(int width, int height)
	{
		int arcSize;
		if (width <= height)
		{
			arcSize = height / 5;
			if (arcSize > (width / 2))
			{
				arcSize = width / 2;
			}
		}
		else
		{
			arcSize = width / 5;
			if (arcSize > (height / 2))
			{
				arcSize = height / 2;
			}
		}
		return arcSize;
	}
}
