Coverage Report - org.argouml.notation.providers.uml.InitNotationUml
 
Classes in this File Line Coverage Branch Coverage Complexity
InitNotationUml
100%
29/29
N/A
1
 
 1  
 /* $Id: InitNotationUml.java 18559 2010-07-24 20:11:42Z linus $
 2  
  *****************************************************************************
 3  
  * Copyright (c) 2009 Contributors - see below
 4  
  * All rights reserved. This program and the accompanying materials
 5  
  * are made available under the terms of the Eclipse Public License v1.0
 6  
  * which accompanies this distribution, and is available at
 7  
  * http://www.eclipse.org/legal/epl-v10.html
 8  
  *
 9  
  * Contributors:
 10  
  *    mvw
 11  
  *****************************************************************************
 12  
  *
 13  
  * Some portions of this file was previously release using the BSD License:
 14  
  */
 15  
 
 16  
 // Copyright (c) 2005-2008 The Regents of the University of California. All
 17  
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 18  
 // software and its documentation without fee, and without a written
 19  
 // agreement is hereby granted, provided that the above copyright notice
 20  
 // and this paragraph appear in all copies.  This software program and
 21  
 // documentation are copyrighted by The Regents of the University of
 22  
 // California. The software program and documentation are supplied "AS
 23  
 // IS", without any accompanying services from The Regents. The Regents
 24  
 // does not warrant that the operation of the program will be
 25  
 // uninterrupted or error-free. The end-user understands that the program
 26  
 // was developed for research purposes and is advised not to rely
 27  
 // exclusively on the program for any reason.  IN NO EVENT SHALL THE
 28  
 // UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
 29  
 // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
 30  
 // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
 31  
 // THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
 32  
 // SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
 33  
 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 34  
 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
 35  
 // PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
 36  
 // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
 37  
 // UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 38  
 
 39  
 package org.argouml.notation.providers.uml;
 40  
 
 41  
 import java.util.Collections;
 42  
 import java.util.List;
 43  
 
 44  
 import org.argouml.application.api.AbstractArgoJPanel;
 45  
 import org.argouml.application.api.GUISettingsTabInterface;
 46  
 import org.argouml.application.api.InitSubsystem;
 47  
 import org.argouml.application.helpers.ResourceLoaderWrapper;
 48  
 import org.argouml.notation.Notation;
 49  
 import org.argouml.notation.NotationName;
 50  
 import org.argouml.notation.NotationProviderFactory2;
 51  
 
 52  
 /**
 53  
  * This class initialises the UML Notation subsystem.
 54  
  * 
 55  
  * This class is the only one that has the knowledge of the complete list of
 56  
  * NotationProvider4 implementations for UML. <p>
 57  
  * 
 58  
  * @author mvw@tigris.org
 59  
  */
 60  900
 public class InitNotationUml implements InitSubsystem {
 61  
 
 62  
     /**
 63  
      * static initializer, register all appropriate notations.
 64  
      */
 65  
     public void init() {
 66  900
         NotationProviderFactory2 npf = NotationProviderFactory2.getInstance();
 67  900
         NotationName name =
 68  
             Notation.makeNotation(
 69  
                     "UML",
 70  
                     "1.4",
 71  
                     ResourceLoaderWrapper.lookupIconResource("UmlNotation"));
 72  
 
 73  900
         npf.addNotationProvider(
 74  
                 NotationProviderFactory2.TYPE_NAME,
 75  
                 name, ModelElementNameNotationUml.class);
 76  900
         npf.addNotationProvider(
 77  
                 NotationProviderFactory2.TYPE_TRANSITION,
 78  
                 name, TransitionNotationUml.class);
 79  900
         npf.addNotationProvider(
 80  
                 NotationProviderFactory2.TYPE_STATEBODY,
 81  
                 name, StateBodyNotationUml.class);
 82  900
         npf.addNotationProvider(
 83  
                 NotationProviderFactory2.TYPE_ACTIONSTATE,
 84  
                 name, ActionStateNotationUml.class);
 85  900
         npf.addNotationProvider(
 86  
                 NotationProviderFactory2.TYPE_OBJECT,
 87  
                 name, ObjectNotationUml.class);
 88  900
         npf.addNotationProvider(
 89  
                 NotationProviderFactory2.TYPE_COMPONENTINSTANCE,
 90  
                 name, ComponentInstanceNotationUml.class);
 91  900
         npf.addNotationProvider(
 92  
                 NotationProviderFactory2.TYPE_NODEINSTANCE,
 93  
                 name, NodeInstanceNotationUml.class);
 94  900
         npf.addNotationProvider(
 95  
                 NotationProviderFactory2.TYPE_OBJECTFLOWSTATE_TYPE,
 96  
                 name, ObjectFlowStateTypeNotationUml.class);
 97  900
         npf.addNotationProvider(
 98  
                 NotationProviderFactory2.TYPE_OBJECTFLOWSTATE_STATE,
 99  
                 name, ObjectFlowStateStateNotationUml.class);
 100  900
         npf.addNotationProvider(
 101  
                 NotationProviderFactory2.TYPE_CALLSTATE,
 102  
                 name, CallStateNotationUml.class);
 103  900
         npf.addNotationProvider(
 104  
                 NotationProviderFactory2.TYPE_CLASSIFIERROLE,
 105  
                 name, ClassifierRoleNotationUml.class);
 106  900
         npf.addNotationProvider(
 107  
                 NotationProviderFactory2.TYPE_MESSAGE,
 108  
                 name, MessageNotationUml.class);
 109  900
         npf.addNotationProvider(
 110  
                 NotationProviderFactory2.TYPE_ATTRIBUTE,
 111  
                 name, AttributeNotationUml.class);
 112  900
         npf.addNotationProvider(
 113  
                 NotationProviderFactory2.TYPE_OPERATION,
 114  
                 name, OperationNotationUml.class);
 115  900
         npf.addNotationProvider(
 116  
                 NotationProviderFactory2.TYPE_EXTENSION_POINT,
 117  
                 name, ExtensionPointNotationUml.class);
 118  900
         npf.addNotationProvider(
 119  
                 NotationProviderFactory2.TYPE_ASSOCIATION_END_NAME,
 120  
                 name, AssociationEndNameNotationUml.class);
 121  900
         npf.addNotationProvider(
 122  
                 NotationProviderFactory2.TYPE_ASSOCIATION_ROLE,
 123  
                 name, AssociationRoleNotationUml.class);
 124  900
         npf.addNotationProvider(
 125  
                 NotationProviderFactory2.TYPE_ASSOCIATION_NAME,
 126  
                 name, AssociationNameNotationUml.class);
 127  900
         npf.addNotationProvider(
 128  
                 NotationProviderFactory2.TYPE_MULTIPLICITY,
 129  
                 name, MultiplicityNotationUml.class);
 130  900
         npf.addNotationProvider(
 131  
                 NotationProviderFactory2.TYPE_ENUMERATION_LITERAL,
 132  
                 name, EnumerationLiteralNotationUml.class);
 133  
 
 134  900
         NotationProviderFactory2.getInstance().setDefaultNotation(name);
 135  
 
 136  
         /* Initialize the NotationUtilityUml: */
 137  900
         NotationUtilityUml.init();
 138  900
     }
 139  
 
 140  
     public List<GUISettingsTabInterface> getProjectSettingsTabs() {
 141  900
         return Collections.emptyList();
 142  
     }
 143  
 
 144  
     public List<GUISettingsTabInterface> getSettingsTabs() {
 145  900
         return Collections.emptyList();
 146  
     }
 147  
 
 148  
     public List<AbstractArgoJPanel> getDetailsTabs() {
 149  900
         return Collections.emptyList();
 150  
     }
 151  
 
 152  
 }