-
Notifications
You must be signed in to change notification settings - Fork 263
Using DOM Metadata for Palettes and Other Items
You can add metadata to DomNodeType
objects to do various things, such as setting up a palette.
Besides adding information to DomNodeType
objects to specify property descriptors for attributes, as shown in DOM Property Descriptors, you can add information that serves other purposes, such as describing objects in a palette. Add this information by calling the NamedMetadata.SetTag()
method.
A NamedMetadata
object, such as a DomNodeType
, contains a dictionary to which you can add information. You can add any object to a DomNodeType
, with any object as a key, by using the NamedMetadata.SetTag()
method. It has two forms:
void SetTag(object key, object value)
void SetTag<T>(T value)
NamedMetadata.GetTagLocal()
method, which has two analogous forms:
object GetTagLocal(object key)
T GetTagLocal<T>()
DomNodeType
objects and retrieve it later. SetTag()
was illustrated in DOM Property Descriptors adding property descriptor information to DomNodeType
objects.
A number of ATF samples use a palette for objects that can be dragged onto a canvas, such as ATF DOM Tree Editor Sample and ATF Simple DOM Editor Sample, which contains this code:
Schema.eventType.Type.SetTag(
new NodeTypePaletteItem(
Schema.eventType.Type,
"Event".Localize(),
"Event in a sequence".Localize(),
Resources.EventImage));
Schema.animationResourceType.Type.SetTag(
new NodeTypePaletteItem(
Schema.animationResourceType.Type,
"Animation".Localize(),
"Animation resource".Localize(),
Resources.AnimationImage));
...
A NodeTypePaletteItem
object is added to the DomNodeType
for each type of object that appears on the application's palette. NodeTypePaletteItem
contains such information as a tool tip and an image that represents the object on the palette.
For details on how the ATF Simple DOM Editor Sample creates and uses a palette, including using NodeTypePaletteItem
, see Using a Palette in Simple DOM Editor Programming Discussion.
You can also add palette information with annotations in the type definition if you are using an XML Schema. For an example of how to do this from the ATF Timeline Editor Sample, see Other Uses of Annotations.
- What is the DOM For: Overview of the DOM's features and advantages.
- It All Starts With Data: Defining application data models with types, especially using XML Schema.
-
DomNodes and DOM Metadata Classes: The fundamental
DomNode
class and its type metadata classes, such asDomNodeType
. Application data resides in a tree ofDomNode
s. - Type Loaders: Loading the type definition file into the application to use the file's data types and create type metadata class objects.
-
DOM Adapters: DOM adapters allow adapting
DomNode
s to other types and monitor events in theDomNode
tree to validate data. - DOM Property Descriptors: DOM property descriptors make it easy to use property editors on application data and are stored in type metadata.
- Using DOM Metadata for Palettes and Other Items: Type metadata can hold all sorts of data, such as palette object information.
-
DOM Persistence: Persisting application data using classes to write the
DomNode
tree to XML and read it back to aDomNode
tree. - DOM Debugging: ATF tools to facilitate debugging DOM code.
- DOM Use in Simple DOM Editor: Explains how the ATF Simple DOM Editor Sample uses the DOM.
- 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