Skip to content

Commit

Permalink
Merge pull request #377 from jburel/edit-name
Browse files Browse the repository at this point in the history
Allow to edit the name of plate acquisition (see #9640)
  • Loading branch information
joshmoore committed Sep 24, 2012
2 parents 812c82b + 15a974a commit 031d12c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
20 changes: 7 additions & 13 deletions components/blitz/src/pojos/PlateAcquisitionData.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ public class PlateAcquisitionData
extends DataObject
{

/** The default text used when displaying the label.*/
private static final String DEFAULT_TEXT = "Run ";

/** The Id of the plate this plate acquisition is for. */
private long refPlateId;

/** The label associated to the plate acquisition. */
private String label;

/** Creates a new instance. */
public PlateAcquisitionData()
Expand All @@ -77,7 +77,6 @@ public PlateAcquisitionData(PlateAcquisition value)
throw new IllegalArgumentException("Object cannot null.");
setValue(value);
refPlateId = -1L;
label = null;
}

/**
Expand Down Expand Up @@ -183,12 +182,8 @@ public Timestamp getEndTime()
*/
public String getLabel()
{
if (label != null) return label;
String name = getName();
if (name != null && name.length() > 0) {
label = name;
return label;
}
if (name != null && name.length() > 0) return name;
Timestamp time = getStartTime();
String start = "";
String end = "";
Expand Down Expand Up @@ -218,7 +213,7 @@ public String getLabel()
}
String value = "";
if (start.length() == 0 && end.length() == 0)
return "Run "+getId();
return DEFAULT_TEXT+getId();
if (date.length() == 0 && end.length() != 0)
return dateEnd+" "+end;
if (dateEnd.length() == 0) {
Expand All @@ -227,9 +222,8 @@ public String getLabel()
} else {
value = date+" "+start+" - "+dateEnd+" "+end;
}
if (value.length() > 0) label = value;
else label = "Run "+getId();
return label;
if (value.length() > 0) return value;
return DEFAULT_TEXT+getId();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
//Third-party libraries

//Application-internal dependencies
import org.apache.commons.lang.SystemUtils;
import org.openmicroscopy.shoola.agents.events.editor.EditFileEvent;
import org.openmicroscopy.shoola.agents.events.iviewer.ViewImage;
import org.openmicroscopy.shoola.agents.events.iviewer.ViewImageObject;
Expand Down Expand Up @@ -1118,8 +1117,7 @@ else if (refObject instanceof TagAnnotationData) {
descriptionPane.setForeground(UIUtilities.DEFAULT_FONT_COLOR);


if ((refObject instanceof WellSampleData) ||
(refObject instanceof PlateAcquisitionData)) b = false;
if (refObject instanceof WellSampleData) b = false;

namePane.setEnabled(b);
//descriptionPane.setEnabled(b);
Expand Down Expand Up @@ -1209,6 +1207,9 @@ void updateDataObject()
FileData f = (FileData) object;
if (f.getId() > 0) return;
//if (f.isImage()) f.setDescription(desc);
} else if (object instanceof PlateAcquisitionData) {
PlateAcquisitionData pa = (PlateAcquisitionData) object;
if (name.length() > 0) pa.setName(name);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,6 @@ void keepSessionAlive()
ServiceInterfacePrx[] entries = (ServiceInterfacePrx[])
all.toArray(new ServiceInterfacePrx[all.size()]);
try {
if (importStore != null) importStore.ping();
entryEncrypted.keepAllAlive(entries);
} catch (Exception e) {}
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,14 @@ public static void fillIObject(IObject oldObject, IObject newObject)
n.setGreen(o.getGreen());
n.setBlue(o.getBlue());
n.setAlpha(o.getAlpha());
} else if (oldObject instanceof PlateAcquisition) {
PlateAcquisition n = (PlateAcquisition) newObject;
PlateAcquisition o = (PlateAcquisition) oldObject;
n.setName(o.getName());
n.setDescription(o.getDescription());
n.setEndTime(o.getEndTime());
n.setStartTime(o.getStartTime());
n.setMaximumFieldCount(o.getMaximumFieldCount());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void checkSpeedLevel(int level)
public LoginCredentials(String userName, String password, String hostName,
int speedLevel, int port, boolean encrypted)
{
this(userName, password, hostName, speedLevel, port, -1L, false);
this(userName, password, hostName, speedLevel, port, -1L, encrypted);
}

/**
Expand Down

0 comments on commit 031d12c

Please sign in to comment.