UNPKG

@mkerkstra/jsts-cjs

Version:

A CommonJS fork of JSTS: A JavaScript library of spatial predicates and functions for processing geometry

34 lines (33 loc) 1.13 kB
import Geometry from '../geom/Geometry.js' import Exception from '../../../../java/lang/Exception.js' export default class TestBuilderProxy { static init() { if (TestBuilderProxy.tbClass !== null) return null try { TestBuilderProxy.tbClass = TestBuilderProxy.getClassLoader().loadClass(TestBuilderProxy.CLASS_FUNCTIONS_UTIL) TestBuilderProxy.methodShowIndicator = TestBuilderProxy.tbClass.getMethod('showIndicator', Geometry) } catch (ex) { if (ex instanceof Exception) {} else { throw ex } } finally {} } static showIndicator(geom) { TestBuilderProxy.init() if (TestBuilderProxy.methodShowIndicator === null) return null try { TestBuilderProxy.methodShowIndicator.invoke(null, geom) } catch (e) { if (e instanceof Exception) {} else { throw e } } finally {} } static isActive() { TestBuilderProxy.init() return TestBuilderProxy.tbClass !== null } } TestBuilderProxy.CLASS_FUNCTIONS_UTIL = 'org.locationtech.jtstest.function.FunctionsUtil' TestBuilderProxy.tbClass = null TestBuilderProxy.methodShowIndicator = null