本文整理匯總了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;
}