Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imagej prep #3329

Merged
merged 61 commits into from
Jan 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
7b1e83a
Initial clean up.
jburel Dec 19, 2014
f589556
Adjust container so correct agent is activated.
jburel Dec 19, 2014
6657436
Do not invoke shutdown twice when run as a plugin.
jburel Dec 21, 2014
35c87c8
Remove import and add doc.
jburel Dec 21, 2014
2b9a751
Fix terminate method.
jburel Dec 21, 2014
39cd8f0
remove imports.
jburel Dec 21, 2014
0f43ce2
Add option to import images from ImageJ
jburel Jan 5, 2015
93c1161
Modify text to match mock-up.
jburel Jan 5, 2015
68025f9
Remove imports
jburel Jan 5, 2015
d414142
Modify init sequence of agents when use as plugin.
jburel Jan 6, 2015
d74d299
Update header and remove import introduced while debugging.
jburel Jan 6, 2015
3ad6275
Refactor code to handle imagePlus object.
jburel Jan 9, 2015
3b76d97
Fix possible NPE.
jburel Jan 9, 2015
4bd4f4a
Add docs
jburel Jan 9, 2015
41e64c7
Generate ome.tiff if image is modified.
jburel Jan 9, 2015
acb46e7
Add compression parameter
jburel Jan 9, 2015
b1dcc9f
Pass lower case parameter.
jburel Jan 10, 2015
47a938d
Remove commented out code.
jburel Jan 10, 2015
9368fb2
Review way to specify parameter
jburel Jan 11, 2015
0c7d028
Rename tmp file.
jburel Jan 11, 2015
bb7f746
Fix possible NPE while adding listeners.
jburel Jan 11, 2015
0a6548f
Rename file as ome.tif.
jburel Jan 11, 2015
6d129cd
Review delete sequence.
jburel Jan 12, 2015
540179f
Review agents loading sequence.
jburel Jan 12, 2015
ccd7b3c
Use collectionUtils.
jburel Jan 12, 2015
8b6b2c6
Handle whitespace path.
jburel Jan 12, 2015
cc499be
Remove extension and set path to name.
jburel Jan 12, 2015
6aef02b
toString() method uses the original file.
jburel Jan 13, 2015
cd10aa4
Add message.
jburel Jan 13, 2015
b68810b
Add option to import as orphaned.
jburel Jan 13, 2015
bf59ef3
Handle file with space in name.
jburel Jan 13, 2015
40517f8
Fix possible NPE.
jburel Jan 13, 2015
074596e
Fix typo.
jburel Jan 13, 2015
0ab5d98
Fix possible NPE if no log id returned.
jburel Jan 13, 2015
3e10dd6
Initial work to support roi.
jburel Jan 13, 2015
e6c7ddb
read more shape types.
jburel Jan 14, 2015
e158a05
Remove imports
jburel Jan 14, 2015
3ab1ab9
Update ij.jar to match version in B-F
jburel Jan 14, 2015
34bf5bd
Add support for all roi types.
jburel Jan 14, 2015
831beaf
Open image in ImageJ when in import mode.
jburel Jan 14, 2015
d9d1f4b
Add support for roi settings.
jburel Jan 14, 2015
8035bd1
clean up.
jburel Jan 14, 2015
2cecad2
Add option to import current image or all images.
jburel Jan 15, 2015
c31ca93
Read from overlay
jburel Jan 15, 2015
c0c0550
Add image from manager if no overlay
jburel Jan 16, 2015
410053a
Remove not required IJ.log
jburel Jan 16, 2015
c5074f8
Fix display when importer opened from data manager.
jburel Jan 16, 2015
e676a6b
Add Save to OMERO to File>Import
jburel Jan 16, 2015
21179b8
Fix default dataset depending on context.
jburel Jan 16, 2015
6b8ff86
Fix entry in File menu.
jburel Jan 16, 2015
5a33c7d
Fix menu entry.
jburel Jan 19, 2015
c34d4a0
Fix import and reading of tiff files.
jburel Jan 20, 2015
6f1668d
Fix text as suggested by Petr.
jburel Jan 20, 2015
65ca404
Remove imports
jburel Jan 21, 2015
714e3ec
Handle addition of MIF to queue.
jburel Jan 21, 2015
1f2d966
Pass imageID to plugin
jburel Jan 22, 2015
97adb0e
Fix NPE if quit is pressed from login screen.
jburel Jan 22, 2015
1bcfea9
Prepare to save overlay on images from MIF.
jburel Jan 26, 2015
573a184
Improve support for MIF and overlay.
jburel Jan 27, 2015
50b80b5
Review reading of roi from manager.
jburel Jan 27, 2015
afc1ee6
Fix connect after quit
jburel Jan 27, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions components/blitz/src/pojos/ShapeSettingsData.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public Color getFill()
}

/**
* Set the fill colour.
* Set the fill color.
*
* @param fillColour See above.
*/
Expand All @@ -173,6 +173,7 @@ public void setFill(Color fillColour)
Shape shape = (Shape) asIObject();
if (shape == null)
throw new IllegalArgumentException("No shape specified.");
if (fillColour == null) return;
shape.setFillColor(rtypes.rint(fillColour.getRGB()));
setDirty(true);
}
Expand All @@ -192,7 +193,7 @@ public Color getStroke()
}

/**
* Set the stroke colour.
* Set the stroke color.
*
* @param strokeColour See above.
*/
Expand All @@ -201,6 +202,7 @@ public void setStroke(Color strokeColour)
Shape shape = (Shape) asIObject();
if (shape == null)
throw new IllegalArgumentException("No shape specified.");
if (strokeColour == null) return;
shape.setStrokeColor(rtypes.rint(strokeColour.getRGB()));
setDirty(true);
}
Expand Down
26 changes: 21 additions & 5 deletions components/insight/SRC/org/openmicroscopy/shoola/MainIJPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import java.io.File;
import java.io.IOException;
import java.security.CodeSource;
import java.util.ArrayList;
import java.util.List;

import javax.swing.BorderFactory;
import javax.swing.JButton;
Expand All @@ -48,12 +50,16 @@
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;



//Third-party libraries
import ij.IJ;
import ij.ImageJ;
import ij.plugin.BrowserLauncher;
import ij.plugin.PlugIn;



//Application-internal dependencies
import org.openmicroscopy.shoola.env.Container;
import org.openmicroscopy.shoola.env.LookupNames;
Expand Down Expand Up @@ -176,7 +182,7 @@ public void windowClosing(WindowEvent e) {
onImageJClosing();
}
});
if (view.getMenuBar().getMenuCount() > 0) {
if (view.getMenuBar() != null && view.getMenuBar().getMenuCount() > 0) {
Menu menu = view.getMenuBar().getMenu(0);
int count = menu.getItemCount();
if (count > 0) {
Expand Down Expand Up @@ -227,10 +233,21 @@ public void run(String args)
}
String home = "";
String configFile = null;
int index = LookupNames.IMAGE_J;
if (args != null) {
String[] values = args.split(" ");
if (values.length > 0) configFile = values[0];
if (values.length > 1) home = values[1];
List<String> l = new ArrayList<String>();
for (int i = 0; i < values.length; i++) {
String v = values[i];
if (v.startsWith("imageJ")) {
String[] k = v.split("=");
if (k.length == 2 && k[1].equals("import")) {
index = LookupNames.IMAGE_J_IMPORT;
}
} else l.add(v);
}
if (l.size() > 0) configFile = l.get(0);
if (l.size() > 1) home = l.get(1);
}
CodeSource src =
MainIJPlugin.class.getProtectionDomain().getCodeSource();
Expand All @@ -242,8 +259,7 @@ public void run(String args)
} catch (Exception e) {}
}
try {
container = Container.startupInPluginMode(home, configFile,
LookupNames.IMAGE_J);
container = Container.startupInPluginMode(home, configFile, index);
attachListeners();
} catch (StartupException e) {
showMessage(e.getPlugin());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@

//Java imports
import java.awt.event.ActionEvent;

import javax.swing.Action;

//Third-party libraries


//Application-internal dependencies
import org.openmicroscopy.shoola.agents.dataBrowser.DataBrowserAgent;
import org.openmicroscopy.shoola.agents.dataBrowser.IconManager;
import org.openmicroscopy.shoola.agents.dataBrowser.browser.Browser;
import org.openmicroscopy.shoola.agents.dataBrowser.browser.ImageDisplay;
import org.openmicroscopy.shoola.agents.dataBrowser.view.DataBrowser;
import org.openmicroscopy.shoola.env.LookupNames;
import org.openmicroscopy.shoola.env.data.events.ViewInPluginEvent;
import org.openmicroscopy.shoola.util.ui.UIUtilities;

Expand Down Expand Up @@ -95,14 +98,14 @@ public ViewInPluginAction(DataBrowser model, int plugin)

IconManager icons = IconManager.getInstance();
switch (plugin) {
case DataBrowser.IMAGE_J:
case LookupNames.IMAGE_J:
putValue(Action.NAME, NAME_IJ);
putValue(Action.SHORT_DESCRIPTION,
UIUtilities.formatToolTipText(DESCRIPTION_IJ));
putValue(Action.SMALL_ICON,
icons.getIcon(IconManager.VIEWER_IJ));
break;
case DataBrowser.KNIME:
case LookupNames.KNIME:
putValue(Action.NAME, NAME_KNIME);
putValue(Action.SHORT_DESCRIPTION,
UIUtilities.formatToolTipText(DESCRIPTION_KNIME));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,6 @@ public interface DataBrowser

/** Identifies the <code>FSFolderModel</code>. */
public static final int FS_FOLDER = 9;

/** Indicates to run the application as an <code>ImageJ</code> plugin.*/
public static final int IMAGE_J = LookupNames.IMAGE_J;

/** Indicates to run the application as an <code>Knime</code> plugin.*/
public static final int KNIME = LookupNames.KNIME;

/** Bound property indicating to activate the user.*/
public static final String ACTIVATE_USER_PROPERTY = "activateUser";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@
import java.util.Set;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;

import javax.swing.Icon;
import javax.swing.JComponent;

//Third-party libraries


import org.apache.commons.collections.CollectionUtils;
//Application-internal dependencies
import org.openmicroscopy.shoola.agents.dataBrowser.DataBrowserAgent;
Expand All @@ -62,6 +64,7 @@
import org.openmicroscopy.shoola.agents.events.iviewer.ViewImageObject;
import org.openmicroscopy.shoola.agents.util.EditorUtil;
import org.openmicroscopy.shoola.agents.util.SelectionWizard;
import org.openmicroscopy.shoola.env.LookupNames;
import org.openmicroscopy.shoola.env.data.events.ViewInPluginEvent;
import org.openmicroscopy.shoola.env.data.model.ApplicationData;
import org.openmicroscopy.shoola.env.data.model.TableResult;
Expand All @@ -77,6 +80,7 @@
import org.openmicroscopy.shoola.util.ui.RegExFactory;
import org.openmicroscopy.shoola.util.ui.UIUtilities;
import org.openmicroscopy.shoola.util.ui.component.AbstractComponent;

import pojos.DataObject;
import pojos.DatasetData;
import pojos.ExperimenterData;
Expand Down Expand Up @@ -1729,9 +1733,9 @@ public void viewDisplay(ImageDisplay node, boolean internal)
if (go instanceof DataObject)
data = (DataObject) go;
object.setContext(data, null);
if (DataBrowserAgent.runAsPlugin() == DataBrowser.IMAGE_J) {
if (DataBrowserAgent.runAsPlugin() == LookupNames.IMAGE_J) {
ViewInPluginEvent evt = new ViewInPluginEvent(ctx,
img, DataBrowser.IMAGE_J);
img, LookupNames.IMAGE_J);
bus.post(evt);
} else {
bus.post(new ViewImage(ctx, object, null));
Expand All @@ -1753,11 +1757,11 @@ public void viewDisplay(ImageDisplay node, boolean internal)
data = (DataObject) go;
object.setContext((DataObject) parent, data);
}
if (DataBrowserAgent.runAsPlugin() == DataBrowser.IMAGE_J) {
if (DataBrowserAgent.runAsPlugin() == LookupNames.IMAGE_J) {

ViewInPluginEvent evt = new ViewInPluginEvent(
model.getSecurityContext(),
wellSample.getImage(), DataBrowser.IMAGE_J);
wellSample.getImage(), LookupNames.IMAGE_J);
bus.post(evt);
} else {
bus.post(new ViewImage(model.getSecurityContext(), object,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;

import javax.swing.Action;


//Third-party libraries


import org.apache.commons.collections.CollectionUtils;
//Application-internal dependencies
import org.openmicroscopy.shoola.agents.dataBrowser.DataBrowserAgent;
Expand Down Expand Up @@ -70,12 +72,14 @@
import org.openmicroscopy.shoola.agents.util.ViewerSorter;
import org.openmicroscopy.shoola.agents.util.ui.EditorDialog;
import org.openmicroscopy.shoola.agents.util.ui.RollOverThumbnailManager;
import org.openmicroscopy.shoola.env.LookupNames;
import org.openmicroscopy.shoola.env.data.model.ApplicationData;
import org.openmicroscopy.shoola.env.data.util.FilterContext;
import org.openmicroscopy.shoola.env.data.util.SecurityContext;
import org.openmicroscopy.shoola.util.ui.PlateGrid;
import org.openmicroscopy.shoola.util.ui.PlateGridObject;
import org.openmicroscopy.shoola.util.ui.search.SearchObject;

import pojos.DataObject;
import pojos.DatasetData;
import pojos.ExperimenterData;
Expand Down Expand Up @@ -181,9 +185,9 @@ class DataBrowserControl
private void createActions()
{
actionsMap.put(VIEW_IN_KNIME, new ViewInPluginAction(model,
DataBrowser.KNIME));
LookupNames.KNIME));
actionsMap.put(VIEW_IN_IJ, new ViewInPluginAction(model,
DataBrowser.IMAGE_J));
LookupNames.IMAGE_J));
actionsMap.put(VIEW, new ViewAction(model));
actionsMap.put(COPY_OBJECT, new ManageObjectAction(model,
ManageObjectAction.COPY));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.awt.event.ItemListener;
import java.util.Iterator;
import java.util.List;

import javax.swing.BorderFactory;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JMenu;
Expand All @@ -36,6 +37,7 @@
import javax.swing.JSeparator;
import javax.swing.border.BevelBorder;


//Third-party libraries
import org.apache.commons.collections.CollectionUtils;

Expand All @@ -46,6 +48,7 @@
import org.openmicroscopy.shoola.agents.dataBrowser.actions.MoveToAction;
import org.openmicroscopy.shoola.agents.dataBrowser.actions.ViewOtherAction;
import org.openmicroscopy.shoola.agents.dataBrowser.browser.ImageDisplay;
import org.openmicroscopy.shoola.env.LookupNames;

import pojos.ExperimenterData;

Expand Down Expand Up @@ -233,14 +236,15 @@ private void buildGUI()
JMenu menu;
String text = "View";
switch (DataBrowserAgent.runAsPlugin()) {
case DataBrowser.IMAGE_J:
case LookupNames.IMAGE_J:
case LookupNames.IMAGE_J_IMPORT:
menu = new JMenu(text);
menu.setIcon(view.getIcon());
menu.add(view);
menu.add(controller.getAction(DataBrowserControl.VIEW_IN_IJ));
add(menu);
break;
case DataBrowser.KNIME:
case LookupNames.KNIME:
menu = new JMenu(text);
menu.setIcon(view.getIcon());
menu.add(view);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

//Application-internal dependencies
import org.openmicroscopy.shoola.env.LookupNames;
import org.openmicroscopy.shoola.env.data.events.ViewInPluginEvent;
import org.openmicroscopy.shoola.env.data.util.SecurityContext;
import org.openmicroscopy.shoola.env.event.RequestEvent;

Expand All @@ -58,9 +57,6 @@ public class ViewImage
extends RequestEvent
{

/** Identifies the <code>ImageJ</code> plugin.*/
public static final int IMAGE_J = LookupNames.IMAGE_J;

/** The selected plugin.*/
private int plugin;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

//Third-party libraries


import org.apache.commons.collections.CollectionUtils;
//Application-internal dependencies
import org.openmicroscopy.shoola.agents.dataBrowser.view.DataBrowser;
import org.openmicroscopy.shoola.agents.fsimporter.view.Importer;
Expand Down Expand Up @@ -83,8 +85,7 @@ public ImagesImporter(Importer viewer,
ImportableObject context, Integer loaderID)
{
super(viewer, null);
if (context == null || context.getFiles() == null ||
context.getFiles().size() == 0)
if (context == null || CollectionUtils.isEmpty(context.getFiles()))
throw new IllegalArgumentException("No Files to import.");
this.context = context;
this.loaderID = loaderID;
Expand Down