Author: mvw
Date: 2007-12-21 07:53:49-0800
New Revision: 13973
Added:
trunk/src_new/org/argouml/uml/ui/InitUmlUI.java (contents, props changed)
Modified:
trunk/src_new/org/argouml/application/Main.java
trunk/src_new/org/argouml/ui/DetailsPane.java
trunk/src_new/org/argouml/ui/ProjectBrowser.java
Log:
Reduced the dependency from org.argouml.ui on org.argouml.uml.ui.
This changes the way details panels are added.
Modified: trunk/src_new/org/argouml/application/Main.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/application/Main.java?view=diff&rev=13973&p1=trunk/src_new/org/argouml/application/Main.java&p2=trunk/src_new/org/argouml/application/Main.java&r1=13972&r2=13973
==============================================================================
--- trunk/src_new/org/argouml/application/Main.java (original)
+++ trunk/src_new/org/argouml/application/Main.java 2007-12-21 07:53:49-0800
@@ -78,6 +78,7 @@
import org.argouml.ui.cmd.PrintManager;
import org.argouml.uml.diagram.ui.InitDiagramAppearanceUI;
import org.argouml.uml.reveng.java.JavaImport;
+import org.argouml.uml.ui.InitUmlUI;
import org.argouml.util.ArgoFrame;
import org.argouml.util.logging.SimpleTimer;
import org.tigris.gef.util.Util;
@@ -419,6 +420,7 @@
SubsystemUtility.initSubsystem(new InitNotationUml());
SubsystemUtility.initSubsystem(new InitNotationJava());
SubsystemUtility.initSubsystem(new InitDiagramAppearanceUI());
+ SubsystemUtility.initSubsystem(new InitUmlUI());
SubsystemUtility.initSubsystem(new InitCheckListUI());
SubsystemUtility.initSubsystem(new InitCognitiveUI());
}
Modified: trunk/src_new/org/argouml/ui/DetailsPane.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/DetailsPane.java?view=diff&rev=13973&p1=trunk/src_new/org/argouml/ui/DetailsPane.java&p2=trunk/src_new/org/argouml/ui/DetailsPane.java&r1=13972&r2=13973
==============================================================================
--- trunk/src_new/org/argouml/ui/DetailsPane.java (original)
+++ trunk/src_new/org/argouml/ui/DetailsPane.java 2007-12-21 07:53:49-0800
@@ -32,7 +32,6 @@
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
@@ -54,14 +53,8 @@
import org.argouml.ui.targetmanager.TargetListener;
import org.argouml.ui.targetmanager.TargetManager;
import org.argouml.uml.ui.PropPanel;
-import org.argouml.uml.ui.TabConstraints;
-import org.argouml.uml.ui.TabDocumentation;
import org.argouml.uml.ui.TabModelTarget;
import org.argouml.uml.ui.TabProps;
-import org.argouml.uml.ui.TabSrc;
-import org.argouml.uml.ui.TabStereotype;
-import org.argouml.uml.ui.TabStyle;
-import org.argouml.uml.ui.TabTaggedValues;
import org.tigris.swidgets.Orientable;
import org.tigris.swidgets.Orientation;
@@ -116,6 +109,8 @@
private EventListenerList listenerList = new EventListenerList();
private Orientation orientation;
+
+ private boolean hasTabs = false;
/**
* Adds a listener.
@@ -157,66 +152,30 @@
setFont(new Font("Dialog", Font.PLAIN, 10));
add(topLevelTabbedPane, BorderLayout.CENTER);
- for (JPanel t : tabPanelList) {
- String titleKey = "tab";
- if (t instanceof AbstractArgoJPanel) {
- titleKey = ((AbstractArgoJPanel) t).getTitle();
- }
- String title = Translator.localize(titleKey);
- if (t instanceof TabToDoTarget) {
- topLevelTabbedPane.addTab(title, leftArrowIcon, t);
- } else if (t instanceof TabModelTarget) {
- topLevelTabbedPane.addTab(title, upArrowIcon, t);
- } else if (t instanceof TabFigTarget) {
- topLevelTabbedPane.addTab(title, upArrowIcon, t);
- } else {
- topLevelTabbedPane.addTab(title, t);
- }
- }
-
- // set the tab that should be shown on first entrance
- lastNonNullTab = -1;
- Component[] tabs = topLevelTabbedPane.getComponents();
- for (int i = 0; i < tabs.length; i++) {
- // tabprops should be shown if loaded
- if (tabs[i] instanceof TabProps) {
- lastNonNullTab = i;
- break;
- }
- // default if there is no tabprops if there is no tabtodo
- // either, this will result in lastNonNullTab = -1;
- if (tabs[i] instanceof TabToDoTarget) {
- lastNonNullTab = i;
- }
- }
setTarget(null, true);
topLevelTabbedPane.addMouseListener(this);
topLevelTabbedPane.addChangeListener(this);
}
- // TODO: Some parts of ArgoUML have preliminary support for multiple
- // details panels, but we currently only support the default South (bottom) panel
- private void loadTabs(String direction, Orientation orientation) {
+ /* TODO: Some parts of ArgoUML have preliminary support for multiple
+ * details panels, but we currently only support
+ * the default South (bottom) panel
+ */
+ private void loadTabs(String direction, Orientation theOrientation) {
if (Position.South.toString().equalsIgnoreCase(direction)
// Special case for backward compatibility
|| "detail".equalsIgnoreCase(direction)) {
- tabPanelList.addAll(Arrays.asList(new JPanel[] {
-// new org.argouml.cognitive.ui.TabToDo(),
- new TabProps(),
- new TabDocumentation(),
- new TabStyle(),
- // TabDocs,
- new TabSrc(),
- // TabJavaSrc | TabSrc,
- new TabConstraints(), new TabStereotype(),
- new TabTaggedValues(),
-// new org.argouml.cognitive.checklist.ui.TabChecklist(),
- // TabHistory,
- // TabHash,
- }));
+ /* The south panel always has tabs - but they are
+ * added (later) elsewhere.
+ */
+ hasTabs = true;
}
}
+ boolean hasTabs() {
+ return hasTabs;
+ }
+
/**
* Returns the JTabbedPane that contains all details panels.
* @deprecated by MVW, in V0.25.4. Will become package scope.
Modified: trunk/src_new/org/argouml/ui/ProjectBrowser.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/ProjectBrowser.java?view=diff&rev=13973&p1=trunk/src_new/org/argouml/ui/ProjectBrowser.java&p2=trunk/src_new/org/argouml/ui/ProjectBrowser.java&r1=13972&r2=13973
==============================================================================
--- trunk/src_new/org/argouml/ui/ProjectBrowser.java (original)
+++ trunk/src_new/org/argouml/ui/ProjectBrowser.java 2007-12-21 07:53:49-0800
@@ -993,7 +993,7 @@
Orientation orientation) {
DetailsPane detailsPane =
new DetailsPane(compassPoint.toLowerCase(), orientation);
- if (detailsPane.getTabCount() == 0) {
+ if (!detailsPane.hasTabs()) {
return null;
}
return detailsPane;
Added: trunk/src_new/org/argouml/uml/ui/InitUmlUI.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/InitUmlUI.java?view=auto&rev=13973
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/uml/ui/InitUmlUI.java 2007-12-21 07:53:49-0800
@@ -0,0 +1,66 @@
+// $Id$
+// Copyright (c) 2007 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.Collections;
+import java.util.List;
+
+import org.argouml.application.api.AbstractArgoJPanel;
+import org.argouml.application.api.GUISettingsTabInterface;
+import org.argouml.application.api.InitSubsystem;
+
+/**
+ *
+ * @author Michiel
+ */
+public class InitUmlUI implements InitSubsystem {
+
+ public void init() {
+ // Do nothing
+ }
+
+ public List<AbstractArgoJPanel> getDetailsTabs() {
+ List<AbstractArgoJPanel> result =
+ new ArrayList<AbstractArgoJPanel>();
+ result.add(new TabProps());
+ result.add(new TabDocumentation());
+ result.add(new TabStyle());
+ result.add(new TabSrc());
+ result.add(new TabConstraints());
+ result.add(new TabStereotype());
+ result.add(new TabTaggedValues());
+ return result;
+ }
+
+ public List<GUISettingsTabInterface> getProjectSettingsTabs() {
+ return Collections.emptyList();
+ }
+
+ public List<GUISettingsTabInterface> getSettingsTabs() {
+ return Collections.emptyList();
+ }
+
+}
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.