svn commit: r15169 - trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java
[email protected] 6 Jul 2008 00:00:36 -0000
Newsgroups
gmane.comp.lang.uml.argouml.cvs
Message-ID
<[email protected] >
Author: bobtarling
Date: 2008-07-05 17:00:36-0700
New Revision: 15169
Modified:
trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java
Log:
Issue 5202: Make sure the screen refreshes, remove unused instance variable while at it.
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=15169&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=15168&r2=15169
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java 2008-07-05 17:00:36-0700
@@ -68,7 +68,6 @@
*/
private static final Logger LOG = Logger.getLogger(TabProps.class);
- private boolean shouldBeEnabled = false;
private JPanel blankPanel = new JPanel();
private Hashtable<Class, TabModelTarget> panels =
new Hashtable<Class, TabModelTarget>();
@@ -166,12 +165,16 @@
@Deprecated
public void setTarget(Object target) {
// targets ought to be UML objects or diagrams
+ LOG.info("setTarget: there are "
+ + TargetManager.getInstance().getTargets().size()
+ + " targets");
+
target = (target instanceof Fig) ? ((Fig) target).getOwner() : target;
if (!(target == null || Model.getFacade().isAUMLElement(target)
|| target instanceof ArgoDiagram)) {
return;
}
-
+
if (lastPanel != null) {
remove(lastPanel);
if (lastPanel instanceof TargetListener) {
@@ -187,10 +190,10 @@
this.target = target;
if (target == null) {
add(blankPanel, BorderLayout.CENTER);
- shouldBeEnabled = false;
+ validate();
+ repaint();
lastPanel = blankPanel;
} else {
- shouldBeEnabled = true;
TabModelTarget newPanel = null;
newPanel = findPanelFor(target);
if (newPanel != null) {
@@ -198,14 +201,13 @@
}
if (newPanel instanceof JPanel) {
add((JPanel) newPanel, BorderLayout.CENTER);
- shouldBeEnabled = true;
lastPanel = (JPanel) newPanel;
} else {
add(blankPanel, BorderLayout.CENTER);
- shouldBeEnabled = false;
+ validate();
+ repaint();
lastPanel = blankPanel;
}
-
}
}