本文整理汇总了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);
}
示例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;
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}