Print

Print


Commit in java/trunk/util/src/main/java/org/lcsim/hps/util on MAIN
AIDAFrame.java+53added 350
RandomGaussian.java+32added 350
Redrawable.java+13added 350
Resettable.java+14added 350
+112
4 added files
Adding some classes to util temporarily while I sort out some module dependencies.

java/trunk/util/src/main/java/org/lcsim/hps/util
AIDAFrame.java added at 350
--- java/trunk/util/src/main/java/org/lcsim/hps/util/AIDAFrame.java	                        (rev 0)
+++ java/trunk/util/src/main/java/org/lcsim/hps/util/AIDAFrame.java	2014-03-26 00:31:32 UTC (rev 350)
@@ -0,0 +1,53 @@
+package org.lcsim.hps.util;
+
+import hep.aida.*;
+import hep.aida.ref.plotter.PlotterUtilities;
+import java.awt.BorderLayout;
+import javax.swing.*;
+
+/**
+ *
+ * @author Sho Uemura <[log in to unmask]>
+ * @version $Id: AIDAFrame.java,v 1.1 2013/10/25 19:41:01 jeremy Exp $
+ * @deprecated
+ */
+@Deprecated
+public class AIDAFrame extends JFrame {
+
+    JPanel controlsPanel;
+    JMenuBar menubar;
+    JTabbedPane tabbedPane;
+
+    public AIDAFrame() {
+        tabbedPane = new JTabbedPane();
+        this.getContentPane().setLayout(new BorderLayout());
+
+        menubar = new JMenuBar();
+        this.setJMenuBar(menubar);
+
+        this.add(tabbedPane, BorderLayout.CENTER);
+
+        controlsPanel = new JPanel();
+        controlsPanel.setLayout(new BoxLayout(controlsPanel, BoxLayout.X_AXIS));
+        this.add(controlsPanel, BorderLayout.SOUTH);
+    }
+
+    public void addPlotter(IPlotter plotter) {
+        JPanel plotterPanel = new JPanel(new BorderLayout());
+        // Now embed the plotter
+        plotterPanel.add(PlotterUtilities.componentForPlotter(plotter), BorderLayout.CENTER);
+        tabbedPane.add(plotter.title(), plotterPanel);
+    }
+
+    public JTabbedPane getTabbedPane() {
+        return tabbedPane;
+    }
+
+    public JPanel getControlsPanel() {
+        return controlsPanel;
+    }
+
+    public JMenuBar getMenubar() {
+        return menubar;
+    }
+}

java/trunk/util/src/main/java/org/lcsim/hps/util
RandomGaussian.java added at 350
--- java/trunk/util/src/main/java/org/lcsim/hps/util/RandomGaussian.java	                        (rev 0)
+++ java/trunk/util/src/main/java/org/lcsim/hps/util/RandomGaussian.java	2014-03-26 00:31:32 UTC (rev 350)
@@ -0,0 +1,32 @@
+package org.lcsim.hps.util;
+
+//--- java ---//
+import java.util.Random;
+
+/**
+ * 
+ * @author Omar Moreno
+ * @version $Id: RandomGaussian.java,v 1.1 2012/08/27 19:01:36 omoreno Exp $
+ */
+public class RandomGaussian {
+
+    private static Random randNumberGenerator;
+        
+    /**
+     * Class shouldn't be instantiated by anyone 
+     */
+    private RandomGaussian(){
+    }
+
+    /**
+     * Generates a Gaussian distributed number with given mean and standard deviation
+     *
+     * @param mean : Mean of the distribution
+     * @param sigma : Standard deviation of the distribution
+     * @return Gaussian distributed number
+     */
+    public static double getGaussian(double mean, double sigma){
+            if(randNumberGenerator == null) randNumberGenerator = new Random();
+            return mean + randNumberGenerator.nextGaussian()*sigma;
+    }
+}

java/trunk/util/src/main/java/org/lcsim/hps/util
Redrawable.java added at 350
--- java/trunk/util/src/main/java/org/lcsim/hps/util/Redrawable.java	                        (rev 0)
+++ java/trunk/util/src/main/java/org/lcsim/hps/util/Redrawable.java	2014-03-26 00:31:32 UTC (rev 350)
@@ -0,0 +1,13 @@
+package org.lcsim.hps.util;
+
+/**
+ * Drivers that will be attached to monitoring system should implement 
+ * this if they will only redraw plots every N events, or when redraw() is called.
+ * Setting eventRefreshRate = 0 should disable automatic redrawing.
+ * @deprecated Individual Drivers should implement this behavior.  No interface should be necessary.
+ */
+@Deprecated
+public interface Redrawable {
+    public void redraw();
+    public void setEventRefreshRate(int eventRefreshRate);
+}

java/trunk/util/src/main/java/org/lcsim/hps/util
Resettable.java added at 350
--- java/trunk/util/src/main/java/org/lcsim/hps/util/Resettable.java	                        (rev 0)
+++ java/trunk/util/src/main/java/org/lcsim/hps/util/Resettable.java	2014-03-26 00:31:32 UTC (rev 350)
@@ -0,0 +1,14 @@
+package org.lcsim.hps.util;
+
+/**
+ * Drivers that will be attached to monitoring system should implement 
+ * this if they will be reset when the "reset" button is pressed on the
+ * monitoring app.
+ * @author Jeremy McCormick <[log in to unmask]>
+ * @deprecated Use standard methods like {@link org.lcsim.util.Driver#startOfData()} 
+ * or {@link org.lcsim.util.Driver#detectorChanged(Detector)}.
+ */
+@Deprecated
+public interface Resettable {
+    void reset();
+}
SVNspam 0.1