Author: tfmorris Date: 2008-05-01 12:21:43-0700 New Revision: 14565 Modified: trunk/src/argouml-app/src/org/argouml/cognitive/ui/ActionGoToCritique.java trunk/src/argouml-app/src/org/argouml/cognitive/ui/TabToDo.java trunk/src/argouml-app/src/org/argouml/cognitive/ui/ToDoPane.java trunk/src/argouml-app/src/org/argouml/cognitive/ui/WizStep.java trunk/src/argouml-app/src/org/argouml/ui/DetailsPane.java trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java trunk/src/argouml-app/src/org/argouml/ui/TabToDoTarget.java
Log: Add TODOs and deprecate methods for issue 5048 Modified: trunk/src/argouml-app/src/org/argouml/cognitive/ui/ActionGoToCritique.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/cognitive/ui/ActionGoToCritique.java?view=diff&rev=14565&p1=trunk/src/argouml-app/src/org/argouml/cognitive/ui/ActionGoToCritique.java&p2=trunk/src/argouml-app/src/org/argouml/cognitive/ui/ActionGoToCritique.java&r1=14564&r2=14565 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/cognitive/ui/ActionGoToCritique.java (original) +++ trunk/src/argouml-app/src/org/argouml/cognitive/ui/ActionGoToCritique.java 2008-05-01 12:21:43-0700 @@ -60,9 +60,11 @@ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent ae) { - super.actionPerformed(ae); - ((ToDoPane) ProjectBrowser.getInstance().getTodoPane()) - .selectItem(item); + super.actionPerformed(ae); + // TODO: ProjectBrowser doesn't need to mediate this conversation + // Use an event listener in the ToDoPane to communicate instead. - tfm + ((ToDoPane) ProjectBrowser.getInstance().getTodoPane()) + .selectItem(item); } } /* end class ActionGoToCritique */ Modified: trunk/src/argouml-app/src/org/argouml/cognitive/ui/TabToDo.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/cognitive/ui/TabToDo.java?view=diff&rev=14565&p1=trunk/src/argouml-app/src/org/argouml/cognitive/ui/TabToDo.java&p2=trunk/src/argouml-app/src/org/argouml/cognitive/ui/TabToDo.java&r1=14564&r2=14565 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/cognitive/ui/TabToDo.java (original) +++ trunk/src/argouml-app/src/org/argouml/cognitive/ui/TabToDo.java 2008-05-01 12:21:43-0700 @@ -101,6 +101,9 @@ setTarget(null); addComponentListener(this); + + // TODO: Register listener for target ToDo item changes + // and for new showStep() requests } /** @@ -158,6 +161,9 @@ if (isVisible()) { setTargetInternal(item); } + + // Request that we be made visible if we're not? + // topLevelTabbedPane.setSelectedComponent(t); } private void setTargetInternal(Object item) { Modified: trunk/src/argouml-app/src/org/argouml/cognitive/ui/ToDoPane.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/cognitive/ui/ToDoPane.java?view=diff&rev=14565&p1=trunk/src/argouml-app/src/org/argouml/cognitive/ui/ToDoPane.java&p2=trunk/src/argouml-app/src/org/argouml/cognitive/ui/ToDoPane.java&r1=14564&r2=14565 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/cognitive/ui/ToDoPane.java (original) +++ trunk/src/argouml-app/src/org/argouml/cognitive/ui/ToDoPane.java 2008-05-01 12:21:43-0700 @@ -297,7 +297,7 @@ public void valueChanged(TreeSelectionEvent e) { LOG.debug("ToDoPane valueChanged"); //TODO: should fire its own event and ProjectBrowser - //should register a listener + //should register a listener - tfm Object sel = getSelectedObject(); ProjectBrowser.getInstance().setToDoItem(sel); LOG.debug("lastselection: " + lastSel); Modified: trunk/src/argouml-app/src/org/argouml/cognitive/ui/WizStep.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/cognitive/ui/WizStep.java?view=diff&rev=14565&p1=trunk/src/argouml-app/src/org/argouml/cognitive/ui/WizStep.java&p2=trunk/src/argouml-app/src/org/argouml/cognitive/ui/WizStep.java&r1=14564&r2=14565 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/cognitive/ui/WizStep.java (original) +++ trunk/src/argouml-app/src/org/argouml/cognitive/ui/WizStep.java 2008-05-01 12:21:43-0700 @@ -252,10 +252,10 @@ * Set the target and make visible. */ protected void updateTabToDo() { + // TODO: TabToDo should listen for an event that this fires so that we + // can decouple from the ProjectBrowser. - tfm TabToDo ttd = (TabToDo) ProjectBrowser.getInstance().getTab(TabToDo.class); - // TODO: TabToDo should listen for an event that this fires so that we - // can decouple from the ProjectBrowser. JPanel ws = getWizard().getCurrentPanel(); if (ws instanceof WizStep) { ((WizStep) ws).setTarget(target); @@ -312,7 +312,6 @@ */ public void targetAdded(TargetEvent e) { setTarget(e.getNewTarget()); - } /* @@ -322,7 +321,6 @@ // how to handle empty target lists? // probably the wizstep should only show an empty pane in that case setTarget(e.getNewTarget()); - } /* Modified: trunk/src/argouml-app/src/org/argouml/ui/DetailsPane.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/DetailsPane.java?view=diff&rev=14565&p1=trunk/src/argouml-app/src/org/argouml/ui/DetailsPane.java&p2=trunk/src/argouml-app/src/org/argouml/ui/DetailsPane.java&r1=14564&r2=14565 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/ui/DetailsPane.java (original) +++ trunk/src/argouml-app/src/org/argouml/ui/DetailsPane.java 2008-05-01 12:21:43-0700 @@ -208,7 +208,10 @@ * * @param item the selected todo item * @return true if todo tab is really selected. + * @deprecated for 0.25.5 by tfmorris. Send an event that TabToDoTargets + * listen to. */ + @Deprecated public boolean setToDoItem(Object item) { enableTabs(item); for (JPanel t : tabPanelList) { @@ -291,11 +294,9 @@ if (!tabSelected) { JPanel tab = tabPanelList.get(0); if (!(tab instanceof TabToDoTarget)) { - Iterator it = tabPanelList.iterator(); - while (it.hasNext()) { - Object o = it.next(); - if (o instanceof TabToDoTarget) { - tab = (JPanel) o; + for (JPanel panel : tabPanelList) { + if (panel instanceof TabToDoTarget) { + tab = panel; break; } } Modified: trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java?view=diff&rev=14565&p1=trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java&p2=trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java&r1=14564&r2=14565 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java (original) +++ trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java 2008-05-01 12:21:43-0700 @@ -267,6 +267,7 @@ getContentPane().setFont(defaultFont); + // TODO: This causes a cyclic depencency with ActionSaveProject saveAction = new ActionSaveProject(); ProjectManager.getManager().setSaveAction(saveAction); @@ -290,7 +291,7 @@ // allows me to ask "Do you want to save first?" setDefaultCloseOperation(ProjectBrowser.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowCloser()); - + setApplicationIcon(); // Add listener for project changes @@ -326,7 +327,7 @@ // We're looking at focus change to // flag the start of an interaction. This // is to detect when focus is gained in a prop - // panel field on the assumption editing of that + // panel field on the assumption editing of that // field is about to start. // Not a good assumption. We Need to see if we can get // rid of this. @@ -361,21 +362,21 @@ final List<Image> argoImages = new ArrayList<Image>(2); argoImages.add(argoImage16x16.getImage()); argoImages.add(argoImage32x32.getImage()); - try { + try { // java.awt.Window.setIconImages is new in Java 6. - // check for it using reflection on current instance + // check for it using reflection on current instance final Method m = getClass().getMethod("setIconImages", List.class); - m.invoke(this, argoImages); - } catch (InvocationTargetException e) { + m.invoke(this, argoImages); + } catch (InvocationTargetException e) { LOG.error("Exception", e); } catch (NoSuchMethodException e) { LOG.error("Exception", e); - } catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { LOG.error("Exception", e); - } catch (IllegalAccessException e) { + } catch (IllegalAccessException e) { LOG.error("Exception", e); - } + } } } @@ -778,12 +779,12 @@ /** * Select the tab page containing the todo item. - * - * TODO: should introduce an instance variable to go straight to - * the correct tab instead of trying all - * + * * @param o the todo item to select + * @deprecated for 0.25.5 by tfmorris. Send an event that the + * DetailsPane/TabToDo will be listening for. */ + @Deprecated public void setToDoItem(Object o) { Iterator it = detailsPanesByCompassPoint.values().iterator(); while (it.hasNext()) { @@ -796,7 +797,7 @@ /** * Get the tab page containing the properties. - * + * * @return the TabProps tabpage * @deprecated for 0.25.5 by tfmorris. No one should need to manipulate the * properties tab directly. The only place this is currently @@ -818,7 +819,7 @@ /** * Get the tab page instance of the given class. - * + * * @param tabClass the given class * @return the tabpage * @deprecated by for 0.25.5 by tfmorris. Tabs should register themselves @@ -901,7 +902,7 @@ /** * Given a list of targets, displays the corresponding diagram. This method * jumps to the diagram showing the targets, and scrolls to make it visible. - * + * * @param targets Collection of targets to show * @deprecated for 0.25.5 by tfmorris. This is unused by ArgoUML. If there * are clients that require this functionality, it should be Modified: trunk/src/argouml-app/src/org/argouml/ui/TabToDoTarget.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/TabToDoTarget.java?view=diff&rev=14565&p1=trunk/src/argouml-app/src/org/argouml/ui/TabToDoTarget.java&p2=trunk/src/argouml-app/src/org/argouml/ui/TabToDoTarget.java&r1=14564&r2=14565 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/ui/TabToDoTarget.java (original) +++ trunk/src/argouml-app/src/org/argouml/ui/TabToDoTarget.java 2008-05-01 12:21:43-0700 @@ -1,5 +1,5 @@ // $Id$ -// Copyright (c) 1996-2006 The Regents of the University of California. All +// Copyright (c) 1996-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 @@ -22,15 +22,12 @@ // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, // UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -// TODO: remove all methods before release 0.16. They are all deprecated - package org.argouml.ui; import org.argouml.ui.targetmanager.TargetListener; /** - * Empty interface used to tag Tabbed panels that accept a ToDo Element Target. - * + * Interface used to tag Tabbed panels that accept a ToDo Element Target. */ public interface TabToDoTarget extends TargetListener { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
