/* Copyright 1999-2008 Acelet.org. All rights reserved. GPL v2 license */
/** @author Wei Jiang */
package com.acelet.s.workflow;
import org.jgraph.JGraph;
import org.jgraph.graph.AttributeMap;
import org.jgraph.graph.DefaultEdge;
import org.jgraph.graph.DefaultGraphCell;
import org.jgraph.graph.DefaultPort;
public class CellType {
static String CELL_TYPE_KEY = "cellType";
static String CELL_TYPE_ACTION = "action";
public static boolean isCellActionCell(Object cellObject) {
if (cellObject == null || (cellObject instanceof DefaultGraphCell) == false)
return false;
if (cellObject instanceof DefaultEdge)
return false;
else if (cellObject instanceof DefaultPort)
return false;
else if (cellObject instanceof DefaultGraphCell) {
DefaultGraphCell defaultGraphCell = (DefaultGraphCell) cellObject;
AttributeMap attributes = defaultGraphCell.getAttributes();
String type = (String) attributes.get(CELL_TYPE_KEY);
if (type != null && type.equals(CELL_TYPE_ACTION))
return true;
else
return false;
} else
return false;
}
}