当前位置: 首页>>代码示例>>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;未经允许,请勿转载。