-
Notifications
You must be signed in to change notification settings - Fork 263
Diagram Editor Programming Discussion
The ATF Diagram Editor Sample serves as a great example of how powerful MEF component composition can be. This sample simply puts the MEF components used in the other graph samples in its TypeCatalog
to produce an application that has nearly all the capabilities of the individual graph samples:
- ATF Circuit Editor Sample, described in Circuit Editor Programming Discussion.
- ATF Fsm Editor Sample, described in FSM Editor Programming Discussion.
- ATF State Chart Editor Sample, described in State Chart Editor Programming Discussion.
DiagramEditor provides all of its capabilities by adding graph components from the graph samples to its MEF TypeCatalog
. Everything else that is needed is included by referencing it, such as XML Schema files from SchemaLoader
classes. The TypeCatalog
includes (almost) a superset of the components in the three graph editor samples, so DiagramEditor provides all the capabilities those components do.
The only file in this sample of any substance is Program.cs
. Its Main()
function sets up the MEF components in a typical fashion. The MEF components it uses are a superset of the components used in the other three graph samples, with the few exceptions noted.
Some of these components are the ones most samples include: CommandService
, ControlHostService
, and WindowLayoutService
. PaletteService
is used in about half the samples and is needed here, because all the graph samples use palettes and have palette clients. A few are ones that are common to the graph samples, but not the other samples, such as PrototypeLister
.
DiagramEditor must also include the key graph components in the graph samples. Here are the editor components listed for these samples:
// Editors
typeof(StatechartEditorSample.Editor), // sample statechart editor
typeof(StatechartEditorSample.SchemaLoader), // loads statechart schema and extends types
typeof(StatechartEditorSample.PaletteClient), // component which adds palette items
typeof(CircuitEditorSample.Editor), // sample circuit editor
typeof(CircuitEditorSample.SchemaLoader), // loads circuit schema and extends types
typeof(GroupingCommands), // circuit group/ungroup commands
typeof(CircuitControlRegistry), // circuit controls management
typeof(MasteringCommands), // circuit master/unmaster commands
typeof(CircuitEditorSample.ModulePlugin), // component that defines circuit module types
typeof(LayeringCommands), // "Add Layer" context menu command for the Layer Lister
typeof(FsmEditorSample.Editor), // editor which manages FSM documents and controls
typeof(FsmEditorSample.PaletteClient), // component which adds palette items
typeof(FsmEditorSample.SchemaLoader), // loads FSM schema and extends types
There are three components that are common to all the samples:
-
SchemaLoader
: Schema loader, derived fromXmlSchemaTypeLoader
, that loads the schema file describing the sample's data model. All the graph samples use the ATF DOM and define their data model with an XML Schema. -
Editor
: Editor that opens and closes documents and manages the document editing controls. This is both a document and control host client, implementingIDocumentClient
andIControlHostClient
. These components perform in a similar way in the different samples. For more details of what they do, see Editor Component in FsmEditor and Circuit Document Display and Editing in CircuitEditor. -
PaletteClient
: Palette client that populates the palette with the items that can be dragged onto a canvas. CircuitEditor sample's palette client class is calledModulePlugin
. Note that the application handles multiple palettes smoothly, combining them in one pane, with individual palette items separated by headers. In addition, you can only drag items onto a canvas of the proper type. You can't drag circuit items onto a statechart canvas, for example. For more details on palettes, see Using a Palette.
SchemaLoader
classes all need to load their XML Schema .xsd
files. SchemaLoader
also depends on the type metadata classes in the Schema
class for each sample. DiagramEditor is built out of much more than appears in its project.
For FsmEditor and StateChartEditor, these three components above are the only ones needed, because they are the only components implemented in those samples.
CircuitEditor, however, has several more listed that provide important capabilities. GroupingCommands
, for example, is used for commands to group and ungroup modules and the connections between them. LayerLister
is also used only by CircuitEditor, even though it is not grouped with the other components.
Some of the components in CircuitEditor are not listed in DiagramEditor, such as GraphViewCommands
or any of the template related components like TemplateLister
. This means that DiagramEditor doesn't have the commands to increase or decrease the magnification of the graph using zoom presets, because GraphViewCommands
provides that. Nor does it have templates. These absences also demonstrate how capabilities can be easily removed from (or added to) applications by encapsulating them in components.
- Circuit Editor Programming Discussion: Learn how ATF handles graphs, and provides editors for kinds of graphs, such as circuits.
- Code Editor Programming Discussion: Shows how to interface third party software to an ATF application: the ActiproSoftware SyntaxEditor.
- Diagram Editor Programming Discussion: Very simply combines components from the CircuitEditor, FsmEditor, and StateChartEditor samples into one application, with the abilities of all three, showing the power of components.
-
DOM Property Editor Programming Discussion: Shows how to use the ATF DOM with an XML Schema to define application data with a large variety of attribute types, whose values can be viewed and edited using the ATF
PropertyEditor
component, using various value editors to view and edit attributes. - DOM Tree Editor Programming Discussion: Shows how to edit DOM data using a tree control and display properties in a variety of value editors.
- File Explorer Programming Discussion: Discusses the ATF File Explorer Sample using list and tree controls with adapters.
- FSM Editor Programming Discussion: Tells you about how the ATF FSM Editor Sample edits simple graphs for state machines, using DOM adapters for contexts and validation.
-
Model Viewer Programming Discussion: Shows how the ATF Model Viewer Sample is written, discussing how ATGI and Collada model data is handled, using rendering components, and using a
DesignControl
as a canvas for rendering. -
Simple DOM Editor Programming Discussion: Programming the ATF Simple DOM Editor Sample, creating a palette, using DOM adapters and contexts, editing application data, and searching
DomNode
s. - Simple DOM Editor WPF Programming Discussion: Programming the ATF Simple DOM Editor WPF Sample, which is similar to ATF Simple DOM Editor Sample, but implemented using ATF's WPF framework.
- Simple DOM No XML Editor Programming Discussion: Programming the ATF Simple DOM No XML Editor Sample, which is very similar to ATF Simple DOM Editor Sample, except that it doesn't use XML for either its data model or persisting application data.
- State Chart Editor Programming Discussion: Shows using ATF graph and other classes to create a statechart editor, using DOM adapters, documents, contexts, and validators.
- Target Manager Programming Discussion: Description of how a target manager is implemented using ATF components to manage target devices, such as PlayStation®Vita or PS3™ consoles. A target manager is used in other tools, such as the StateMachine tool.
- Timeline Editor Programming Discussion: Discusses how to create a fairly full-featured timeline editor using the ATF timeline facilities, such as the timeline renderer and the timeline control and its manipulators.
-
Tree List Control Programming Discussion: Demonstrates using the
TreeListControl
andTreeListItemRenderer
classes to display and edit hierarchical data in a tree view with details in columns. -
Tree List Editor Programming Discussion: Demonstrates how to use the ATF tree controls
TreeListView
and its enhancement,TreeListViewEditor
.TreeListView
usesTreeListViewAdapter
, which adaptsTreeListView
to display data in a tree. - Using Dom Programming Discussion: Shows how to use the various parts of the ATF DOM: an XML Schema, a schema metadata class file generated by DomGen, DOM adapters for the data types, a schema loader, and saving application data to an XML file.
- Home
- Getting Started
- Features & Benefits
- Requirements & Dependencies
- Gallery
- Technology & Samples
- Adoption
- News
- Release Notes
- ATF Community
- Searching Documentation
- Using Documentation
- Videos
- Tutorials
- How To
- Programmer's Guide
- Reference
- Code Samples
- Documentation Files
© 2014-2015, Sony Computer Entertainment America LLC