当前位置: 首页>>代码示例>>Java>>正文


Java UndoManager.setLimit方法代码示例

本文整理汇总了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);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:26,代码来源:XMap.java

示例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();
	
}
 
开发者ID:musaeed,项目名称:Prism-gsoc16,代码行数:17,代码来源:GUIPepaModelEditor.java

示例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());
            }
        }
    });
}
 
开发者ID:silverslade,项目名称:jif,代码行数:21,代码来源:JifTextPane.java

示例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);
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:12,代码来源:ProjectExplorerView.java


注:本文中的javax.swing.undo.UndoManager.setLimit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。