svn commit: r14530 - trunk/src/argouml-app/src/org/argouml/uml: diagram/ui ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2008-04-30 05:26:50-0700
New Revision: 14530

Added:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/DiagramPropPanelFactory.java   (contents, props changed)
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ElementPropPanelFactory.java   (contents, props changed)
   trunk/src/argouml-app/src/org/argouml/uml/ui/PropPanelFactory.java   (contents, props changed)
   trunk/src/argouml-app/src/org/argouml/uml/ui/PropPanelFactoryManager.java   (contents, props changed)
Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/InitDiagramAppearanceUI.java
   trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java

Log:
Created a PropPanelFactory.

Added: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/DiagramPropPanelFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/DiagramPropPanelFactory.java?view=auto&rev=14530
==============================================================================
--- (empty file)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/DiagramPropPanelFactory.java	2008-04-30 05:26:50-0700
@@ -0,0 +1,75 @@
+// $Id$
+// Copyright (c) 2008 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.uml.diagram.ui;
+
+import org.argouml.uml.diagram.activity.ui.UMLActivityDiagram;
+import org.argouml.uml.diagram.collaboration.ui.UMLCollaborationDiagram;
+import org.argouml.uml.diagram.deployment.ui.UMLDeploymentDiagram;
+import org.argouml.uml.diagram.sequence.ui.UMLSequenceDiagram;
+import org.argouml.uml.diagram.state.ui.UMLStateDiagram;
+import org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram;
+import org.argouml.uml.diagram.use_case.ui.UMLUseCaseDiagram;
+import org.argouml.uml.ui.PropPanel;
+import org.argouml.uml.ui.PropPanelFactory;
+
+/**
+ * This factory creates the right PropPanelDiagram for a given UMLDiagram.
+ * 
+ * TODO: This class should be split up, to have a different
+ * factory for each package. 
+ * That would solve the current wrong package dependencies.
+ * However, the statement added by Bob to return PropPanelDiagram
+ * needs a different solution then - or can it be removed?
+ *
+ * @author Michiel
+ */
+class DiagramPropPanelFactory implements PropPanelFactory {
+
+    public PropPanel createPropPanel(Object object) {
+        if (object instanceof UMLDiagram) {
+            if (object instanceof UMLActivityDiagram) {
+                return new PropPanelUMLActivityDiagram();
+            } else if (object instanceof UMLClassDiagram) {
+                return new PropPanelUMLClassDiagram();
+            } else if (object instanceof UMLCollaborationDiagram) {
+                return new PropPanelUMLCollaborationDiagram();
+            } else if (object instanceof UMLDeploymentDiagram) {
+                return new PropPanelUMLDeploymentDiagram();
+            } else if (object instanceof UMLSequenceDiagram) {
+                return new PropPanelUMLSequenceDiagram();
+            } else if (object instanceof UMLStateDiagram) {
+                return new PropPanelUMLStateDiagram();
+            } else if (object instanceof UMLUseCaseDiagram) {
+                return new PropPanelUMLUseCaseDiagram();
+            } else {
+                // If we get here then presumably a plugin has provided a
+                // different diagram type. For now lets show something.
+                return new PropPanelDiagram();
+            }
+        }
+        return null;
+    }
+    
+}

Added: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ElementPropPanelFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ElementPropPanelFactory.java?view=auto&rev=14530
==============================================================================
--- (empty file)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ElementPropPanelFactory.java	2008-04-30 05:26:50-0700
@@ -0,0 +1,348 @@
+// $Id$
+// Copyright (c) 2008 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.uml.diagram.ui;
+
+import org.argouml.model.Model;
+import org.argouml.uml.ui.PropPanel;
+import org.argouml.uml.ui.PropPanelFactory;
+import org.argouml.uml.ui.behavior.activity_graphs.PropPanelActionState;
+import org.argouml.uml.ui.behavior.activity_graphs.PropPanelActivityGraph;
+import org.argouml.uml.ui.behavior.activity_graphs.PropPanelCallState;
+import org.argouml.uml.ui.behavior.activity_graphs.PropPanelClassifierInState;
+import org.argouml.uml.ui.behavior.activity_graphs.PropPanelObjectFlowState;
+import org.argouml.uml.ui.behavior.activity_graphs.PropPanelPartition;
+import org.argouml.uml.ui.behavior.activity_graphs.PropPanelSubactivityState;
+import org.argouml.uml.ui.behavior.collaborations.PropPanelAssociationEndRole;
+import org.argouml.uml.ui.behavior.collaborations.PropPanelAssociationRole;
+import org.argouml.uml.ui.behavior.collaborations.PropPanelClassifierRole;
+import org.argouml.uml.ui.behavior.collaborations.PropPanelCollaboration;
+import org.argouml.uml.ui.behavior.collaborations.PropPanelInteraction;
+import org.argouml.uml.ui.behavior.collaborations.PropPanelMessage;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelAction;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelActionSequence;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelArgument;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelCallAction;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelComponentInstance;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelCreateAction;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelDestroyAction;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelException;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelLink;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelLinkEnd;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelNodeInstance;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelObject;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelReception;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelReturnAction;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelSendAction;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelSignal;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelStimulus;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelTerminateAction;
+import org.argouml.uml.ui.behavior.common_behavior.PropPanelUninterpretedAction;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelCallEvent;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelChangeEvent;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelCompositeState;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelFinalState;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelGuard;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelPseudostate;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelSignalEvent;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelSimpleState;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelStateMachine;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelStateVertex;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelStubState;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelSubmachineState;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelSynchState;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelTimeEvent;
+import org.argouml.uml.ui.behavior.state_machines.PropPanelTransition;
+import org.argouml.uml.ui.behavior.use_cases.PropPanelActor;
+import org.argouml.uml.ui.behavior.use_cases.PropPanelExtend;
+import org.argouml.uml.ui.behavior.use_cases.PropPanelExtensionPoint;
+import org.argouml.uml.ui.behavior.use_cases.PropPanelInclude;
+import org.argouml.uml.ui.behavior.use_cases.PropPanelUseCase;
+import org.argouml.uml.ui.foundation.core.PropPanelAbstraction;
+import org.argouml.uml.ui.foundation.core.PropPanelAssociation;
+import org.argouml.uml.ui.foundation.core.PropPanelAssociationClass;
+import org.argouml.uml.ui.foundation.core.PropPanelAssociationEnd;
+import org.argouml.uml.ui.foundation.core.PropPanelAttribute;
+import org.argouml.uml.ui.foundation.core.PropPanelClass;
+import org.argouml.uml.ui.foundation.core.PropPanelClassifier;
+import org.argouml.uml.ui.foundation.core.PropPanelComment;
+import org.argouml.uml.ui.foundation.core.PropPanelComponent;
+import org.argouml.uml.ui.foundation.core.PropPanelConstraint;
+import org.argouml.uml.ui.foundation.core.PropPanelDataType;
+import org.argouml.uml.ui.foundation.core.PropPanelDependency;
+import org.argouml.uml.ui.foundation.core.PropPanelElementResidence;
+import org.argouml.uml.ui.foundation.core.PropPanelEnumeration;
+import org.argouml.uml.ui.foundation.core.PropPanelEnumerationLiteral;
+import org.argouml.uml.ui.foundation.core.PropPanelFlow;
+import org.argouml.uml.ui.foundation.core.PropPanelGeneralization;
+import org.argouml.uml.ui.foundation.core.PropPanelInterface;
+import org.argouml.uml.ui.foundation.core.PropPanelMethod;
+import org.argouml.uml.ui.foundation.core.PropPanelNode;
+import org.argouml.uml.ui.foundation.core.PropPanelOperation;
+import org.argouml.uml.ui.foundation.core.PropPanelParameter;
+import org.argouml.uml.ui.foundation.core.PropPanelPermission;
+import org.argouml.uml.ui.foundation.core.PropPanelRelationship;
+import org.argouml.uml.ui.foundation.core.PropPanelUsage;
+import org.argouml.uml.ui.foundation.extension_mechanisms.PropPanelStereotype;
+import org.argouml.uml.ui.foundation.extension_mechanisms.PropPanelTagDefinition;
+import org.argouml.uml.ui.foundation.extension_mechanisms.PropPanelTaggedValue;
+import org.argouml.uml.ui.model_management.PropPanelElementImport;
+import org.argouml.uml.ui.model_management.PropPanelModel;
+import org.argouml.uml.ui.model_management.PropPanelPackage;
+import org.argouml.uml.ui.model_management.PropPanelSubsystem;
+
+/**
+ * This factory creates the right PropPanelModelElement 
+ * for a given UML Element. <p>
+ * 
+ * Constraint: Every UML element shall have a proppanel.
+ * We throw an exception if one is not found.
+ *
+ * @author Michiel
+ */
+public class ElementPropPanelFactory implements PropPanelFactory {
+
+    public PropPanel createPropPanel(Object element) {
+        if (Model.getFacade().isAElement(element)) {
+            if (Model.getFacade().isAClassifier(element)) {
+                return getClassifierPropPanel(element);
+            } else if (Model.getFacade().isARelationship(element)) {
+                return getRelationshipPropPanel(element);
+            } else if (Model.getFacade().isAStateVertex(element)) {
+                return getStateVertexPropPanel(element);
+            } else if (Model.getFacade().isAActionSequence(element)) {
+                // This is not a subtype of PropPanelAction, 
+                // so it must come first
+                return new PropPanelActionSequence();
+            } else if (Model.getFacade().isAAction(element)) {
+                return getActionPropPanel(element);
+                /*
+                 * TODO: This needs to be in type hierarchy order to work
+                 * properly and create the most specific property panel
+                 * properly. Everything which has been factored out of this
+                 * method has been reviewed. Anything below this point still
+                 * needs to be reviewed - tfm
+                 */
+            } else if (Model.getFacade().isAActivityGraph(element)) {
+                return new PropPanelActivityGraph();
+            } else if (Model.getFacade().isAArgument(element)) {
+                return new PropPanelArgument();
+            } else if (Model.getFacade().isAAssociationEndRole(element)) {
+                return new PropPanelAssociationEndRole();
+            } else if (Model.getFacade().isAAssociationEnd(element)) {
+                return new PropPanelAssociationEnd();
+            } else if (Model.getFacade().isAAttribute(element)) {
+                return new PropPanelAttribute();
+            } else if (Model.getFacade().isACollaboration(element)) {
+                return new PropPanelCollaboration();
+            } else if (Model.getFacade().isAComment(element)) {
+                return new PropPanelComment();
+            } else if (Model.getFacade().isAComponentInstance(element)) {
+                return new PropPanelComponentInstance();
+            } else if (Model.getFacade().isAConstraint(element)) {
+                return new PropPanelConstraint();
+            } else if (Model.getFacade().isAEnumerationLiteral(element)) {
+                return new PropPanelEnumerationLiteral();
+            } else if (Model.getFacade().isAElementImport(element)) {
+                return new PropPanelElementImport();
+            } else if (Model.getFacade().isAElementResidence(element)) {
+                return new PropPanelElementResidence();
+            } else if (Model.getFacade().isAExtensionPoint(element)) {
+                return new PropPanelExtensionPoint();
+            } else if (Model.getFacade().isAGuard(element)) {
+                return new PropPanelGuard();
+            } else if (Model.getFacade().isAInteraction(element)) {
+                return new PropPanelInteraction();
+            } else if (Model.getFacade().isALink(element)) {
+                return new PropPanelLink();
+            } else if (Model.getFacade().isALinkEnd(element)) {
+                return new PropPanelLinkEnd();
+            } else if (Model.getFacade().isAMessage(element)) {
+                return new PropPanelMessage();
+            } else if (Model.getFacade().isAMethod(element)) {
+                return new PropPanelMethod();
+            } else if (Model.getFacade().isAModel(element)) {
+                return new PropPanelModel();
+            } else if (Model.getFacade().isANodeInstance(element)) {
+                return new PropPanelNodeInstance();
+            } else if (Model.getFacade().isAObject(element)) {
+                return new PropPanelObject();
+            } else if (Model.getFacade().isAOperation(element)) {
+                return new PropPanelOperation();
+            } else if (Model.getFacade().isAPackage(element)) {
+                return new PropPanelPackage();
+            } else if (Model.getFacade().isAParameter(element)) {
+                return new PropPanelParameter();
+            } else if (Model.getFacade().isAPartition(element)) {
+                return new PropPanelPartition();
+            } else if (Model.getFacade().isAReception(element)) {
+                return new PropPanelReception();
+            } else if (Model.getFacade().isAStateMachine(element)) {
+                return new PropPanelStateMachine();
+            } else if (Model.getFacade().isAStereotype(element)) {
+                return new PropPanelStereotype();
+            } else if (Model.getFacade().isAStimulus(element)) {
+                return new PropPanelStimulus();
+            } else if (Model.getFacade().isASubsystem(element)) {
+                return new PropPanelSubsystem();
+            } else if (Model.getFacade().isATaggedValue(element)) {
+                return new PropPanelTaggedValue();
+            } else if (Model.getFacade().isATagDefinition(element)) {
+                return new PropPanelTagDefinition();
+            } else if (Model.getFacade().isATransition(element)) {
+                return new PropPanelTransition();
+            } else if (Model.getFacade().isACallEvent(element)) {
+                return new PropPanelCallEvent();
+            } else if (Model.getFacade().isAChangeEvent(element)) {
+                return new PropPanelChangeEvent();
+            } else if (Model.getFacade().isASignalEvent(element)) {
+                return new PropPanelSignalEvent();
+            } else if (Model.getFacade().isATimeEvent(element)) {
+                return new PropPanelTimeEvent();
+            } else if (Model.getFacade().isADependency(element)) {
+                return new PropPanelDependency();
+            }
+            throw new IllegalArgumentException("Unsupported Element type");
+        }
+        return null;
+    }
+
+
+    private PropPanelClassifier getClassifierPropPanel(Object element) {
+        if (Model.getFacade().isAActor(element)) {
+            return new PropPanelActor();
+        } else if (Model.getFacade().isAAssociationClass(element)) {
+            return new PropPanelAssociationClass();
+        } else if (Model.getFacade().isAClass(element)) {
+            return new PropPanelClass();
+        } else if (Model.getFacade().isAClassifierInState(element)) {
+            return new PropPanelClassifierInState();
+        } else if (Model.getFacade().isAClassifierRole(element)) {
+            return new PropPanelClassifierRole();
+        } else if (Model.getFacade().isAComponent(element)) {
+            return new PropPanelComponent();
+        } else if (Model.getFacade().isADataType(element)) {
+            if (Model.getFacade().isAEnumeration(element)) {
+                return new PropPanelEnumeration();
+            } else {
+                return new PropPanelDataType();
+            }
+        } else if (Model.getFacade().isAInterface(element)) {
+            return new PropPanelInterface();
+        } else if (Model.getFacade().isANode(element)) {
+            return new PropPanelNode();
+        } else if (Model.getFacade().isASignal(element)) {
+            if (Model.getFacade().isAException(element)) {
+                return new PropPanelException();
+            } else {
+                return new PropPanelSignal();
+            }
+        } else if (Model.getFacade().isAUseCase(element)) {
+            return new PropPanelUseCase();
+        }
+        throw new IllegalArgumentException("Unsupported Element type");
+    }
+
+    private PropPanelRelationship getRelationshipPropPanel(Object element) {
+        if (Model.getFacade().isAAssociation(element)) {
+            if (Model.getFacade().isAAssociationRole(element)) {
+                return new PropPanelAssociationRole();
+            } else {
+                return new PropPanelAssociation();
+            }
+        } else if (Model.getFacade().isADependency(element)) {
+            if (Model.getFacade().isAAbstraction(element)) {
+                return new PropPanelAbstraction();
+            } else if (Model.getFacade().isAPackageImport(element)) {
+                return new PropPanelPermission();
+            } else if (Model.getFacade().isAUsage(element)) {
+                return new PropPanelUsage();
+            } else {
+                return new PropPanelDependency();
+            }
+        } else if (Model.getFacade().isAExtend(element)) {
+            return new PropPanelExtend();
+        } else if (Model.getFacade().isAFlow(element)) {
+            return new PropPanelFlow();
+        } else if (Model.getFacade().isAGeneralization(element)) {
+            return new PropPanelGeneralization();
+        } else if (Model.getFacade().isAInclude(element)) {
+            return new PropPanelInclude();
+        }
+        throw new IllegalArgumentException("Unsupported Relationship type");
+    }
+
+    private PropPanelAction getActionPropPanel(Object action) {
+        if (Model.getFacade().isACallAction(action)) {
+            return new PropPanelCallAction();
+        } else if (Model.getFacade().isACreateAction(action)) {
+            return new PropPanelCreateAction();
+        } else if (Model.getFacade().isADestroyAction(action)) {
+            return new PropPanelDestroyAction();
+        } else if (Model.getFacade().isAReturnAction(action)) {
+            return new PropPanelReturnAction();
+        } else if (Model.getFacade().isASendAction(action)) {
+            return new PropPanelSendAction();
+        } else if (Model.getFacade().isATerminateAction(action)) {
+            return new PropPanelTerminateAction();
+        } else if (Model.getFacade().isAUninterpretedAction(action)) {
+            return new PropPanelUninterpretedAction();
+        }
+        throw new IllegalArgumentException("Unsupported Action type");
+    }
+    
+    private PropPanelStateVertex getStateVertexPropPanel(Object element) {
+        if (Model.getFacade().isAState(element)) {
+            if (Model.getFacade().isAActionState(element)) {
+                return new PropPanelActionState();
+            } else if (Model.getFacade().isACallState(element)) {
+                return new PropPanelCallState();
+            } else if (Model.getFacade().isACompositeState(element)) {
+                if (Model.getFacade().isASubmachineState(element)) {
+                    if (Model.getFacade().isASubactivityState(element)) {
+                        return new PropPanelSubactivityState();
+                    } else {
+                        return new PropPanelSubmachineState();
+                    }
+                } else {
+                    return new PropPanelCompositeState();
+                }
+            } else if (Model.getFacade().isAFinalState(element)) {
+                return new PropPanelFinalState();
+            } else if (Model.getFacade().isAObjectFlowState(element)) {
+                return new PropPanelObjectFlowState();
+            } else if (Model.getFacade().isASimpleState(element)) {
+                return new PropPanelSimpleState();
+            }
+        } else if (Model.getFacade().isAPseudostate(element)) {
+            return new PropPanelPseudostate();
+        } else if (Model.getFacade().isAStubState(element)) {
+            return new PropPanelStubState();
+        } else if (Model.getFacade().isASynchState(element)) {
+            return new PropPanelSynchState();
+        }
+        throw new IllegalArgumentException("Unsupported State type");
+    }
+
+}

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/InitDiagramAppearanceUI.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/InitDiagramAppearanceUI.java?view=diff&rev=14530&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/InitDiagramAppearanceUI.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/InitDiagramAppearanceUI.java&r1=14529&r2=14530
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/InitDiagramAppearanceUI.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/InitDiagramAppearanceUI.java	2008-04-30 05:26:50-0700
@@ -32,6 +32,8 @@
 import org.argouml.application.api.Argo;
 import org.argouml.application.api.GUISettingsTabInterface;
 import org.argouml.application.api.InitSubsystem;
+import org.argouml.uml.ui.PropPanelFactory;
+import org.argouml.uml.ui.PropPanelFactoryManager;
 
 /**
  * Initialise this subsystem.
@@ -41,7 +43,11 @@
 public class InitDiagramAppearanceUI implements InitSubsystem {
 
     public void init() {
-
+        PropPanelFactory diagramFactory = new DiagramPropPanelFactory();
+        PropPanelFactoryManager.addPropPanelFactory(diagramFactory);
+        
+        PropPanelFactory elementFactory = new ElementPropPanelFactory();
+        PropPanelFactoryManager.addPropPanelFactory(elementFactory);
     }
 
     public List<GUISettingsTabInterface> getProjectSettingsTabs() {
@@ -62,4 +68,5 @@
         return Collections.emptyList();
     }
 
+
 }

Added: trunk/src/argouml-app/src/org/argouml/uml/ui/PropPanelFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/PropPanelFactory.java?view=auto&rev=14530
==============================================================================
--- (empty file)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/PropPanelFactory.java	2008-04-30 05:26:50-0700
@@ -0,0 +1,53 @@
+// $Id$
+// Copyright (c) 2008 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.uml.ui;
+
+/**
+ * Interface for a factory of proppanels, 
+ * which are created based on a given object.
+ *
+ * @author Michiel
+ */
+public interface PropPanelFactory {
+
+    /**
+     * This method shall test the type of the given object,
+     * and if recognised, create a new instance of a PropPanel. <p>
+     * 
+     * If the object type is not something this factory 
+     * knows how to deal with, then null shall be returned
+     * (do NOT throw an exception). <p>
+     * 
+     * If the given object falls within a class of objects 
+     * that this factory is the exclusive factory for,
+     * then it is allowed to throw an exception if 
+     * the object is invalid/unknown. However,
+     * be careful not to break the possibility to extend ArgoUML.  
+     *  
+     * @param obj the object to create a new PropPanel for
+     * @return the new proppanel or null
+     */
+    PropPanel createPropPanel(Object obj);
+}

Added: trunk/src/argouml-app/src/org/argouml/uml/ui/PropPanelFactoryManager.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/PropPanelFactoryManager.java?view=auto&rev=14530
==============================================================================
--- (empty file)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/PropPanelFactoryManager.java	2008-04-30 05:26:50-0700
@@ -0,0 +1,68 @@
+// $Id$
+// Copyright (c) 2008 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.uml.ui;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * Manager of factories registered in ArgoUML. <p>
+ * 
+ * You can add and remove a PropPanelFactory instance 
+ * to this central registry. The registered factories 
+ * are then used when a new PropPanel has to be build.
+ *
+ * @author Michiel
+ */
+public class PropPanelFactoryManager {
+    private static Collection<PropPanelFactory> ppfactories = 
+        new ArrayList<PropPanelFactory>();
+    
+    /**
+     * @param factory add the given factory
+     */
+    public static void addPropPanelFactory(PropPanelFactory factory) {
+        ppfactories.add(factory);
+    }
+    
+    /**
+     * For modules, it would be usefule to be able to remove their factories.<p>
+     * 
+     * TODO: The effect of this method is not yet tested!
+     * 
+     * @param factory the factory to remove
+     */
+    public static void removePropPanelFactory(PropPanelFactory factory) {
+        ppfactories.remove(factory);
+    }
+    
+    /**
+     * This method is not public since it is meant to be used 
+     * exclusively by TabProps.
+     */
+    static Collection<PropPanelFactory> getFactories() {
+        return ppfactories;
+    }
+}

Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java?view=diff&rev=14530&p1=trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java&p2=trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java&r1=14529&r2=14530
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java	2008-04-30 05:26:50-0700
@@ -40,108 +40,7 @@
 import org.argouml.ui.targetmanager.TargetListener;
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.diagram.ArgoDiagram;
-import org.argouml.uml.diagram.activity.ui.UMLActivityDiagram;
-import org.argouml.uml.diagram.collaboration.ui.UMLCollaborationDiagram;
-import org.argouml.uml.diagram.deployment.ui.UMLDeploymentDiagram;
-import org.argouml.uml.diagram.sequence.ui.UMLSequenceDiagram;
-import org.argouml.uml.diagram.state.ui.UMLStateDiagram;
-import org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram;
-import org.argouml.uml.diagram.ui.PropPanelDiagram;
 import org.argouml.uml.diagram.ui.PropPanelString;
-import org.argouml.uml.diagram.ui.PropPanelUMLActivityDiagram;
-import org.argouml.uml.diagram.ui.PropPanelUMLClassDiagram;
-import org.argouml.uml.diagram.ui.PropPanelUMLCollaborationDiagram;
-import org.argouml.uml.diagram.ui.PropPanelUMLDeploymentDiagram;
-import org.argouml.uml.diagram.ui.PropPanelUMLSequenceDiagram;
-import org.argouml.uml.diagram.ui.PropPanelUMLStateDiagram;
-import org.argouml.uml.diagram.ui.PropPanelUMLUseCaseDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
-import org.argouml.uml.diagram.use_case.ui.UMLUseCaseDiagram;
-import org.argouml.uml.ui.behavior.activity_graphs.PropPanelActionState;
-import org.argouml.uml.ui.behavior.activity_graphs.PropPanelActivityGraph;
-import org.argouml.uml.ui.behavior.activity_graphs.PropPanelCallState;
-import org.argouml.uml.ui.behavior.activity_graphs.PropPanelClassifierInState;
-import org.argouml.uml.ui.behavior.activity_graphs.PropPanelObjectFlowState;
-import org.argouml.uml.ui.behavior.activity_graphs.PropPanelPartition;
-import org.argouml.uml.ui.behavior.activity_graphs.PropPanelSubactivityState;
-import org.argouml.uml.ui.behavior.collaborations.PropPanelAssociationEndRole;
-import org.argouml.uml.ui.behavior.collaborations.PropPanelAssociationRole;
-import org.argouml.uml.ui.behavior.collaborations.PropPanelClassifierRole;
-import org.argouml.uml.ui.behavior.collaborations.PropPanelCollaboration;
-import org.argouml.uml.ui.behavior.collaborations.PropPanelInteraction;
-import org.argouml.uml.ui.behavior.collaborations.PropPanelMessage;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelAction;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelActionSequence;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelArgument;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelCallAction;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelComponentInstance;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelCreateAction;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelDestroyAction;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelException;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelLink;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelLinkEnd;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelNodeInstance;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelObject;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelReception;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelReturnAction;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelSendAction;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelSignal;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelStimulus;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelTerminateAction;
-import org.argouml.uml.ui.behavior.common_behavior.PropPanelUninterpretedAction;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelCallEvent;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelChangeEvent;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelCompositeState;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelFinalState;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelGuard;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelPseudostate;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelSignalEvent;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelSimpleState;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelStateMachine;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelStateVertex;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelStubState;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelSubmachineState;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelSynchState;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelTimeEvent;
-import org.argouml.uml.ui.behavior.state_machines.PropPanelTransition;
-import org.argouml.uml.ui.behavior.use_cases.PropPanelActor;
-import org.argouml.uml.ui.behavior.use_cases.PropPanelExtend;
-import org.argouml.uml.ui.behavior.use_cases.PropPanelExtensionPoint;
-import org.argouml.uml.ui.behavior.use_cases.PropPanelInclude;
-import org.argouml.uml.ui.behavior.use_cases.PropPanelUseCase;
-import org.argouml.uml.ui.foundation.core.PropPanelAbstraction;
-import org.argouml.uml.ui.foundation.core.PropPanelAssociation;
-import org.argouml.uml.ui.foundation.core.PropPanelAssociationClass;
-import org.argouml.uml.ui.foundation.core.PropPanelAssociationEnd;
-import org.argouml.uml.ui.foundation.core.PropPanelAttribute;
-import org.argouml.uml.ui.foundation.core.PropPanelClass;
-import org.argouml.uml.ui.foundation.core.PropPanelClassifier;
-import org.argouml.uml.ui.foundation.core.PropPanelComment;
-import org.argouml.uml.ui.foundation.core.PropPanelComponent;
-import org.argouml.uml.ui.foundation.core.PropPanelConstraint;
-import org.argouml.uml.ui.foundation.core.PropPanelDataType;
-import org.argouml.uml.ui.foundation.core.PropPanelDependency;
-import org.argouml.uml.ui.foundation.core.PropPanelElementResidence;
-import org.argouml.uml.ui.foundation.core.PropPanelEnumeration;
-import org.argouml.uml.ui.foundation.core.PropPanelEnumerationLiteral;
-import org.argouml.uml.ui.foundation.core.PropPanelFlow;
-import org.argouml.uml.ui.foundation.core.PropPanelGeneralization;
-import org.argouml.uml.ui.foundation.core.PropPanelInterface;
-import org.argouml.uml.ui.foundation.core.PropPanelMethod;
-import org.argouml.uml.ui.foundation.core.PropPanelModelElement;
-import org.argouml.uml.ui.foundation.core.PropPanelNode;
-import org.argouml.uml.ui.foundation.core.PropPanelOperation;
-import org.argouml.uml.ui.foundation.core.PropPanelParameter;
-import org.argouml.uml.ui.foundation.core.PropPanelPermission;
-import org.argouml.uml.ui.foundation.core.PropPanelRelationship;
-import org.argouml.uml.ui.foundation.core.PropPanelUsage;
-import org.argouml.uml.ui.foundation.extension_mechanisms.PropPanelStereotype;
-import org.argouml.uml.ui.foundation.extension_mechanisms.PropPanelTagDefinition;
-import org.argouml.uml.ui.foundation.extension_mechanisms.PropPanelTaggedValue;
-import org.argouml.uml.ui.model_management.PropPanelElementImport;
-import org.argouml.uml.ui.model_management.PropPanelModel;
-import org.argouml.uml.ui.model_management.PropPanelPackage;
-import org.argouml.uml.ui.model_management.PropPanelSubsystem;
 import org.tigris.gef.base.Diagram;
 import org.tigris.gef.presentation.Fig;
 import org.tigris.gef.presentation.FigText;
@@ -259,6 +158,7 @@
      * @deprecated As of ArgoUml version 0.13.5,
      *         the visibility of this method will change in the future,
      *         replaced by {@link org.argouml.ui.targetmanager.TargetManager}.
+     *         TODO: MVW: I think this should not be deprecated.
      *
      * @param target the new target
      * @see org.argouml.ui.TabTarget#setTarget(java.lang.Object)
@@ -363,11 +263,15 @@
     private TabModelTarget createPropPanel(Object targetObject) {
 	TabModelTarget propPanel = null;
 
-	if (targetObject instanceof UMLDiagram) {
-            propPanel = getDiagramPropPanel((UMLDiagram) targetObject);
-        } else if (Model.getFacade().isAElement(targetObject)) {
-            propPanel = getElementPropPanel(targetObject);
-        } else if (targetObject instanceof FigText) {
+	for (PropPanelFactory factory
+	        : PropPanelFactoryManager.getFactories()) {
+	    propPanel = factory.createPropPanel(targetObject);
+	    if (propPanel != null) return propPanel;
+	}
+
+	/* This does not work (anymore/yet?), 
+	 * since we never have a FigText here: */
+	if (targetObject instanceof FigText) {
             propPanel = new PropPanelString();
         }
 
@@ -383,249 +287,6 @@
         return propPanel;
     }
 
-    // Create prop panels for diagrams
-    private PropPanelDiagram getDiagramPropPanel(UMLDiagram diagram) {
-        if (diagram instanceof UMLActivityDiagram) {
-            return new PropPanelUMLActivityDiagram();
-        } else if (diagram instanceof UMLClassDiagram) {
-            return new PropPanelUMLClassDiagram();
-        } else if (diagram instanceof UMLCollaborationDiagram) {
-            return new PropPanelUMLCollaborationDiagram();
-        } else if (diagram instanceof UMLDeploymentDiagram) {
-            return new PropPanelUMLDeploymentDiagram();
-        } else if (diagram instanceof UMLSequenceDiagram) {
-            return new PropPanelUMLSequenceDiagram();
-        } else if (diagram instanceof UMLStateDiagram) {
-            return new PropPanelUMLStateDiagram();
-        } else if (diagram instanceof UMLUseCaseDiagram) {
-            return new PropPanelUMLUseCaseDiagram();
-        } else {
-            // If we get here then presumably a plugin has provided a
-            // different diagram type. For now lets show something.
-            // TODO: It would be useful to be able to provide a
-            // PropPanelFactory from a plugin which can be called here
-            // in order to provide something more specific that the plugin
-            // requires.
-            return new PropPanelDiagram();
-        }
-    }
-
-    
-    private PropPanelModelElement getElementPropPanel(Object element) {
-        if (Model.getFacade().isAClassifier(element)) {
-            return getClassifierPropPanel(element);
-        } else if (Model.getFacade().isARelationship(element)) {
-            return getRelationshipPropPanel(element);
-        } else if (Model.getFacade().isAStateVertex(element)) {
-            return getStateVertexPropPanel(element);
-        } else if (Model.getFacade().isAActionSequence(element)) {
-            // This is not a subtype of PropPanelAction, so it must come first
-            return new PropPanelActionSequence();
-        } else if (Model.getFacade().isAAction(element)) {
-            return getActionPropPanel(element);
-            // TODO: This needs to be in type hierarchy order to work properly
-            // and create the most specific property panel properly.  Everything
-            // which has been factored out of this method has been reviewed.
-            // Anything below this point still needs to be review - tfm
-        } else if (Model.getFacade().isAActivityGraph(element)) {
-            return new PropPanelActivityGraph();
-        } else if (Model.getFacade().isAArgument(element)) {
-            return new PropPanelArgument();
-        } else if (Model.getFacade().isAAssociationEndRole(element)) {
-            return new PropPanelAssociationEndRole();
-        } else if (Model.getFacade().isAAssociationEnd(element)) {
-            return new PropPanelAssociationEnd();
-        } else if (Model.getFacade().isAAttribute(element)) {
-            return new PropPanelAttribute();
-        } else if (Model.getFacade().isACollaboration(element)) {
-            return new PropPanelCollaboration();
-        } else if (Model.getFacade().isAComment(element)) {
-            return new PropPanelComment();
-        } else if (Model.getFacade().isAComponentInstance(element)) {
-            return new PropPanelComponentInstance();
-        } else if (Model.getFacade().isAConstraint(element)) {
-            return new PropPanelConstraint();
-        } else if (Model.getFacade().isAEnumerationLiteral(element)) {
-            return new PropPanelEnumerationLiteral();
-        } else if (Model.getFacade().isAElementImport(element)) {
-            return new PropPanelElementImport();
-        } else if (Model.getFacade().isAElementResidence(element)) {
-            return new PropPanelElementResidence();
-        } else if (Model.getFacade().isAExtensionPoint(element)) {
-            return new PropPanelExtensionPoint();
-        } else if (Model.getFacade().isAGuard(element)) {
-            return new PropPanelGuard();
-        } else if (Model.getFacade().isAInteraction(element)) {
-            return new PropPanelInteraction();
-        } else if (Model.getFacade().isALink(element)) {
-            return new PropPanelLink();
-        } else if (Model.getFacade().isALinkEnd(element)) {
-            return new PropPanelLinkEnd();
-        } else if (Model.getFacade().isAMessage(element)) {
-            return new PropPanelMessage();
-        } else if (Model.getFacade().isAMethod(element)) {
-            return new PropPanelMethod();
-        } else if (Model.getFacade().isAModel(element)) {
-            return new PropPanelModel();
-        } else if (Model.getFacade().isANodeInstance(element)) {
-            return new PropPanelNodeInstance();
-        } else if (Model.getFacade().isAObject(element)) {
-            return new PropPanelObject();
-        } else if (Model.getFacade().isAOperation(element)) {
-            return new PropPanelOperation();
-        } else if (Model.getFacade().isAPackage(element)) {
-            return new PropPanelPackage();
-        } else if (Model.getFacade().isAParameter(element)) {
-            return new PropPanelParameter();
-        } else if (Model.getFacade().isAPartition(element)) {
-            return new PropPanelPartition();
-        } else if (Model.getFacade().isAReception(element)) {
-            return new PropPanelReception();
-        } else if (Model.getFacade().isAStateMachine(element)) {
-            return new PropPanelStateMachine();
-        } else if (Model.getFacade().isAStereotype(element)) {
-            return new PropPanelStereotype();
-        } else if (Model.getFacade().isAStimulus(element)) {
-            return new PropPanelStimulus();
-        } else if (Model.getFacade().isASubsystem(element)) {
-            return new PropPanelSubsystem();
-        } else if (Model.getFacade().isATaggedValue(element)) {
-            return new PropPanelTaggedValue();
-        } else if (Model.getFacade().isATagDefinition(element)) {
-            return new PropPanelTagDefinition();
-        } else if (Model.getFacade().isATransition(element)) {
-            return new PropPanelTransition();
-        } else if (Model.getFacade().isACallEvent(element)) {
-            return new PropPanelCallEvent();
-        } else if (Model.getFacade().isAChangeEvent(element)) {
-            return new PropPanelChangeEvent();
-        } else if (Model.getFacade().isASignalEvent(element)) {
-            return new PropPanelSignalEvent();
-        } else if (Model.getFacade().isATimeEvent(element)) {
-            return new PropPanelTimeEvent();
-        } else if (Model.getFacade().isADependency(element)) {
-            return new PropPanelDependency();
-        }
-        throw new IllegalArgumentException("Unsupported Element type");
-    }
-    
-    private PropPanelClassifier getClassifierPropPanel(Object element) {
-        if (Model.getFacade().isAActor(element)) {
-            return new PropPanelActor();
-        } else if (Model.getFacade().isAAssociationClass(element)) {
-            return new PropPanelAssociationClass();
-        } else if (Model.getFacade().isAClass(element)) {
-            return new PropPanelClass();
-        } else if (Model.getFacade().isAClassifierInState(element)) {
-            return new PropPanelClassifierInState();
-        } else if (Model.getFacade().isAClassifierRole(element)) {
-            return new PropPanelClassifierRole();
-        } else if (Model.getFacade().isAComponent(element)) {
-            return new PropPanelComponent();
-        } else if (Model.getFacade().isADataType(element)) {
-            if (Model.getFacade().isAEnumeration(element)) {
-                return new PropPanelEnumeration();
-            } else {
-                return new PropPanelDataType();
-            }
-        } else if (Model.getFacade().isAInterface(element)) {
-            return new PropPanelInterface();
-        } else if (Model.getFacade().isANode(element)) {
-            return new PropPanelNode();
-        } else if (Model.getFacade().isASignal(element)) {
-            if (Model.getFacade().isAException(element)) {
-                return new PropPanelException();
-            } else {
-                return new PropPanelSignal();
-            }
-        } else if (Model.getFacade().isAUseCase(element)) {
-            return new PropPanelUseCase();
-        }
-        throw new IllegalArgumentException("Unsupported Element type");
-    }
-
-    private PropPanelRelationship getRelationshipPropPanel(Object element) {
-        if (Model.getFacade().isAAssociation(element)) {
-            if (Model.getFacade().isAAssociationRole(element)) {
-                return new PropPanelAssociationRole();
-            } else {
-                return new PropPanelAssociation();
-            }
-        } else if (Model.getFacade().isADependency(element)) {
-            if (Model.getFacade().isAAbstraction(element)) {
-                return new PropPanelAbstraction();
-            } else if (Model.getFacade().isAPackageImport(element)) {
-                return new PropPanelPermission();
-            } else if (Model.getFacade().isAUsage(element)) {
-                return new PropPanelUsage();
-            } else {
-                return new PropPanelDependency();
-            }
-        } else if (Model.getFacade().isAExtend(element)) {
-            return new PropPanelExtend();
-        } else if (Model.getFacade().isAFlow(element)) {
-            return new PropPanelFlow();
-        } else if (Model.getFacade().isAGeneralization(element)) {
-            return new PropPanelGeneralization();
-        } else if (Model.getFacade().isAInclude(element)) {
-            return new PropPanelInclude();
-        }
-        throw new IllegalArgumentException("Unsupported Relationship type");
-    }
-
-    private PropPanelAction getActionPropPanel(Object action) {
-        if (Model.getFacade().isACallAction(action)) {
-            return new PropPanelCallAction();
-        } else if (Model.getFacade().isACreateAction(action)) {
-            return new PropPanelCreateAction();
-        } else if (Model.getFacade().isADestroyAction(action)) {
-            return new PropPanelDestroyAction();
-        } else if (Model.getFacade().isAReturnAction(action)) {
-            return new PropPanelReturnAction();
-        } else if (Model.getFacade().isASendAction(action)) {
-            return new PropPanelSendAction();
-        } else if (Model.getFacade().isATerminateAction(action)) {
-            return new PropPanelTerminateAction();
-        } else if (Model.getFacade().isAUninterpretedAction(action)) {
-            return new PropPanelUninterpretedAction();
-        }
-        throw new IllegalArgumentException("Unsupported Action type");
-    }
-    
-    private PropPanelStateVertex getStateVertexPropPanel(Object element) {
-        if (Model.getFacade().isAState(element)) {
-            if (Model.getFacade().isAActionState(element)) {
-                return new PropPanelActionState();
-            } else if (Model.getFacade().isACallState(element)) {
-                return new PropPanelCallState();
-            } else if (Model.getFacade().isACompositeState(element)) {
-                if (Model.getFacade().isASubmachineState(element)) {
-                    if (Model.getFacade().isASubactivityState(element)) {
-                        return new PropPanelSubactivityState();
-                    } else {
-                        return new PropPanelSubmachineState();
-                    }
-                } else {
-                    return new PropPanelCompositeState();
-                }
-            } else if (Model.getFacade().isAFinalState(element)) {
-                return new PropPanelFinalState();
-            } else if (Model.getFacade().isAObjectFlowState(element)) {
-                return new PropPanelObjectFlowState();
-            } else if (Model.getFacade().isASimpleState(element)) {
-                return new PropPanelSimpleState();
-            }
-        } else if (Model.getFacade().isAPseudostate(element)) {
-            return new PropPanelPseudostate();
-        } else if (Model.getFacade().isAStubState(element)) {
-            return new PropPanelStubState();
-        } else if (Model.getFacade().isASynchState(element)) {
-            return new PropPanelSynchState();
-        }
-        throw new IllegalArgumentException("Unsupported State type");
-    }
-
-    
     /**
      * @return the name
      */
@@ -639,6 +300,7 @@
      * the visibility of this method will change in the future, replaced by
      * {@link org.argouml.ui.targetmanager.TargetManager#getTarget()
      * TargetManager.getInstance().getTarget()}.
+     * TODO: MVW: I think this should not be deprecated.
      *
      * @return the target
      * @see org.argouml.ui.TabTarget#getTarget()
@@ -751,4 +413,3 @@
     }
 
 } /* end class TabProps */
-
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.