本文整理汇总了Java中javax.swing.undo.UndoManager.setLimit方法的典型用法代码示例。如果您正苦于以下问题:Java UndoManager.setLimit方法的具体用法?Java UndoManager.setLimit怎么用?Java UndoManager.setLimit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.undo.UndoManager
的用法示例。
在下文中一共展示了UndoManager.setLimit方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: XMap
import javax.swing.undo.UndoManager; //导入方法依赖的package包/类
public XMap(Object app, Projection proj, BufferedImage image) {
this.app = app;
this.proj = proj;
this.image = image;
width = image.getWidth();
height = image.getHeight();
overlays = new Vector();
overlayAlphas = new HashMap<Overlay, Float>();
mapInsets = null;
zoom = 1d;
rotation = 0;
try {
CylindricalProjection p = (CylindricalProjection) proj;
wrap = Math.rint(360.*(p.getX(10.)-p.getX(9.)));
} catch (ClassCastException ex) {
wrap = -1.;
}
// GMA 1.6.4: Add mouse motion listener to perform pan, mouse listener to perform center
addMouseMotionListener(this);
addMouseListener(this);
undoManager = new UndoManager();
undoManager.setLimit(8);
zoomActionTrack.getDocument().addUndoableEditListener(undoManager);
}
示例2: GUIPepaModelEditor
import javax.swing.undo.UndoManager; //导入方法依赖的package包/类
/** Creates a new instance of GUIPepaModelEditor */
public GUIPepaModelEditor(GUIMultiModelHandler handler)
{
editor = new JEditorPane();
PepaEditorKit kit = new PepaEditorKit();
editor.setEditorKitForContentType("text/pepa", kit);
editor.setContentType("text/pepa");
undoManager = new UndoManager();
undoManager.setLimit(200);
//editor.setForeground(FOREGROUND_COLOR);
this.handler = handler;
d = (PlainDocument)editor.getDocument();
editor.getDocument().addDocumentListener(this);
initComponents();
}
示例3: initUndoManager
import javax.swing.undo.UndoManager; //导入方法依赖的package包/类
/**
* This method is called from within the constructor to initialise the undo
* manager for the text pane.
*/
private void initUndoManager() {
undoF = new UndoManager();
undoF.setLimit(5000);
doc.addUndoableEditListener(new UndoableEditListener() {
@Override
public void undoableEditHappened(UndoableEditEvent evt) {
undoF.addEdit(evt.getEdit());
// adding a "*" to the file name, when the file has changed but not saved
if (jframe.getFileTabCount() != 0 && jframe.getSelectedPath().indexOf("*") == -1) {
jframe.setSelectedTitle(subPath + "*");
jframe.setTitle(jframe.getJifVersion() + " - " + jframe.getSelectedPath());
}
}
});
}
示例4: ProjectExplorerView
import javax.swing.undo.UndoManager; //导入方法依赖的package包/类
/**
* The constructor.
*/
public ProjectExplorerView() {
// Initialize the undo.redo system
undoManager = new UndoManager();
undoManager.setLimit(100);
// Set view reference to this new instance (if view is closed and reopened)
ConvertigoPlugin.projectManager.setProjectExplorerView(this);
}