本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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));
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}