@Test public void testVSetWithColorMap() throws IOException { URL url = this.getClass().getResource("vset.vs"); InputStream is = url.openStream(); GocadReaderParameters parameters = new GocadReaderParameters(); ColorMap colorMap = new ColorMap(); colorMap.setValuesPercentages(true); colorMap.put(0d, Color.BLACK); colorMap.put(1d, Color.WHITE); parameters.setColorMap(colorMap); List<FastShape> shapes = GocadFactory.read(is, url, parameters); assertEquals(1, shapes.size()); FastShape shape = shapes.get(0); assertNotNull(shape.getColorBuffer()); assertEquals(20 * 4, shape.getColorBuffer().length); }
public static List<FastShape> read(File file, GocadReaderParameters parameters) { try { return read(new FileReader(file), file.toURI().toURL(), parameters); } catch (MalformedURLException e) { return null; } catch (FileNotFoundException e) { e.printStackTrace(); return null; } }
GocadFactory { public static List<FastShape> read(File file, GocadReaderParameters parameters) { try { return read(new FileReader(file), file.toURI().toURL(), parameters); } catch (MalformedURLException e) { return null; } catch (FileNotFoundException e) { e.printStackTrace(); return null; } } }
GocadFactory { public static List<FastShape> read(File file, GocadReaderParameters parameters) { try { return read(new FileReader(file), file.toURI().toURL(), parameters); } catch (MalformedURLException e) { return null; } catch (FileNotFoundException e) { e.printStackTrace(); return null; } }  }
GocadFactory { public static List<FastShape> read(File file, GocadReaderParameters parameters) { try { return read(new FileReader(file), file.toURI().toURL(), parameters); } catch (MalformedURLException e) { return null; } catch (FileNotFoundException e) { e.printStackTrace(); return null; } }  static boolean isGocadFileSuffix(String suffix); static List<FastShape> read(File file, GocadReaderParameters parameters); static List<FastShape> read(InputStream is, URL context, GocadReaderParameters parameters); static List<FastShape> read(Reader reader, URL context, GocadReaderParameters parameters); }
GocadFactory { public static List<FastShape> read(File file, GocadReaderParameters parameters) { try { return read(new FileReader(file), file.toURI().toURL(), parameters); } catch (MalformedURLException e) { return null; } catch (FileNotFoundException e) { e.printStackTrace(); return null; } }  static boolean isGocadFileSuffix(String suffix); static List<FastShape> read(File file, GocadReaderParameters parameters); static List<FastShape> read(InputStream is, URL context, GocadReaderParameters parameters); static List<FastShape> read(Reader reader, URL context, GocadReaderParameters parameters);  }