Skip to content

Commit

Permalink
Refactor packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ppouchin committed Nov 19, 2024
1 parent 431275d commit 03e6e6a
Show file tree
Hide file tree
Showing 59 changed files with 261 additions and 170 deletions.
3 changes: 2 additions & 1 deletion src/main/java/fr/igred/omero/AnnotatableWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
import fr.igred.omero.annotations.RatingAnnotationWrapper;
import fr.igred.omero.annotations.TableWrapper;
import fr.igred.omero.annotations.TagAnnotationWrapper;
import fr.igred.omero.client.Client;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.repository.RepositoryObjectWrapper.ReplacePolicy;
import fr.igred.omero.RepositoryObjectWrapper.ReplacePolicy;
import omero.gateway.facility.TablesFacility;
import omero.gateway.model.AnnotationData;
import omero.gateway.model.DataObject;
Expand Down
13 changes: 2 additions & 11 deletions src/main/java/fr/igred/omero/ObjectWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package fr.igred.omero;


import fr.igred.omero.client.Client;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.meta.ExperimenterWrapper;
Expand Down Expand Up @@ -88,7 +89,7 @@ protected ObjectWrapper(T o) {
*
* @return See above.
*/
protected static <U extends DataObject, V extends ObjectWrapper<U>> List<V>
public static <U extends DataObject, V extends ObjectWrapper<U>> List<V>
wrap(Collection<U> objects, Function<? super U, ? extends V> mapper) {
return wrap(objects, mapper, ObjectWrapper::getId);
}
Expand Down Expand Up @@ -142,16 +143,6 @@ public T asDataObject() {
}


/**
* Returns the contained DataObject as IObject.
*
* @return See above.
*/
IObject asIObject() {
return data.asIObject();
}


/**
* Gets the object id
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@
* Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package fr.igred.omero.repository;
package fr.igred.omero;


import fr.igred.omero.AnnotatableWrapper;
import fr.igred.omero.Browser;
import fr.igred.omero.Client;
import fr.igred.omero.GatewayWrapper;
import fr.igred.omero.client.Browser;
import fr.igred.omero.client.Client;
import fr.igred.omero.client.GatewayWrapper;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ExceptionHandler;
import fr.igred.omero.exception.ServiceException;
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/fr/igred/omero/annotations/AnnotationWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
package fr.igred.omero.annotations;


import fr.igred.omero.Client;
import fr.igred.omero.client.Client;
import fr.igred.omero.ObjectWrapper;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.repository.DatasetWrapper;
import fr.igred.omero.repository.FolderWrapper;
import fr.igred.omero.repository.ImageWrapper;
import fr.igred.omero.repository.PlateAcquisitionWrapper;
import fr.igred.omero.repository.PlateWrapper;
import fr.igred.omero.repository.ProjectWrapper;
import fr.igred.omero.repository.ScreenWrapper;
import fr.igred.omero.repository.WellWrapper;
import fr.igred.omero.containers.DatasetWrapper;
import fr.igred.omero.containers.FolderWrapper;
import fr.igred.omero.core.ImageWrapper;
import fr.igred.omero.screen.PlateAcquisitionWrapper;
import fr.igred.omero.screen.PlateWrapper;
import fr.igred.omero.containers.ProjectWrapper;
import fr.igred.omero.screen.ScreenWrapper;
import fr.igred.omero.screen.WellWrapper;
import omero.RLong;
import omero.gateway.model.AnnotationData;
import omero.gateway.model.PlateAcquisitionData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package fr.igred.omero.annotations;


import fr.igred.omero.Client;
import fr.igred.omero.client.Client;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ExceptionHandler;
import fr.igred.omero.exception.ServiceException;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fr/igred/omero/annotations/TableWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
package fr.igred.omero.annotations;


import fr.igred.omero.Client;
import fr.igred.omero.ObjectWrapper;
import fr.igred.omero.client.Client;
import fr.igred.omero.core.ImageWrapper;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.repository.ImageWrapper;
import fr.igred.omero.roi.ROIWrapper;
import ij.gui.Roi;
import ij.macro.Variable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package fr.igred.omero.annotations;


import fr.igred.omero.Client;
import fr.igred.omero.client.Client;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import omero.gateway.model.TagAnnotationData;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fr/igred/omero/annotations/TagSetWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package fr.igred.omero.annotations;


import fr.igred.omero.Browser;
import fr.igred.omero.Client;
import fr.igred.omero.client.Browser;
import fr.igred.omero.client.Client;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import omero.gateway.model.TagAnnotationData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,23 @@
* Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package fr.igred.omero;
package fr.igred.omero.client;


import fr.igred.omero.ObjectWrapper;
import fr.igred.omero.annotations.AnnotationWrapper;
import fr.igred.omero.annotations.MapAnnotationWrapper;
import fr.igred.omero.annotations.TagAnnotationWrapper;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.meta.ExperimenterWrapper;
import fr.igred.omero.repository.DatasetWrapper;
import fr.igred.omero.repository.FolderWrapper;
import fr.igred.omero.repository.ImageWrapper;
import fr.igred.omero.repository.PlateWrapper;
import fr.igred.omero.repository.ProjectWrapper;
import fr.igred.omero.repository.ScreenWrapper;
import fr.igred.omero.repository.WellWrapper;
import fr.igred.omero.containers.DatasetWrapper;
import fr.igred.omero.containers.FolderWrapper;
import fr.igred.omero.core.ImageWrapper;
import fr.igred.omero.screen.PlateWrapper;
import fr.igred.omero.containers.ProjectWrapper;
import fr.igred.omero.screen.ScreenWrapper;
import fr.igred.omero.screen.WellWrapper;
import omero.RLong;
import omero.gateway.Gateway;
import omero.gateway.SecurityContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@
* Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package fr.igred.omero;
package fr.igred.omero.client;


import fr.igred.omero.ObjectWrapper;
import fr.igred.omero.annotations.AnnotationWrapper;
import fr.igred.omero.annotations.TableWrapper;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ExceptionHandler;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.meta.ExperimenterWrapper;
import fr.igred.omero.meta.GroupWrapper;
import fr.igred.omero.repository.FolderWrapper;
import fr.igred.omero.repository.ImageWrapper;
import fr.igred.omero.repository.ProjectWrapper;
import fr.igred.omero.containers.FolderWrapper;
import fr.igred.omero.core.ImageWrapper;
import fr.igred.omero.containers.ProjectWrapper;
import omero.ApiUsageException;
import omero.gateway.Gateway;
import omero.gateway.SecurityContext;
Expand Down Expand Up @@ -140,7 +141,7 @@ public void delete(Collection<? extends ObjectWrapper<?>> objects)
}
if (!objects.isEmpty()) {
delete(objects.stream()
.map(ObjectWrapper::asIObject)
.map(o -> o.asDataObject().asIObject())
.collect(Collectors.toList()));
}
}
Expand All @@ -162,7 +163,7 @@ public void delete(ObjectWrapper<?> object)
if (object instanceof FolderWrapper) {
((FolderWrapper) object).unlinkAllROIs(this);
}
delete(object.asIObject());
delete(object.asDataObject().asIObject());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package fr.igred.omero;
package fr.igred.omero.client;


import fr.igred.omero.exception.AccessException;
Expand Down Expand Up @@ -475,7 +475,7 @@ public IObject save(IObject object)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
* @throws InterruptedException If block(long) does not return.
*/
void delete(IObject object)
public void delete(IObject object)
throws ServiceException, AccessException, ExecutionException, InterruptedException {
final long wait = 500L;
ExceptionHandler.ofConsumer(getDm(),
Expand All @@ -496,7 +496,7 @@ void delete(IObject object)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
* @throws InterruptedException If block(long) does not return.
*/
void delete(List<IObject> objects)
public void delete(List<IObject> objects)
throws ServiceException, AccessException, ExecutionException, InterruptedException {
final long wait = 500L;
ExceptionHandler.ofConsumer(getDm(),
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/fr/igred/omero/client/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (C) 2020-2023 GReD
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
* Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* This package contains the client classes used to interact with an OMERO server.
*/
package fr.igred.omero.client;
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
* Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package fr.igred.omero.repository;
package fr.igred.omero.containers;


import fr.igred.omero.Browser;
import fr.igred.omero.Client;
import fr.igred.omero.client.Browser;
import fr.igred.omero.client.Client;
import fr.igred.omero.ObjectWrapper;
import fr.igred.omero.annotations.TagAnnotationWrapper;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.core.ImageWrapper;
import fr.igred.omero.RepositoryObjectWrapper;
import fr.igred.omero.roi.ROIWrapper;
import omero.RLong;
import omero.gateway.model.DatasetData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
* Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package fr.igred.omero.repository;
package fr.igred.omero.containers;


import fr.igred.omero.Browser;
import fr.igred.omero.Client;
import fr.igred.omero.client.Browser;
import fr.igred.omero.client.Client;
import fr.igred.omero.ObjectWrapper;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ExceptionHandler;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.core.ImageWrapper;
import fr.igred.omero.RepositoryObjectWrapper;
import fr.igred.omero.roi.ROIWrapper;
import omero.gateway.facility.ROIFacility;
import omero.gateway.model.AnnotationData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
* Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package fr.igred.omero.repository;
package fr.igred.omero.containers;


import fr.igred.omero.Browser;
import fr.igred.omero.Client;
import fr.igred.omero.client.Browser;
import fr.igred.omero.client.Client;
import fr.igred.omero.ObjectWrapper;
import fr.igred.omero.annotations.TagAnnotationWrapper;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.core.ImageWrapper;
import fr.igred.omero.RepositoryObjectWrapper;
import omero.gateway.model.ImageData;
import omero.gateway.model.ProjectData;
import omero.model.ProjectDatasetLink;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
* <p> This includes containers (such as screens or projects for example), as well as data contained within images
* (e.g. pixels and channels).
*/
package fr.igred.omero.repository;
package fr.igred.omero.containers;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package fr.igred.omero.repository;
package fr.igred.omero.core;


import fr.igred.omero.ObjectWrapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,25 @@
* Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package fr.igred.omero.repository;
package fr.igred.omero.core;


import fr.igred.omero.Browser;
import fr.igred.omero.Client;
import fr.igred.omero.client.Browser;
import fr.igred.omero.client.Client;
import fr.igred.omero.ObjectWrapper;
import fr.igred.omero.containers.DatasetWrapper;
import fr.igred.omero.containers.FolderWrapper;
import fr.igred.omero.containers.ProjectWrapper;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.repository.PixelsWrapper.Bounds;
import fr.igred.omero.repository.PixelsWrapper.Coordinates;
import fr.igred.omero.core.PixelsWrapper.Bounds;
import fr.igred.omero.core.PixelsWrapper.Coordinates;
import fr.igred.omero.screen.PlateAcquisitionWrapper;
import fr.igred.omero.screen.PlateWrapper;
import fr.igred.omero.RepositoryObjectWrapper;
import fr.igred.omero.screen.ScreenWrapper;
import fr.igred.omero.screen.WellSampleWrapper;
import fr.igred.omero.screen.WellWrapper;
import fr.igred.omero.roi.ROIWrapper;
import ij.CompositeImage;
import ij.IJ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
* Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package fr.igred.omero.repository;
package fr.igred.omero.core;


import fr.igred.omero.Client;
import fr.igred.omero.client.Client;
import fr.igred.omero.ObjectWrapper;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ExceptionHandler;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.meta.PlaneInfoWrapper;
import ome.units.unit.Unit;
import omero.gateway.exception.DataSourceException;
import omero.gateway.facility.RawDataFacility;
Expand All @@ -40,7 +39,7 @@
import java.util.concurrent.ExecutionException;

import static fr.igred.omero.exception.ExceptionHandler.call;
import static fr.igred.omero.meta.PlaneInfoWrapper.getMinPosition;
import static fr.igred.omero.core.PlaneInfoWrapper.getMinPosition;
import static ome.formats.model.UnitsFactory.convertLength;


Expand Down
Loading

0 comments on commit 03e6e6a

Please sign in to comment.