-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix usage of deprecated API in FilteredAndGroupedExplorerPanel
- Loading branch information
Showing
2 changed files
with
88 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/net/preibisch/mvrecon/fiji/spimdata/explorer/bdv/BDVUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package net.preibisch.mvrecon.fiji.spimdata.explorer.bdv; | ||
|
||
import bdv.AbstractSpimSource; | ||
import bdv.tools.transformation.TransformedSource; | ||
import bdv.viewer.Source; | ||
import bdv.viewer.SourceAndConverter; | ||
import java.util.Collection; | ||
import java.util.function.BiConsumer; | ||
|
||
public class BDVUtils | ||
{ | ||
public static void forEachAbstractSpimSource( | ||
final Collection< ? extends SourceAndConverter< ? > > sources, | ||
final BiConsumer< ? super SourceAndConverter< ? >, ? super AbstractSpimSource< ? > > action ) | ||
{ | ||
for ( final SourceAndConverter< ? > soc : sources ) | ||
{ | ||
Source< ? > source = soc.getSpimSource(); | ||
|
||
if ( source instanceof TransformedSource ) | ||
source = ( ( TransformedSource< ? > ) source ).getWrappedSource(); | ||
|
||
if ( source instanceof AbstractSpimSource ) | ||
action.accept( soc, ( AbstractSpimSource< ? > ) source ); | ||
} | ||
} | ||
|
||
public static void forEachTransformedSource( | ||
final Collection< ? extends SourceAndConverter< ? > > sources, | ||
final BiConsumer< ? super SourceAndConverter< ? >, ? super TransformedSource< ? > > action ) | ||
{ | ||
for ( final SourceAndConverter< ? > soc : sources ) | ||
{ | ||
Source< ? > source = soc.getSpimSource(); | ||
|
||
if ( source instanceof TransformedSource ) | ||
action.accept( soc, ( TransformedSource< ? > ) source ); | ||
} | ||
} | ||
} |