当前位置: 首页>>代码示例>>Java>>正文


Java GraphSelectionListener类代码示例

本文整理汇总了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);
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:19,代码来源:GraphEditorTab.java

示例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();
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:22,代码来源:StateDisplay.java

示例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());
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:25,代码来源:LabelTree.java

示例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();
        }
    });
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:19,代码来源:RuleLevelTree.java

示例5: createGraphSelectionListener

import org.jgraph.event.GraphSelectionListener; //导入依赖的package包/类
@Override
protected GraphSelectionListener createGraphSelectionListener() {
	return new JmtGraphSelectionHandler();
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:5,代码来源:JmtGraphUI.java


注:本文中的org.jgraph.event.GraphSelectionListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。