Difference between revisions of "PrF UG meta change meta"

From Protege Wiki
Jump to: navigation, search
(Automated import of articles)
 
 
(5 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
== Changing the Metaclass of a Class ==
 
== Changing the Metaclass of a Class ==
  
{{PrF_UG_TOC_meta}}<div id='prf_ug'>
+
<noinclude>{{PrF_UG_TOC_meta}}<div id='prf_ug'></noinclude>
  
 
For any existing class in your project,
 
For any existing class in your project,
 
you can change the metaclass used for that class.
 
you can change the metaclass used for that class.
This gives the class and the
+
This gives the class
[[PrF_UG_classes_class_editor|Class Editor]]
+
and the [[PrF_UG_classes_class_editor|Class Editor]]
 
the attributes defined by the newly-assigned metaclass.
 
the attributes defined by the newly-assigned metaclass.
 
New classes that you create as subclasses of the class will also use the new metaclass.
 
New classes that you create as subclasses of the class will also use the new metaclass.
However,
+
However, each existing subclass will continue to use its previously assigned metaclass
each existing subclass will continue to use its previously assigned metaclass unless you specifically change it.
+
unless you specifically change it.
  
 
This example uses the <b>wines</b> project,
 
This example uses the <b>wines</b> project,
Line 20: Line 20:
 
<ol class='a'>
 
<ol class='a'>
 
   <li><p>
 
   <li><p>
     In the
+
     In the [[PrF_UG_classes_class_browser|Class Browser]],
    [[PrF_UG_classes_class_browser|Class Browser]],
 
 
     click on the class that you want to change.
 
     click on the class that you want to change.
   
 
    </p><p> <div>[[Image:PrF_UG_meta_select_superclass.png|metaclasses_select_superclass]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_meta_select_superclass.png|frame|none|
 +
          Class Browser, "White wine" selected]]</div>
  
 
   <li><p>
 
   <li><p>
 
     Click the right mouse button and select "Change metaclass...".
 
     Click the right mouse button and select "Change metaclass...".
   
 
    </p><p> <div>[[Image:PrF_UG_meta_change_metaclass.png|metaclasses_change_metaclass]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_meta_change_metaclass.png|frame|none|
 +
          "Change Metaclass..." selected]]</div>
  
 
   <li><p>
 
   <li><p>
Line 39: Line 38:
 
     Note that if the class currently uses a non-standard class,
 
     Note that if the class currently uses a non-standard class,
 
     you can revert to <b>:STANDARD-CLASS</b>.
 
     you can revert to <b>:STANDARD-CLASS</b>.
   
 
    </p><p> <div>[[Image:PrF_UG_meta_select_metaclass.png|metaclasses_select_metaclass]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_meta_select_metaclass.png|frame|none|
 +
          Select Metaclass dialog, "Wine template" selected]]</div>
  
 
   <li><p>
 
   <li><p>
Line 53: Line 52:
  
  
</div>
+
<noinclude></div></noinclude>

Latest revision as of 17:22, November 13, 2008

Changing the Metaclass of a Class


Protege-Frames User's Guide
Metaclasses
Understanding Metaclasses
Example: Creating and Using a Metaclass
Looking at :STANDARD- CLASS
Creating a Metaclass
Creating a Class Using a Metaclass
Changing the Metaclass of a Class
Changing the Metaclass of Subclasses
Setting the Default Metaclass
Customizing the Class or Slot Editor
Understanding Slot Metaclasses
Creating a Slot Metaclass
Changing the Slot Metaclass of a Slot
Creating a Subslot Using a Slot Metaclass
Changing the Slot Metaclass of Subslots
Setting the Default Slot Metaclass
Glossary, Editing Help

For any existing class in your project, you can change the metaclass used for that class. This gives the class and the Class Editor the attributes defined by the newly-assigned metaclass. New classes that you create as subclasses of the class will also use the new metaclass. However, each existing subclass will continue to use its previously assigned metaclass unless you specifically change it.

This example uses the wines project, which includes a Wine template that supplies metaclass structure.

To change the metaclass of an existing class:

  1. In the Class Browser, click on the class that you want to change.

    Class Browser, "White wine" selected
  2. Click the right mouse button and select "Change metaclass...".

    "Change Metaclass..." selected
  3. A dialog box will display the Concrete metaclasses, which are the classes you can use. You cannot use Abstract metaclasses in this way. Note that if the class currently uses a non-standard class, you can revert to :STANDARD-CLASS.

    Select Metaclass dialog, "Wine template" selected
  4. Select the metaclass that has the properties you want and click OK. The highlighted class will now have the Class Editor from the selected metaclass, with entry fields determined by the template slots of the metaclass. The name of the metaclass you used will be displayed at the top of the Class Editor, immediately after the name of the class.