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


Java UndoableEditSupport类代码示例

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


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


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