當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。