-
Notifications
You must be signed in to change notification settings - Fork 263
IInstancingContext and IHierarchicalInsertionContext Interfaces
Instancing is implemented in two interfaces: primarily in IInstancingContext
and also with IHierarchicalInsertionContext
.
The IInstancingContext
interface provides all the editing commands customarily available under application Edit menus. It is primarily used for contexts without any kind of hierarchy to the objects. It contains these methods:
-
CanCopy()
: Return whether the context can copy the selection. -
Copy()
: Copy the selection, returning a data object representing the copied items. -
CanInsert()
: Return whether the context can insert the data object. -
Insert()
: Insert the data object into the context. -
CanDelete()
: Return whether the context can delete the selection. -
Delete()
: Delete the selection.
These methods are very general, so they apply to editing objects of any type. IInstancingContext
could apply to graphic objects on a canvas as for ATF Fsm Editor Sample and ATF State Chart Editor Sample. It can also apply to objects dragged from a palette, as in the ATF Simple DOM Editor Sample. It can apply to composite objects, such as prototypes, as in the ATF Fsm Editor Sample.
This interface is used in various editing mechanisms, too. Instancing supports both editing with menu items from either the Edit menu or context menus, as well as drag and drop editing.
The IHierarchicalInsertionContext
interface is used for contexts that can insert new objects under a specific parent object, by drag and drop for example. Its methods are a subset of IInstancingContext
:
-
CanInsert()
: Can the child object be inserted under the given parent. -
Insert()
: Insert the child object under the given parent.
IHierarchicalInsertionContext
works with objects of any type that can be selected, just as for IInstancingContext
.
If implementing instancing in a context with hierarchical items, it can be more appropriate to use the insertion methods of IHierarchicalInsertionContext
rather than IInstancingContext
.
For instance, the ApplicationUtil
class provides utilities for inserting objects in contexts. This class is used by several hierarchical editor components:
-
ListViewEditor
: Base class for list editors. -
TreeControlEditor
: Base class for tree editors. -
TreeListViewEditor
: Tree editor with right click context menu editing. It is used in the ATF Tree List Editor Sample.
ApplicationUtil
's CanInsert()
and Insert()
methods, which have parameters for context, child, and parent objects. If the given context implements IHierarchicalInsertionContext
, the IHierarchicalInsertionContext
interface's CanInsert()
and Insert()
methods are used to insert the child under the parent. If only IInstancingContext
is implemented in the context, then its methods are used.
In addition, the LayeringContext
class implements IHierarchicalInsertionContext
for contexts with a hierarchy of layer objects. The ATF Circuit Editor Sample uses this context for its Layers window, which allows you to create layers of objects. You can control a layer and its individual object's visibility with check boxes in this window. You can also drag layers under other layers, so there is a hierarchy of layers, as shown in this illustration:
The visibility of lower layers is controlled its parent layers' visibility.
- What is Instancing: Generally describes instancing, which also requires instances to be selectable.
-
IInstancingContext and IHierarchicalInsertionContext Interfaces: Discuss the
IInstancingContext
interface and its editing methods. -
StandardEditCommands and Instancing: Show how the
StandardEditCommands
component works with instancing. - Drag and Drop and Instancing: Explain how drag and drop is used with instancing.
- Implementing Instancing: Point to examples of implementing instancing in the ATF Simple DOM Editor Sample.
- 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