本文整理匯總了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);
}