Package com.acelet.s.workflow

Source Code of com.acelet.s.workflow.SelectedCell

/* 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);
  }
}
TOP

Related Classes of com.acelet.s.workflow.SelectedCell

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.