本文整理汇总了Java中org.jgraph.event.GraphSelectionEvent.getCells方法的典型用法代码示例。如果您正苦于以下问题:Java GraphSelectionEvent.getCells方法的具体用法?Java GraphSelectionEvent.getCells怎么用?Java GraphSelectionEvent.getCells使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jgraph.event.GraphSelectionEvent
的用法示例。
在下文中一共展示了GraphSelectionEvent.getCells方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: installListeners
import org.jgraph.event.GraphSelectionEvent; //导入方法依赖的package包/类
@Override
protected void installListeners() {
this.graphSelectionListener = new GraphSelectionListener() {
@Override
public void valueChanged(GraphSelectionEvent e) {
if (StateDisplay.this.matchSelected) {
// change only if cells were removed from the selection
boolean removed = false;
Object[] cells = e.getCells();
for (int i = 0; !removed && i < cells.length; i++) {
removed = !e.isAddedCell(i);
}
if (removed) {
clearSelectedMatch(false);
}
}
}
};
getSimulatorModel().addListener(this, GRAMMAR, GTS, STATE, MATCH);
activateListening();
}
示例2: valueChanged
import org.jgraph.event.GraphSelectionEvent; //导入方法依赖的package包/类
public void valueChanged(GraphSelectionEvent e) {
if(isVisible()){
Object cell = e.getCells()[0];
if(cell != null){
if(propertiesPane != null)
propertiesPane.showProperties(cell, this);
showInfoDetails(cell);
if(cell instanceof PlaceCell || cell instanceof TransitionCell){
BasicCell basicCell = (BasicCell) cell;
GraphLabel label = (GraphLabel)getCellFromData(basicCell.getData().getChild("name"));
addSelectionCell(label);
}
}
}
}
示例3: valueChanged
import org.jgraph.event.GraphSelectionEvent; //导入方法依赖的package包/类
@Override
public void valueChanged(GraphSelectionEvent e) {
Object[] cells = e.getCells();
for (int i = 0; i < cells.length; i++) {
Object c = cells[i];
if (c instanceof JCell) {
@SuppressWarnings("unchecked")
JCell<G> jCell = (JCell<G>) c;
jCell.putVisual(VisualKey.EMPHASIS, e.isAddedCell(i));
}
}
}