本文整理汇总了Java中org.jhotdraw.draw.handle.Handle.setView方法的典型用法代码示例。如果您正苦于以下问题:Java Handle.setView方法的具体用法?Java Handle.setView怎么用?Java Handle.setView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jhotdraw.draw.handle.Handle
的用法示例。
在下文中一共展示了Handle.setView方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleRequestSecondaryHandles
import org.jhotdraw.draw.handle.Handle; //导入方法依赖的package包/类
@Override
public void handleRequestSecondaryHandles(HandleEvent e) {
secondaryHandleOwner = e.getHandle();
secondaryHandles.clear();
secondaryHandles.addAll(secondaryHandleOwner.createSecondaryHandles());
for (Handle h : secondaryHandles) {
h.setView(DefaultDrawingView.this);
h.addHandleListener(eventHandler);
}
repaint();
}
示例2: 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);
}
}
}
示例3: 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);
}
}
}
示例4: handleRequestSecondaryHandles
import org.jhotdraw.draw.handle.Handle; //导入方法依赖的package包/类
@Override
public void handleRequestSecondaryHandles(HandleEvent e) {
secondaryHandleOwner = e.getHandle();
secondaryHandles.clear();
secondaryHandles.addAll(secondaryHandleOwner.createSecondaryHandles());
for (Handle h : secondaryHandles) {
h.setView(InteractiveDrawingView.this);
h.addHandleListener(eventHandler);
}
repaint();
}
示例5: 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);
}
}
}