Author: tfmorris
Date: 2007-07-10 13:08:18-0700
New Revision: 13044
Added:
trunk/src_new/org/argouml/ui/ProjectActions.java (contents, props changed)
Modified:
trunk/src_new/org/argouml/ui/cmd/GenericArgoMenuBar.java
trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java
trunk/src_new/org/argouml/ui/explorer/ExplorerTree.java
trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java
trunk/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java
Log:
Split Actions management out from ProjectBrowser to reduce size/complexity.
Added: trunk/src_new/org/argouml/ui/ProjectActions.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/ProjectActions.java?view=auto&rev=13044
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/ui/ProjectActions.java 2007-07-10 13:08:18-0700
@@ -0,0 +1,229 @@
+// $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.ui;
+
+import java.util.Collection;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+
+import org.argouml.i18n.Translator;
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
+import org.argouml.ui.targetmanager.TargetEvent;
+import org.argouml.ui.targetmanager.TargetListener;
+import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.UMLMutableGraphSupport;
+import org.argouml.uml.diagram.ui.ActionRemoveFromDiagram;
+import org.tigris.gef.base.Diagram;
+import org.tigris.gef.base.Editor;
+import org.tigris.gef.base.Globals;
+import org.tigris.gef.graph.GraphModel;
+import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.undo.RedoAction;
+import org.tigris.gef.undo.UndoAction;
+
+/**
+ * Class to manage Project related actions which need to be (or historically
+ * have been) managed as singletons.
+ *
+ * TODO: It's unclear to me whether all of these actually have to be managed as
+ * singletons, but for now I've just moved them from ProjectBrowser as is. - tfm
+ *
+ * @author Tom Morris
+ */
+public final class ProjectActions implements TargetListener {
+
+ private static ProjectActions theInstance;
+
+ private ProjectActions() {
+ super();
+ TargetManager.getInstance().addTargetListener(this);
+ }
+
+ /**
+ * The action to undo the last user interaction.
+ */
+ private final UndoAction undoAction =
+ new UndoAction(Translator.localize("action.undo"));
+ /**
+ * The action to redo the last undone action.
+ */
+ private final AbstractAction redoAction =
+ new RedoAction(Translator.localize("action.redo"));
+
+ /**
+ * Singleton retrieval method for the projectbrowser. Lazely instantiates
+ * the projectbrowser.
+ * @return the singleton instance of the projectbrowser
+ */
+ public static synchronized ProjectActions getInstance() {
+ if (theInstance == null) {
+ theInstance = new ProjectActions();
+ }
+ return theInstance;
+ }
+
+ /**
+ * The action to remove the current selected Figs from the diagram.
+ */
+ private final ActionRemoveFromDiagram removeFromDiagram =
+ new ActionRemoveFromDiagram(
+ Translator.localize("action.remove-from-diagram"));
+
+ /**
+ * Get the action that can undo the last user interaction on this project.
+ * @return the undo action.
+ */
+ public AbstractAction getUndoAction() {
+ return undoAction;
+ }
+
+ /**
+ * Get the action that can redo the last undone action.
+ * @return the redo action.
+ */
+ public AbstractAction getRedoAction() {
+ return redoAction;
+ }
+
+ /**
+ * Get the action that removes selected figs from the diagram.
+ * @return the remove from diagram action.
+ */
+ public AbstractAction getRemoveFromDiagramAction() {
+ return removeFromDiagram;
+ }
+
+ /*
+ * @see org.argouml.ui.targetmanager.TargetListener#targetAdded(org.argouml.ui.targetmanager.TargetEvent)
+ */
+ public void targetAdded(TargetEvent e) {
+ determineRemoveEnabled();
+ }
+
+ /*
+ * @see org.argouml.ui.targetmanager.TargetListener#targetRemoved(org.argouml.ui.targetmanager.TargetEvent)
+ */
+ public void targetRemoved(TargetEvent e) {
+ determineRemoveEnabled();
+ }
+
+ /*
+ * @see org.argouml.ui.targetmanager.TargetListener#targetSet(org.argouml.ui.targetmanager.TargetEvent)
+ */
+ public void targetSet(TargetEvent e) {
+ determineRemoveEnabled();
+ }
+
+ /**
+ * Enabled the remove action if an item is selected in anything other then
+ * the activity or state diagrams.
+ */
+ private void determineRemoveEnabled() {
+ Editor editor = Globals.curEditor();
+ Collection figs = editor.getSelectionManager().getFigs();
+ boolean removeEnabled = !figs.isEmpty();
+ GraphModel gm = editor.getGraphModel();
+ if (gm instanceof UMLMutableGraphSupport) {
+ removeEnabled =
+ ((UMLMutableGraphSupport) gm).isRemoveFromDiagramAllowed(figs);
+ }
+ removeFromDiagram.setEnabled(removeEnabled);
+ }
+
+ /**
+ * Given a list of targets, displays the according diagram.
+ * This method jumps to the diagram showing the targets,
+ * and scrolls to make it visible.
+ *
+ * @param targets Collection of targets to show
+ *
+ * TODO: Move to different class?
+ */
+ public static void jumpToDiagramShowing(List targets) {
+
+ if (targets == null || targets.size() == 0) {
+ return;
+ }
+ Object first = targets.get(0);
+ if (first instanceof Diagram && targets.size() > 1) {
+ setTarget(first);
+ setTarget(targets.get(1));
+ return;
+ }
+ if (first instanceof Diagram && targets.size() == 1) {
+ setTarget(first);
+ return;
+ }
+ List<ArgoDiagram> diagrams =
+ ProjectManager.getManager().getCurrentProject().getDiagramList();
+ Object target = TargetManager.getInstance().getTarget();
+ if ((target instanceof Diagram)
+ && ((Diagram) target).countContained(targets) == targets.size()) {
+ setTarget(first);
+ return;
+ }
+
+ ArgoDiagram bestDiagram = null;
+ int bestNumContained = 0;
+ for (ArgoDiagram d : diagrams) {
+ int nc = d.countContained(targets);
+ if (nc > bestNumContained) {
+ bestNumContained = nc;
+ bestDiagram = d;
+ }
+ if (nc == targets.size()) {
+ break;
+ }
+ }
+ if (bestDiagram != null) {
+ if (!ProjectManager.getManager().getCurrentProject()
+ .getActiveDiagram().equals(bestDiagram)) {
+ setTarget(bestDiagram);
+ }
+ setTarget(first);
+ }
+ // making it possible to jump to the modelroot
+ if (first.equals(ProjectManager.getManager().getCurrentProject()
+ .getRoot())) {
+ setTarget(first);
+ }
+
+ // and finally, adjust the scrollbars to show the Fig
+ Project p = ProjectManager.getManager().getCurrentProject();
+ if (p != null) {
+ Object f = TargetManager.getInstance().getFigTarget();
+ if (f instanceof Fig) {
+ Globals.curEditor().scrollToShow((Fig) f);
+ }
+ }
+ }
+
+ private static void setTarget(Object o) {
+ TargetManager.getInstance().setTarget(o);
+ }
+}
Modified: trunk/src_new/org/argouml/ui/cmd/GenericArgoMenuBar.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/cmd/GenericArgoMenuBar.java?view=diff&rev=13044&p1=trunk/src_new/org/argouml/ui/cmd/GenericArgoMenuBar.java&p2=trunk/src_new/org/argouml/ui/cmd/GenericArgoMenuBar.java&r1=13043&r2=13044
==============================================================================
--- trunk/src_new/org/argouml/ui/cmd/GenericArgoMenuBar.java (original)
+++ trunk/src_new/org/argouml/ui/cmd/GenericArgoMenuBar.java 2007-07-10 13:08:18-0700
@@ -45,7 +45,7 @@
import org.argouml.ui.ActionProjectSettings;
import org.argouml.ui.ActionSettings;
import org.argouml.ui.ArgoJMenu;
-import org.argouml.ui.ProjectBrowser;
+import org.argouml.ui.ProjectActions;
import org.argouml.ui.ZoomSliderButton;
import org.argouml.ui.explorer.ActionPerspectiveConfig;
import org.argouml.ui.targetmanager.TargetEvent;
@@ -67,11 +67,15 @@
import org.argouml.uml.ui.ActionRevertToSaved;
import org.argouml.uml.ui.ActionSaveAllGraphics;
import org.argouml.uml.ui.ActionSaveGraphics;
+import org.argouml.uml.ui.ActionSaveProject;
import org.argouml.uml.ui.ActionSaveProjectAs;
import org.argouml.uml.ui.ActionSequenceDiagram;
import org.argouml.uml.ui.ActionStateDiagram;
import org.argouml.uml.ui.ActionUseCaseDiagram;
import org.tigris.gef.base.AdjustPageBreaksAction;
+import org.tigris.gef.base.AlignAction;
+import org.tigris.gef.base.DistributeAction;
+import org.tigris.gef.base.ReorderAction;
import org.tigris.gef.base.SelectAllAction;
import org.tigris.gef.base.SelectInvertAction;
import org.tigris.gef.base.ZoomAction;
@@ -301,12 +305,11 @@
fileToolbar.add(new ActionOpenProject());
file.addSeparator();
- JMenuItem saveProjectItem = file.add(ProjectBrowser.getInstance()
- .getSaveAction());
+ JMenuItem saveProjectItem = file.add(ActionSaveProject.getInstance());
setMnemonic(saveProjectItem, "Save");
ShortcutMgr.assignAccelerator(saveProjectItem,
ShortcutMgr.ACTION_SAVE_PROJECT);
- fileToolbar.add((ProjectBrowser.getInstance().getSaveAction()));
+ fileToolbar.add(ActionSaveProject.getInstance());
JMenuItem saveProjectAsItem = file.add(new ActionSaveProjectAs());
setMnemonic(saveProjectAsItem, "SaveAs");
ShortcutMgr.assignAccelerator(saveProjectAsItem,
@@ -381,13 +384,13 @@
edit = add(new JMenu(menuLocalize("Edit")));
setMnemonic(edit, "Edit");
- JMenuItem undoItem = edit.add(ProjectBrowser.getInstance()
+ JMenuItem undoItem = edit.add(ProjectActions.getInstance()
.getUndoAction());
setMnemonic(undoItem, "Undo");
ShortcutMgr.assignAccelerator(undoItem, ShortcutMgr.ACTION_UNDO);
undoItem.setVisible(UndoEnabler.isEnabled());
- JMenuItem redoItem = edit.add(ProjectBrowser.getInstance()
+ JMenuItem redoItem = edit.add(ProjectActions.getInstance()
.getRedoAction());
setMnemonic(redoItem, "Redo");
ShortcutMgr.assignAccelerator(redoItem, ShortcutMgr.ACTION_REDO);
@@ -437,7 +440,7 @@
//
// edit.addSeparator();
- Action removeFromDiagram = ProjectBrowser.getInstance()
+ Action removeFromDiagram = ProjectActions.getInstance()
.getRemoveFromDiagramAction();
JMenuItem removeItem = edit.add(removeFromDiagram);
@@ -629,8 +632,137 @@
arrange.add(new ActionLayout());
// This used to be deferred, but it's only 30-40 msec of work.
- InitMenusLater.initMenus(align, distribute, reorder);
+ initAlignMenu(align);
+ initDistributeMenu(distribute);
+ initReorderMenu(reorder);
}
+
+ /**
+ * Initialize submenus of the Align menu.
+ *
+ * @param align
+ * the Align menu
+ */
+ private static void initAlignMenu(JMenu align) {
+ JMenuItem alignTops = align
+ .add(new AlignAction(AlignAction.ALIGN_TOPS));
+ setMnemonic(alignTops, "align tops");
+ ShortcutMgr.assignAccelerator(alignTops, ShortcutMgr.ACTION_ALIGN_TOPS);
+
+ JMenuItem alignBottoms = align.add(new AlignAction(
+ AlignAction.ALIGN_BOTTOMS));
+ setMnemonic(alignBottoms, "align bottoms");
+ ShortcutMgr.assignAccelerator(alignBottoms,
+ ShortcutMgr.ACTION_ALIGN_BOTTOMS);
+
+ JMenuItem alignRights = align.add(new AlignAction(
+ AlignAction.ALIGN_RIGHTS));
+ setMnemonic(alignRights, "align rights");
+ ShortcutMgr.assignAccelerator(alignRights,
+ ShortcutMgr.ACTION_ALIGN_RIGHTS);
+
+ JMenuItem alignLefts = align.add(new AlignAction(
+ AlignAction.ALIGN_LEFTS));
+ setMnemonic(alignLefts, "align lefts");
+ ShortcutMgr.assignAccelerator(alignLefts,
+ ShortcutMgr.ACTION_ALIGN_LEFTS);
+
+ JMenuItem alignHCenters = align.add(new AlignAction(
+ AlignAction.ALIGN_H_CENTERS));
+ setMnemonic(alignHCenters,
+ "align horizontal centers");
+ ShortcutMgr.assignAccelerator(alignHCenters,
+ ShortcutMgr.ACTION_ALIGN_H_CENTERS);
+
+ JMenuItem alignVCenters = align.add(new AlignAction(
+ AlignAction.ALIGN_V_CENTERS));
+ setMnemonic(alignVCenters, "align vertical centers");
+ ShortcutMgr.assignAccelerator(alignVCenters,
+ ShortcutMgr.ACTION_ALIGN_V_CENTERS);
+
+ JMenuItem alignToGrid = align.add(new AlignAction(
+ AlignAction.ALIGN_TO_GRID));
+ setMnemonic(alignToGrid, "align to grid");
+ ShortcutMgr.assignAccelerator(alignToGrid,
+ ShortcutMgr.ACTION_ALIGN_TO_GRID);
+ }
+
+ /**
+ * Initialize submenus of the Distribute menu.
+ *
+ * @param distribute
+ * the Distribute menu
+ */
+ private static void initDistributeMenu(JMenu distribute) {
+ JMenuItem distributeHSpacing = distribute.add(new DistributeAction(
+ DistributeAction.H_SPACING));
+ setMnemonic(distributeHSpacing,
+ "distribute horizontal spacing");
+ ShortcutMgr.assignAccelerator(distributeHSpacing,
+ ShortcutMgr.ACTION_DISTRIBUTE_H_SPACING);
+
+ JMenuItem distributeHCenters = distribute.add(new DistributeAction(
+ DistributeAction.H_CENTERS));
+ setMnemonic(distributeHCenters,
+ "distribute horizontal centers");
+ ShortcutMgr.assignAccelerator(distributeHCenters,
+ ShortcutMgr.ACTION_DISTRIBUTE_H_CENTERS);
+
+ JMenuItem distributeVSpacing = distribute.add(new DistributeAction(
+ DistributeAction.V_SPACING));
+ setMnemonic(distributeVSpacing,
+ "distribute vertical spacing");
+ ShortcutMgr.assignAccelerator(distributeVSpacing,
+ ShortcutMgr.ACTION_DISTRIBUTE_V_SPACING);
+
+ JMenuItem distributeVCenters = distribute.add(new DistributeAction(
+ DistributeAction.V_CENTERS));
+ setMnemonic(distributeVCenters,
+ "distribute vertical centers");
+ ShortcutMgr.assignAccelerator(distributeVCenters,
+ ShortcutMgr.ACTION_DISTRIBUTE_V_CENTERS);
+ }
+
+ /**
+ * Initialize the submenus for the Reorder menu.
+ *
+ * @param reorder
+ * the main Reorder menu
+ */
+ private static void initReorderMenu(JMenu reorder) {
+ JMenuItem reorderBringForward = reorder.add(new ReorderAction(
+ Translator.localize("action.bring-forward"),
+ ReorderAction.BRING_FORWARD));
+ setMnemonic(reorderBringForward,
+ "reorder bring forward");
+ ShortcutMgr.assignAccelerator(reorderBringForward,
+ ShortcutMgr.ACTION_REORDER_FORWARD);
+
+ JMenuItem reorderSendBackward = reorder.add(new ReorderAction(
+ Translator.localize("action.send-backward"),
+ ReorderAction.SEND_BACKWARD));
+ setMnemonic(reorderSendBackward,
+ "reorder send backward");
+ ShortcutMgr.assignAccelerator(reorderSendBackward,
+ ShortcutMgr.ACTION_REORDER_BACKWARD);
+
+ JMenuItem reorderBringToFront = reorder.add(new ReorderAction(
+ Translator.localize("action.bring-to-front"),
+ ReorderAction.BRING_TO_FRONT));
+ setMnemonic(reorderBringToFront,
+ "reorder bring to front");
+ ShortcutMgr.assignAccelerator(reorderBringToFront,
+ ShortcutMgr.ACTION_REORDER_TO_FRONT);
+
+ JMenuItem reorderSendToBack = reorder.add(new ReorderAction(
+ Translator.localize("action.send-to-back"),
+ ReorderAction.SEND_TO_BACK));
+ setMnemonic(reorderSendToBack,
+ "reorder send to back");
+ ShortcutMgr.assignAccelerator(reorderSendToBack,
+ ShortcutMgr.ACTION_REORDER_TO_BACK);
+ }
+
/**
* Build the menu "Generation".
@@ -721,6 +853,7 @@
// setHelpMenu(help);
add(help);
}
+
/**
* Get the create diagram toolbar.
@@ -754,7 +887,7 @@
// editToolbar.add(ActionCopy.getInstance());
// editToolbar.add(ActionPaste.getInstance());
editToolbar.addFocusListener(ActionPaste.getInstance());
- editToolbar.add(ProjectBrowser.getInstance()
+ editToolbar.add(ProjectActions.getInstance()
.getRemoveFromDiagramAction());
editToolbar.add(navigateTargetBackAction);
editToolbar.add(navigateTargetForwardAction);
@@ -811,6 +944,9 @@
*
* @param filename
* of the project
+ *
+ * TODO: This should listen for file save events rather than being called
+ * directly - tfm.
*/
public void addFileSaved(String filename) {
lruList.addEntry(filename);
Modified: trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java?view=diff&rev=13044&p1=trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java&p2=trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java&r1=13043&r2=13044
==============================================================================
--- trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java (original)
+++ trunk/src_new/org/argouml/ui/cmd/ShortcutMgr.java 2007-07-10 13:08:18-0700
@@ -47,7 +47,7 @@
import org.argouml.ui.ActionImportXMI;
import org.argouml.ui.ActionProjectSettings;
import org.argouml.ui.ActionSettings;
-import org.argouml.ui.ProjectBrowser;
+import org.argouml.ui.ProjectActions;
import org.argouml.ui.explorer.ActionPerspectiveConfig;
import org.argouml.uml.ui.ActionActivityDiagram;
import org.argouml.uml.ui.ActionClassDiagram;
@@ -63,6 +63,7 @@
import org.argouml.uml.ui.ActionRevertToSaved;
import org.argouml.uml.ui.ActionSaveAllGraphics;
import org.argouml.uml.ui.ActionSaveGraphics;
+import org.argouml.uml.ui.ActionSaveProject;
import org.argouml.uml.ui.ActionSaveProjectAs;
import org.argouml.uml.ui.ActionSequenceDiagram;
import org.argouml.uml.ui.ActionStateDiagram;
@@ -550,8 +551,7 @@
putDefaultShortcut(ACTION_OPEN_PROJECT, KeyStroke.getKeyStroke(
KeyEvent.VK_O, DEFAULT_MASK), new ActionOpenProject());
putDefaultShortcut(ACTION_SAVE_PROJECT, KeyStroke.getKeyStroke(
- KeyEvent.VK_S, DEFAULT_MASK), ProjectBrowser.getInstance()
- .getSaveAction());
+ KeyEvent.VK_S, DEFAULT_MASK), ActionSaveProject.getInstance());
putDefaultShortcut(ACTION_SAVE_PROJECT_AS, null,
new ActionSaveProjectAs());
putDefaultShortcut(ACTION_REVERT_TO_SAVED, null,
@@ -575,9 +575,9 @@
putDefaultShortcut(ACTION_SELECT_ALL, KeyStroke.getKeyStroke(
KeyEvent.VK_A, DEFAULT_MASK), new SelectAllAction());
putDefaultShortcut(ACTION_REDO, KeyStroke.getKeyStroke(KeyEvent.VK_Y,
- DEFAULT_MASK), ProjectBrowser.getInstance().getRedoAction());
+ DEFAULT_MASK), ProjectActions.getInstance().getRedoAction());
putDefaultShortcut(ACTION_UNDO, KeyStroke.getKeyStroke(KeyEvent.VK_Z,
- DEFAULT_MASK), ProjectBrowser.getInstance().getUndoAction());
+ DEFAULT_MASK), ProjectActions.getInstance().getUndoAction());
putDefaultShortcut(ACTION_NAVIGATE_FORWARD, null,
new NavigateTargetForwardAction());
putDefaultShortcut(ACTION_NAVIGATE_BACK, null,
@@ -588,7 +588,7 @@
new ActionPerspectiveConfig());
putDefaultShortcut(ACTION_SETTINGS, null, new ActionSettings());
putDefaultShortcut(ACTION_REMOVE_FROM_DIAGRAM, KeyStroke.getKeyStroke(
- KeyEvent.VK_DELETE, 0), ProjectBrowser.getInstance()
+ KeyEvent.VK_DELETE, 0), ProjectActions.getInstance()
.getRemoveFromDiagramAction());
putDefaultShortcut(ACTION_DELETE_MODEL_ELEMENTS, KeyStroke
.getKeyStroke(KeyEvent.VK_DELETE, DEFAULT_MASK),
Modified: trunk/src_new/org/argouml/ui/explorer/ExplorerTree.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/explorer/ExplorerTree.java?view=diff&rev=13044&p1=trunk/src_new/org/argouml/ui/explorer/ExplorerTree.java&p2=trunk/src_new/org/argouml/ui/explorer/ExplorerTree.java&r1=13043&r2=13044
==============================================================================
--- trunk/src_new/org/argouml/ui/explorer/ExplorerTree.java (original)
+++ trunk/src_new/org/argouml/ui/explorer/ExplorerTree.java 2007-07-10 13:08:18-0700
@@ -31,7 +31,6 @@
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
-import java.util.Vector;
import javax.swing.JPopupMenu;
import javax.swing.JTree;
@@ -48,7 +47,7 @@
import org.argouml.kernel.ProjectManager;
import org.argouml.kernel.ProjectSettings;
import org.argouml.ui.DisplayTextTree;
-import org.argouml.ui.ProjectBrowser;
+import org.argouml.ui.ProjectActions;
import org.argouml.ui.targetmanager.TargetEvent;
import org.argouml.ui.targetmanager.TargetListener;
import org.argouml.ui.targetmanager.TargetManager;
@@ -173,9 +172,9 @@
private void myDoubleClick() {
Object target = TargetManager.getInstance().getTarget();
if (target != null) {
- Vector show = new Vector();
+ List show = new ArrayList();
show.add(target);
- ProjectBrowser.getInstance().jumpToDiagramShowing(show);
+ ProjectActions.jumpToDiagramShowing(show);
}
}
Modified: trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java?view=diff&rev=13044&p1=trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java&p2=trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java&r1=13043&r2=13044
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java (original)
+++ trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java 2007-07-10 13:08:18-0700
@@ -41,7 +41,7 @@
import org.argouml.cognitive.ToDoItem;
import org.argouml.kernel.Project;
import org.argouml.kernel.ProjectManager;
-import org.argouml.ui.ProjectBrowser;
+import org.argouml.ui.ProjectActions;
/**
@@ -119,13 +119,13 @@
* Action jumps to the diagram containing all or most of the
* offenders and calls {@link #deselect()}, {@link #select()}
* around the call to
- * {@link ProjectBrowser#jumpToDiagramShowing(java.util.Vector)}.
+ * {@link ProjectDiagramActions#jumpToDiagramShowing(java.util.List)}.
*/
@Override
public void action() {
deselect();
// this also sets the target as a convenient side effect
- ProjectBrowser.getInstance().jumpToDiagramShowing(getOffenders());
+ ProjectActions.jumpToDiagramShowing(getOffenders());
select();
}
Modified: trunk/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java?view=diff&rev=13044&p1=trunk/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java&p2=trunk/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java&r1=13043&r2=13044
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java 2007-07-10 13:08:18-0700
@@ -39,7 +39,7 @@
import javax.swing.SwingUtilities;
import org.argouml.model.Model;
-import org.argouml.ui.ProjectBrowser;
+import org.argouml.ui.ProjectActions;
import org.argouml.uml.diagram.ui.ActionAddConcurrentRegion;
import org.argouml.uml.diagram.ui.ActionDeleteConcurrentRegion;
import org.tigris.gef.base.Globals;
@@ -60,18 +60,11 @@
MouseListener,
MouseMotionListener {
- ////////////////////////////////////////////////////////////////
- // instance variables
-
- // /** The main label on this icon. */
- //FigText _name;
private FigRect cover;
private FigLine dividerline;
private static Handle curHandle = new Handle(-1);
- ////////////////////////////////////////////////////////////////
- // constructors
/**
* The constructor.
@@ -146,16 +139,13 @@
return figClone;
}
- ////////////////////////////////////////////////////////////////
- // accessors
-
/*
* @see org.tigris.gef.ui.PopupGenerator#getPopUpActions(java.awt.event.MouseEvent)
*/
public Vector getPopUpActions(MouseEvent me) {
Vector popUpActions = super.getPopUpActions(me);
popUpActions.remove(
- ProjectBrowser.getInstance().getRemoveFromDiagramAction());
+ ProjectActions.getInstance().getRemoveFromDiagramAction());
popUpActions.add(new JSeparator());
popUpActions.addElement(
new ActionAddConcurrentRegion());
@@ -566,4 +556,4 @@
* The UID.
*/
private static final long serialVersionUID = -7228935179004210975L;
-} /* end class FigConcurrentRegion */
+}
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.