/* Copyright 1999-2008 Acelet.org. All rights reserved. GPL v2 license */
/** @author Wei Jiang */
package com.acelet.s.workflow;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import org.jgraph.JGraph;
import org.jgraph.graph.DefaultEdge;
import org.jgraph.graph.DefaultGraphCell;
import org.jgraph.graph.DefaultPort;
public class SelectedCell {
public static boolean isDefaultGraphCellSelected() {
JGraph graph = Util.getCurrentGraph();
return isDefaultGraphCellSelected(graph);
}
public static boolean isDefaultGraphCellSelected(JGraph graph) {
if (graph == null)
return false;
Object cellObject = graph.getSelectionCell();
if (cellObject == null || (cellObject instanceof DefaultGraphCell) == false)
return false;
return true;
}
public static boolean isSelectedCellActionCell() {
JGraph graph = Util.getCurrentGraph();
return isSelectedCellActionCell(graph);
}
public static boolean isSelectedCellActionCell(JGraph graph) {
if (graph == null)
return false;
Object cellObject = graph.getSelectionCell();
return CellType.isCellActionCell(cellObject);
}
}