Skip to content

ATF Simple DOM No XML Editor Sample

Gary edited this page Mar 17, 2015 · 3 revisions

Table of Contents

Description

SimpleDomNoXmlEditor is a sample editor that demonstrates the use of the DOM (Document Object Model). SimpleDomNoXmlEditor operates on event sequence files, *.SimpleDomTxt files, that contain a sequence of events. The events can contain resources: animations or geometries. Each event sequence file displays in a ListView control, which shows all events and resources that can be selected and edited, as well as the properties on the selected items to be edited. The editor can load multiple event sequence files. The Resources editor tracks the last selected event and displays its resources in another ListView control.

SimpleDomNoXmlEditor is very similar to the SimpleDOMEditor sample, but does not use XML.

For information about programming in this sample, see Simple DOM No XML Editor Programming Discussion.

ATF Features Demonstrated by SimpleDomNoXmlEditor

  • Define a custom data model, not using an XML schema. It does not use XML for application data either, which SimpleDOMEditor does.
  • Use of adapters to decorate the DOM to create event sequence data models.
  • Use of IDocumentClient and the document framework to manage multiple documents.
  • Show implementing IPaletteClient to create a UI parts palette.
  • Using ListView and ListViewAdapter to display editable lists of events and resources.
  • Use of IListView, IItemView, and IObservableContext interfaces to adapt data to a list.
  • Use of ContextRegistry to track the active editing context, so application components always apply where the user is editing.
  • Use of the interfaces IInstancingContext, ISelectionContext, and IHistoryContext to adapt data for editing commands.
  • Use of ATF PropertyEditor and GridPropertyEditor components to allow property editing on selected UI elements.

Run SimpleDomNoXmlEditor

  1. Double-click the SimpleDomNoXmlEditor.exe in \bin\wws_atf\Release.
  2. The SimpleDomNoXmlEditor window appears.

SimpleDomNoXmlEditor has the following window panes:

  • Palette (Events and Resources): choose Event, Animation, or Geometry.
  • Property Editor: edit a selected event or resource property in a list control.
  • Grid Property Editor: edit a selected event or resource property in a grid control.
  • Resources: list the resources for the active event sequence file.
  • Canvas: displays the event sequence file contents.
The toolbar and menu bar contain standard items for file management: save, create new, open existing files, and so on; for locking/unlocking the UI window panes; and for editing: cut, copy, paste, delete, undo/redo. The Edit menu provides the standard editing functions as well as keyboard shortcuts, load or save UI window settings, and preferences. You can use Window menu items to activate and rearrange window panes. Help provides information about SimpleDomNoXmlEditor.

How to Use SimpleDomNoXmlEditor

To start:

  1. Create an event sequence file. Use the initial "Untitled.SimpleDomText" window, or choose File > New Event Sequence in the SimpleDomNoXmlEditor toolbar. An empty sequence file opens in the editing canvas.
  2. From the Palette, drag and drop an Event onto the event sequence file in the editing canvas.
  3. Click the tabs for the various panes to view and edit event properties.
To add resources:
  1. Drag and drop resources (Animation or Geometry) onto the Resource pane.
  2. Click the tabs for the various panes to view and edit resource properties.

TreeListEditor Modules

Modules perform these functions:

  • Program.cs: Contains the Main program. It creates a TypeCatalog listing the ATF and internal classes used.
  • DomTypes.cs: Defines DOM data types, not using an XML schema.
  • Editors.cs: Implements IDocumentClient and uses the document framework to manage multiple documents, implement File menu commands, auto-new and open documents on startup.
  • PaletteClient.cs: Implements IPaletteClient and uses IPaletteService to create a UI parts palette.
  • EventListEditor.cs: Uses ListView and ListViewAdapter to display editable lists of events and resources.
  • ResourceListEditor.cs: Display and edit the resources that belong to the most recently selected event. It handles drag and drop, and right-click context menus for events and resources.
  • EventSequenceContext.cs, EventContext.cs: Use IListView, IItemView, and IObservableContext interfaces to adapt data to a list.
  • EventSequenceContext.cs, EventContext.cs: Implement the ATF interfaces IInstancingContext, ISelectionContext, and IHistoryContext to adapt data so that ATF command components can be used to get undo/redo, cut/paste, and selection commands.
  • HelpAboutCommand.cs: Implements a standard Help/About dialog.

Topics in this section

Clone this wiki locally