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


Java Handle類代碼示例

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


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

示例1: createHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
@Override
public Collection<Handle> createHandles(int detailLevel) {
    LinkedList<Handle> handles = new LinkedList<Handle>();
    switch (detailLevel % 2) {
        case -1: // Mouse hover handles
            handles.add(new BezierOutlineHandle(this, true));
            break;
        case 0:
            handles.add(new BezierOutlineHandle(this));
            for (int i = 0, n = path.size(); i < n; i++) {
                handles.add(new BezierNodeHandle(this, i));
            }
            break;
        case 1:
            TransformHandleKit.addTransformHandles(this, handles);
            handles.add(new BezierScaleHandle(this));
            break;
    }
    return handles;
}
 
開發者ID:umple,項目名稱:umple,代碼行數:21,代碼來源:BezierFigure.java

示例2: createHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
@Override
public Collection<Handle> createHandles(int detailLevel) {
    LinkedList<Handle> handles = new LinkedList<Handle>();
    switch (detailLevel) {
        case -1 : // Mouse hover handles
            handles.add(new BezierOutlineHandle(this, true));
            break;
        case 0 :
            handles.add(new BezierOutlineHandle(this));
            for (int i=0, n = path.size(); i < n; i++) {
                handles.add(new BezierNodeHandle(this, i));
            }
            break;
    }
    return handles;
}
 
開發者ID:umple,項目名稱:umple,代碼行數:17,代碼來源:LineFigure.java

示例3: getCompatibleHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
/**
 * Gets compatible handles.
 * @return A collection containing the handle and all compatible handles.
 */
@Override
public Collection<Handle> getCompatibleHandles(Handle master) {
    validateHandles();

    HashSet<Figure> owners = new HashSet<Figure>();
    LinkedList<Handle> compatibleHandles = new LinkedList<Handle>();
    owners.add(master.getOwner());
    compatibleHandles.add(master);

    for (Handle handle : getSelectionHandles()) {
        if (!owners.contains(handle.getOwner()) && handle.isCombinableWith(master)) {
            owners.add(handle.getOwner());
            compatibleHandles.add(handle);
        }

    }
    return compatibleHandles;

}
 
開發者ID:umple,項目名稱:umple,代碼行數:24,代碼來源:DefaultDrawingView.java

示例4: updateCursor

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
public void updateCursor(DrawingView view, Point p) {
    if (view.isEnabled()) {
        Handle handle = view.findHandle(p);
        if (handle != null) {
            view.setCursor(handle.getCursor());
        } else {
            Figure figure = view.findFigure(p);
            Point2D.Double point = view.viewToDrawing(p);
            Drawing drawing = view.getDrawing();
            while (figure != null && !figure.isSelectable()) {
                figure = drawing.findFigureBehind(point, figure);
            }
            if (figure != null) {
                view.setCursor(figure.getCursor(view.viewToDrawing(p)));
            } else {
                view.setCursor(Cursor.getDefaultCursor());
            }
        }
    } else {
        view.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    }
}
 
開發者ID:umple,項目名稱:umple,代碼行數:23,代碼來源:AbstractTool.java

示例5: createHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
@Override
public Collection<Handle> createHandles(int detailLevel) {
    LinkedList<Handle> handles = new LinkedList<Handle>();
    switch (detailLevel) {
        case -1:
            handles.add(new BoundsOutlineHandle(this, false, true));
            break;
        case 0:
            handles.add(new BoundsOutlineHandle(this));
            handles.add(new MoveHandle(this, RelativeLocator.northWest()));
            handles.add(new MoveHandle(this, RelativeLocator.northEast()));
            handles.add(new MoveHandle(this, RelativeLocator.southWest()));
            handles.add(new MoveHandle(this, RelativeLocator.southEast()));
            handles.add(new FontSizeHandle(this));
            break;
    }
    return handles;
}
 
開發者ID:umple,項目名稱:umple,代碼行數:19,代碼來源:TextFigure.java

示例6: createHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
/**
 * Gets the handles of the figure. It returns the normal
 * PolylineHandles but adds ChangeConnectionHandles at the
 * start and end.
 */
@Override
public Collection<Handle> createHandles(int detailLevel) {
    ArrayList<Handle> handles = new ArrayList<Handle>(getNodeCount());
    switch (detailLevel) {
        case -1: // Mouse hover handles
            handles.add(new BezierOutlineHandle(this, true));
            break;
        case 0:
            handles.add(new BezierOutlineHandle(this));
            if (getLiner() == null) {
                for (int i = 1, n = getNodeCount() - 1; i < n; i++) {
                    handles.add(new BezierNodeHandle(this, i));
                }
            }
            handles.add(new ConnectionStartHandle(this));
            handles.add(new ConnectionEndHandle(this));
            break;
    }
    return handles;
}
 
開發者ID:umple,項目名稱:umple,代碼行數:26,代碼來源:LineConnectionFigure.java

示例7: createHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
@Override
public Collection<Handle> createHandles(int detailLevel) {
    LinkedList<Handle> handles = new LinkedList<Handle>();
    switch (detailLevel % 2) {
        case -1: // Mouse hover handles
            handles.add(new BoundsOutlineHandle(this, false, true));
            break;
        case 0:
            ResizeHandleKit.addResizeHandles(this, handles);
            handles.add(new LinkHandle(this));
            break;
        case 1:
            TransformHandleKit.addTransformHandles(this, handles);
            break;
        default:
            break;
    }
    return handles;
}
 
開發者ID:umple,項目名稱:umple,代碼行數:20,代碼來源:SVGEllipseFigure.java

示例8: createHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
@Override
public Collection<Handle> createHandles(int detailLevel) {
    LinkedList<Handle> handles = new LinkedList<Handle>();
    switch (detailLevel % 2) {
        case -1 : // Mouse hover handles
            handles.add(new BoundsOutlineHandle(this, false, true));
            break;
        case 0 :
            handles.add(new BoundsOutlineHandle(this));
            handles.add(new MoveHandle(this, RelativeLocator.northWest()));
            handles.add(new MoveHandle(this, RelativeLocator.northEast()));
            handles.add(new MoveHandle(this, RelativeLocator.southWest()));
            handles.add(new MoveHandle(this, RelativeLocator.southEast()));
            handles.add(new FontSizeHandle(this));
            handles.add(new LinkHandle(this));
            break;
        case 1 :
            TransformHandleKit.addTransformHandles(this, handles);
            break;
    }
    return handles;
}
 
開發者ID:umple,項目名稱:umple,代碼行數:23,代碼來源:SVGTextFigure.java

示例9: createHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
@Override
public Collection<Handle> createHandles(int detailLevel) {
    LinkedList<Handle> handles = new LinkedList<Handle>();
    switch (detailLevel % 2) {
        case -1: // Mouse hover handles
            handles.add(new SVGPathOutlineHandle(this, true));
            break;
        case 0:
            handles.add(new SVGPathOutlineHandle(this));
            for (Figure child : getChildren()) {
                handles.addAll(((SVGBezierFigure) child).createHandles(this, detailLevel));
            }
            handles.add(new LinkHandle(this));
            break;
        case 1:
            TransformHandleKit.addTransformHandles(this, handles);
            break;
        default:
            break;
    }
    return handles;
}
 
開發者ID:umple,項目名稱:umple,代碼行數:23,代碼來源:SVGPathFigure.java

示例10: createHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
@Override
public Collection<Handle> createHandles(int detailLevel) {
    LinkedList<Handle> handles = new LinkedList<Handle>();
    switch (detailLevel % 2) {
        case -1: // Mouse hover handles
            handles.add(new BoundsOutlineHandle(this, false, true));
            break;
        case 0:
            ResizeHandleKit.addResizeHandles(this, handles);
            handles.add(new SVGRectRadiusHandle(this));
            handles.add(new LinkHandle(this));
            break;
        case 1:
            TransformHandleKit.addTransformHandles(this, handles);
            break;
        default:
            break;
    }
    return handles;
}
 
開發者ID:umple,項目名稱:umple,代碼行數:21,代碼來源:SVGRectFigure.java

示例11: createHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
public Collection<Handle> createHandles(SVGPathFigure pathFigure, int detailLevel) {
    LinkedList<Handle> handles = new LinkedList<Handle>();
    switch (detailLevel % 2) {
        case 0:
            for (int i = 0, n = path.size(); i < n; i++) {
                handles.add(new BezierNodeHandle(this, i, pathFigure));
            }
            break;
        case 1:
            TransformHandleKit.addTransformHandles(this, handles);
            break;
        default:
            break;
    }
    return handles;
}
 
開發者ID:umple,項目名稱:umple,代碼行數:17,代碼來源:SVGBezierFigure.java

示例12: createHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
@Override
public Collection<Handle> createHandles(int detailLevel) {
    LinkedList<Handle> handles = new LinkedList<Handle>();

    switch (detailLevel % 2) {
        case -1: // Mouse hover handles
            handles.add(new BoundsOutlineHandle(this, false, true));
            break;
        case 0:
            ResizeHandleKit.addResizeHandles(this, handles);
            handles.add(new FontSizeHandle(this));
            handles.add(new TextOverflowHandle(this));
            handles.add(new LinkHandle(this));
            break;
        case 1:
            TransformHandleKit.addTransformHandles(this, handles);
            break;
        default:
            break;
    }
    return handles;
}
 
開發者ID:umple,項目名稱:umple,代碼行數:23,代碼來源:SVGTextAreaFigure.java

示例13: createHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
@Override
public Collection<Handle> createHandles(int detailLevel) {
    LinkedList<Handle> handles = new LinkedList<Handle>();

    switch (detailLevel % 2) {
        case -1: // Mouse hover handles
            handles.add(new BoundsOutlineHandle(this, false, true));
            break;
        case 0:
            ResizeHandleKit.addResizeHandles(this, handles);
            handles.add(new LinkHandle(this));
            break;
        case 1:
            TransformHandleKit.addTransformHandles(this, handles);
            break;
        default:
            break;
    }
    return handles;
}
 
開發者ID:umple,項目名稱:umple,代碼行數:21,代碼來源:SVGImageFigure.java

示例14: createHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
@Override
public Collection<Handle> createHandles(int detailLevel) {
    LinkedList<Handle> handles = new LinkedList<Handle>();
    switch (detailLevel % 2) {
        case 0:
            handles.add(new ODGPathOutlineHandle(this));
            for (Figure child : getChildren()) {
                handles.addAll(((ODGBezierFigure) child).createHandles(this, detailLevel));
            }
            break;
        case 1:
            TransformHandleKit.addTransformHandles(this, handles);
            break;
        default:
            break;
    }
    return handles;
}
 
開發者ID:umple,項目名稱:umple,代碼行數:19,代碼來源:ODGPathFigure.java

示例15: createHandles

import org.jhotdraw.draw.handle.Handle; //導入依賴的package包/類
public Collection<Handle> createHandles(ODGPathFigure pathFigure, int detailLevel) {
    LinkedList<Handle> handles = new LinkedList<Handle>();
    switch (detailLevel % 2) {
        case 0:
            for (int i = 0, n = path.size(); i < n; i++) {
                handles.add(new BezierNodeHandle(this, i, pathFigure));
            }
            break;
        case 1:
            TransformHandleKit.addTransformHandles(this, handles);
            break;
        default:
            break;
    }
    return handles;
}
 
開發者ID:umple,項目名稱:umple,代碼行數:17,代碼來源:ODGBezierFigure.java


注:本文中的org.jhotdraw.draw.handle.Handle類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。