📄 figuretransfercommand.java
字号:
/* * @(#)FigureTransferCommand.java 5.1 * */package CH.ifa.draw.standard;import java.util.*;import CH.ifa.draw.util.*;import CH.ifa.draw.framework.*;/** * Common base clase for commands that transfer figures * between a drawing and the clipboard. */abstract class FigureTransferCommand extends Command { protected DrawingView fView; /** * Constructs a drawing command. * @param name the command name * @param view the target view */ protected FigureTransferCommand(String name, DrawingView view) { super(name); fView = view; } /** * Deletes the selection from the drawing. */ protected void deleteSelection() { fView.drawing().removeAll(fView.selection()); fView.clearSelection(); } /** * Copies the selection to the clipboard. */ protected void copySelection() { FigureSelection selection = fView.getFigureSelection(); Clipboard.getClipboard().setContents(selection); } /** * Inserts a vector of figures and translates them by the * given offset. */ protected void insertFigures(Vector figures, int dx, int dy) { FigureEnumeration e = new FigureEnumerator(figures); while (e.hasMoreElements()) { Figure figure = e.nextFigure(); figure.moveBy(dx, dy); figure = fView.add(figure); fView.addToSelection(figure); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -