Commit in hps-java/src/main/java/org/lcsim/hps/monitoring on MAIN | |||
MonitoringAnalysisFactory.java | +12 | -4 | 1.1 -> 1.2 |
keep track of plot factories and return existing if there is a name match
diff -u -r1.1 -r1.2 --- MonitoringAnalysisFactory.java 5 Jun 2012 18:21:06 -0000 1.1 +++ MonitoringAnalysisFactory.java 5 Jun 2013 19:06:43 -0000 1.2 @@ -3,12 +3,17 @@
import hep.aida.IPlotterFactory; import hep.aida.ref.AnalysisFactory;
+import java.util.HashMap; +import java.util.Map; +
/** * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: MonitoringAnalysisFactory.java,v 1.1 2012/06/05 18:21:06 jeremy Exp $
+ * @version $Id: MonitoringAnalysisFactory.java,v 1.2 2013/06/05 19:06:43 jeremy Exp $
*/ public class MonitoringAnalysisFactory extends AnalysisFactory {
-
+ + Map<String,IPlotterFactory> plotFactories = new HashMap<String,IPlotterFactory>(); +
/** * Register this class as the default AnalysisFactory for AIDA by setting the magic property string. */
@@ -17,10 +22,13 @@
} /**
- * Create a named plotter factory for the monitoring application.
+ * Create a named plotter factory for the monitoring application.
*/ public IPlotterFactory createPlotterFactory(String name) {
- return new MonitoringPlotFactory(name);
+ if (plotFactories.get(name) == null) { + plotFactories.put(name, new MonitoringPlotFactory(name)); + } + return plotFactories.get(name);
} /**
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1