@Test public void testCreate_WithNullSources() { final MultiLevelSource lonSource = new TestMultiLevelSource(10, 10); final MultiLevelSource latSource = new TestMultiLevelSource(10, 10); final LonLatFunction function = new TestLonLatFunction(); try { LonLatMultiLevelSource.create(null, latSource, function, DataBuffer.TYPE_DOUBLE); fail(); } catch (IllegalArgumentException ignored) { } try { LonLatMultiLevelSource.create(lonSource, null, function, DataBuffer.TYPE_DOUBLE); fail(); } catch (IllegalArgumentException ignored) { } }
public static MultiLevelSource create(MultiLevelSource lonSource, MultiLevelSource latSource, LonLatFunction function, int targetDataType) { Assert.argument(lonSource != null, "lonSource != null"); Assert.argument(latSource != null, "latSource != null"); Assert.argument(function != null, "function != null"); Rectangle2D lonModelBounds = lonSource.getModel().getModelBounds(); Rectangle2D latModelBounds = latSource.getModel().getModelBounds(); Assert.argument(Objects.equals(lonModelBounds, latModelBounds), "Model bounds of lat and lon source must be equal"); return new LonLatMultiLevelSource(lonSource, latSource, function, targetDataType); }
LonLatMultiLevelSource extends GenericMultiLevelSource { public static MultiLevelSource create(MultiLevelSource lonSource, MultiLevelSource latSource, LonLatFunction function, int targetDataType) { Assert.argument(lonSource != null, "lonSource != null"); Assert.argument(latSource != null, "latSource != null"); Assert.argument(function != null, "function != null"); Rectangle2D lonModelBounds = lonSource.getModel().getModelBounds(); Rectangle2D latModelBounds = latSource.getModel().getModelBounds(); Assert.argument(Objects.equals(lonModelBounds, latModelBounds), "Model bounds of lat and lon source must be equal"); return new LonLatMultiLevelSource(lonSource, latSource, function, targetDataType); } }
LonLatMultiLevelSource extends GenericMultiLevelSource { public static MultiLevelSource create(MultiLevelSource lonSource, MultiLevelSource latSource, LonLatFunction function, int targetDataType) { Assert.argument(lonSource != null, "lonSource != null"); Assert.argument(latSource != null, "latSource != null"); Assert.argument(function != null, "function != null"); Rectangle2D lonModelBounds = lonSource.getModel().getModelBounds(); Rectangle2D latModelBounds = latSource.getModel().getModelBounds(); Assert.argument(Objects.equals(lonModelBounds, latModelBounds), "Model bounds of lat and lon source must be equal"); return new LonLatMultiLevelSource(lonSource, latSource, function, targetDataType); } private  LonLatMultiLevelSource(MultiLevelSource lonSource, MultiLevelSource latSource, LonLatFunction function,
                                   int targetDataType); }
LonLatMultiLevelSource extends GenericMultiLevelSource { public static MultiLevelSource create(MultiLevelSource lonSource, MultiLevelSource latSource, LonLatFunction function, int targetDataType) { Assert.argument(lonSource != null, "lonSource != null"); Assert.argument(latSource != null, "latSource != null"); Assert.argument(function != null, "function != null"); Rectangle2D lonModelBounds = lonSource.getModel().getModelBounds(); Rectangle2D latModelBounds = latSource.getModel().getModelBounds(); Assert.argument(Objects.equals(lonModelBounds, latModelBounds), "Model bounds of lat and lon source must be equal"); return new LonLatMultiLevelSource(lonSource, latSource, function, targetDataType); } private  LonLatMultiLevelSource(MultiLevelSource lonSource, MultiLevelSource latSource, LonLatFunction function,
                                   int targetDataType); static MultiLevelSource create(MultiLevelSource lonSource, MultiLevelSource latSource,
                                          LonLatFunction function, int targetDataType); }
LonLatMultiLevelSource extends GenericMultiLevelSource { public static MultiLevelSource create(MultiLevelSource lonSource, MultiLevelSource latSource, LonLatFunction function, int targetDataType) { Assert.argument(lonSource != null, "lonSource != null"); Assert.argument(latSource != null, "latSource != null"); Assert.argument(function != null, "function != null"); Rectangle2D lonModelBounds = lonSource.getModel().getModelBounds(); Rectangle2D latModelBounds = latSource.getModel().getModelBounds(); Assert.argument(Objects.equals(lonModelBounds, latModelBounds), "Model bounds of lat and lon source must be equal"); return new LonLatMultiLevelSource(lonSource, latSource, function, targetDataType); } private  LonLatMultiLevelSource(MultiLevelSource lonSource, MultiLevelSource latSource, LonLatFunction function,
                                   int targetDataType); static MultiLevelSource create(MultiLevelSource lonSource, MultiLevelSource latSource,
                                          LonLatFunction function, int targetDataType);  }