Author: maurelio1234
Date: 2008-06-30 14:26:58-0700
New Revision: 15131
Added:
branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/internal/ui/
branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/internal/ui/ProfilePropPanelFactory.java
branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/internal/ui/PropPanelCritic.java
Modified:
branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/init/InitProfileSubsystem.java
branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/diagram/ui/TabDiagram.java
branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/ui/TabProps.java
Log:
property panel for critics
Modified: branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/init/InitProfileSubsystem.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/init/InitProfileSubsystem.java?view=diff&rev=15131&p1=branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/init/InitProfileSubsystem.java&p2=branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/init/InitProfileSubsystem.java&r1=15130&r2=15131
==============================================================================
--- branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/init/InitProfileSubsystem.java (original)
+++ branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/init/InitProfileSubsystem.java 2008-06-30 14:26:58-0700
@@ -25,6 +25,9 @@
package org.argouml.profile.init;
import org.argouml.profile.ProfileFacade;
+import org.argouml.profile.internal.ui.ProfilePropPanelFactory;
+import org.argouml.uml.ui.PropPanelFactory;
+import org.argouml.uml.ui.PropPanelFactoryManager;
/**
* Initializer class for the Profile subsystem.
@@ -39,6 +42,10 @@
public void init() {
ProfileFacade.setManager(
new org.argouml.profile.internal.ProfileManagerImpl());
+
+ /* Set up the property panels for critics: */
+ PropPanelFactory factory = new ProfilePropPanelFactory();
+ PropPanelFactoryManager.addPropPanelFactory(factory);
}
}
Added: branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/internal/ui/ProfilePropPanelFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/internal/ui/ProfilePropPanelFactory.java?view=auto&rev=15131
==============================================================================
--- (empty file)
+++ branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/internal/ui/ProfilePropPanelFactory.java 2008-06-30 14:26:58-0700
@@ -0,0 +1,41 @@
+// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $
+// 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.profile.internal.ui;
+
+import org.argouml.uml.cognitive.critics.CrUML;
+import org.argouml.uml.ui.PropPanel;
+import org.argouml.uml.ui.PropPanelFactory;
+
+public class ProfilePropPanelFactory implements PropPanelFactory {
+
+ public PropPanel createPropPanel(Object object) {
+ if (object instanceof CrUML) {
+ return new PropPanelCritic();
+ } else {
+ return null;
+ }
+ }
+
+}
Added: branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/internal/ui/PropPanelCritic.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/internal/ui/PropPanelCritic.java?view=auto&rev=15131
==============================================================================
--- (empty file)
+++ branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/internal/ui/PropPanelCritic.java 2008-06-30 14:26:58-0700
@@ -0,0 +1,103 @@
+// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $
+// 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.profile.internal.ui;
+
+import javax.swing.ImageIcon;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+
+import org.argouml.cognitive.Critic;
+import org.argouml.uml.ui.PropPanel;
+
+/**
+ * PropPanel for Critic
+ *
+ * @author maurelio1234
+ */
+public class PropPanelCritic extends PropPanel {
+
+ private JTextField criticClass;
+ private JTextField name;
+ private JTextField headline;
+ private JTextField priority;
+ private JTextArea description;
+ private JTextField supportedDecision;
+ private JTextField knowledgeType;
+
+ /**
+ * Constructor
+ */
+ public PropPanelCritic() {
+ super("", (ImageIcon)null);
+
+ criticClass = new JTextField();
+ addField("label.class", criticClass);
+ criticClass.setEditable(false);
+
+ name = new JTextField();
+ addField("label.name", name);
+ name.setEditable(false);
+
+ headline = new JTextField();
+ addField("label.headline", headline);
+ headline.setEditable(false);
+
+ priority = new JTextField();
+ addField("label.priority", priority);
+ priority.setEditable(false);
+
+ description = new JTextArea(5, 30);
+ addField("label.description", description);
+ description.setEditable(false);
+ description.setLineWrap(true);
+
+ supportedDecision = new JTextField();
+ addField("label.decision", supportedDecision);
+ supportedDecision.setEditable(false);
+
+ knowledgeType = new JTextField();
+ addField("label.knowledge_types", knowledgeType);
+ knowledgeType.setEditable(false);
+ }
+
+
+ /**
+ * @see org.argouml.uml.ui.PropPanel#setTarget(java.lang.Object)
+ */
+ public void setTarget(Object t) {
+ super.setTarget(t);
+
+ criticClass.setText(getTarget().getClass().getCanonicalName());
+
+ Critic c = (Critic) getTarget();
+ name.setText(c.getCriticName());
+ headline.setText(c.getHeadline());
+ description.setText(c.getDescriptionTemplate());
+ supportedDecision.setText(""+c.getSupportedDecisions());
+
+ priority.setText(""+c.getPriority());
+ knowledgeType.setText("" + c.getKnowledgeTypes());
+ }
+}
Modified: branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/diagram/ui/TabDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/diagram/ui/TabDiagram.java?view=diff&rev=15131&p1=branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/diagram/ui/TabDiagram.java&p2=branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/diagram/ui/TabDiagram.java&r1=15130&r2=15131
==============================================================================
--- branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/diagram/ui/TabDiagram.java (original)
+++ branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/diagram/ui/TabDiagram.java 2008-06-30 14:26:58-0700
@@ -44,6 +44,7 @@
import org.apache.log4j.Logger;
import org.argouml.application.api.AbstractArgoJPanel;
import org.argouml.application.api.Argo;
+import org.argouml.cognitive.Critic;
import org.argouml.configuration.Configuration;
import org.argouml.kernel.ProjectManager;
import org.argouml.ui.TabModelTarget;
Modified: branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/ui/TabProps.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/ui/TabProps.java?view=diff&rev=15131&p1=branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/ui/TabProps.java&p2=branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/ui/TabProps.java&r1=15130&r2=15131
==============================================================================
--- branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/ui/TabProps.java (original)
+++ branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/uml/ui/TabProps.java 2008-06-30 14:26:58-0700
@@ -33,6 +33,7 @@
import org.apache.log4j.Logger;
import org.argouml.application.api.AbstractArgoJPanel;
+import org.argouml.cognitive.Critic;
import org.argouml.model.Model;
import org.argouml.swingext.UpArrowIcon;
import org.argouml.ui.TabModelTarget;
@@ -168,7 +169,9 @@
// targets ought to be UML objects or diagrams
target = (target instanceof Fig) ? ((Fig) target).getOwner() : target;
if (!(target == null || Model.getFacade().isAUMLElement(target)
- || target instanceof ArgoDiagram)) {
+ || target instanceof ArgoDiagram
+ // TODO Improve extensibility of this!
+ || target instanceof Critic)) {
return;
}
@@ -267,8 +270,8 @@
: 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) {
@@ -325,7 +328,11 @@
if (target instanceof Fig) {
target = ((Fig) target).getOwner();
}
- return ((target instanceof Diagram || Model.getFacade().isAUMLElement(target))
+
+ // TODO: this should be more extensible... may be only
+ // "findPanelFor(target)" if there is a panel why not show it?
+ return ((target instanceof Diagram || Model.getFacade().isAUMLElement(
+ target)) || target instanceof Critic
&& findPanelFor(target) != null);
}
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.