ResourceDisplay.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:JavaGraph 作者:
/**
 * Initialises all listening activity on the display, and
 * calls {@link #activateListening()}.
 */
@Override
protected void installListeners() {
    getSimulatorModel().addListener(this, Change.GRAMMAR, Change.toChange(getResourceKind()));
    // adds a mouse listener that offers a popup menu with a detach action
    getTabPane().addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            if (e.getButton() == MouseEvent.BUTTON3) {
                int index = getTabPane().indexAtLocation(e.getX(), e.getY());
                if (index >= 0) {
                    ResourceTab tab = (ResourceTab) getTabPane().getComponentAt(index);
                    if (tab != getMainTab()) {
                        createDetachMenu(tab).show(ResourceDisplay.this, e.getX(), e.getY());
                    }
                }
            }
        }
    });
    activateListening();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号