diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/MicroManager.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/MicroManager.java index ca133834871c64bea8202f5a2ad81a085e280f3e..2a6a8fa70c8f0d1aa68416c4fd875980b8447238 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/MicroManager.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/MicroManager.java @@ -1,17 +1,5 @@ package plugins.tprovoost.Microscopy.MicroManager; -import icy.common.Version; -import icy.file.FileUtil; -import icy.gui.dialog.MessageDialog; -import icy.gui.frame.progress.FailedAnnounceFrame; -import icy.image.IcyBufferedImage; -import icy.main.Icy; -import icy.sequence.Sequence; -import icy.system.IcyExceptionHandler; -import icy.system.thread.ThreadUtil; -import icy.util.ClassUtil; -import icy.util.StringUtil; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -33,6 +21,17 @@ import org.micromanager.api.TaggedImageAnalyzer; import org.micromanager.utils.MDUtils; import org.micromanager.utils.ReportingUtils; +import icy.common.Version; +import icy.file.FileUtil; +import icy.gui.dialog.MessageDialog; +import icy.gui.frame.progress.FailedAnnounceFrame; +import icy.image.IcyBufferedImage; +import icy.main.Icy; +import icy.sequence.Sequence; +import icy.system.IcyExceptionHandler; +import icy.system.thread.ThreadUtil; +import icy.util.ClassUtil; +import icy.util.StringUtil; import mmcorej.CMMCore; import mmcorej.MMCoreJ; import mmcorej.StrVector; @@ -63,7 +62,7 @@ public class MicroManager static Thread liveManager = null; /** - * Retrieve the MicroManager main frame instance. + * @return the MicroManager main frame instance. */ public static MMMainFrame getInstance() { @@ -75,7 +74,7 @@ public class MicroManager } /** - * Retrieve the MicroManager version + * @return the MicroManager version */ public static Version getMMVersion() { @@ -101,7 +100,7 @@ public class MicroManager /** * Every {@link MicroscopePlugin} shares the same core, so you will receive every acquisition - * even if it was not asked by you.<br/> + * even if it was not asked by you.<br> * You should register your listener only when you need image and remove it when your done. * * @param listener @@ -141,11 +140,13 @@ public class MicroManager } /** - * Every {@link MicroscopePlugin} shares the same core, so the same live,<br/> - * when your plugin start, a live may have been already started and your {@link LiveListener} - * <br/> - * could receive images at the moment you call this method. <br /> - * You should register your listener only when you need image and remove it when your done. + * Every {@link MicroscopePlugin} shares the same core, so the same live,<br> + * when your plugin start, a live may have been already started and your {@link LiveListener}<br> + * could receive images at the moment you call this method.<br> + * You should register your listener only when you need image and remove it when you're done. + * + * @param listener + * the <i>live</i> listener to add */ public static void addLiveListener(LiveListener listener) { @@ -156,6 +157,15 @@ public class MicroManager } } + /** + * Every {@link MicroscopePlugin} shares the same core, so the same live,<br> + * when your plugin start, a live may have been already started and your {@link LiveListener}<br> + * could receive images at the moment you call this method.<br> + * You should register your listener only when you need image and remove it when you're done. + * + * @param listener + * the <i>live</i> listener to remove + */ public static void removeLiveListener(LiveListener listener) { synchronized (liveListeners) @@ -165,6 +175,8 @@ public class MicroManager } /** + * @param listener + * the <i>acquisition</i> listener to register * @deprecated Use {@link #addAcquisitionListener(AcquisitionListener)} instead. */ @Deprecated @@ -174,6 +186,8 @@ public class MicroManager } /** + * @param listener + * the <i>acquisition</i> listener to remove * @deprecated Use {@link #removeAcquisitionListener(AcquisitionListener)} instead. */ @Deprecated @@ -183,6 +197,8 @@ public class MicroManager } /** + * @param listener + * the <i>live</i> listener to register * @deprecated Use {@link #addLiveListener(LiveListener)} instead. */ @Deprecated @@ -192,6 +208,8 @@ public class MicroManager } /** + * @param listener + * the <i>live</i> listener to remove * @deprecated Use {@link #removeLiveListener(LiveListener)} instead. */ @Deprecated @@ -217,12 +235,14 @@ public class MicroManager /** * Use this to access micro-manager core and to be able to use function that - * are not been implemented in Micro-Manger for Icy. </br> - * </br> + * are not been implemented in Micro-Manger for Icy. <br> + * <br> * Be careful, if you use core functions instead of the integrated {@link MicroManager} methods * or utility class as {@link StageMover} you will have to handle synchronization of the - * core and catch all exception. </br> + * core and catch all exception. <br> * In most of case you don't need to use it, but only if you want to make fancy things. + * + * @return The micro-manager core object */ public static CMMCore getCore() { @@ -234,7 +254,7 @@ public class MicroManager } /** - * Get exclusive access to micro manager.</br> + * Get exclusive access to micro manager.<br> * * @param wait * number of milli second to wait to retrieve exclusive access if micro manager is @@ -243,6 +263,7 @@ public class MicroManager * @return <code>true</code> if you obtained exclusive access and <code>false</code> if micro * manager is already locked by another thread and wait time elapsed. * @throws InterruptedException + * if thread was interrupt while waiting for lock * @see #lock() * @see #unlock() */ @@ -256,7 +277,7 @@ public class MicroManager } /** - * Get exclusive access to micro manager.</br> + * Get exclusive access to micro manager.<br> * If another thread already has exclusive access then it will wait until it release it. * * @see #lock(long) @@ -285,10 +306,12 @@ public class MicroManager inst.unlock(); } - + /** * Wait for a MM device to be ready. * + * @param device + * the device name * @throws Exception * if an error occurs */ @@ -335,7 +358,7 @@ public class MicroManager } /** - * Get the default config file name + * @return the default config file name */ public static String getDefaultConfigFileName() { @@ -344,6 +367,9 @@ public class MicroManager /** * Set the default config file name + * + * @param fileName + * the config filename */ public static void setDefaultConfigFileName(String fileName) { @@ -403,7 +429,7 @@ public class MicroManager /** * @return Returns the number of channel of the camera device (usually 3 for color camera and 1 - * in other case).</br> + * in other case).<br> * Just a shortcut for <code>getCore().getNumberOfCameraChannels()</code> */ public static long getCameraChannelCount() @@ -416,11 +442,9 @@ public class MicroManager } /** - * Returns the metadata object associated to the last image retrieved with - * {@link #getLastImage()} or - * {@link #snapImage()}.</br> - * Returns <code>null</code> if there is no metadata associated to the specified channel. - * + * @return the metadata object associated to the last image retrieved with + * {@link #getLastImage()} or {@link #snapImage()}<br> + * Returns <code>null</code> if there is no metadata associated to the specified channel. * @param channel * channel index for multi channel camera * @see #getLastImage() @@ -434,11 +458,9 @@ public class MicroManager } /** - * Returns the metadata object associated to the last image retrieved with - * {@link #getLastImage()} or - * {@link #snapImage()}.</br> - * Returns <code>null</code> if there is no image has been retrieved yet. - * + * @return the metadata object associated to the last image retrieved with + * {@link #getLastImage()} or {@link #snapImage()}.<br> + * Returns <code>null</code> if there is no image has been retrieved yet. * @see #getLastImage() * @see #snapImage() * @see #getMetadata(int) @@ -450,16 +472,16 @@ public class MicroManager } /** - * Returns the last image captured from the micro manager continuous acquisition.</br> - * Returns <code>null</code> if the continuous acquisition is not running.</br> - * </br> - * You can listen new image event from acquisition or live mode by using these methods:</br> - * {@link #addLiveListener(LiveListener)}</br> - * {@link #addAcquisitionListener(AcquisitionListener)}</br> - * </br> - * You can retrieve the associated metadata by using {@link #getMetadata(int)} method. - * + * @return the last image captured from the micro manager continuous acquisition.<br> + * Returns <code>null</code> if the continuous acquisition is not running.<br> + * <br> + * You can listen new image event from acquisition or live mode by using these methods:<br> + * {@link #addLiveListener(LiveListener)}<br> + * {@link #addAcquisitionListener(AcquisitionListener)}<br> + * <br> + * You can retrieve the associated metadata by using {@link #getMetadata(int)} method. * @throws Exception + * if an error occurred while retrieved last image */ public static IcyBufferedImage getLastImage() throws Exception { @@ -467,17 +489,17 @@ public class MicroManager } /** - * Returns a list of {@link TaggedImage} representing the last image captured from the micro - * manager continuous acquisition. The list contains as many image than camera channel (see - * {@link #getCameraChannelCount()}).</br> - * Returns an empty list if the continuous acquisition is not running or if image buffer is - * empty</br> - * </br> - * You can listen new image event from acquisition or live mode by using these methods:</br> - * {@link #addLiveListener(LiveListener)}</br> - * {@link #addAcquisitionListener(AcquisitionListener)}</br> - * + * @return a list of {@link TaggedImage} representing the last image captured from the micro + * manager continuous acquisition. The list contains as many image than camera channel (see + * {@link #getCameraChannelCount()}).<br> + * Returns an empty list if the continuous acquisition is not running or if image buffer is + * empty<br> + * <br> + * You can listen new image event from acquisition or live mode by using these methods:<br> + * {@link #addLiveListener(LiveListener)}<br> + * {@link #addAcquisitionListener(AcquisitionListener)}<br> * @throws Exception + * if an error occurred while retrieved last tagged images */ public static List<TaggedImage> getLastTaggedImage() throws Exception { @@ -524,14 +546,17 @@ public class MicroManager /** * This method waits for the next image captured from the micro manager continuous acquisition - * and returns it.</br> - * Returns <code>null</code> if the continuous acquisition is not running.</br> - * </br> - * You can listen new image event from acquisition or live mode by using these methods:</br> - * {@link #addLiveListener(LiveListener)}</br> - * {@link #addAcquisitionListener(AcquisitionListener)}</br> - * </br> + * and returns it.<br> + * <br> + * You can listen new image event from acquisition or live mode by using these methods:<br> + * {@link #addLiveListener(LiveListener)}<br> + * {@link #addAcquisitionListener(AcquisitionListener)}<br> + * <br> * You can retrieve the associated metadata by using {@link #getMetadata(int)} method. + * + * @return next captured image or <code>null</code> if the continuous acquisition is not running + * @throws Exception + * if an error occurred */ public static IcyBufferedImage getNextImage() throws Exception { @@ -541,12 +566,16 @@ public class MicroManager /** * This method waits for the next image captured from the micro manager continuous acquisition * and returns the result as a list of {@link TaggedImage}. The list contains as many image than - * camera channel (see {@link #getCameraChannelCount()}).</br> - * Returns an empty list if the continuous acquisition is not running.</br> - * </br> - * You can listen new image event from acquisition or live mode by using these methods:</br> - * {@link #addLiveListener(LiveListener)}</br> - * {@link #addAcquisitionListener(AcquisitionListener)}</br> + * camera channel (see {@link #getCameraChannelCount()}).<br> + * Returns an empty list if the continuous acquisition is not running.<br> + * <br> + * You can listen new image event from acquisition or live mode by using these methods:<br> + * {@link #addLiveListener(LiveListener)}<br> + * {@link #addAcquisitionListener(AcquisitionListener)}<br> + * + * @return next captured image as List of {@link TaggedImage} or an empty list if the continuous acquisition is not running + * @throws Exception + * if an error occurred */ public static List<TaggedImage> getNextTaggedImage() throws Exception { @@ -611,6 +640,10 @@ public class MicroManager * will wait for and return the next image from the image acquisition buffer.<br> * In other case it just snaps a new image from the camera device and returns it.<br> * You can retrieve the associated metadata by using {@link #getMetadata(int)} method. + * + * @return the captured image or <code>null</code> if conversion failed + * @throws Exception + * if an error occurred */ public static IcyBufferedImage snapImage() throws Exception { @@ -625,6 +658,10 @@ public class MicroManager * This function return a list of image as the camera device can have several channel (see * {@link #getCameraChannelCount()}) in which case we have one image per channel.<br> * You can retrieve the associated metadata by using {@link #getMetadata(int)} method. + * + * @return the captured image as List of {@link TaggedImage} + * @throws Exception + * if an error occurred */ public static List<TaggedImage> snapTaggedImage() throws Exception { @@ -676,7 +713,7 @@ public class MicroManager } /** - * Use this method to know if the continuous acquisition (live mode) is running. + * @return <code>true</code> if the continuous acquisition (live mode) is running, <code>false</code> otherwise */ public static boolean isLiveRunning() { @@ -689,22 +726,20 @@ public class MicroManager /** * Use this method to start the continuous acquisition mode (live mode) and retrieve images with - * {@link LiveListener}.</br> + * {@link LiveListener}.<br> * This command does not block the calling thread for the duration of the acquisition. * The GUI will draw the indeterminate progress bar representing a live acquisition running, - * in the Running Acquisition tab panel.<br/> - * <b>There is only one "live" progress bar for all plugin<b/>.<br/> + * in the Running Acquisition tab panel.<br> + * <b>There is only one "live" progress bar for all plugin</b>.<br> * * @throws Exception * If a sequence acquisition is running (see {@link #startAcquisition(int, double)}) or - * if the core - * doesn't respond. + * if the core doesn't respond. * @see #stopLiveMode() * @see #addLiveListener(LiveListener) * @see #isLiveRunning() * @return <code>true</code> if the method actually started the live mode and <code>false</code> - * if it was already - * running. + * if it was already running */ public static boolean startLiveMode() throws Exception { @@ -738,9 +773,9 @@ public class MicroManager } /** - * Use this method to stop the continuous acquisition mode (live mode).<br/> + * Use this method to stop the continuous acquisition mode (live mode).<br> * The GUI will remove indeterminate progress bar representing a live acquisition running, - * in the Running Acquisition tab panel, if live have been stopped. <br/> + * in the Running Acquisition tab panel, if live have been stopped. <br> * * @throws Exception * If the core can't stop the continuous acquisition mode. @@ -776,6 +811,7 @@ public class MicroManager * * @see #startAcquisition(int, double) * @see #stopAcquisition() + * @return <code>true</code> if the continuous is currently in process, <code>false</code> otherwise */ public static boolean isAcquisitionRunning() { @@ -788,8 +824,8 @@ public class MicroManager /** * Use this method to start an acquisition on the current camera device and retrieve images with - * {@link AcquisitionListener}.</br> - * This command does not block the calling thread for the duration of the acquisition.</br> + * {@link AcquisitionListener}.<br> + * This command does not block the calling thread for the duration of the acquisition.<br> * Note that you have to stop the live mode (see {@link #stopLiveMode()}) before calling this * method. * @@ -798,8 +834,7 @@ public class MicroManager * @param intervalMs * The interval between images * @throws Exception - * if live is running or if a sequence acquisition have been started and is not finished - * yet. + * if live is running or if a sequence acquisition have been started and is not finished yet. * @see #isAcquisitionRunning() * @see #getAcquisitionResult() * @see #stopAcquisition() @@ -850,12 +885,11 @@ public class MicroManager /** * If acquisition storage is enabled (see {@link #setStoreLastAcquisition(boolean)} method) then - * this method will - * return the list of sequence corresponding to the last sequence acquisition or - * <code>null</code> if no acquisition - * was done.</br> + * this method will return the list of sequence corresponding to the last sequence acquisition or + * <code>null</code> if no acquisition was done.<br> * Note you can have severals sequence for acquisition using different XY position.<br> * + * @return the list of sequence corresponding to the last sequence acquisition or * <code>null</code> if no acquisition was done. * @see #startAcquisition(int, double) */ public static List<Sequence> getAcquisitionResult() @@ -867,7 +901,9 @@ public class MicroManager } /** - * Returns the current camera device name + * @return the current camera device name + * @throws Exception + * if an error occurred */ public static String getCamera() throws Exception { @@ -879,7 +915,9 @@ public class MicroManager } /** - * Get the exposure of the current camera + * @return the exposure of the current camera + * @throws Exception + * if an error occurred */ public static double getExposure() throws Exception { @@ -892,6 +930,11 @@ public class MicroManager /** * Set the exposure of the current camera + * + * @param exposure + * the exposure to set + * @throws Exception + * if an error occurred */ public static void setExposure(double exposure) throws Exception { @@ -935,7 +978,9 @@ public class MicroManager } /** - * Get the current camera binning mode (String format) + * @return the current camera binning mode (String format) + * @throws Exception + * if an error occurred */ private static String getBinningAsString(CMMCore core, String camera) throws Exception { @@ -943,7 +988,9 @@ public class MicroManager } /** - * Get the current camera binning mode (String format) + * @return the current camera binning mode (String format) + * @throws Exception + * if an error occurred */ public static String getBinningAsString() throws Exception { @@ -961,6 +1008,11 @@ public class MicroManager /** * Set the current camera binning mode (String format) + * + * @param value + * the binning value to set + * @throws Exception + * if an error occurred */ public static void setBinning(String value) throws Exception { @@ -1003,7 +1055,9 @@ public class MicroManager } /** - * Get the binning in integer format + * @return the binning in integer format + * @throws Exception + * if an error occurred */ private static int getBinningAsInt(String value, int def) throws Exception { @@ -1017,7 +1071,9 @@ public class MicroManager } /** - * Get the current camera binning mode + * @return the current camera binning mode + * @throws Exception + * if an error occurred */ public static int getBinning() throws Exception { @@ -1026,6 +1082,11 @@ public class MicroManager /** * Set the current camera binning mode + * + * @param value + * the binning value to set + * @throws Exception + * if an error occurred */ public static void setBinning(int value) throws Exception { @@ -1080,7 +1141,9 @@ public class MicroManager } /** - * Returns the current shutter device. + * @return the current shutter device. + * @throws Exception + * if an error occurred */ public static String getShutter() throws Exception { @@ -1093,6 +1156,11 @@ public class MicroManager /** * Sets the current shutter device. + * + * @param value + * device name to set for the shutter + * @throws Exception + * if an error occurred */ public static void setShutter(String value) throws Exception { @@ -1116,7 +1184,9 @@ public class MicroManager } /** - * Returns the current shutter device open state. + * @return the current shutter device open state. + * @throws Exception + * if an error occurred */ public static boolean isShutterOpen() throws Exception { @@ -1129,6 +1199,11 @@ public class MicroManager /** * Open / close the current shutter device. + * + * @param value + * open state of shutter device + * @throws Exception + * if an error occurred */ public static void setShutterOpen(boolean value) throws Exception { @@ -1152,7 +1227,9 @@ public class MicroManager } /** - * Returns the current auto shutter state. + * @return the current auto shutter state. + * @throws Exception + * if an error occurred */ public static boolean getAutoShutter() throws Exception { @@ -1165,6 +1242,11 @@ public class MicroManager /** * Sets the auto shutter state. + * + * @param value + * <code>true</code> to set the automatic shutter mode, <code>false</code> otherwise + * @throws Exception + * if an error occurred */ public static void setAutoShutter(boolean value) throws Exception { @@ -1190,8 +1272,7 @@ public class MicroManager } /** - * Returns current pixel configured pixel size in micro meter.<br/> - * Returns 0d if pixel size is not defined + * @return current pixel configured pixel size in micro meter or <code>0d</code> if pixel size is not defined */ public static double getPixelSize() { @@ -1203,7 +1284,7 @@ public class MicroManager } /** - * Get all available config group + * @return all available config group */ public static List<String> getConfigGroups() { @@ -1221,7 +1302,9 @@ public class MicroManager } /** - * Get all available config preset for the specified group + * @param group + * group name + * @return all available config preset for the specified group */ public static List<String> getConfigs(String group) { @@ -1242,7 +1325,11 @@ public class MicroManager } /** - * Get the current config preset for the specified group + * @param group + * group name + * @return the current config preset for the specified group + * @throws Exception + * if an error occurred */ public static String getCurrentConfig(String group) throws Exception { @@ -1258,6 +1345,15 @@ public class MicroManager /** * Set the specified preset for the given config group + * + * @param group + * group name + * @param preset + * preset name + * @param wait + * wait for the preset configuration to be loaded + * @throws Exception + * if an error occurred */ public static void setConfigForGroup(String group, String preset, boolean wait) throws Exception { @@ -1299,7 +1395,7 @@ public class MicroManager } /** - * Returns current channel group (camera / channel / objective...) + * @return current channel group (camera / channel / objective...) */ public static String getChannelGroup() { @@ -1312,6 +1408,11 @@ public class MicroManager /** * Set the channel group (camera / channel / objective...) + * + * @param group + * channel group name + * @throws Exception + * if an error occurred */ public static void setChannelGroup(String group) throws Exception { @@ -1347,8 +1448,7 @@ public class MicroManager } /** - * Returns configurations for current channel group. - * + * @return configurations for current channel group. * @see #getChannelGroup() * @see #getConfigs(String) */ @@ -1358,8 +1458,7 @@ public class MicroManager } /** - * Returns the "enable storage of last acquisition" state. - * + * @return the "enable storage of last acquisition" state. * @see #setStoreLastAcquisition(boolean) * @see #getAcquisitionResult() */ @@ -1376,6 +1475,8 @@ public class MicroManager * {@link #getAcquisitionResult()}.<br> * Set to <code>true</code> by default. * + * @param value + * <code>true</code> to enable storage of last acquisition, <code>false</code> otherwise * @see #getAcquisitionResult() */ public static void setStoreLastAcquisition(boolean value) @@ -1385,8 +1486,7 @@ public class MicroManager } /** - * Enable immediate display of image acquisition. - * + * @return state of immediate display of image acquisition. * @see #startAcquisition(int, double) */ public static boolean getDisplayAcquisitionSequence() @@ -1400,6 +1500,8 @@ public class MicroManager /** * Enable immediate display of image acquisition. * + * @param value + * <code>true</code> to enable immediate display of acquisition, <code>false</code> otherwise * @see #startAcquisition(int, double) */ public static void setDisplayAcquisitionSequence(boolean value) @@ -1411,10 +1513,11 @@ public class MicroManager /** * Use this method to enable logging (disabled by default).<br> * Log file are in Icy folder and are named this way : CoreLog20140515.txt ; 20140515 is the - * date of debugging (2014/05/15)<br/> + * date of debugging (2014/05/15)<br> * <b>Be careful, log files can be very huge and take easily 1Gb.</b> * * @param enable + * <code>true</code> to enable debug logging, <code>false</code> otherwise */ public static void enableDebugLogging(boolean enable) { @@ -1427,8 +1530,7 @@ public class MicroManager } /** - * Returns <code>true</code> if Micro-Manager is initialized / loaded.<br> - * + * @return <code>true</code> if Micro-Manager is initialized / loaded.<br> * @see MicromanagerPlugin#init() */ public static boolean isInitialized() diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/core/AcquisitionResult.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/core/AcquisitionResult.java index 4534c257066b434055c2ec6ca5d0e9a9dd29bffc..686e8bda53e0886d4390cb495f85ac4e9e5ac4e1 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/core/AcquisitionResult.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/core/AcquisitionResult.java @@ -22,7 +22,7 @@ import plugins.tprovoost.Microscopy.MicroManager.MicroManager; import plugins.tprovoost.Microscopy.MicroManager.tools.MMUtils; /** - * This class is to be used by AcquisitionListener.</br> + * This class is to be used by AcquisitionListener.<br> * It initializes an empty icy sequence you need to feed with the {@link #imageReceived(TaggedImage)} method so the * sequence will be updated with those images. * diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/event/AcquisitionListener.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/event/AcquisitionListener.java index 6434515e52d171c8c05a2307289ae10c10d2fcf7..48e4be41cba87b7336bc8213ee46e73b5b0f93cd 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/event/AcquisitionListener.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/event/AcquisitionListener.java @@ -1,14 +1,12 @@ package plugins.tprovoost.Microscopy.MicroManager.event; -import icy.sequence.Sequence; - import java.util.List; -import mmcorej.TaggedImage; - import org.json.JSONObject; import org.micromanager.api.SequenceSettings; +import icy.sequence.Sequence; +import mmcorej.TaggedImage; import plugins.tprovoost.Microscopy.MicroManager.MicroManager; import plugins.tprovoost.Microscopy.MicroManager.tools.MMUtils; import plugins.tprovoost.Microscopy.MicroManagerForIcy.MicroscopePlugin; @@ -21,7 +19,7 @@ public interface AcquisitionListener { /** * Called when a new image is captured from a core sequence acquisition (not continuous - * sequence acquisition).</br> + * sequence acquisition).<br> * You can retrieve the current global acquisition result by using {@link MicroManager#getAcquisitionResult()} if * acquisition storage is enabled. * @@ -37,6 +35,11 @@ public interface AcquisitionListener /** * Callback when {@link MicroManager#startAcquisition(int, double)} have * been called by a {@link MicroscopePlugin} + * + * @param settings + * SequenceSetting object + * @param metadata + * JSON metadata object */ public void acquisitionStarted(SequenceSettings settings, JSONObject metadata); diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/event/LiveListener.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/event/LiveListener.java index c41bc09ad77f86b2f88a4b19a3425bfe5e38812c..cf56aad2995947ca3be098ba0be3506ce8288d2d 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/event/LiveListener.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/event/LiveListener.java @@ -1,9 +1,8 @@ package plugins.tprovoost.Microscopy.MicroManager.event; -import icy.sequence.Sequence; - import java.util.List; +import icy.sequence.Sequence; import mmcorej.TaggedImage; import plugins.tprovoost.Microscopy.MicroManager.MicroManager; import plugins.tprovoost.Microscopy.MicroManager.tools.MMUtils; @@ -15,9 +14,9 @@ import plugins.tprovoost.Microscopy.MicroManager.tools.MMUtils; public interface LiveListener { /** - * Called when a new image is captured by the core when live mode is on.<br/> + * Called when a new image is captured by the core when live mode is on.<br> * Note that the new image properties may have changed (such as the image size, binning, - * exposure...)<br/> + * exposure...)<br> * Note that you can easily convert TaggedImage to Icy image by using * {@link MMUtils#setImage(Sequence, TaggedImage)} or {@link MMUtils#convertToIcyImage(List)} methods. * diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/AboutPanel.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/AboutPanel.java index 85dcc8bdc9359cf369e29badf32ad8c2f619c3fe..1fcdb07afb8aa9bdc574d3eabf19dea5824097fe 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/AboutPanel.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/AboutPanel.java @@ -1,7 +1,5 @@ package plugins.tprovoost.Microscopy.MicroManager.gui; -import icy.network.NetworkUtil; - import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionListener; @@ -19,6 +17,8 @@ import javax.swing.border.EmptyBorder; import org.micromanager.MMVersion; +import icy.network.NetworkUtil; + public class AboutPanel extends JPanel { /** @@ -30,6 +30,9 @@ public class AboutPanel extends JPanel /** * Create the panel. + * + * @param OkAction + * action to execute on OK button click */ public AboutPanel(ActionListener OkAction) { @@ -45,18 +48,17 @@ public class AboutPanel extends JPanel { setBorder(new EmptyBorder(10, 10, 10, 10)); JPanel center = new JPanel(new BorderLayout()); - final JLabel value = new JLabel( - "<html><body>" - + "<h2>About</h2><p>Micro-Manager for Icy is being developed by Stephane Dallongeville, Irsath Nguyen and Thomas Provoost." - + "<br/>Copyright 2016, Institut Pasteur</p><br/>" - + "<p>This plugin is based on Micro-Manager? " + MMVersion.VERSION_STRING - + " which is developed under the following license:<br/>" - + "<i>This software is distributed free of charge in the hope that it will be<br/>" - + "useful, but WITHOUT ANY WARRANTY; without even the implied<br/>" - + "warranty of merchantability or fitness for a particular purpose. In no<br/>" - + "event shall the copyright owner or contributors be liable for any direct,<br/>" - + "indirect, incidental spacial, examplary, or consequential damages.<br/>" - + "Copyright University of California San Francisco, 2010. All rights reserved.</i>" + "</p>" + "</body></html>"); + final JLabel value = new JLabel("<html><body>" + + "<h2>About</h2><p>Micro-Manager for Icy is being developed by Stephane Dallongeville, Irsath Nguyen and Thomas Provoost." + + "<br/>Copyright 2016, Institut Pasteur</p><br/>" + "<p>This plugin is based on Micro-Manager? " + + MMVersion.VERSION_STRING + " which is developed under the following license:<br/>" + + "<i>This software is distributed free of charge in the hope that it will be<br/>" + + "useful, but WITHOUT ANY WARRANTY; without even the implied<br/>" + + "warranty of merchantability or fitness for a particular purpose. In no<br/>" + + "event shall the copyright owner or contributors be liable for any direct,<br/>" + + "indirect, incidental spacial, examplary, or consequential damages.<br/>" + + "Copyright University of California San Francisco, 2010. All rights reserved.</i>" + "</p>" + + "</body></html>"); JLabel link = new JLabel("<html><a href=\"\">For more information, please follow this link.</a></html>"); link.addMouseListener(new MouseAdapter() { diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/AcquisitionInfoPanel.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/AcquisitionInfoPanel.java index d24a3b894f78dd78d3069a28cbb24e31161effe6..f86d481cdc5c8ec4894a71e16f77abfd4920ac84 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/AcquisitionInfoPanel.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/AcquisitionInfoPanel.java @@ -38,6 +38,8 @@ public class AcquisitionInfoPanel extends JPanel implements Runnable /** * Create the panel. + * + * @param mainFrame the attached {@link MMMainFrame} object */ public AcquisitionInfoPanel(MMMainFrame mainFrame) { diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/ActionsPanel.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/ActionsPanel.java index 2e1b1b64046b95a69ce9fc6c9084e312088ef1dc..05f3e81866b6c9b452e40c6171d7e865b99e2004 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/ActionsPanel.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/ActionsPanel.java @@ -64,6 +64,9 @@ public class ActionsPanel extends JPanel implements LiveListener, SequenceListen /** * Create the panel. + * + * @param mainFrame + * the attached {@link MMMainFrame} object */ public ActionsPanel(MMMainFrame mainFrame) { diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/CameraSettingsPanel.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/CameraSettingsPanel.java index 8eea7b4965b2003870057294e1dac9b8aa7df886..97439afe75511e92623d09bb61021c64be14e151 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/CameraSettingsPanel.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/CameraSettingsPanel.java @@ -1,15 +1,5 @@ package plugins.tprovoost.Microscopy.MicroManager.gui; -import icy.gui.component.NumberTextField; -import icy.gui.component.NumberTextField.ValueChangeListener; -import icy.gui.component.button.IcyButton; -import icy.gui.component.button.IcyToggleButton; -import icy.gui.dialog.MessageDialog; -import icy.resource.icon.IcyIcon; -import icy.system.IcyExceptionHandler; -import icy.system.thread.ThreadUtil; -import icy.util.StringUtil; - import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; @@ -27,6 +17,15 @@ import javax.swing.border.TitledBorder; import org.micromanager.MMStudio; +import icy.gui.component.NumberTextField; +import icy.gui.component.NumberTextField.ValueChangeListener; +import icy.gui.component.button.IcyButton; +import icy.gui.component.button.IcyToggleButton; +import icy.gui.dialog.MessageDialog; +import icy.resource.icon.IcyIcon; +import icy.system.IcyExceptionHandler; +import icy.system.thread.ThreadUtil; +import icy.util.StringUtil; import mmcorej.CMMCore; import mmcorej.DeviceType; import mmcorej.MMCoreJ; @@ -67,6 +66,9 @@ public class CameraSettingsPanel extends JPanel implements Runnable /** * Create the panel. + * + * @param mainFrame + * the attached {@link MMMainFrame} object */ public CameraSettingsPanel(MMMainFrame mainFrame) { diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/ConfigurationPanel.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/ConfigurationPanel.java index 81d2caa26d210771eafc9cdb0524d633e062d08d..2a92aee27013bebd1ba9dc16417a16a631e7c11b 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/ConfigurationPanel.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/ConfigurationPanel.java @@ -1,13 +1,5 @@ package plugins.tprovoost.Microscopy.MicroManager.gui; -import icy.gui.component.button.IcyButton; -import icy.gui.dialog.ConfirmDialog; -import icy.gui.dialog.MessageDialog; -import icy.resource.ResourceUtil; -import icy.resource.icon.IcyIcon; -import icy.system.thread.ThreadUtil; -import icy.util.StringUtil; - import java.awt.BorderLayout; import java.awt.Font; import java.awt.GridBagConstraints; @@ -23,13 +15,19 @@ import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.border.TitledBorder; -import mmcorej.CMMCore; - import org.micromanager.ConfigGroupPad; import org.micromanager.MMStudio; import org.micromanager.dialogs.GroupEditor; import org.micromanager.dialogs.PresetEditor; +import icy.gui.component.button.IcyButton; +import icy.gui.dialog.ConfirmDialog; +import icy.gui.dialog.MessageDialog; +import icy.resource.ResourceUtil; +import icy.resource.icon.IcyIcon; +import icy.system.thread.ThreadUtil; +import icy.util.StringUtil; +import mmcorej.CMMCore; import plugins.tprovoost.Microscopy.MicroManager.tools.MMUtils; public class ConfigurationPanel extends JPanel @@ -51,6 +49,9 @@ public class ConfigurationPanel extends JPanel /** * Create the panel. + * + * @param mainFrame + * the attached {@link MMMainFrame} object */ public ConfigurationPanel(MMMainFrame mainFrame) { @@ -190,12 +191,12 @@ public class ConfigurationPanel extends JPanel final String groupName = MMUtils.getSelectedGroupName(groupPad); if (StringUtil.isEmpty(groupName)) - MessageDialog - .showDialog("To remove a group, please select it first then press the remove group button."); + MessageDialog.showDialog( + "To remove a group, please select it first then press the remove group button."); else { - if (ConfirmDialog.confirm("Remove group", "Are you sure you want to remove group " + groupName - + " and all associated presets ?")) + if (ConfirmDialog.confirm("Remove group", + "Are you sure you want to remove group " + groupName + " and all associated presets ?")) { try { @@ -242,8 +243,8 @@ public class ConfigurationPanel extends JPanel final String groupName = MMUtils.getSelectedGroupName(groupPad); if (StringUtil.isEmpty(groupName)) - MessageDialog - .showDialog("To add a preset to a group, please select the group first then press the add preset button."); + MessageDialog.showDialog( + "To add a preset to a group, please select the group first then press the add preset button."); else { final PresetEditor pe = new PresetEditor(groupName, "", getMMStudio(), getCore(), true); @@ -275,8 +276,8 @@ public class ConfigurationPanel extends JPanel final String presetName = MMUtils.getSelectedPresetName(groupPad); if (StringUtil.isEmpty(groupName) || StringUtil.isEmpty(presetName)) - MessageDialog - .showDialog("To edit a preset, please select the preset first then press the edit preset button."); + MessageDialog.showDialog( + "To edit a preset, please select the preset first then press the edit preset button."); else { final PresetEditor pe = new PresetEditor(groupName, presetName, getMMStudio(), getCore(), false); @@ -301,15 +302,15 @@ public class ConfigurationPanel extends JPanel final String presetName = MMUtils.getSelectedPresetName(groupPad); if (StringUtil.isEmpty(groupName) || StringUtil.isEmpty(presetName)) - MessageDialog - .showDialog("To remove a preset from a group, please select preset first then press the remove button."); + MessageDialog.showDialog( + "To remove a preset from a group, please select preset first then press the remove button."); else { if (getCore().getAvailableConfigs(groupName).size() == 1L) { - if (ConfirmDialog.confirm("Remove last preset in group", "'" + presetName - + "' is the last preset for the '" + groupName - + "' group.\nDelete both preset and group ?")) + if (ConfirmDialog.confirm("Remove last preset in group", + "'" + presetName + "' is the last preset for the '" + groupName + + "' group.\nDelete both preset and group ?")) { try { diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/LiveSettingsPanel.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/LiveSettingsPanel.java index 4e84235f6e5da639b323cbe983b59d34f57c1789..1aec464a6d4f3d174a41ad76dd372c45747cb74e 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/LiveSettingsPanel.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/LiveSettingsPanel.java @@ -26,6 +26,12 @@ public class LiveSettingsPanel extends JPanel private JLabel lblNewLabel; private NumberTextField zStepField; + /** + * Create the panel. + * + * @param mainFrame + * the attached {@link MMMainFrame} object + */ public LiveSettingsPanel(MMMainFrame mainFrame) { super(); @@ -37,7 +43,8 @@ public class LiveSettingsPanel extends JPanel private void initialize() { - setBorder(new TitledBorder(null, "Snap / Live / Album settings", TitledBorder.LEADING, TitledBorder.TOP, null, null)); + setBorder(new TitledBorder(null, "Snap / Live / Album settings", TitledBorder.LEADING, TitledBorder.TOP, null, + null)); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[] {60, 0, 60, 0, 60, 0, 0}; diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/LoadFrame.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/LoadFrame.java index 6805976f81f294fe859eaee315171d1b52be24c1..c494bcbfceaf47dd662d6582ed7a5078a0c68a2e 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/LoadFrame.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/LoadFrame.java @@ -1,16 +1,5 @@ package plugins.tprovoost.Microscopy.MicroManager.gui; -import icy.action.IcyAbstractAction; -import icy.file.FileUtil; -import icy.gui.component.button.IcyButton; -import icy.gui.dialog.MessageDialog; -import icy.gui.dialog.OpenDialog; -import icy.main.Icy; -import icy.preferences.PluginsPreferences; -import icy.preferences.XMLPreferences; -import icy.resource.ResourceUtil; -import icy.resource.icon.IcyIcon; - import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Font; @@ -40,6 +29,16 @@ import javax.swing.border.EmptyBorder; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; +import icy.action.IcyAbstractAction; +import icy.file.FileUtil; +import icy.gui.component.button.IcyButton; +import icy.gui.dialog.MessageDialog; +import icy.gui.dialog.OpenDialog; +import icy.main.Icy; +import icy.preferences.PluginsPreferences; +import icy.preferences.XMLPreferences; +import icy.resource.ResourceUtil; +import icy.resource.icon.IcyIcon; import plugins.tprovoost.Microscopy.MicroManager.tools.MMUtils; import plugins.tprovoost.Microscopy.MicroManagerForIcy.MicromanagerPlugin; @@ -48,7 +47,9 @@ import plugins.tprovoost.Microscopy.MicroManagerForIcy.MicromanagerPlugin; * visible the first time the user launches the plugin, and when he hits the "Load Configuration" * button in the {@link MMMainFrame}. * - * @author Irsath Nguyen & Thomas Provoost + * @author Irsath Nguyen + * @author Thomas Provoost + * @author Stephane Dallongeville */ public class LoadFrame extends JDialog { @@ -164,8 +165,8 @@ public class LoadFrame extends JDialog } } else - _list_files - .setToolTipText("Double click on a file or select it then click on 'Open File' to open it."); + _list_files.setToolTipText( + "Double click on a file or select it then click on 'Open File' to open it."); } }); _list_files.addMouseListener(new MouseAdapter() diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/MMMainFrame.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/MMMainFrame.java index 01139d040b4514ad675be4b08062edaf1b1b987c..87ae10848f21623723c6ba5ce13041bd2701407b 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/MMMainFrame.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/MMMainFrame.java @@ -1,28 +1,5 @@ package plugins.tprovoost.Microscopy.MicroManager.gui; -import icy.common.MenuCallback; -import icy.file.FileUtil; -import icy.gui.dialog.ActionDialog; -import icy.gui.dialog.ConfirmDialog; -import icy.gui.dialog.MessageDialog; -import icy.gui.dialog.SaveDialog; -import icy.gui.frame.IcyFrame; -import icy.gui.frame.IcyFrameAdapter; -import icy.gui.frame.IcyFrameEvent; -import icy.gui.frame.progress.FailedAnnounceFrame; -import icy.gui.frame.progress.ToolTipFrame; -import icy.gui.util.ComponentUtil; -import icy.main.Icy; -import icy.preferences.PluginPreferences; -import icy.preferences.XMLPreferences; -import icy.resource.ResourceUtil; -import icy.resource.icon.IcyIcon; -import icy.system.IcyExceptionHandler; -import icy.system.SystemUtil; -import icy.system.thread.ThreadUtil; -import icy.util.ReflectionUtil; -import icy.util.StringUtil; - import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; @@ -51,6 +28,28 @@ import org.micromanager.conf2.MicroscopeModel; import org.micromanager.dialogs.CalibrationListDlg; import org.micromanager.utils.ReportingUtils; +import icy.common.MenuCallback; +import icy.file.FileUtil; +import icy.gui.dialog.ActionDialog; +import icy.gui.dialog.ConfirmDialog; +import icy.gui.dialog.MessageDialog; +import icy.gui.dialog.SaveDialog; +import icy.gui.frame.IcyFrame; +import icy.gui.frame.IcyFrameAdapter; +import icy.gui.frame.IcyFrameEvent; +import icy.gui.frame.progress.FailedAnnounceFrame; +import icy.gui.frame.progress.ToolTipFrame; +import icy.gui.util.ComponentUtil; +import icy.main.Icy; +import icy.preferences.PluginPreferences; +import icy.preferences.XMLPreferences; +import icy.resource.ResourceUtil; +import icy.resource.icon.IcyIcon; +import icy.system.IcyExceptionHandler; +import icy.system.SystemUtil; +import icy.system.thread.ThreadUtil; +import icy.util.ReflectionUtil; +import icy.util.StringUtil; import mmcorej.CMMCore; import mmcorej.MMCoreJ; import mmcorej.MMEventCallback; @@ -602,17 +601,17 @@ public class MMMainFrame extends IcyFrame } }); -// JMenuItem mmConfigProcessors = new JMenuItem("Configure processors..."); -// mmConfigProcessors.setIcon(new IcyIcon(ResourceUtil.ICON_LIGHTING, true)); -// mmConfigProcessors.setToolTipText("Configure on the fly image processors..."); -// mmConfigProcessors.addActionListener(new ActionListener() -// { -// @Override -// public void actionPerformed(ActionEvent e) -// { -// mmstudio.showPipelinePanel(); -// } -// }); + // JMenuItem mmConfigProcessors = new JMenuItem("Configure processors..."); + // mmConfigProcessors.setIcon(new IcyIcon(ResourceUtil.ICON_LIGHTING, true)); + // mmConfigProcessors.setToolTipText("Configure on the fly image processors..."); + // mmConfigProcessors.addActionListener(new ActionListener() + // { + // @Override + // public void actionPerformed(ActionEvent e) + // { + // mmstudio.showPipelinePanel(); + // } + // }); JMenuItem mmScriptPanel = new JMenuItem("Script panel"); mmScriptPanel.setIcon(new IcyIcon(ResourceUtil.getAlphaIconAsImage("text_curstor"), true)); @@ -637,7 +636,7 @@ public class MMMainFrame extends IcyFrame // toReturn.insertSeparator(idx++); toReturn.insert(propertyBrowserItem, idx++); toReturn.insert(menuPxSizeConfigItem, idx++); -// toReturn.insert(mmConfigProcessors, idx++); + // toReturn.insert(mmConfigProcessors, idx++); toReturn.insert(mmScriptPanel, idx++); toReturn.insert(mmSettingItem, idx++); toReturn.insertSeparator(idx++); @@ -746,34 +745,48 @@ public class MMMainFrame extends IcyFrame } } + /** + * @return the {@link MMStudio} object + */ public MMStudio getMMStudio() { return mmstudio; } + /** + * @return the {@link AcquisitionHandler} object + */ public AcquisitionHandler getAcquisitionHandler() { return acquisitionHandler; } + /** + * @return the {@link MMOptions} object + */ public MMOptions getOptions() { return options; } + /** + * @return the {@link Preferences} object + */ public Preferences getMainPreferences() { return mainPreferences; } + /** + * @return the {@link XMLPreferences} object + */ public XMLPreferences getPreferences() { return preferences; } /** - * Returns the "enable storage of last acquisition" state. - * + * @return the "enable storage of last acquisition" state. * @see #setStoreLastAcquisition(boolean) * @see MicroManager#getAcquisitionResult() */ @@ -786,6 +799,8 @@ public class MMMainFrame extends IcyFrame * Enable storage of last acquisition so it can be retrieved with {@link MicroManager#getAcquisitionResult()}.<br> * Set to <code>true</code> by default. * + * @param value + * <code>true</code> to enable storage of last acquisition, <code>false</code> otherwise * @see MicroManager#getAcquisitionResult() */ public void setStoreLastAcquisition(boolean value) @@ -794,8 +809,7 @@ public class MMMainFrame extends IcyFrame } /** - * Enable immediate display of image acquisition. - * + * @return state of immediate display of image acquisition. * @see MicroManager#startAcquisition(int, double) */ public boolean getDisplayAcquisitionSequence() @@ -806,6 +820,8 @@ public class MMMainFrame extends IcyFrame /** * Enable immediate display of image acquisition. * + * @param value + * <code>true</code> to enable immediate display of acquisition, <code>false</code> otherwise * @see MicroManager#startAcquisition(int, double) */ public void setDisplayAcquisitionSequence(boolean value) @@ -831,7 +847,7 @@ public class MMMainFrame extends IcyFrame * Adds the plugin to the plugin list of MMMainFrame. * * @param plugin - * : plugin to be added. + * plugin to be added * @see #removePlugin(MicroscopePlugin) */ public void addPlugin(MicroscopePlugin plugin) @@ -845,7 +861,7 @@ public class MMMainFrame extends IcyFrame * using the acquisition is running, acquisition is stopped. * * @param plugin - * : plugin to be removed. + * plugin to be removed. * @see #addPlugin(MicroscopePlugin) */ public void removePlugin(MicroscopePlugin plugin) diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/MainPanel.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/MainPanel.java index 4e9b38e338afa7ad4d6f00e970720597b6a91f07..9d75dcd4d7b754b8cd267ed18f868445966a7b47 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/MainPanel.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/MainPanel.java @@ -25,6 +25,12 @@ public class MainPanel extends JPanel public AcquisitionInfoPanel acquisitionInfoPanel; public PluginsToolbar pluginsPanel; + /** + * Create the panel. + * + * @param mainFrame + * the attached {@link MMMainFrame} object + */ public MainPanel(MMMainFrame mainFrame) { super(); diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/PluginsToolbar.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/PluginsToolbar.java index 1ade4b785259a83d19ce8429cd63f963623cb6b6..0787b65dc2cfa68c243388c1eef3480be1d554d9 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/PluginsToolbar.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/gui/PluginsToolbar.java @@ -32,6 +32,9 @@ public class PluginsToolbar extends JPanel /** * Create the panel. + * + * @param mainFrame + * the attached {@link MMMainFrame} object */ public PluginsToolbar(MMMainFrame mainFrame) { @@ -70,15 +73,15 @@ public class PluginsToolbar extends JPanel })); } -// if (plugins.size() == 0) -// { -// MessageDialog.showDialog("Information", -// "You don't have any Micro manager plugins installed, use the search bar to install some", -// MessageDialog.INFORMATION_MESSAGE); -// -// // search for micro manager plugin -// // Icy.getMainInterface().getSearchEngine().search("micro-manager"); -// } + // if (plugins.size() == 0) + // { + // MessageDialog.showDialog("Information", + // "You don't have any Micro manager plugins installed, use the search bar to install some", + // MessageDialog.INFORMATION_MESSAGE); + // + // // search for micro manager plugin + // // Icy.getMainInterface().getSearchEngine().search("micro-manager"); + // } setLayout(new BorderLayout()); setBorder(new TitledBorder("Plugins")); @@ -107,7 +110,7 @@ public class PluginsToolbar extends JPanel * Adds the plugin to the active plugin list of MMMainFrame. * * @param plugin - * : plugin to be added. + * plugin to be added. * @see #removePlugin(MicroscopePlugin) */ public void addPlugin(MicroscopePlugin plugin) @@ -120,7 +123,7 @@ public class PluginsToolbar extends JPanel * Removes the plugin from the active plugin list of MMMainFrame. * * @param plugin - * : plugin to be removed. + * plugin to be removed. * @see #addPlugin(MicroscopePlugin) */ public void removePlugin(MicroscopePlugin plugin) @@ -130,7 +133,7 @@ public class PluginsToolbar extends JPanel } /** - * Returns list of active Microscope Plugin + * @return list of active Microscope Plugin */ public List<MicroscopePlugin> getRunningPlugins() { @@ -138,7 +141,7 @@ public class PluginsToolbar extends JPanel } /** - * Returns number of active Microscope Plugin + * @return number of active Microscope Plugin */ public int getRunningPluginsCount() { diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/patch/MMStudioMethods.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/patch/MMStudioMethods.java index a135ef708d741f8b2346a8a7b76318a962591c2e..07bf2edbf40d021d5d71f4c57c0d1e3d901d366b 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/patch/MMStudioMethods.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/patch/MMStudioMethods.java @@ -63,13 +63,26 @@ import plugins.tprovoost.Microscopy.MicroManager.MicroManager; */ public class MMStudioMethods { - /** Replaces <code>MMStudio.isLiveModeOn()</code> method */ + /** + * @deprecated Use {@link MicroManager#isLiveRunning()} instead + * @param obj + * MMStudio object + * @return live mode state + */ + @Deprecated public static boolean isLiveModeOn(final MMStudio obj) { return MicroManager.isLiveRunning(); } - /** Replaces <code>MMStudio.enableLiveMode(boolean enable)</code> method */ + /** + * @deprecated Use {@link MicroManager#startLiveMode()} / {@link MicroManager#startLiveMode()} instead + * @param obj + * MMStudio object + * @param enable + * enable state + */ + @Deprecated public static void enableLiveMode(final MMStudio obj, final boolean enable) { try diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/FrameUtils.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/FrameUtils.java index 83a7c98889cf5ad6f6d1ead7e8c611ec538184c3..2856b889908b20106dbf35172f9cb6abe4c1a6d3 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/FrameUtils.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/FrameUtils.java @@ -23,6 +23,13 @@ import icy.resource.icon.IcyIcon; */ public class FrameUtils { + /** + * Add the specified MM window to Icy desktop pane (transforming it as an {@link IcyFrame} in the process) + * + * @param window + * the window to add to the main pane + * @return the window converted as an {@link IcyFrame} + */ public static IcyFrame addMMWindowToDesktopPane(Window window) { IcyFrame frame = GuiUtil.createIcyFrameFromWindow(window); @@ -30,7 +37,16 @@ public class FrameUtils frame.setVisible(true); return frame; } - + + /** + * Find a button from its label in the specified container + * + * @param container + * the container containing the button we are looking for + * @param label + * button label + * @return the button searched or <code>null</code> if was not found + */ public static JButton findButtonComponents(Container container, String label) { for (Component c : container.getComponents()) @@ -47,13 +63,16 @@ public class FrameUtils return null; } - /** + * Create an {@link IcyButton} from given information + * * @param buttonText + * button text * @param iconPath - * may be null, if no icon wanted + * the icon path. Can be null if no icon wanted * @param action - * @return an IcyButton with buttonText and an icon on it if iconPath not null.<br /> + * the action to execute when button is clicked + * @return an IcyButton with buttonText and an icon on it if iconPath not null.<br> * The button returned have an actionListener wich execute the runnable. */ public static IcyButton createUIButton(String buttonText, String iconPath, final Runnable action) @@ -75,6 +94,12 @@ public class FrameUtils } /** + * Create a button to launch the specified plugin + * + * @param plugin + * plugin descriptor + * @param action + * the action to execute when we click on the button * @return an IcyButton with text and icon describing the specified plugin. */ public static IcyButton createPluginButton(PluginDescriptor plugin, ActionListener action) @@ -87,5 +112,4 @@ public class FrameUtils return result; } - } diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/ImageGetter.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/ImageGetter.java index e9b6eeff719b89c41378e8ebc9c4003670627f81..ff18948b87edb3e16cf6ef9789f6d65c956c5709 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/ImageGetter.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/ImageGetter.java @@ -1,15 +1,13 @@ package plugins.tprovoost.Microscopy.MicroManager.tools; -import icy.image.IcyBufferedImage; -import icy.type.collection.array.Array1DUtil; - import java.util.List; -import mmcorej.CMMCore; -import mmcorej.TaggedImage; - import org.json.JSONException; +import icy.image.IcyBufferedImage; +import icy.type.collection.array.Array1DUtil; +import mmcorej.CMMCore; +import mmcorej.TaggedImage; import plugins.tprovoost.Microscopy.MicroManager.MicroManager; /** @@ -20,6 +18,11 @@ public class ImageGetter { /** * @deprecated Use {@link MMUtils#convertToIcyImage(List)} instead. + * @param images + * the list of {@link TaggedImage} to convert + * @return the {@link IcyBufferedImage} image + * @throws JSONException + * if an error occurred while reading the metadata */ @Deprecated public static IcyBufferedImage convertToIcyImage(List<TaggedImage> images) throws JSONException @@ -29,6 +32,11 @@ public class ImageGetter /** * @deprecated Use {@link MMUtils#convertToIcyImage(TaggedImage)} instead. + * @param image + * the input {@link TaggedImage} to convert + * @return the resulting {@link IcyBufferedImage} image + * @throws JSONException + * if an error occurred while reading the metadata */ @Deprecated public static IcyBufferedImage convertToIcyImage(TaggedImage image) throws JSONException @@ -56,6 +64,9 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#getLastImage()} instead. + * @return the last image captured from the micro manager continuous acquisition. + * @throws Exception + * if an error occurred while retrieved last image */ @Deprecated public static IcyBufferedImage getLastImage() throws Exception @@ -65,6 +76,10 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#getLastTaggedImage()} instead. + * @return a list of {@link TaggedImage} representing the last image captured from the micro + * manager continuous acquisition. + * @throws Exception + * if an error occurred while retrieved last tagged images */ @Deprecated public static List<TaggedImage> getLastTaggedImage() throws Exception @@ -74,6 +89,9 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#snapImage()} instead. + * @return the captured image or <code>null</code> if conversion failed + * @throws Exception + * if an error occurred */ @Deprecated public static IcyBufferedImage snapImage() throws Exception @@ -83,6 +101,9 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#snapTaggedImage()} instead. + * @return the captured image as List of {@link TaggedImage} + * @throws Exception + * if an error occurred */ @Deprecated public static List<TaggedImage> snapTaggedImage() throws Exception @@ -94,6 +115,7 @@ public class ImageGetter * Use this method to only get the data of a snapped image. Uses short. * * @param core + * micro-manager core * @return Returns data in int. Returns null if an error occurs (Mostly when acquisition is * running). * @deprecated use {@link #snapImageFromCore()} instead. @@ -127,7 +149,7 @@ public class ImageGetter * * @deprecated use {@link #snapImageFromLive()} instead. * @param core - * : reference to actual core + * reference to actual core * @return Returns a data short[] image. Returns null if an error occurs * (mostly when acquisition sequence has not yet been run). */ @@ -155,6 +177,9 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#snapImage()} instead. + * @return the captured image or <code>null</code> if an error occurred + * @throws Exception + * if an error occurred */ @Deprecated public static IcyBufferedImage snapIcyImageFromCore() throws Exception @@ -164,6 +189,9 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#snapImage()} instead. + * @return the captured image from live or <code>null</code> if an error occurred + * @throws Exception + * if an error occurred */ @Deprecated public static IcyBufferedImage snapImageFromLiveToIcy() throws Exception @@ -173,6 +201,9 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#snapImage()} instead. + * @return the captured image or <code>null</code> if an error occurred + * @throws Exception + * if an error occurred */ @Deprecated public static IcyBufferedImage snapImageFromCoreToIcy() throws Exception @@ -182,6 +213,9 @@ public class ImageGetter /** * @deprecated Use {@link #snapImage()} instead. + * @return the captured image or <code>null</code> if an error occurred + * @throws Exception + * if an error occurred */ @Deprecated public static IcyBufferedImage snapIcyImage() throws Exception @@ -191,6 +225,9 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#snapImage()} instead. + * @return the captured image or <code>null</code> if an error occurred + * @throws Exception + * if an error occurred */ @Deprecated public static IcyBufferedImage snapToIcy() throws Exception @@ -200,6 +237,9 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#snapTaggedImage()} instead. + * @return the captured {@link TaggedImage} or <code>null</code> if an error occurred + * @throws Exception + * if an error occurred */ @Deprecated public static TaggedImage snapImageFromCore() throws Exception @@ -214,6 +254,11 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#getLastImage()} instead. + * @param remove + * indicate if we want to remove the image from the acquisition stack + * @return the last image captured from the micro manager continuous acquisition. + * @throws Exception + * if an error occurred while retrieved last image */ @Deprecated public static IcyBufferedImage snapIcyImageFromLive(boolean remove) throws Exception @@ -223,6 +268,9 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#getLastImage()} instead. + * @return the last image captured from the micro manager continuous acquisition. + * @throws Exception + * if an error occurred while retrieved last image */ @Deprecated public static IcyBufferedImage snapIcyImageFromLive() throws Exception @@ -232,6 +280,11 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#getLastTaggedImage()} + * @param remove + * indicate if we want to remove the image from the acquisition stack + * @return the last image captured from the micro manager continuous acquisition. + * @throws Exception + * if an error occurred while retrieved last image */ @Deprecated public static TaggedImage snapImageFromLive(boolean remove) throws Exception @@ -246,6 +299,9 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#getLastTaggedImage()} instead. + * @return the last image captured from the micro manager continuous acquisition. + * @throws Exception + * if an error occurred while retrieved last image */ @Deprecated public static TaggedImage snapImageFromLive() throws Exception @@ -260,6 +316,9 @@ public class ImageGetter /** * @deprecated Use {@link MicroManager#snapTaggedImage()} instead. + * @return the captured image as a {@link TaggedImage} + * @throws Exception + * if an error occurred */ @Deprecated public static TaggedImage snap() throws Exception diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/MMUtils.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/MMUtils.java index c9c72d375f1d1b86b2c93d648edeb2419ea24426..40d940d166d5ba7b183a4bb1648158291464a0bb 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/MMUtils.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/MMUtils.java @@ -70,7 +70,7 @@ public class MMUtils private static boolean loaded = false; /** - * Returns the Micro-Manager folder + * @return the Micro-Manager folder */ public static String getMicroManagerFolder() { @@ -81,11 +81,17 @@ public class MMUtils return uManagerRep; } + /** + * @return <code>true</code> if Micro-Manager library is loaded + */ public static boolean isSystemLibrairiesLoaded() { return loaded; } + /** + * @return <code>true</code> if Micro-Manager path has been correctly updated and library loaded. + */ public static boolean fixSystemLibrairies() { if (loaded) @@ -193,6 +199,9 @@ public class MMUtils return loaded; } + /** + * Reset the Micro-Manager library path + */ public static void resetLibrayPath() { prefs.put(MM_PATH_ID, ""); @@ -200,7 +209,9 @@ public class MMUtils } /** - * Return true if the specified list of TaggedImage contains a <code>null</code> or poison image. + * @param images + * the list of {@link TaggedImage} to test + * @return <code>true</code> if the specified list of TaggedImage contains a <code>null</code> or poison image. */ public static boolean hasNullOrPoison(List<TaggedImage> images) { @@ -215,7 +226,11 @@ public class MMUtils * Convert a list of {@link TaggedImage} (Micro Manager) to {@link IcyBufferedImage} (Icy) where each * {@link TaggedImage} represents one channel of the output image. * + * @param images + * the list of {@link TaggedImage} to convert + * @return the resulting {@link IcyBufferedImage} image * @throws JSONException + * if an error occurred while reading the metadata */ public static IcyBufferedImage convertToIcyImage(List<TaggedImage> images) throws JSONException { @@ -265,7 +280,11 @@ public class MMUtils /** * Convert a {@link TaggedImage} (Micro-Manager) to {@link IcyBufferedImage} (Icy). * + * @param img + * the input {@link TaggedImage} to convert + * @return the resulting {@link IcyBufferedImage} image * @throws JSONException + * if an error occurred while reading the metadata */ public static IcyBufferedImage convertToIcyImage(TaggedImage img) throws JSONException { @@ -275,8 +294,14 @@ public class MMUtils /** * Set Sequence metadata from the given JSON metadata object (can be image or summaryMetadata). * + * @param sequence + * the sequence we want to set metadata + * @param tags + * JSON metadata object * @throws JSONException + * if an error occurred while reading the metadata * @throws MMScriptException + * if an error occurred on MM script parsing */ public static void setMetadata(Sequence sequence, JSONObject tags) throws JSONException, MMScriptException { @@ -433,6 +458,8 @@ public class MMUtils /** * Set the TaggedImage metadata. * + * @param taggedImage + * the image we want to set metadata * @param t * wanted T position (frame) of the image, set to <code>-1</code> to keep current value * @param z @@ -446,6 +473,7 @@ public class MMUtils * @param sizeC * wanted global size C (number of channel), set to <code>-1</code> to keep current value * @throws JSONException + * if an error occurred while reading the metadata */ public static void setImageMetadata(TaggedImage taggedImage, int t, int z, int c, int sizeT, int sizeZ, int sizeC) throws JSONException @@ -470,7 +498,16 @@ public class MMUtils } /** - * Set image data + * Set {@link IcyBufferedImage} data from native Micro-Manager pixels data blob + * + * @param dest + * the {@link IcyBufferedImage} we want to set data + * @param pixels + * the pixel data in native micro-manager format + * @param channel + * the channel where we want to set data + * @param rgb + * <code>true</code> if the source data comes from a RGB image */ static void setImageData(IcyBufferedImage dest, Object pixels, int channel, boolean rgb) { @@ -515,8 +552,10 @@ public class MMUtils * metadata), set it to 0 to ignore it. * @return <code>true</code> if the operation succeed and <code>false</code> otherwise. * @throws JSONException + * if an error occurred while reading the metadata * @throws MMScriptException - * @see {@link #setImageMetadata(TaggedImage, int, int, int, int, int, int)} + * if an error occurred on MM script parsing + * @see #setImageMetadata(TaggedImage, int, int, int, int, int, int) */ public static boolean setImage(Sequence sequence, TaggedImage taggedImage, long startDate) throws JSONException, MMScriptException @@ -634,7 +673,9 @@ public class MMUtils * Tagged image to set in the sequence * @return <code>true</code> if the operation succeed and <code>false</code> otherwise. * @throws JSONException + * if an error occurred while reading the metadata * @throws MMScriptException + * if an error occurred on MM script parsing */ public static boolean setImage(Sequence sequence, TaggedImage taggedImage) throws JSONException, MMScriptException { @@ -642,11 +683,16 @@ public class MMUtils } /** - * Returns <code>true</code> if the sequence data format is compatible with specified JSON metadata (same dimension - * and same pixel format) - * + * @param sequence + * the sequence we want to test compatibility + * @param metadata + * JSON metadata object + * @return <code>true</code> if the sequence data format is compatible with specified JSON metadata (same dimension + * and same pixel format) * @throws JSONException + * if an error occurred while reading the metadata * @throws MMScriptException + * if an error occurred on MM script parsing */ public static boolean isCompatible(Sequence sequence, JSONObject metadata) throws JSONException, MMScriptException { @@ -661,11 +707,14 @@ public class MMUtils } /** - * Create an empty IcyBufferedImage using properties in given JSON metadata object. It can be either the one from - * TaggedImage or the summaryMetadata (see {@link MicroManager#getAcquisitionMetaData()}) - * + * @param metadata + * JSON metadata object + * @return an empty IcyBufferedImage using properties in given JSON metadata object.<br> + * It can be either the one from TaggedImage or the summaryMetadata (see {@link MicroManager#getAcquisitionMetaData()}) * @throws JSONException + * if an error occurred while reading the metadata * @throws MMScriptException + * if an error occurred on MM script parsing */ public static IcyBufferedImage createEmptyImage(JSONObject metadata) throws JSONException, MMScriptException { @@ -694,7 +743,9 @@ public class MMUtils } /** - * Returns the selected group name from specified ConfigGroupPad + * @param group + * the {@link ConfigGroupPad} name + * @return the selected group name from specified ConfigGroupPad */ public static String getSelectedGroupName(ConfigGroupPad group) { @@ -716,7 +767,9 @@ public class MMUtils } /** - * Returns the selected preset name from specified ConfigGroupPad + * @param group + * the {@link ConfigGroupPad} name + * @return the selected preset name from specified ConfigGroupPad */ public static String getSelectedPresetName(ConfigGroupPad group) { @@ -805,5 +858,4 @@ public class MMUtils return true; } - } \ No newline at end of file diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/StageMover.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/StageMover.java index 5c4c129ed190a05341d544dc32878cf37f50858b..4ee3b5c55b6c61a145c7c105c7bf202980962864 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/StageMover.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManager/tools/StageMover.java @@ -46,6 +46,12 @@ public class StageMover /** Constant value of the switch between x and y for stage movement */ private static final String SWITCHXY = "switchxy"; + /** + * Load the preferences. + * + * @param pref + * {@link XMLPreferences} node + */ public static void loadPreferences(XMLPreferences pref) { prefs = pref; @@ -60,7 +66,7 @@ public class StageMover * and focus device (x,y,z). * * @param sl - * : Listener object to be added. + * Listener object to be added. */ public static void addListener(StageListener sl) { @@ -71,76 +77,133 @@ public class StageMover * Add a listener to the Stage Mover. he stage will update the listeners with the new values. * * @param sl - * : Listener object to be removed. + * Listener object to be removed. */ public static void removeListener(StageListener sl) { _listeners.remove(sl); } + /** + * Remove all listeners + */ public static void clearListener() { _listeners.clear(); } + /** + * Set inverted X axis state. + * + * @param invertX + * invert X axis state to set + */ public static void setInvertX(boolean invertX) { StageMover.invertX = invertX; prefs.putBoolean(INVERTX, invertX); } + /** + * Set inverted Y axis state. + * + * @param invertY + * invert Y axis state to set + */ public static void setInvertY(boolean invertY) { StageMover.invertY = invertY; prefs.putBoolean(INVERTY, invertY); } + /** + * Set inverted Z axis state. + * + * @param invertZ + * invert Z axis state to set + */ public static void setInvertZ(boolean invertZ) { StageMover.invertZ = invertZ; prefs.putBoolean(INVERTZ, invertZ); } + /** + * @return state of X inverted axis. + */ public static boolean isInvertX() { return invertX; } + /** + * @return state of Y inverted axis. + */ public static boolean isInvertY() { return invertY; } + /** + * @return state of Y inverted axis. + */ public static boolean isInvertZ() { return invertZ; } + /** + * Switch X and Y axis. + * + * @param switchXY + * <code>true</code> to invert X a Y axis, <code>false</code> otherwise + */ public static void setSwitchXY(boolean switchXY) { StageMover.switchXY = switchXY; prefs.putBoolean(SWITCHXY, switchXY); } + /** + * @return state of X and Y axis inversion. + */ public static boolean isSwitchXY() { return switchXY; } + /** + * Fire Z stage position change event + * + * @param s + * stage devicce name + * @param z + * Z position + */ public static void onStagePositionChanged(String s, double z) { for (StageListener l : _listeners) l.onStagePositionChanged(s, z); } - public static void onXYStagePositionChanged(String s, double d, double d1) + /** + * Fire XY stage position change event + * + * @param s + * stage device name + * @param x + * X position + * @param y + * Y position + */ + public static void onXYStagePositionChanged(String s, double x, double y) { for (StageListener l : _listeners) - l.onXYStagePositionChanged(s, d, d1); + l.onXYStagePositionChanged(s, x, y); }; /** - * Returns current Stage device + * @return current XY Stage device */ public static String getXYStageDevice() { @@ -148,7 +211,7 @@ public class StageMover } /** - * Returns current focus (Z position) device + * @return current focus (Z position) device */ public static String getZFocusDevice() { @@ -156,7 +219,7 @@ public class StageMover } /** - * Blocking method. + * Wait XY stage device to reply. * * @throws Exception * if an error occurs @@ -170,7 +233,7 @@ public class StageMover } /** - * Blocking method. + * Wait Z stage device to reply. * * @throws Exception * if an error occurs @@ -184,9 +247,9 @@ public class StageMover } /** - * This method returns the coordinates x of the current stage device + * This method returns the X coordinate of the current stage device * - * @return Returns the coordinates x of the current stage device. + * @return the X coordinate of the current stage device. * @throws Exception * if an error occurs */ @@ -202,9 +265,9 @@ public class StageMover } /** - * This method returns the coordinates y of the current stage device + * This method returns the Y coordinate of the current stage device * - * @return Returns the coordinates y of the current stage device. + * @return the Y coordinate of the current stage device. * @throws Exception * if an error occurs */ @@ -220,9 +283,9 @@ public class StageMover } /** - * This method returns the coordinates z of the current focus device + * This method returns the Z coordinates of the current focus device * - * @return Returns the coordinates z of the current focus device. + * @return the Z coordinate of the current focus device. * @throws Exception * if an error occurs */ @@ -238,8 +301,9 @@ public class StageMover } /** - * This method returns the coordinates x and y of the current stage device. + * This method returns the X and Y coordinates of the current stage device. * + * @return the X and Y coordinates of the current stage device. * @throws Exception * if an error occurs */ @@ -255,8 +319,9 @@ public class StageMover } /** - * This method returns the coordinates x and y of the current stage deviceand z coordinate of focus device. + * This method returns the X and Y coordinates of the current stage device and the Z coordinate of focus device. * + * @return the X, Y and Z coordinates of the current stage/focus device(s). * @throws Exception * if an error occurs */ @@ -267,9 +332,9 @@ public class StageMover } /** - * This method returns the coordinates x and y of the current stage device and z coordinate of focus device. + * This method returns the X and Y coordinates of the current stage device and the Z coordinate of focus device. * - * @return Returns [x, y, z] + * @return the X, Y and Z coordinates of the current stage/focus device(s) in double[3] format * @throws Exception * if an error occurs */ @@ -283,6 +348,8 @@ public class StageMover * Wait while stage device (XY position) is changing (blocking method). * * @return <code>false</code> if more than 5 seconds passed or <code>true</code> if the movement is done. + * @throws Exception + * if an error occurs */ public static boolean waitXYMoving() throws Exception { @@ -307,6 +374,8 @@ public class StageMover * Wait while focus device (Z position) is changing (blocking method). * * @return <code>false</code> if more than 5 seconds passed or <code>true</code> if the movement is done. + * @throws Exception + * if an error occurs */ public static boolean waitZMoving() throws Exception { @@ -331,6 +400,7 @@ public class StageMover * Stops the XY stage Movement. * * @throws Exception + * if an error occurs */ public static void stopXYStage() throws Exception { @@ -354,6 +424,7 @@ public class StageMover * Stops the Z focus Movement. * * @throws Exception + * if an error occurs */ public static void stopZFocus() throws Exception { @@ -379,6 +450,7 @@ public class StageMover * @param position * Z position (in ?m) * @throws Exception + * if an error occurs */ public static void moveZAbsolute(double position) throws Exception { @@ -386,7 +458,7 @@ public class StageMover } /** - * Moves the stage on the Z-Axis. <br/> + * Moves the stage on the Z-Axis. <br> * <b>You should wait for the microscope if you are planning to capture image after this call</b> * * @param position @@ -395,6 +467,7 @@ public class StageMover * wait for device to process command. Note that you can use {@link #waitZMoving()} to ensure Z stage * complete the movement. * @throws Exception + * if an error occurs * @see #moveZRelative(double, boolean) * @see #waitZMoving() */ @@ -427,6 +500,7 @@ public class StageMover * @param posY * y position wanted * @throws Exception + * if an error occurs */ public static void moveXYAbsolute(double posX, double posY) throws Exception { @@ -434,7 +508,7 @@ public class StageMover } /** - * Move the stage on the X and Y axes to the absolute position given by posX and posY. <br/> + * Move the stage on the X and Y axes to the absolute position given by posX and posY. <br> * <b>You should wait for the microscope if you are planning to capture image after this call</b> * * @param posX @@ -445,6 +519,7 @@ public class StageMover * wait for device to process command. Note that you can use {@link #waitXYMoving()} to ensure XY stage * complete the movement. * @throws Exception + * if an error occurs * @see #moveXYRelative(double, double, boolean) * @see #waitXYMoving() */ @@ -470,12 +545,13 @@ public class StageMover } /** - * Moves the stage on the Z-axis relative to current position. Wait for movement. <br/> + * Moves the stage on the Z-axis relative to current position. Wait for movement. <br> * <b>Relative move may not be accurate !</b> * * @param movement - * : movement (in ?m) + * movement (in um) * @throws Exception + * if an error occurs */ public static void moveZRelative(double movement) throws Exception { @@ -483,16 +559,17 @@ public class StageMover } /** - * Moves the stage on the Z-axis relative to current position. <br/> - * <b>Relative move may not be accurate !</b> <br/> + * Moves the stage on the Z-axis relative to current position. <br> + * <b>Relative move may not be accurate !</b> <br> * <b>You should wait for the microscope if you are planning to capture image after this call</b> * * @param movement - * Z movement (in ?m) + * Z movement (in um) * @param wait * wait for device to process command. Note that you can use {@link #waitZMoving()} to ensure Z stage * complete the movement. * @throws Exception + * if an error occurs * @see #moveZAbsolute(double, boolean) * @see #waitZMoving() */ @@ -521,14 +598,15 @@ public class StageMover } /** - * Moves the stage on the X and Y axes relative to actual position. Wait for movement. <br/> + * Moves the stage on the X and Y axes relative to actual position. Wait for movement. <br> * <b>Relative move may not be accurate !</b> * * @param movX - * movement on X-Axis (in ?m) + * movement on X-Axis (in um) * @param movY - * movement on Y-Axis (in ?m) + * movement on Y-Axis (in um) * @throws Exception + * if an error occurs */ public static void moveXYRelative(double movX, double movY) throws Exception { @@ -536,18 +614,19 @@ public class StageMover } /** - * Moves the stage on the X and Y axes relative to actual position. <br/> - * <b>Relative move may not be accurate !</b> <br/> + * Moves the stage on the X and Y axes relative to actual position. <br> + * <b>Relative move may not be accurate !</b> <br> * <b>You should wait for the microscope if you are planning to capture image after this call</b> * * @param movX - * movement on X-Axis (in ?m) + * movement on X-Axis (in um) * @param movY - * movement on Y-Axis (in ?m) + * movement on Y-Axis (in um) * @param wait * wait for device to process command. Note that you can use {@link #waitXYMoving()} to ensure XY stage * complete the movement. * @throws Exception + * if an error occurs * @see #moveXYAbsolute(double, double, boolean) * @see #waitXYMoving() */ @@ -582,8 +661,8 @@ public class StageMover /** * This method will move the stage to the ROI wanted in the Sequence. This call is blocking while the microscope not * finished it move. <b>Be careful, this method should not be used if the pixelSize configuration is not - * accurate.</b> <br/> - * <br/> + * accurate.</b> <br> + * <br> * <b>This movement may not be accurate !</b> * * @param s @@ -591,6 +670,7 @@ public class StageMover * @param roi * The ROI2D to focus on. * @throws Exception + * if an error occurs */ public static void moveStageToROI(Sequence s, ROI2D roi) throws Exception { @@ -610,7 +690,7 @@ public class StageMover /** * Move the stage to a specific point <b>in the sequence</b>. The movement will be relative to the actual position * of the stage, and relative to the center in the sequence. This call is blocking while the microscope not - * finished/ it move. <br/> + * finished/ it move. <br> * <b>This movement may not be accurate !</b> * * @param s @@ -620,6 +700,7 @@ public class StageMover * @param y * y value of the point we want to go to. * @throws Exception + * if an error occurs */ public static void moveToPoint(Sequence s, double x, double y) throws Exception { diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManagerForIcy/MicromanagerPlugin.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManagerForIcy/MicromanagerPlugin.java index dbf9003513f43412f07035bb5878740dddf58b16..9dd0164806c8b9139e225e459295373dce6c5b24 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManagerForIcy/MicromanagerPlugin.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManagerForIcy/MicromanagerPlugin.java @@ -34,6 +34,7 @@ public final class MicromanagerPlugin extends PluginActionable implements Plugin /** * @deprecated Only provided for backward compatibility. Use {@link MicroManager#getCore()} instead. + * @return micro-manager core */ @Deprecated public static CMMCore getCore() diff --git a/src/main/java/plugins/tprovoost/Microscopy/MicroManagerForIcy/MicroscopePlugin.java b/src/main/java/plugins/tprovoost/Microscopy/MicroManagerForIcy/MicroscopePlugin.java index ebd58e34a0aa63d8d68ccd7cac6467dd13b5bbaf..db051fc25de5bf5e21fb840927f873604c116a93 100644 --- a/src/main/java/plugins/tprovoost/Microscopy/MicroManagerForIcy/MicroscopePlugin.java +++ b/src/main/java/plugins/tprovoost/Microscopy/MicroManagerForIcy/MicroscopePlugin.java @@ -4,15 +4,16 @@ import icy.plugin.abstract_.Plugin; import plugins.tprovoost.Microscopy.MicroManager.MicroManager; /** - * This is the class to inherit in order to create a Microscope Plugin.<br/> + * This is the class to inherit in order to create a Microscope Plugin.<br> * Any {@link MicroscopePlugin} has to implement the start() method. That * way, you will have access to the main interface and the core, and your plugin - * will automatically wait for the Micro-Manager For Icy to be running.<br/> + * will automatically wait for the Micro-Manager For Icy to be running.<br> * <b>At the end of life of your plugin you should manually call shutdown()</b> * <p> - * <b>Example: </b></br> start() { <br/> - * System.out.println(core.getAPIVersionInfo());<br/> - * shutdown();<br/> + * <b>Example: </b><br> + * start() { <br> + * System.out.println(core.getAPIVersionInfo());<br> + * shutdown();<br> * } * </p> * @@ -33,18 +34,17 @@ public abstract class MicroscopePlugin extends Plugin } /** - * Method to define in sub-classes in replacement of usual run() method of - * Icy plugin's + * Method to define in sub-classes in replacement of usual run() method of Icy plugin's. * It is called only <b>AFTER</b> Micro-Manager For Icy is launched. */ public abstract void start(); /** - * Called when main Micro-Manager GUI is closed.<br/> + * Called when main Micro-Manager GUI is closed.<br> * Override this method to compute some special operation / data saving before exiting (like image saving, frame - * position saving...)<br/> + * position saving...)<br> * <b>You should dispose all your threads / resources using MicroManager in this method, remove all listeners and - * not use them anymore.</b><br/> + * not use them anymore.</b><br> * Don't delete the call to super.shutdown(); */ public void shutdown() @@ -54,6 +54,8 @@ public abstract class MicroscopePlugin extends Plugin /** * @deprecated No more supported (not really useful) + * @param value + * enable state */ @Deprecated public void showProgressBar(boolean value) @@ -72,6 +74,8 @@ public abstract class MicroscopePlugin extends Plugin /** * @deprecated No more supported (not really useful) + * @param progress + * progress value */ @Deprecated public void notifyProgress(int progress) @@ -83,6 +87,7 @@ public abstract class MicroscopePlugin extends Plugin * Override this method in order to listen to exposure changes. * * @param newExposure + * exposure to set */ public void onExposureChanged(double newExposure) { @@ -93,9 +98,11 @@ public abstract class MicroscopePlugin extends Plugin * Override this method in order to listen to core properties changes. * * @param deviceName + * device name * @param propName - * Defined as string's in MMCoreJ.getG_Keyword_[....] + * property name * @param propValue + * property value */ public void onCorePropertyChanged(String deviceName, String propName, String propValue) {