本文整理汇总了Java中org.jgraph.event.GraphSelectionListener类的典型用法代码示例。如果您正苦于以下问题:Java GraphSelectionListener类的具体用法?Java GraphSelectionListener怎么用?Java GraphSelectionListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GraphSelectionListener类属于org.jgraph.event包,在下文中一共展示了GraphSelectionListener类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initListeners
import org.jgraph.event.GraphSelectionListener; //导入依赖的package包/类
/** Initialises the graph selection listener and attributed graph listener. */
private void initListeners() {
getJGraph().setToolTipEnabled(true);
// Update ToolBar based on Selection Changes
getJGraph().getSelectionModel()
.addGraphSelectionListener(new GraphSelectionListener() {
@Override
public void valueChanged(GraphSelectionEvent e) {
// Update Button States based on Current Selection
boolean selected = !getJGraph().isSelectionEmpty();
getDeleteAction().setEnabled(selected);
getCopyAction().setEnabled(selected);
getCutAction().setEnabled(selected);
}
});
getJGraph().addJGraphModeListener(this);
getSnapToGridAction().addSnapListener(this);
}
示例2: installListeners
import org.jgraph.event.GraphSelectionListener; //导入依赖的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();
}
示例3: installListeners
import org.jgraph.event.GraphSelectionListener; //导入依赖的package包/类
void installListeners() {
getJGraph().addPropertyChangeListener(org.jgraph.JGraph.GRAPH_MODEL_PROPERTY,
new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
updateModel();
}
});
getJGraph().addGraphSelectionListener(new GraphSelectionListener() {
@Override
public void valueChanged(GraphSelectionEvent e) {
clearSelection();
}
});
getFilter().addObserver(new Observer() {
@Override
@SuppressWarnings("unchecked")
public void update(Observable o, Object arg) {
LabelTree.this.repaint();
getJGraph().refreshCells((Set<JCell<G>>) arg);
}
});
addMouseListener(new MyMouseListener());
}
示例4: RuleLevelTree
import org.jgraph.event.GraphSelectionListener; //导入依赖的package包/类
/** Creates a new tree, for a given rule model. */
public RuleLevelTree(AspectJGraph jGraph) {
this.jGraph = jGraph;
setLargeModel(true);
setEnabled(jGraph.isEnabled());
setShowsRootHandles(false);
getUI().setCollapsedIcon(null);
getUI().setExpandedIcon(null);
addMouseListener(new MyMouseListener());
// deselect the level tree whenever the graph
// selection changes
jGraph.addGraphSelectionListener(new GraphSelectionListener() {
@Override
public void valueChanged(GraphSelectionEvent e) {
clearSelection();
}
});
}
示例5: createGraphSelectionListener
import org.jgraph.event.GraphSelectionListener; //导入依赖的package包/类
@Override
protected GraphSelectionListener createGraphSelectionListener() {
return new JmtGraphSelectionHandler();
}