當前位置: 首頁>>代碼示例>>Java>>正文


Java Handle.getDrawingArea方法代碼示例

本文整理匯總了Java中org.jhotdraw.draw.handle.Handle.getDrawingArea方法的典型用法代碼示例。如果您正苦於以下問題:Java Handle.getDrawingArea方法的具體用法?Java Handle.getDrawingArea怎麽用?Java Handle.getDrawingArea使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jhotdraw.draw.handle.Handle的用法示例。


在下文中一共展示了Handle.getDrawingArea方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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

示例2: 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

示例3: 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.getDrawingArea方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。