LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  March 2015

HPS-SVN March 2015

Subject:

r2597 - /java/trunk/monitoring-util/src/main/java/org/hps/monitoring/plotting/PlotterRegistry.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Fri, 27 Mar 2015 18:16:59 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (94 lines)

Author: [log in to unmask]
Date: Fri Mar 27 11:16:54 2015
New Revision: 2597

Log:
Add access to global plotter list from PlotterRegistry.

Modified:
    java/trunk/monitoring-util/src/main/java/org/hps/monitoring/plotting/PlotterRegistry.java

Modified: java/trunk/monitoring-util/src/main/java/org/hps/monitoring/plotting/PlotterRegistry.java
 =============================================================================
--- java/trunk/monitoring-util/src/main/java/org/hps/monitoring/plotting/PlotterRegistry.java	(original)
+++ java/trunk/monitoring-util/src/main/java/org/hps/monitoring/plotting/PlotterRegistry.java	Fri Mar 27 11:16:54 2015
@@ -1,29 +1,35 @@
-/**
- * 
- */
 package org.hps.monitoring.plotting;
 
 import hep.aida.IPlotter;
 import hep.aida.IPlotterRegion;
 
+import java.util.Collection;
 import java.util.HashMap;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.Map.Entry;
 import java.util.Set;
 
 /**
+ * This is a global registry of plotters used by the monitoring plot factory. 
  * @author Jeremy McCormick <[log in to unmask]>
- *
  */
 public class PlotterRegistry {
 
-    Set<IPlotter> plotters = new HashSet<IPlotter>();    
+    Set<IPlotter> plotters = new LinkedHashSet<IPlotter>();    
     HashMap<IPlotter, int[]> tabMap = new HashMap<IPlotter, int[]>();
     
+    /**
+     * Clear the list of plotters.
+     */
     public void clear() {
         plotters.clear();
     }
     
+    /**
+     * Find a plotter that contains the region object.
+     * @param region The plotter region object.
+     * @return The plotter that contains this region or null if none.
+     */
     public IPlotter find(IPlotterRegion region) {
         for (IPlotter plotter : plotters) {
             for (int i = 0; i < plotter.numberOfRegions(); i++) {
@@ -35,10 +41,23 @@
         return null;
     }
     
+    /**
+     * Register a plotter along with its tab indices.
+     * @param plotter The plotter to register.
+     * @param index1 The top tab index.
+     * @param index2 The sub-tab index.
+     */
     public void register(IPlotter plotter, int index1, int index2) {
         tabMap.put(plotter, new int[] { index1, index2 });
     }
     
+    /**
+     * Find a plotter by its tab indices e.g. those that are currently selected
+     * in an application.
+     * @param index1 The top tab index.
+     * @param index2 The sub-tab index.
+     * @return The plotter or null if none found.
+     */
     public IPlotter find(int index1, int index2) {
         for (Entry<IPlotter, int[]> entry : tabMap.entrySet()) {
             int[] indices = entry.getValue();
@@ -48,4 +67,12 @@
         }
         return null;
     }
+    
+    /**
+     * Get the current collection of plotters.
+     * @return The current collection of plotters.
+     */
+    public Collection<IPlotter> getPlotters() {
+        return plotters;
+    }
 }

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use