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


Java Handle.addHandleListener方法代码示例

本文整理汇总了Java中org.jhotdraw.draw.handle.Handle.addHandleListener方法的典型用法代码示例。如果您正苦于以下问题:Java Handle.addHandleListener方法的具体用法?Java Handle.addHandleListener怎么用?Java Handle.addHandleListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jhotdraw.draw.handle.Handle的用法示例。


在下文中一共展示了Handle.addHandleListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleRequestSecondaryHandles

import org.jhotdraw.draw.handle.Handle; //导入方法依赖的package包/类
@Override
public void handleRequestSecondaryHandles(HandleEvent e) {
    secondaryHandleOwner = e.getHandle();
    secondaryHandles.clear();
    secondaryHandles.addAll(secondaryHandleOwner.createSecondaryHandles());
    for (Handle h : secondaryHandles) {
        h.setView(DefaultDrawingView.this);
        h.addHandleListener(eventHandler);
    }
    repaint();
}
 
开发者ID:umple,项目名称:umple,代码行数:12,代码来源:DefaultDrawingView.java

示例2: addToSelection

import org.jhotdraw.draw.handle.Handle; //导入方法依赖的package包/类
/**
 * Adds a figure to the current selection.
 */
@Override
public void addToSelection(Figure figure) {
    if (DEBUG) {
        System.out.println("DefaultDrawingView" + ".addToSelection(" + figure + ")");
    }

    Set<Figure> oldSelection = new HashSet<Figure>(selectedFigures);
    if (selectedFigures.add(figure)) {
        figure.addFigureListener(handleInvalidator);
        Set<Figure> newSelection = new HashSet<Figure>(selectedFigures);
        Rectangle invalidatedArea = null;
        if (handlesAreValid && getEditor() != null) {
            for (Handle h : figure.createHandles(detailLevel)) {
                h.setView(this);
                selectionHandles.add(h);
                h.addHandleListener(eventHandler);
                if (invalidatedArea == null) {
                    invalidatedArea = h.getDrawingArea();
                } else {
                    invalidatedArea.add(h.getDrawingArea());
                }

            }
        }
        fireSelectionChanged(oldSelection, newSelection);
        if (invalidatedArea != null) {
            repaint(invalidatedArea);
        }

    }
}
 
开发者ID:umple,项目名称:umple,代码行数:35,代码来源:DefaultDrawingView.java

示例3: validateHandles

import org.jhotdraw.draw.handle.Handle; //导入方法依赖的package包/类
/**
 * Validates the handles.
 */
private void validateHandles() {
    // Validate handles only, if they are invalid, and if
    // the DrawingView has a DrawingEditor.
    if (!handlesAreValid && getEditor() != null) {
        handlesAreValid = true;
        selectionHandles.clear();
        Rectangle invalidatedArea = null;
        while (true) {
            for (Figure figure : getSelectedFigures()) {
                for (Handle handle : figure.createHandles(detailLevel)) {
                    handle.setView(this);
                    selectionHandles.add(handle);
                    handle.addHandleListener(eventHandler);
                    if (invalidatedArea == null) {
                        invalidatedArea = handle.getDrawingArea();
                    } else {
                        invalidatedArea.add(handle.getDrawingArea());
                    }

                }
            }

            if (selectionHandles.size() == 0 && detailLevel != 0) {
                // No handles are available at the desired detail level.
                // Retry with detail level 0.
                detailLevel = 0;
                continue;
            }
            break;
        }

        if (invalidatedArea != null) {
            repaint(invalidatedArea);
        }

    }

}
 
开发者ID:umple,项目名称:umple,代码行数:42,代码来源:DefaultDrawingView.java

示例4: handleRequestSecondaryHandles

import org.jhotdraw.draw.handle.Handle; //导入方法依赖的package包/类
@Override
public void handleRequestSecondaryHandles(HandleEvent e) {
    secondaryHandleOwner = e.getHandle();
    secondaryHandles.clear();
    secondaryHandles.addAll(secondaryHandleOwner.createSecondaryHandles());
    for (Handle h : secondaryHandles) {
        h.setView(InteractiveDrawingView.this);
        h.addHandleListener(eventHandler);
    }
    repaint();
}
 
开发者ID:fjug,项目名称:IDDEA,代码行数:12,代码来源:InteractiveDrawingView.java

示例5: validateHandles

import org.jhotdraw.draw.handle.Handle; //导入方法依赖的package包/类
/**
 * Validates the handles.
 */
protected void validateHandles() {
    // Validate handles only, if they are invalid, and if
    // the DrawingView has a DrawingEditor.
    if (!handlesAreValid && getEditor() != null) {
        handlesAreValid = true;
        selectionHandles.clear();
        Rectangle invalidatedArea = null;
        while (true) {
            for (Figure figure : getSelectedFigures()) {
                for (Handle handle : figure.createHandles(detailLevel)) {
                    handle.setView(this);
                    selectionHandles.add(handle);
                    handle.addHandleListener(eventHandler);
                    if (invalidatedArea == null) {
                        invalidatedArea = handle.getDrawingArea();
                    } else {
                        invalidatedArea.add(handle.getDrawingArea());
                    }

                }
            }

            if (selectionHandles.size() == 0 && detailLevel != 0) {
                // No handles are available at the desired detail level.
                // Retry with detail level 0.
                detailLevel = 0;
                continue;
            }
            break;
        }

        if (invalidatedArea != null) {
            repaint(invalidatedArea);
        }

    }

}
 
开发者ID:fjug,项目名称:IDDEA,代码行数:42,代码来源:InteractiveDrawingView.java


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