01: /*
02: * SceneItemCD.java
03: *
04: * Created on January 10, 2007, 6:22 PM
05: *
06: * To change this template, choose Tools | Template Manager
07: * and open the template in the editor.
08: */
09:
10: package org.netbeans.modules.vmd.game.model;
11:
12: import org.netbeans.modules.vmd.api.model.*;
13: import org.netbeans.modules.vmd.api.model.common.ValidatorPresenter;
14: import org.netbeans.modules.vmd.game.integration.components.GameTypes;
15: import org.netbeans.modules.vmd.midp.components.MidpTypes;
16:
17: import java.util.Arrays;
18: import java.util.List;
19:
20: /**
21: *
22: * @author Karel Herink
23: */
24: public class SceneItemCD extends ComponentDescriptor {
25:
26: /** Creates a new instance of SceneItemCD */
27: public SceneItemCD() {
28: }
29:
30: public static final TypeID TYPEID = new TypeID(
31: TypeID.Kind.COMPONENT, "SceneItem"); // NOI18N
32:
33: public static final String PROPERTY_LAYER = "sceneitemcd.prop.layer"; // NOI18N
34: public static final String PROPERTY_LOCK = "sceneitemcd.prop.lock"; // NOI18N
35: public static final String PROPERTY_VISIBLE = "sceneitemcd.prop.visible"; // NOI18N
36: public static final String PROPERTY_POSITION = "sceneitemcd.prop.position"; // NOI18N
37: public static final String PROPERTY_Z_ORDER = "sceneitemcd.prop.z.order"; // NOI18N
38:
39: public TypeDescriptor getTypeDescriptor() {
40: return new TypeDescriptor(null, TYPEID, true, false);
41: }
42:
43: public VersionDescriptor getVersionDescriptor() {
44: return null;
45: }
46:
47: public List<PropertyDescriptor> getDeclaredPropertyDescriptors() {
48: return Arrays.asList(new PropertyDescriptor(PROPERTY_LAYER,
49: LayerCD.TYPEID, PropertyValue.createNull(), false,
50: false, Versionable.FOREVER), new PropertyDescriptor(
51: PROPERTY_LOCK, MidpTypes.TYPEID_BOOLEAN, PropertyValue
52: .createNull(), false, false,
53: Versionable.FOREVER), new PropertyDescriptor(
54: PROPERTY_VISIBLE, MidpTypes.TYPEID_BOOLEAN,
55: PropertyValue.createNull(), false, false,
56: Versionable.FOREVER), new PropertyDescriptor(
57: PROPERTY_POSITION, GameTypes.TYPEID_POINT,
58: PropertyValue.createNull(), false, false,
59: Versionable.FOREVER), new PropertyDescriptor(
60: PROPERTY_Z_ORDER, MidpTypes.TYPEID_INT, PropertyValue
61: .createNull(), false, false,
62: Versionable.FOREVER));
63: }
64:
65: protected List<? extends Presenter> createPresenters() {
66: return Arrays.asList(new ValidatorPresenter() {
67: protected void checkCustomValidity() {
68: //assert getComponent().readProperty(PROPERTY_LAYER).getKind() != PropertyValue.Kind.NULL;
69: }
70: });
71: }
72:
73: }
|