[Schmitzm-commits] r546 - in branches/1.0-gt2-2.6/src/skrueger: . swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Nov 22 19:56:42 CET 2009


Author: alfonx
Date: 2009-11-22 19:56:40 +0100 (Sun, 22 Nov 2009)
New Revision: 546

Modified:
   branches/1.0-gt2-2.6/src/skrueger/AttributeMetadata.java
   branches/1.0-gt2-2.6/src/skrueger/swing/HeapBar.java
Log:
* Mouseclicks on the HeapBar will now trigger a GarbageCollectin
* AttributeMetadata constructor didn't correctly handle the visbile state

Modified: branches/1.0-gt2-2.6/src/skrueger/AttributeMetadata.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/AttributeMetadata.java	2009-11-21 18:22:36 UTC (rev 545)
+++ branches/1.0-gt2-2.6/src/skrueger/AttributeMetadata.java	2009-11-22 18:56:40 UTC (rev 546)
@@ -134,13 +134,7 @@
 		this.setName(name);
 		this.title = title;
 		this.desc = desc;
-//
-//		// The THE_GEOM and shall never be visible!
-//		if (name.getLocalPart().equalsIgnoreCase("the_geom"))
-//			this.visible = false;
-//		else
-//			this.visible = visible;
-
+		this.visible = visible;
 		this.unit = unit;
 	}
 

Modified: branches/1.0-gt2-2.6/src/skrueger/swing/HeapBar.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/swing/HeapBar.java	2009-11-21 18:22:36 UTC (rev 545)
+++ branches/1.0-gt2-2.6/src/skrueger/swing/HeapBar.java	2009-11-22 18:56:40 UTC (rev 546)
@@ -2,6 +2,8 @@
 
 import java.awt.Color;
 import java.awt.Graphics;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
 import java.util.Locale;
 import java.util.Timer;
 import java.util.TimerTask;
@@ -36,6 +38,14 @@
 		setMaximum(100);
 
 		SwingUtil.setPreferredWidth(this, 200);
+		
+		// Clicking the bar triggers a GC
+		addMouseListener( new MouseAdapter() {
+			@Override
+			public void mouseClicked(MouseEvent e) {
+				LangUtil.gcTotal();
+			}
+		});
 	}
 
 	@Override



More information about the Schmitzm-commits mailing list