01: //THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
02: //CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
03: //BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
04: //FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
05: //OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
06: //INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
07: //LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
08: //OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
09: //LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
10: //NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
11: //EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
12: //POSSIBILITY OF SUCH DAMAGE.
13: //
14: //Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
15: package com.metaboss.applications.designstudio.userobjects;
16:
17: import com.metaboss.applications.designstudio.Application;
18: import com.metaboss.applications.designstudio.BasePropertiesDialog;
19: import com.metaboss.applications.designstudio.BaseUserObject;
20: import com.metaboss.applications.designstudio.propertiesdialogs.SimpleObjectPropertiesdialog;
21: import com.metaboss.sdlctools.models.metabossmodel.MetaBossModelPackage;
22: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemusagemodel.AbstractNamespace;
23: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemusagemodel.Actor;
24: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemusagemodel.ActorClass;
25:
26: /* Actor class user object */
27:
28: public class ActorsUserObject extends BaseUserObject {
29: private Actor mActor = null;
30:
31: public ActorsUserObject(Actor pActor) {
32: super (pActor, Application.ACTOR_ICON);
33: mActor = pActor;
34: }
35:
36: public ActorsUserObject(Actor pActor, String pCaption, int pMode) {
37: super (pActor, pCaption, pMode);
38: mActor = pActor;
39: }
40:
41: // create new namespace
42: public static ActorsUserObject addNewActor(
43: AbstractNamespace pNamespace) throws Exception {
44: return (ActorsUserObject) new ActorsUserObject(null)
45: .addNewObject(getObjectPackage(pNamespace), pNamespace
46: .getActors());
47: }
48:
49: public BaseUserObject createNewObject(MetaBossModelPackage pPackage) {
50: ActorClass lClass = pPackage.getEnterpriseModel()
51: .getSystemUsageModel().getActor();
52: return new ActorsUserObject(lClass.createActor());
53: }
54:
55: // return object root node captions
56: public String getRootNodeName() {
57: return Application.getString("actors_node");
58: }
59:
60: public Actor getActor() {
61: return mActor;
62: }
63:
64: // get object editor
65: public BasePropertiesDialog getObjectEditor() {
66: return new SimpleObjectPropertiesdialog("Actor");
67: }
68: }
|