• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java UndoableEditSupport类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.swing.undo.UndoableEditSupport的典型用法代码示例。如果您正苦于以下问题:Java UndoableEditSupport类的具体用法?Java UndoableEditSupport怎么用?Java UndoableEditSupport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UndoableEditSupport类属于javax.swing.undo包,在下文中一共展示了UndoableEditSupport类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: BackgroundImageWizardController

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
public BackgroundImageWizardController(Home home, UserPreferences preferences, ViewFactory viewFactory,
		ContentManager contentManager, UndoableEditSupport undoSupport)
{
	super(preferences, viewFactory);
	this.home = home;
	this.preferences = preferences;
	this.viewFactory = viewFactory;
	this.contentManager = contentManager;
	this.undoSupport = undoSupport;
	this.propertyChangeSupport = new PropertyChangeSupport(this);
	setTitle(preferences.getLocalizedString(BackgroundImageWizardController.class, "wizard.title"));
	setResizable(true);
	// Initialize states
	this.imageChoiceStepState = new ImageChoiceStepState();
	this.imageScaleStepState = new ImageScaleStepState();
	this.imageOriginStepState = new ImageOriginStepState();
	setStepState(this.imageChoiceStepState);
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:19,代码来源:BackgroundImageWizardController.java


示例2: LabelController

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Creates the controller of label creation with undo support.
 */
public LabelController(Home home, float x, float y, UserPreferences preferences, ViewFactory viewFactory,
		UndoableEditSupport undoSupport)
{
	this.home = home;
	this.x = x;
	this.y = y;
	this.preferences = preferences;
	this.viewFactory = viewFactory;
	this.undoSupport = undoSupport;
	this.propertyChangeSupport = new PropertyChangeSupport(this);
	this.fontName = preferences.getDefaultFontName();
	this.fontNameSet = true;
	this.fontSize = preferences.getDefaultTextStyle(Label.class).getFontSize();
	this.pitchEnabled = Boolean.FALSE;
	this.elevation = 0f;
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:20,代码来源:LabelController.java


示例3: cut

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Deletes items and post a cut operation to undo support.
 */
public void cut(List<? extends Selectable> items)
{
	// Start a compound edit that deletes items and changes presentation name
	UndoableEditSupport undoSupport = getUndoableEditSupport();
	undoSupport.beginUpdate();
	getPlanController().deleteItems(items);
	// Add a undoable edit to change presentation name
	undoSupport.postEdit(new AbstractUndoableEdit()
	{
		@Override
		public String getPresentationName()
		{
			return preferences.getLocalizedString(HomeController.class, "undoCutName");
		}
	});
	// End compound edit
	undoSupport.endUpdate();
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:22,代码来源:HomeController.java


示例4: pasteToGroup

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Paste the furniture in clipboard to the selected group in home.
 * @since 5.0
 */
public void pasteToGroup()
{
	// Start a compound edit that adds furniture
	UndoableEditSupport undoSupport = getUndoableEditSupport();
	undoSupport.beginUpdate();
	List<HomePieceOfFurniture> addedFurniture = Home.getFurnitureSubList(getView().getClipboardItems());
	adjustFurnitureSizeAndElevation(addedFurniture, true);
	getFurnitureController().addFurnitureToGroup(addedFurniture,
			(HomeFurnitureGroup) this.home.getSelectedItems().get(0));
	undoSupport.postEdit(new AbstractUndoableEdit()
	{
		@Override
		public String getPresentationName()
		{
			return preferences.getLocalizedString(HomeController.class, "undoPasteToGroupName");
		}
	});
	
	// End compound edit
	undoSupport.endUpdate();
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:26,代码来源:HomeController.java


示例5: ImportedFurnitureWizardController

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Creates a controller that edits <code>piece</code> values.
 */
private ImportedFurnitureWizardController(Home home, CatalogPieceOfFurniture piece, String modelName,
		UserPreferences preferences, FurnitureController furnitureController, ViewFactory viewFactory,
		ContentManager contentManager, UndoableEditSupport undoSupport)
{
	super(preferences, viewFactory);
	this.home = home;
	this.piece = piece;
	this.modelName = modelName;
	this.preferences = preferences;
	this.furnitureController = furnitureController;
	this.viewFactory = viewFactory;
	this.undoSupport = undoSupport;
	this.contentManager = contentManager;
	this.propertyChangeSupport = new PropertyChangeSupport(this);
	setTitle(this.preferences.getLocalizedString(ImportedFurnitureWizardController.class,
			piece == null ? "importFurnitureWizard.title" : "modifyFurnitureWizard.title"));
	// Initialize states
	this.furnitureModelStepState = new FurnitureModelStepState();
	this.furnitureOrientationStepState = new FurnitureOrientationStepState();
	this.furnitureAttributesStepState = new FurnitureAttributesStepState();
	this.furnitureIconStepState = new FurnitureIconStepState();
	setStepState(this.furnitureModelStepState);
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:27,代码来源:ImportedFurnitureWizardController.java


示例6: HomeController3D

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Creates the controller of home 3D view.
 * @param home the home edited by this controller and its view
 */
public HomeController3D(final Home home, UserPreferences preferences, ViewFactory viewFactory,
		ContentManager contentManager, UndoableEditSupport undoSupport)
{
	this.home = home;
	this.preferences = preferences;
	this.viewFactory = viewFactory;
	this.contentManager = contentManager;
	this.undoSupport = undoSupport;
	// Initialize states
	this.topCameraState = new TopCameraState(preferences);
	this.observerCameraState = new ObserverCameraState();
	// Set default state 
	setCameraState(home.getCamera() == home.getTopCamera() ? this.topCameraState : this.observerCameraState);
	addModelListeners(home);
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:20,代码来源:HomeController3D.java


示例7: XDMModel

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * @param ms requires an instance of org.netbeans.editor.BaseDocument to be
 * available in the lookup;
 */
public XDMModel(ModelSource ms) {
    source = ms;
    // assert getSwingDocument() != null; // It can be null, for example if the file is deleted. 
    ues = new UndoableEditSupport(this);
    pcs = new PropertyChangeSupport(this);
    parser = new XMLSyntaxParser();
    setStatus(Status.UNPARSED);
    
    //establish a default element identification mechanism
    //domain models should override this by invoking "setElementIdentity"
    ElementIdentity eID = createElementIdentity();
    setElementIdentity(eID);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:XDMModel.java


示例8: WallController

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Creates the controller of wall view with undo support.
 */
public WallController(final Home home, UserPreferences preferences, ViewFactory viewFactory,
		ContentManager contentManager, UndoableEditSupport undoSupport)
{
	this.home = home;
	this.preferences = preferences;
	this.viewFactory = viewFactory;
	this.contentManager = contentManager;
	this.undoSupport = undoSupport;
	this.propertyChangeSupport = new PropertyChangeSupport(this);
	
	updateProperties();
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:16,代码来源:WallController.java


示例9: HomeFurnitureController

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Creates the controller of home furniture view with undo support.
 */
public HomeFurnitureController(Home home, UserPreferences preferences, ViewFactory viewFactory,
		ContentManager contentManager, UndoableEditSupport undoSupport)
{
	this.home = home;
	this.preferences = preferences;
	this.viewFactory = viewFactory;
	this.contentManager = contentManager;
	this.undoSupport = undoSupport;
	this.propertyChangeSupport = new PropertyChangeSupport(this);
	
	updateProperties();
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:16,代码来源:HomeFurnitureController.java


示例10: FurnitureController

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Creates the controller of home furniture view with undo support.
 */
public FurnitureController(final Home home, UserPreferences preferences, ViewFactory viewFactory,
		ContentManager contentManager, UndoableEditSupport undoSupport)
{
	this.home = home;
	this.preferences = preferences;
	this.viewFactory = viewFactory;
	this.undoSupport = undoSupport;
	this.contentManager = contentManager;
	
	addModelListeners();
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:15,代码来源:FurnitureController.java


示例11: addPastedItems

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Adds items to home.
 */
private void addPastedItems(final List<? extends Selectable> items, float dx, float dy,
		final boolean isDropInPlanView, final String presentationNameKey)
{
	if (items.size() > 1 || (items.size() == 1 && !(items.get(0) instanceof Compass)))
	{
		// Always use selection mode after a drop or a paste operation
		getPlanController().setMode(PlanController.Mode.SELECTION);
		// Start a compound edit that adds walls, furniture, rooms, dimension lines, polylines and labels to home
		UndoableEditSupport undoSupport = getUndoableEditSupport();
		undoSupport.beginUpdate();
		List<HomePieceOfFurniture> addedFurniture = Home.getFurnitureSubList(items);
		adjustFurnitureSizeAndElevation(addedFurniture, dx == 0 && dy == 0);
		getPlanController().moveItems(items, dx, dy);
		if (isDropInPlanView && this.preferences.isMagnetismEnabled() && items.size() == 1
				&& addedFurniture.size() == 1)
		{
			// Adjust piece when it's dropped in plan view  
			getPlanController().adjustMagnetizedPieceOfFurniture((HomePieceOfFurniture) items.get(0), dx, dy);
		}
		getPlanController().addItems(items);
		undoSupport.postEdit(new AbstractUndoableEdit()
		{
			@Override
			public String getPresentationName()
			{
				return preferences.getLocalizedString(HomeController.class, presentationNameKey);
			}
		});
		
		// End compound edit
		undoSupport.endUpdate();
	}
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:37,代码来源:HomeController.java


示例12: Home3DAttributesController

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Creates the controller of 3D view with undo support.
 */
public Home3DAttributesController(Home home, UserPreferences preferences, ViewFactory viewFactory,
		ContentManager contentManager, UndoableEditSupport undoSupport)
{
	this.home = home;
	this.preferences = preferences;
	this.viewFactory = viewFactory;
	this.contentManager = contentManager;
	this.undoSupport = undoSupport;
	this.propertyChangeSupport = new PropertyChangeSupport(this);
	
	updateProperties();
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:16,代码来源:Home3DAttributesController.java


示例13: LevelController

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Creates the controller of home levels view with undo support.
 */
public LevelController(Home home, UserPreferences preferences, ViewFactory viewFactory,
		UndoableEditSupport undoSupport)
{
	this.home = home;
	this.preferences = preferences;
	this.viewFactory = viewFactory;
	this.undoSupport = undoSupport;
	this.propertyChangeSupport = new PropertyChangeSupport(this);
	
	updateProperties();
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:15,代码来源:LevelController.java


示例14: RoomController

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Creates the controller of room view with undo support.  
 */
public RoomController(final Home home, UserPreferences preferences, ViewFactory viewFactory,
		ContentManager contentManager, UndoableEditSupport undoSupport)
{
	this.home = home;
	this.preferences = preferences;
	this.viewFactory = viewFactory;
	this.contentManager = contentManager;
	this.undoSupport = undoSupport;
	this.propertyChangeSupport = new PropertyChangeSupport(this);
	
	updateProperties();
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:16,代码来源:RoomController.java


示例15: PolylineController

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Creates the controller of polyline view with undo support.
 */
public PolylineController(final Home home, UserPreferences preferences, ViewFactory viewFactory,
		ContentManager contentManager, UndoableEditSupport undoSupport)
{
	this.home = home;
	this.preferences = preferences;
	this.viewFactory = viewFactory;
	this.undoSupport = undoSupport;
	this.propertyChangeSupport = new PropertyChangeSupport(this);
	
	updateProperties();
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:15,代码来源:PolylineController.java


示例16: CompassController

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
public CompassController(Home home, UserPreferences preferences, ViewFactory viewFactory,
		UndoableEditSupport undoSupport)
{
	this.home = home;
	this.preferences = preferences;
	this.viewFactory = viewFactory;
	this.undoSupport = undoSupport;
	this.propertyChangeSupport = new PropertyChangeSupport(this);
	
	updateProperties();
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:12,代码来源:CompassController.java


示例17: PageSetupController

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Creates the controller of page setup with undo support.
 */
public PageSetupController(Home home, UserPreferences preferences, ViewFactory viewFactory,
		UndoableEditSupport undoSupport)
{
	this.home = home;
	this.preferences = preferences;
	this.viewFactory = viewFactory;
	this.undoSupport = undoSupport;
	this.propertyChangeSupport = new PropertyChangeSupport(this);
	
	setPrint(home.getPrint());
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:15,代码来源:PageSetupController.java


示例18: PlanControllerInspector

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
public PlanControllerInspector(GUIState guiState, Home home,
		UserPreferences preferences, ViewFactory viewFactory,
		ContentManager contentManager, UndoableEditSupport undoSupport) {
	super(home, preferences, viewFactory, contentManager, undoSupport);
	this.guiState = guiState;
	this.home = home;
	this.preferences = preferences;
	this.viewFactory = viewFactory;
	this.contentManager = contentManager;
	this.undoSupport = undoSupport;
}
 
开发者ID:emilioserra,项目名称:UbikSim,代码行数:12,代码来源:PlanControllerInspector.java


示例19: JarTreeDialog

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param owner the owner frame
 * @param root the root directory
 */
public JarTreeDialog(Frame owner, File root) {
  super(owner, true);
  rootFile = root;
  createGUI();
  // set up the undo system
  undoManager = new UndoManager();
  undoSupport = new UndoableEditSupport();
  undoSupport.addUndoableEditListener(undoManager);
  CheckTreeSelectionModel checkModel = checkManager.getSelectionModel();
  checkModel.addPropertyChangeListener(new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent e) {
      if(ignoreEvents) {
        return;
      }
      TreePath[] prev = (TreePath[]) e.getOldValue();
      TreePath[] curr = (TreePath[]) e.getNewValue();
      TreePath path = jarTree.getSelectionPath();
      int row = jarTree.getRowForPath(path);
      SelectionEdit edit = new SelectionEdit(prev, prevRow, curr, row);
      undoSupport.postEdit(edit);
      prevRow = row;
      refresh();
    }

  });
  refresh();
  // center on screen
  Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
  int x = (dim.width-getBounds().width)/2;
  int y = (dim.height-getBounds().height)/2;
  setLocation(x, y);
}
 
开发者ID:OpenSourcePhysics,项目名称:osp,代码行数:39,代码来源:JarTreeDialog.java


示例20: register

import javax.swing.undo.UndoableEditSupport; //导入依赖的package包/类
public void register(UndoableEditSupport undoSupport) {
    if (prevSelection.equals(nextSelection))
        return;
    undoSupport.postEdit(this);
}
 
开发者ID:radsimu,项目名称:UaicNlpToolkit,代码行数:6,代码来源:SelectNodesCommand.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JSONCompareResult类代码示例发布时间:2022-05-22
下一篇:
Java FallbackFactory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap