From c8efcf6720769e918559c820ebf40d35066f678f Mon Sep 17 00:00:00 2001 From: iSergio Date: Mon, 15 Mar 2021 17:14:12 +0300 Subject: [PATCH] Code review. New example. Fix examples. New functional. --- cesiumjs4gwt-main/pom.xml | 2 +- .../src/main/java/org/cesiumjs/cs/Cesium.java | 769 ++-- .../org/cesiumjs/cs/CesiumEntryPoint.java | 22 +- .../cs/collections/BillboardCollection.java | 223 +- .../collections/ClippingPlaneCollection.java | 122 +- .../cesiumjs/cs/collections/Collection.java | 59 +- .../CompositeEntityCollection.java | 451 +-- .../cs/collections/DataSourceCollection.java | 202 +- .../cs/collections/EntityCollection.java | 381 +- .../collections/ImageryLayerCollection.java | 325 +- .../cs/collections/LabelCollection.java | 118 +- .../collections/ModelAnimationCollection.java | 78 +- .../collections/PointPrimitiveCollection.java | 155 +- .../cs/collections/PolylineCollection.java | 140 +- .../cs/collections/PrimitiveCollection.java | 204 +- .../collections/TimeIntervalCollection.java | 659 ++-- .../options/BillboardCollectionOptions.java | 95 +- .../ClippingPlaneCollectionOptions.java | 80 +- .../options/FromIso8601DateArrayOptions.java | 53 +- .../FromIso8601DurationArrayOptions.java | 80 +- .../options/FromIso8601Options.java | 56 +- .../options/FromIso8601OptionsAbstract.java | 67 +- .../options/FromJulianDateArrayOptions.java | 42 +- .../options/LabelCollectionOptions.java | 81 +- .../PointPrimitiveCollectionOptions.java | 69 +- .../options/PolylineCollectionOptions.java | 49 +- .../options/PrimitiveCollectionOptions.java | 23 +- .../cs/core/AxisAlignedBoundingBox.java | 282 +- .../cs/core/BingMapsGeocoderService.java | 61 +- .../cesiumjs/cs/core/BoundingRectangle.java | 508 ++- .../org/cesiumjs/cs/core/BoundingSphere.java | 1705 +++++---- .../java/org/cesiumjs/cs/core/Cartesian2.java | 1156 +++--- .../java/org/cesiumjs/cs/core/Cartesian3.java | 1805 +++++----- .../java/org/cesiumjs/cs/core/Cartesian4.java | 1453 ++++---- .../org/cesiumjs/cs/core/Cartographic.java | 532 +-- .../cs/core/CartographicGeocoderService.java | 32 +- .../main/java/org/cesiumjs/cs/core/Clock.java | 221 +- .../main/java/org/cesiumjs/cs/core/Color.java | 3185 ++++++++--------- .../core/ColorGeometryInstanceAttribute.java | 255 +- .../cesiumjs/cs/core/ComponentDatatype.java | 343 +- .../java/org/cesiumjs/cs/core/Credit.java | 268 +- .../org/cesiumjs/cs/core/CullingVolume.java | 103 +- .../org/cesiumjs/cs/core/DefaultProxy.java | 36 +- .../org/cesiumjs/cs/core/DeveloperError.java | 12 +- .../cs/core/DistanceDisplayCondition.java | 134 +- ...layConditionGeometryInstanceAttribute.java | 221 +- .../org/cesiumjs/cs/core/EasingFunction.java | 396 +- .../cs/core/ElevationBandMaterialBand.java | 3 +- .../cs/core/ElevationBandMaterialEntry.java | 3 +- .../cs/core/EllipseGeometryLibrary.java | 33 +- .../java/org/cesiumjs/cs/core/Ellipsoid.java | 1020 +++--- .../cesiumjs/cs/core/EllipsoidGeodesic.java | 194 +- .../cesiumjs/cs/core/EllipsoidRhumbLine.java | 426 +-- .../main/java/org/cesiumjs/cs/core/Event.java | 142 +- .../cesiumjs/cs/core/FeatureDetection.java | 90 +- .../java/org/cesiumjs/cs/core/Frustum.java | 36 +- .../java/org/cesiumjs/cs/core/Fullscreen.java | 145 +- .../org/cesiumjs/cs/core/GeocoderResult.java | 36 +- .../org/cesiumjs/cs/core/GeocoderService.java | 2 +- .../cs/core/GeographicTilingScheme.java | 15 +- .../cs/core/GeometryInstanceAttribute.java | 81 +- .../core/GoogleEarthEnterpriseMetadata.java | 83 +- .../GoogleEarthEnterpriseTerrainData.java | 41 +- .../org/cesiumjs/cs/core/GregorianDate.java | 92 +- .../cesiumjs/cs/core/HeadingPitchRange.java | 116 +- .../cesiumjs/cs/core/HeadingPitchRoll.java | 376 +- .../cesiumjs/cs/core/IntersectionTests.java | 512 +-- .../org/cesiumjs/cs/core/Intersections2D.java | 260 +- .../java/org/cesiumjs/cs/core/Interval.java | 50 +- .../main/java/org/cesiumjs/cs/core/Ion.java | 26 +- .../cesiumjs/cs/core/IonGeocoderService.java | 85 +- .../org/cesiumjs/cs/core/IonResource.java | 129 +- .../java/org/cesiumjs/cs/core/JulianDate.java | 787 ++-- .../java/org/cesiumjs/cs/core/LeapSecond.java | 60 +- .../main/java/org/cesiumjs/cs/core/Math.java | 1313 +++---- .../java/org/cesiumjs/cs/core/Matrix2.java | 1473 ++++---- .../java/org/cesiumjs/cs/core/Matrix3.java | 1902 +++++----- .../java/org/cesiumjs/cs/core/Matrix4.java | 2423 ++++++------- .../org/cesiumjs/cs/core/NearFarScalar.java | 320 +- .../java/org/cesiumjs/cs/core/Occluder.java | 367 +- .../cs/core/OpenCageGeocoderService.java | 81 +- .../cesiumjs/cs/core/OrientedBoundingBox.java | 631 ++-- .../cesiumjs/cs/core/OrthographicFrustum.java | 181 +- .../cs/core/OrthographicOffCenterFrustum.java | 202 +- .../java/org/cesiumjs/cs/core/Packable.java | 116 +- .../cs/core/PackableForInterpolation.java | 190 +- .../cs/core/PeliasGeocoderService.java | 71 +- .../cesiumjs/cs/core/PerspectiveFrustum.java | 301 +- .../cs/core/PerspectiveOffCenterFrustum.java | 239 +- .../org/cesiumjs/cs/core/PickedObject.java | 15 +- .../java/org/cesiumjs/cs/core/PinBuilder.java | 144 +- .../main/java/org/cesiumjs/cs/core/Plane.java | 404 +-- .../cesiumjs/cs/core/PolygonHierarchy.java | 76 +- .../cesiumjs/cs/core/PolylinePipeline.java | 27 +- .../java/org/cesiumjs/cs/core/Quaternion.java | 1162 +++--- .../main/java/org/cesiumjs/cs/core/Ray.java | 172 +- .../java/org/cesiumjs/cs/core/Rectangle.java | 1390 +++---- .../java/org/cesiumjs/cs/core/Request.java | 184 +- .../cesiumjs/cs/core/RequestScheduler.java | 53 +- .../java/org/cesiumjs/cs/core/Resource.java | 1485 ++++---- .../cs/core/ScreenSpaceEventHandler.java | 245 +- .../main/java/org/cesiumjs/cs/core/Size.java | 14 +- .../java/org/cesiumjs/cs/core/SkyBox.java | 99 +- .../org/cesiumjs/cs/core/SkyBoxSources.java | 24 +- .../java/org/cesiumjs/cs/core/Spherical.java | 308 +- .../org/cesiumjs/cs/core/TaskProcessor.java | 195 +- .../cesiumjs/cs/core/TileAvailability.java | 156 +- .../org/cesiumjs/cs/core/TilingScheme.java | 293 +- .../org/cesiumjs/cs/core/TimeInterval.java | 551 ++- .../java/org/cesiumjs/cs/core/Transforms.java | 1346 +++---- .../cs/core/TranslationRotationScale.java | 84 +- .../main/java/org/cesiumjs/cs/core/Utils.java | 12 +- .../org/cesiumjs/cs/core/VertexFormat.java | 409 ++- .../java/org/cesiumjs/cs/core/Viewport.java | 16 +- .../cs/core/WebMercatorTilingScheme.java | 39 +- .../org/cesiumjs/cs/core/enums/ArcType.java | 24 +- .../cesiumjs/cs/core/enums/ClockRange.java | 47 +- .../org/cesiumjs/cs/core/enums/ClockStep.java | 63 +- .../cesiumjs/cs/core/enums/CornerType.java | 42 +- .../cs/core/enums/ExtrapolationType.java | 40 +- .../cesiumjs/cs/core/enums/GeocodeType.java | 30 +- .../org/cesiumjs/cs/core/enums/Intersect.java | 50 +- .../cs/core/enums/KeyboardEventModifier.java | 44 +- .../cesiumjs/cs/core/enums/PixelDatatype.java | 36 +- .../cesiumjs/cs/core/enums/PixelFormat.java | 218 +- .../cesiumjs/cs/core/enums/PrimitiveType.java | 100 +- .../cs/core/enums/ReferenceFrame.java | 32 +- .../cesiumjs/cs/core/enums/RequestState.java | 68 +- .../cesiumjs/cs/core/enums/RequestType.java | 44 +- .../cs/core/enums/ScreenSpaceEventType.java | 194 +- .../cesiumjs/cs/core/enums/TimeStandard.java | 47 +- .../cesiumjs/cs/core/enums/Visibility.java | 50 +- .../cs/core/events/MouseClickEvent.java | 7 +- .../cs/core/events/MouseDblClickEvent.java | 7 +- .../cs/core/events/MouseDownEvent.java | 7 +- .../cs/core/events/MouseMoveEvent.java | 11 +- .../cesiumjs/cs/core/events/MouseUpEvent.java | 7 +- .../cs/core/events/Touch2StartEvent.java | 11 +- .../cs/core/events/TouchClickEvent.java | 7 +- .../cs/core/events/TouchMoveEvent.java | 11 +- .../core/events/TouchPinchMovementEvent.java | 39 +- .../cs/core/events/TouchStartEvent.java | 7 +- .../cs/core/geometry/BoxGeometry.java | 191 +- .../cs/core/geometry/BoxOutlineGeometry.java | 175 +- .../cs/core/geometry/CircleGeometry.java | 139 +- .../core/geometry/CircleOutlineGeometry.java | 139 +- .../geometry/CoplanarPolygonGeometry.java | 57 +- .../CoplanarPolygonOutlineGeometry.java | 67 +- .../cs/core/geometry/CorridorGeometry.java | 153 +- .../geometry/CorridorOutlineGeometry.java | 155 +- .../cs/core/geometry/EllipseGeometry.java | 155 +- .../core/geometry/EllipseOutlineGeometry.java | 155 +- .../cs/core/geometry/EllipsoidGeometry.java | 151 +- .../geometry/EllipsoidOutlineGeometry.java | 153 +- .../cs/core/geometry/FrustumGeometry.java | 131 +- .../core/geometry/FrustumOutlineGeometry.java | 133 +- .../cesiumjs/cs/core/geometry/Geometry.java | 175 +- .../cs/core/geometry/GeometryAttribute.java | 104 +- .../cs/core/geometry/GeometryAttributes.java | 76 +- .../cs/core/geometry/GeometryInstance.java | 107 +- .../cs/core/geometry/GeometryPipeline.java | 440 +-- .../core/geometry/GroundPolylineGeometry.java | 213 +- .../cs/core/geometry/PlaneGeometry.java | 33 +- .../core/geometry/PlaneOutlineGeometry.java | 17 +- .../cs/core/geometry/PolygonGeometry.java | 151 +- .../core/geometry/PolygonOutlineGeometry.java | 149 +- .../PolylineArrowMaterialProperty.java | 35 +- .../cs/core/geometry/PolylineGeometry.java | 147 +- .../cs/core/geometry/RectangleGeometry.java | 155 +- .../geometry/RectangleOutlineGeometry.java | 141 +- .../core/geometry/SimplePolylineGeometry.java | 153 +- .../cs/core/geometry/WallGeometry.java | 175 +- .../cs/core/geometry/WallOutlineGeometry.java | 177 +- .../geometry/options/BoxGeometryOptions.java | 25 +- .../options/BoxOutlineGeometryOptions.java | 35 +- .../options/CircleGeometryOptions.java | 37 +- .../options/CircleOutlineGeometryOptions.java | 87 +- ...arPolygonGeometryFromPositionsOptions.java | 73 +- .../CoplanarPolygonGeometryOptions.java | 59 +- ...onOutlineGeometryFromPositionsOptions.java | 35 +- ...CoplanarPolygonOutlineGeometryOptions.java | 35 +- .../options/CorridorGeometryOptions.java | 25 +- .../CorridorOutlineGeometryOptions.java | 91 +- .../options/EllipseGeometryOptions.java | 37 +- .../EllipseOutlineGeometryOptions.java | 111 +- .../options/EllipsoidGeometryOptions.java | 25 +- .../EllipsoidOutlineGeometryOptions.java | 113 +- .../options/FrustumGeometryOptions.java | 39 +- .../FrustumOutlineGeometryOptions.java | 43 +- .../GroundPolylineGeometryOptions.java | 71 +- .../options/PlaneGeometryOptions.java | 25 +- .../options/PolygonGeometryOptions.java | 44 +- .../PolygonOutlineGeometryOptions.java | 108 +- .../options/PolylineGeometryOptions.java | 124 +- .../options/RectangleGeometryOptions.java | 61 +- .../RectangleOutlineGeometryOptions.java | 89 +- .../SimplePolylineGeometryOptions.java | 109 +- .../geometry/options/WallGeometryOptions.java | 25 +- .../options/WallOutlineGeometryOptions.java | 95 +- .../HermitePolynomialApproximation.java | 230 +- .../LagrangePolynomialApproximation.java | 124 +- .../interpolation/LinearApproximation.java | 112 +- .../BingMapsGeocoderServiceOptions.java | 54 +- .../cs/core/options/ClockOptions.java | 103 +- .../cs/core/options/ColorRandomOptions.java | 128 +- .../cs/core/options/CreditOptions.java | 48 +- .../core/options/DerivedResourceOptions.java | 17 +- .../core/options/EllipsePositionsOptions.java | 27 +- .../cs/core/options/FromAssetIdOptions.java | 43 +- .../GeographicTilingSchemeOptions.java | 6 +- .../options/GeometryAttributeOptions.java | 58 +- .../GeometryInstanceAttributeOptions.java | 65 +- .../core/options/GeometryInstanceOptions.java | 51 +- .../cs/core/options/GeometryOptions.java | 56 +- .../GoogleEarthEnterpriseMetadataOptions.java | 60 +- ...ogleEarthEnterpriseTerrainDataOptions.java | 55 +- .../options/IonGeocoderServiceOptions.java | 85 +- .../OpenCageGeocoderServiceOptions.java | 150 +- .../core/options/PolylinePipelineOptions.java | 63 +- .../cs/core/options/RequestOptions.java | 101 +- .../cs/core/options/ResourceHttpOptions.java | 125 +- .../cs/core/options/ResourceImageOptions.java | 36 +- .../cs/core/options/ResourceJsonpOptions.java | 10 +- .../cs/core/options/ResourceOptions.java | 131 +- .../cs/core/options/ResourcePutOptions.java | 20 +- .../cs/core/options/SkyBoxOptions.java | 97 +- .../cs/core/options/TilingSchemeOptions.java | 51 +- .../options/TimeIntervalIso8601Options.java | 42 +- .../cs/core/options/TimeIntervalOptions.java | 53 +- .../cs/core/options/VertexFormatOptions.java | 20 +- .../cs/core/options/WebAssemblyOptions.java | 38 +- .../WebMercatorTilingSchemeOptions.java | 41 +- .../core/projection/GeographicProjection.java | 33 +- .../cs/core/projection/MapProjection.java | 139 +- .../projection/WebMercatorProjection.java | 119 +- .../ArcGISTiledElevationTerrainProvider.java | 37 +- .../core/providers/CesiumTerrainProvider.java | 253 +- .../providers/EllipsoidTerrainProvider.java | 214 +- .../providers/GeoserverTerrainProvider.java | 220 +- .../GeoserverTerrainProviderFormatArray.java | 32 +- .../GoogleEarthEnterpriseTerrainProvider.java | 109 +- .../cs/core/providers/TerrainProvider.java | 73 +- .../providers/VRTheWorldTerrainProvider.java | 220 +- ...STiledElevationTerrainProviderOptions.java | 113 +- ...cGisImageServerTerrainProviderOptions.java | 83 +- .../options/CesiumTerrainProviderOptions.java | 85 +- .../EllipsoidTerrainProviderOptions.java | 39 +- .../GeoserverTerrainProviderOptions.java | 151 +- ...EarthEnterpriseTerrainProviderOptions.java | 107 +- .../VRTheWorldTerrainProviderOptions.java | 49 +- .../cs/datasources/CustomDataSource.java | 195 +- .../cs/datasources/CzmlDataSource.java | 441 ++- .../cesiumjs/cs/datasources/DataSource.java | 27 +- .../cs/datasources/DataSourceClock.java | 188 +- .../cs/datasources/DataSourceDisplay.java | 152 +- .../org/cesiumjs/cs/datasources/Entity.java | 541 ++- .../cs/datasources/EntityCluster.java | 175 +- .../cs/datasources/EntityClusterObject.java | 37 +- .../cs/datasources/GeoJsonDataSource.java | 451 +-- .../cs/datasources/KmlDataSource.java | 249 +- .../cs/datasources/StripeOrientation.java | 35 +- .../graphics/BillboardGraphics.java | 408 ++- .../cs/datasources/graphics/BoxGraphics.java | 215 +- .../graphics/Cesium3DTilesetGraphics.java | 115 +- .../graphics/CorridorGraphics.java | 304 +- .../graphics/CylinderGraphics.java | 243 +- .../datasources/graphics/EllipseGraphics.java | 300 +- .../graphics/EllipsoidGraphics.java | 229 +- .../datasources/graphics/LabelGraphics.java | 293 +- .../datasources/graphics/ModelGraphics.java | 311 +- .../cs/datasources/graphics/PathGraphics.java | 159 +- .../datasources/graphics/PlaneGraphics.java | 199 +- .../datasources/graphics/PointGraphics.java | 197 +- .../datasources/graphics/PolygonGraphics.java | 306 +- .../graphics/PolylineGraphics.java | 236 +- .../graphics/PolylineVolumeGraphics.java | 225 +- .../graphics/RectangleGraphics.java | 353 +- .../cs/datasources/graphics/WallGraphics.java | 243 +- .../options/BillboardGraphicsOptions.java | 237 +- .../graphics/options/BoxGraphicsOptions.java | 127 +- .../Cesium3DTilesetGraphicsOptions.java | 41 +- .../options/CorridorGraphicsOptions.java | 217 +- .../options/CylinderGraphicsOptions.java | 175 +- .../options/EllipseGraphicsOptions.java | 237 +- .../options/EllipsoidGraphicsOptions.java | 167 +- .../options/LabelGraphicsOptions.java | 269 +- .../options/ModelGraphicsOptions.java | 253 +- .../graphics/options/PathGraphicsOptions.java | 93 +- .../options/PlaneGraphicsOptions.java | 131 +- .../options/PointGraphicsOptions.java | 129 +- .../options/PolygonGraphicsOptions.java | 249 +- .../options/PolylineGraphicsOptions.java | 185 +- .../PolylineVolumeGraphicsOptions.java | 161 +- .../options/RectangleGraphicsOptions.java | 235 +- .../graphics/options/WallGraphicsOptions.java | 159 +- .../options/CzmlDataSourceOptions.java | 29 +- .../options/DataSourceDisplayOptions.java | 47 +- .../options/EntityClusterOptions.java | 78 +- .../cs/datasources/options/EntityOptions.java | 315 +- .../options/GeoJsonDataSourceOptions.java | 151 +- .../options/KmlDataSourceLoadOptions.java | 54 +- .../KmlDataSourceLoadStaticOptions.java | 136 +- .../options/KmlDataSourceOptions.java | 123 +- .../properties/CallbackProperty.java | 51 +- .../CheckerboardMaterialProperty.java | 86 +- .../properties/ColorMaterialProperty.java | 49 +- .../properties/CompositeMaterialProperty.java | 25 +- .../properties/CompositePositionProperty.java | 101 +- .../properties/CompositeProperty.java | 49 +- .../properties/ConstantPositionProperty.java | 107 +- .../properties/ConstantProperty.java | 68 +- .../properties/GridMaterialProperty.java | 95 +- .../properties/ImageMaterialProperty.java | 81 +- .../properties/MaterialProperty.java | 67 +- .../NodeTransformationProperty.java | 43 +- .../PolylineDashMaterialProperty.java | 86 +- .../PolylineGlowMaterialProperty.java | 103 +- .../PolylineOutlineMaterialProperty.java | 127 +- .../properties/PositionProperty.java | 105 +- .../cs/datasources/properties/Property.java | 105 +- .../properties/ReferenceProperty.java | 304 +- .../properties/SampledPositionProperty.java | 285 +- .../properties/SampledProperty.java | 292 +- .../properties/StripeMaterialProperty.java | 103 +- ...imeIntervalCollectionPositionProperty.java | 106 +- .../TimeIntervalCollectionProperty.java | 52 +- .../VelocityOrientationProperty.java | 77 +- .../properties/VelocityVectorProperty.java | 83 +- .../CheckerboardMaterialPropertyOptions.java | 51 +- .../options/GridMaterialPropertyOptions.java | 69 +- .../options/ImageMaterialPropertyOptions.java | 57 +- .../NodeTransformationPropertyOptions.java | 47 +- .../PolylineDashMaterialPropertyOptions.java | 55 +- .../PolylineGlowMaterialPropertyOptions.java | 9 +- ...olylineOutlineMaterialPropertyOptions.java | 53 +- .../SampledPropertyInterpolationOptions.java | 33 +- .../StripeMaterialPropertyOptions.java | 73 +- .../updater/DynamicGeometryUpdater.java | 43 +- .../updater/EllipseGeometryUpdater.java | 53 +- .../updater/EllipsoidGeometryUpdater.java | 43 +- .../datasources/updater/GeometryUpdater.java | 308 +- .../updater/PlaneGeometryUpdater.java | 41 +- .../updater/PolygonGeometryUpdater.java | 55 +- .../updater/PolylineGeometryUpdater.java | 43 +- .../updater/RectangleGeometryUpdater.java | 53 +- .../updater/WallGeometryUpdater.java | 43 +- .../visualizer/BillboardVisualizer.java | 73 +- .../visualizer/GeometryVisualizer.java | 123 +- .../visualizer/LabelVisualizer.java | 77 +- .../visualizer/ModelVisualizer.java | 73 +- .../visualizer/PathVisualizer.java | 73 +- .../visualizer/PointVisualizer.java | 73 +- .../visualizer/PolylineVisualizer.java | 71 +- .../main/java/org/cesiumjs/cs/js/JsArray.java | 323 +- .../main/java/org/cesiumjs/cs/js/JsBlob.java | 121 +- .../main/java/org/cesiumjs/cs/js/JsDate.java | 236 +- .../main/java/org/cesiumjs/cs/js/JsImage.java | 46 +- .../main/java/org/cesiumjs/cs/js/JsJSON.java | 4 +- .../java/org/cesiumjs/cs/js/JsObject.java | 223 +- .../org/cesiumjs/cs/promise/Executor.java | 2 +- .../java/org/cesiumjs/cs/promise/Fulfill.java | 3 +- .../org/cesiumjs/cs/promise/Function.java | 2 +- .../org/cesiumjs/cs/promise/Progress.java | 9 + .../java/org/cesiumjs/cs/promise/Promise.java | 20 +- .../cesiumjs/cs/promise/PromiseCallback.java | 2 +- .../java/org/cesiumjs/cs/promise/Reject.java | 3 +- .../java/org/cesiumjs/cs/scene/Billboard.java | 679 ++-- .../java/org/cesiumjs/cs/scene/Camera.java | 2351 ++++++------ .../org/cesiumjs/cs/scene/Cesium3DTile.java | 144 +- .../cs/scene/Cesium3DTileContent.java | 157 +- .../cs/scene/Cesium3DTileFeature.java | 174 +- .../cs/scene/Cesium3DTilePointFeature.java | 444 ++- .../cesiumjs/cs/scene/Cesium3DTileStyle.java | 108 +- .../cesiumjs/cs/scene/Cesium3DTileset.java | 1274 ++++--- .../cs/scene/ClassificationPrimitive.java | 290 +- .../org/cesiumjs/cs/scene/ClippingPlane.java | 173 +- .../cs/scene/ConditionsExpression.java | 185 +- .../org/cesiumjs/cs/scene/CreditDisplay.java | 212 +- .../cs/scene/DebugCameraPrimitive.java | 43 +- .../cs/scene/DebugModelMatrixPrimitive.java | 73 +- .../cesiumjs/cs/scene/DirectionalLight.java | 39 +- .../cs/scene/DiscardEmptyTileImagePolicy.java | 21 +- .../scene/DiscardMissingTileImagePolicy.java | 9 +- .../org/cesiumjs/cs/scene/Expression.java | 181 +- .../main/java/org/cesiumjs/cs/scene/Fog.java | 72 +- .../cs/scene/GetFeatureInfoFormat.java | 50 +- .../cs/scene/GetFeatureInfoParameters.java | 18 +- .../java/org/cesiumjs/cs/scene/Globe.java | 573 ++- .../cs/scene/GroundPolylinePrimitive.java | 335 +- .../cesiumjs/cs/scene/GroundPrimitive.java | 288 +- .../org/cesiumjs/cs/scene/ImageryLayer.java | 445 ++- .../cs/scene/ImageryLayerFeatureInfo.java | 109 +- .../java/org/cesiumjs/cs/scene/Label.java | 523 ++- .../java/org/cesiumjs/cs/scene/Light.java | 37 +- .../java/org/cesiumjs/cs/scene/Material.java | 467 ++- .../java/org/cesiumjs/cs/scene/Model.java | 671 ++-- .../org/cesiumjs/cs/scene/ModelAnimation.java | 190 +- .../org/cesiumjs/cs/scene/ModelMaterial.java | 102 +- .../java/org/cesiumjs/cs/scene/ModelMesh.java | 50 +- .../java/org/cesiumjs/cs/scene/ModelNode.java | 72 +- .../main/java/org/cesiumjs/cs/scene/Moon.java | 124 +- .../cs/scene/NeverTileDiscardPolicy.java | 2 +- .../cesiumjs/cs/scene/PointCloudShading.java | 151 +- .../org/cesiumjs/cs/scene/PointPrimitive.java | 201 +- .../java/org/cesiumjs/cs/scene/Polyline.java | 109 +- .../cesiumjs/cs/scene/PostProcessStage.java | 269 +- .../cs/scene/PostProcessStageCollection.java | 216 +- .../cs/scene/PostProcessStageComposite.java | 140 +- .../cs/scene/PostProcessStageLibrary.java | 254 +- .../java/org/cesiumjs/cs/scene/Primitive.java | 336 +- .../java/org/cesiumjs/cs/scene/Scene.java | 2154 ++++++----- .../cs/scene/ScreenSpaceCameraController.java | 405 ++- .../java/org/cesiumjs/cs/scene/ShadowMap.java | 93 +- .../org/cesiumjs/cs/scene/SkyAtmosphere.java | 168 +- .../cesiumjs/cs/scene/StyleExpression.java | 4 +- .../main/java/org/cesiumjs/cs/scene/Sun.java | 84 +- .../java/org/cesiumjs/cs/scene/SunLight.java | 31 +- .../cesiumjs/cs/scene/TileDiscardPolicy.java | 49 +- .../cs/scene/TimeDynamicPointCloud.java | 254 +- .../cs/scene/WebMapServiceParameters.java | 30 +- .../cs/scene/apperances/Appearance.java | 192 +- .../cs/scene/apperances/DebugAppearance.java | 59 +- .../EllipsoidSurfaceAppearance.java | 151 +- .../scene/apperances/MaterialAppearance.java | 150 +- .../PerInstanceColorAppearance.java | 222 +- .../apperances/PolylineColorAppearance.java | 75 +- .../PolylineMaterialAppearance.java | 65 +- .../apperances/options/AppearanceOptions.java | 81 +- .../options/DebugAppearanceOptions.java | 76 +- .../EllipsoidSurfaceAppearanceOptions.java | 115 +- .../options/MaterialAppearanceOptions.java | 115 +- .../PerInstanceColorAppearanceOptions.java | 97 +- .../PolylineColorAppearanceOptions.java | 54 +- .../PolylineMaterialAppearanceOptions.java | 73 +- .../cs/scene/emitters/BoxEmitter.java | 35 +- .../cs/scene/emitters/CircleEmitter.java | 56 +- .../cs/scene/emitters/ConeEmitter.java | 36 +- .../cs/scene/emitters/ParticleEmitter.java | 10 +- .../cs/scene/emitters/SphereEmitter.java | 30 +- .../cesiumjs/cs/scene/enums/BlendOption.java | 50 +- .../cs/scene/enums/CameraEventType.java | 68 +- .../enums/Cesium3DTileColorBlendMode.java | 36 +- .../cs/scene/enums/ClassificationType.java | 36 +- .../cs/scene/enums/ColorBlendMode.java | 42 +- .../cs/scene/enums/HeightReference.java | 30 +- .../cs/scene/enums/HorizontalOrigin.java | 53 +- .../cs/scene/enums/ImagerySplitDirection.java | 40 +- .../cesiumjs/cs/scene/enums/LabelStyle.java | 49 +- .../cesiumjs/cs/scene/enums/MapMode2D.java | 32 +- .../cs/scene/enums/ModelAnimationLoop.java | 38 +- .../enums/PostProcessStageSampleMode.java | 28 +- .../cesiumjs/cs/scene/enums/SceneMode.java | 56 +- .../cesiumjs/cs/scene/enums/ShadowMode.java | 52 +- .../enums/TextureMagnificationFilter.java | 30 +- .../enums/TextureMinificationFilter.java | 70 +- .../cs/scene/enums/VerticalOrigin.java | 64 +- .../scene/interaction/AbstractPrimitive.java | 310 +- .../cs/scene/interaction/CirclePrimitive.java | 134 +- .../scene/interaction/CorridorPrimitive.java | 214 +- .../cs/scene/interaction/DrawInteraction.java | 1142 +++--- .../cs/scene/interaction/MarkerGroup.java | 279 +- .../cs/scene/interaction/MarkerType.java | 2 +- .../cs/scene/interaction/PointPrimitive.java | 46 +- .../scene/interaction/PolygonPrimitive.java | 64 +- .../cs/scene/interaction/PrimitiveType.java | 2 +- .../scene/interaction/RectanglePrimitive.java | 68 +- .../options/AbstractPrimitiveOptions.java | 48 +- .../options/CirclePrimitiveOptions.java | 52 +- .../options/CorridorPrimitiveOptions.java | 44 +- .../options/DrawInteractionOptions.java | 40 +- .../cs/scene/options/BillboardOptions.java | 360 +- .../cs/scene/options/CameraFlyToOptions.java | 184 +- .../scene/options/Cesium3DTilesetOptions.java | 699 ++-- .../ClassificationPrimitiveOptions.java | 185 +- .../options/DebugCameraPrimitiveOptions.java | 101 +- .../DebugModelMatrixPrimitiveOptions.java | 73 +- .../options/DirectionalLightOptions.java | 47 +- .../DiscardMissingTileImagePolicyOptions.java | 55 +- .../cs/scene/options/FromGltfOptions.java | 201 +- .../GroundPolylinePrimitiveOptions.java | 137 +- .../scene/options/GroundPrimitiveOptions.java | 143 +- .../cs/scene/options/ImageryLayerOptions.java | 343 +- .../cs/scene/options/LabelOptions.java | 367 +- .../cs/scene/options/MaterialOptions.java | 71 +- .../scene/options/ModelAnimationOptions.java | 117 +- .../cs/scene/options/ModelOptions.java | 430 ++- .../cs/scene/options/MoonOptions.java | 43 +- .../options/PointCloudShadingOptions.java | 106 +- .../scene/options/PointPrimitiveOptions.java | 155 +- .../cs/scene/options/PolylineOptions.java | 93 +- .../PostProcessStageCompositeOptions.java | 71 +- .../options/PostProcessStageOptions.java | 155 +- .../cs/scene/options/PrimitiveOptions.java | 175 +- .../cs/scene/options/SceneOptions.java | 144 +- .../cs/scene/options/ShadowMapOptions.java | 129 +- .../cs/scene/options/SunLightOptions.java | 29 +- .../options/TimeDynamicPointCloudOptions.java | 153 +- .../cs/scene/options/ViewOptions.java | 69 +- .../cesiumjs/cs/scene/particle/Particle.java | 141 +- .../cs/scene/particle/ParticleBurst.java | 93 +- .../cs/scene/particle/ParticleSystem.java | 377 +- .../options/ParticleBurstOptions.java | 41 +- .../particle/options/ParticleOptions.java | 123 +- .../options/ParticleSystemOptions.java | 341 +- .../ArcGisMapServerImageryProvider.java | 444 ++- .../providers/BingMapsImageryProvider.java | 416 +-- .../cs/scene/providers/BingMapsStyle.java | 122 +- .../GoogleEarthEnterpriseImageryProvider.java | 372 +- .../scene/providers/GridImageryProvider.java | 343 +- .../cs/scene/providers/ImageryProvider.java | 4 +- .../scene/providers/IonImageryProvider.java | 420 ++- .../providers/MapboxImageryProvider.java | 344 +- .../OpenStreetMapImageryProvider.java | 39 +- .../providers/SingleTileImageryProvider.java | 330 +- .../TileCoordinatesImageryProvider.java | 347 +- .../TileMapServiceImageryProvider.java | 35 +- .../providers/UrlTemplateImageryProvider.java | 453 ++- .../WebMapServiceImageryProvider.java | 389 +- .../WebMapTileServiceImageryProvider.java | 392 +- ...ArcGisMapServerImageryProviderOptions.java | 213 +- .../BingMapsImageryProviderOptions.java | 141 +- ...EarthEnterpriseImageryProviderOptions.java | 119 +- .../options/GridImageryProviderOptions.java | 125 +- .../options/IonImageryProviderOptions.java | 69 +- .../options/MapboxImageryProviderOptions.java | 133 +- .../OpenStreetMapImageryProviderOptions.java | 101 +- .../SingleTileImageryProviderOptions.java | 73 +- ...TileCoordinatesImageryProviderOptions.java | 79 +- .../TileMapServiceImageryProviderOptions.java | 165 +- .../UrlTemplateImageryProviderOptions.java | 339 +- .../WebMapServiceImageryProviderOptions.java | 259 +- ...bMapTileServiceImageryProviderOptions.java | 241 +- .../org/cesiumjs/cs/widgets/Animation.java | 335 +- .../cs/widgets/AnimationViewModel.java | 313 +- .../cesiumjs/cs/widgets/BaseLayerPicker.java | 86 +- .../cs/widgets/BaseLayerPickerViewModel.java | 121 +- .../cs/widgets/Cesium3DTilesInspector.java | 82 +- .../Cesium3DTilesInspectorViewModel.java | 757 ++-- .../cesiumjs/cs/widgets/CesiumInspector.java | 82 +- .../org/cesiumjs/cs/widgets/CesiumWidget.java | 384 +- .../cs/widgets/CesiumWidgetPanel.java | 43 +- .../cesiumjs/cs/widgets/ClockViewModel.java | 197 +- .../java/org/cesiumjs/cs/widgets/Command.java | 53 +- .../cesiumjs/cs/widgets/FullscreenButton.java | 115 +- .../cs/widgets/FullscreenButtonViewModel.java | 132 +- .../org/cesiumjs/cs/widgets/Geocoder.java | 127 +- .../cs/widgets/GeocoderViewModel.java | 192 +- .../org/cesiumjs/cs/widgets/HomeButton.java | 71 +- .../cs/widgets/HomeButtonViewModel.java | 65 +- .../java/org/cesiumjs/cs/widgets/InfoBox.java | 89 +- .../cesiumjs/cs/widgets/InfoBoxViewModel.java | 129 +- .../cs/widgets/NavigationHelpButton.java | 74 +- .../NavigationHelpButtonViewModel.java | 68 +- .../cesiumjs/cs/widgets/ProjectionPicker.java | 90 +- .../cs/widgets/ProjectionPickerViewModel.java | 151 +- .../cs/widgets/ProviderViewModel.java | 115 +- .../cesiumjs/cs/widgets/SceneModePicker.java | 150 +- .../cs/widgets/SceneModePickerViewModel.java | 189 +- .../cs/widgets/SelectionIndicator.java | 83 +- .../widgets/SelectionIndicatorViewModel.java | 168 +- .../org/cesiumjs/cs/widgets/Timeline.java | 130 +- .../cs/widgets/ToggleButtonViewModel.java | 65 +- .../org/cesiumjs/cs/widgets/VRButton.java | 126 +- .../cs/widgets/VRButtonViewModel.java | 138 +- .../java/org/cesiumjs/cs/widgets/Viewer.java | 1108 +++--- .../org/cesiumjs/cs/widgets/ViewerPanel.java | 43 +- .../BaseLayerPickerViewModelOptions.java | 91 +- .../widgets/options/CesiumWidgetOptions.java | 244 +- .../cs/widgets/options/FlyToOptions.java | 35 +- .../cs/widgets/options/GeocoderOptions.java | 134 +- .../options/GeocoderViewModelOptions.java | 87 +- .../options/NavigationHelpButtonOptions.java | 97 +- .../options/ProviderViewModelOptions.java | 95 +- .../options/ToggleButtonViewModelOptions.java | 28 +- .../ViewerCesiumNavigationMixinOptions.java | 77 +- .../cs/widgets/options/ViewerOptions.java | 532 ++- .../viewerCesium3DTilesInspectorMixin.java | 14 +- .../widgets/viewerCesiumInspectorMixin.java | 18 +- .../widgets/viewerCesiumNavigationMixin.java | 4 +- .../org/cesiumjs/linker/CesiumLinker.java | 48 +- .../cesiumjs/linker/CesiumLinkerUtils.java | 46 +- .../cesiumjs/linker/CesiumScriptInjector.java | 260 +- .../resources/org/cesiumjs/Cesium.gwt.xml | 4 +- .../org/cesiumjs/CesiumClientBundle.gwt.xml | 8 +- .../org/cesiumjs/CesiumNoScript.gwt.xml | 10 +- .../org/cesiumjs/CesiumScript.gwt.xml | 6 +- .../org/cesiumjs/CesiumUnminified.gwt.xml | 4 +- .../cesiumjs/CesiumUnminifiedScript.gwt.xml | 6 +- .../java/org/cesiumjs/cs/BaseTestCase.java | 61 +- .../test/java/org/cesiumjs/cs/CesiumTest.java | 66 +- .../java/org/cesiumjs/cs/CesiumTestSuite.java | 68 +- .../ClippingPlaneCollectionTest.java | 19 +- .../collections/DataSourceCollectionTest.java | 41 +- .../cs/collections/LabelCollectionTest.java | 154 +- .../org/cesiumjs/cs/core/Cartesian2Test.java | 29 +- .../java/org/cesiumjs/cs/core/ColorTest.java | 21 +- ...onditionGeometryInstanceAttributeTest.java | 55 +- .../cesiumjs/cs/core/Intersections2DTest.java | 86 +- .../org/cesiumjs/cs/core/IonResourceTest.java | 48 +- .../java/org/cesiumjs/cs/core/PlaneTest.java | 17 +- .../geometry/CoplanarPolygonGeometryTest.java | 27 +- .../geometry/GroundPolylineGeometryTest.java | 29 +- .../cs/scene/Cesium3DTilesetTest.java | 73 +- .../cs/scene/GroundPolylinePrimitiveTest.java | 55 +- .../java/org/cesiumjs/cs/scene/LabelTest.java | 50 +- .../cesiumjs/cs/widgets/ViewerPanelTest.java | 42 +- cesiumjs4gwt-showcase/pom.xml | 2 +- .../cleanlogic/cesiumjs4gwt/Showcase.gwt.xml | 2 +- .../showcase/DialogBoxWithCloseButton.java | 172 +- .../cesiumjs4gwt/showcase/ExampleBean.java | 234 +- .../cesiumjs4gwt/showcase/ExamplePanel.java | 158 +- .../cesiumjs4gwt/showcase/InfoPanel.java | 97 +- .../cesiumjs4gwt/showcase/Resources.java | 64 +- .../cesiumjs4gwt/showcase/Showcase.java | 38 +- .../showcase/basic/AbstractExample.java | 128 +- .../showcase/basic/AbstractSourceButton.java | 110 +- .../showcase/basic/ExampleConstants.java | 31 +- .../showcase/basic/ShowSourceButton.java | 64 +- .../components/IShowcaseExamplePanel.java | 30 +- .../components/ShowcaseExamplePanel.java | 99 +- .../components/ShowcaseSearchPanel.java | 145 +- .../showcase/components/ShowcaseTopPanel.java | 67 +- .../showcase/components/list/ULComponent.java | 109 +- .../responsibility/AllExamplesHandler.java | 50 +- .../responsibility/BuilderManager.java | 35 +- .../responsibility/KvpParameterHandler.java | 62 +- .../ShowcaseBuilderHandler.java | 62 +- .../ShowcaseBuilderManager.java | 29 +- .../components/store/ExampleStore.java | 37 +- .../store/ShowcaseExampleStore.java | 68 +- .../showcase/config/Injector.java | 57 +- .../showcase/config/InjectorModule.java | 198 +- .../provider/ShowcaseBrandsProvider.java | 22 +- .../config/provider/ShowcaseLogoProvider.java | 39 +- .../showcase/examples/AmbientOcclusion.java | 267 +- .../examples/ArcGISTiledElevationTerrain.java | 55 +- .../showcase/examples/Billboards.java | 570 ++- .../cesiumjs4gwt/showcase/examples/Bloom.java | 282 +- .../cesiumjs4gwt/showcase/examples/CZML.java | 109 +- .../examples/CZMLModelArticulations.java | 169 +- .../CZMLPolygonIntervalsAvailability.java | 41 +- .../showcase/examples/CallbackProperty.java | 178 +- .../showcase/examples/Camera.java | 565 ++- .../showcase/examples/CameraTutorial.java | 382 +- .../showcase/examples/Cardboard.java | 317 +- .../examples/CartographicLimitRectangle.java | 167 +- .../showcase/examples/CesiumInspector.java | 174 +- .../showcase/examples/CesiumNavigation.java | 57 +- .../showcase/examples/Clampto3DModel.java | 203 +- .../showcase/examples/Clampto3DTiles.java | 127 +- .../showcase/examples/ClamptoTerrain.java | 594 ++- .../showcase/examples/Clustering.java | 408 ++- .../examples/CustomBaseLayerPicker.java | 230 +- .../showcase/examples/CustomGeocoder.java | 130 +- .../showcase/examples/CustomHomeButton.java | 81 +- .../examples/CustomPerFeaturePostProcess.java | 131 +- .../showcase/examples/CustomPostProcess.java | 87 +- .../showcase/examples/DepthOfField.java | 264 +- .../showcase/examples/Drawing.java | 488 ++- .../showcase/examples/DrawingOnTerrain.java | 373 +- .../examples/ElevationBandMaterial.java | 2 +- .../showcase/examples/ExportKML.java | 319 +- .../showcase/examples/GeoJSONAndTopoJSON.java | 222 +- .../showcase/examples/GeoJSONsimplestyle.java | 69 +- .../examples/GeometryAndAppearances.java | 1071 +++--- .../examples/GeometryHeightReference.java | 207 +- .../examples/GoogleEarthEnterprise.java | 59 +- .../showcase/examples/GroundAtmosphere.java | 544 ++- .../examples/GroundPolylinePrimitive.java | 154 +- .../showcase/examples/HeadingPitchRoll.java | 395 +- .../showcase/examples/HelloWorld.java | 53 +- .../showcase/examples/ImageBasedLighting.java | 325 +- .../showcase/examples/ImageryAdjustment.java | 449 ++- .../examples/ImageryColorToAlpha.java | 133 +- .../showcase/examples/ImageryCutout.java | 316 +- .../showcase/examples/ImageryLayers.java | 77 +- .../examples/ImageryLayersManipulation.java | 472 ++- .../showcase/examples/ImageryLayersSplit.java | 138 +- .../showcase/examples/Interpolation.java | 361 +- .../cesiumjs4gwt/showcase/examples/KML.java | 133 +- .../showcase/examples/Labels.java | 349 +- .../showcase/examples/LensFlare.java | 229 +- .../showcase/examples/LoadImages.java | 269 +- .../showcase/examples/Materials.java | 965 +++-- .../showcase/examples/Models3D.java | 218 +- .../showcase/examples/Models3DColoring.java | 696 ++-- .../examples/MultipleSyncedViews.java | 151 +- .../showcase/examples/ParticleSystem.java | 1111 +++--- .../examples/ParticleSystemFireworks.java | 316 +- .../examples/PerFeaturePostProcessing.java | 204 +- .../showcase/examples/Picking.java | 542 ++- .../showcase/examples/PolylineArrow.java | 77 +- .../showcase/examples/PolylineDash.java | 163 +- .../showcase/examples/PolylinesOn3DTiles.java | 243 +- .../showcase/examples/PostProcessing.java | 261 +- .../examples/SampleHeightFrom3DTiles.java | 188 +- .../showcase/examples/Shadows.java | 650 ++-- .../showcase/examples/SkyAtmosphere.java | 330 +- .../examples/SpheresAndEllipsoids.java | 103 +- .../showcase/examples/Terrain.java | 453 ++- .../examples/TerrainClippingPlanes.java | 173 +- .../showcase/examples/Tiles3DBIM.java | 63 +- .../examples/Tiles3DClippingPlanes.java | 564 ++- .../examples/Tiles3DFeaturePicking.java | 313 +- .../showcase/examples/Tiles3DInspector.java | 62 +- .../showcase/examples/Tiles3DInterior.java | 61 +- .../examples/Tiles3DPhotogrammetry.java | 63 +- .../showcase/examples/Tiles3DPointCloud.java | 63 +- .../examples/TimeDynamicPointCloud.java | 147 +- .../showcase/examples/TimeDynamicWheels.java | 229 +- .../showcase/examples/slider/RangeSlider.java | 106 +- .../showcase/examples/slider/Slider.java | 715 ++-- .../showcase/examples/slider/SliderEvent.java | 118 +- .../examples/slider/SliderListener.java | 59 +- .../examples/slider/SliderOption.java | 123 +- .../showcase/i18n/I18NMessages.java | 34 +- .../showcase/i18n/I18NMessages.properties | 7 +- .../showcase/puregwt/ShowcaseEventBus.java | 136 +- .../puregwt/ShowcaseEventBusImpl.java | 54 +- .../puregwt/event/ExampleNumberEvent.java | 59 +- .../puregwt/event/ExamplePanelBuildEvent.java | 69 +- .../puregwt/handler/ExampleNumberHandler.java | 32 +- .../handler/ExamplePanelBuildHandler.java | 32 +- .../public/examples/GeoJSONAndTopoJSON.txt | 99 +- pom.xml | 2 +- 725 files changed, 67014 insertions(+), 68578 deletions(-) create mode 100644 cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/promise/Progress.java diff --git a/cesiumjs4gwt-main/pom.xml b/cesiumjs4gwt-main/pom.xml index bfaa048b..71a1cf17 100644 --- a/cesiumjs4gwt-main/pom.xml +++ b/cesiumjs4gwt-main/pom.xml @@ -7,7 +7,7 @@ cesiumjs4gwt org.cesiumjs - 1.74 + 1.79.1-SNAPSHOT CesiumJS GWT Wrapper diff --git a/cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/Cesium.java b/cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/Cesium.java index 2f00ee8f..ceba95cc 100644 --- a/cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/Cesium.java +++ b/cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/Cesium.java @@ -16,6 +16,7 @@ package org.cesiumjs.cs; +import jsinterop.annotations.*; import org.cesiumjs.cs.collections.EntityCollection; import org.cesiumjs.cs.core.*; import org.cesiumjs.cs.core.providers.CesiumTerrainProvider; @@ -27,437 +28,433 @@ import org.cesiumjs.cs.scene.Material; import org.cesiumjs.cs.scene.Scene; import org.cesiumjs.cs.widgets.Command; -import jsinterop.annotations.JsConstructor; -import jsinterop.annotations.JsFunction; -import jsinterop.annotations.JsMethod; -import jsinterop.annotations.JsOverlay; -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsProperty; -import jsinterop.annotations.JsType; - /** * @author Serge Silaev aka iSergio */ public class Cesium { - @JsProperty(namespace = JsPackage.GLOBAL, name = "Cesium") - public static native boolean isInitialized(); - - @JsProperty(namespace = "Cesium", name = "VERSION") - public static native String version(); - - @JsProperty(namespace = JsPackage.GLOBAL, name = "CesiumPath") - public static native String path(); - - public static native void log(Object object) /*-{ - console.log(object); - }-*/; - - /** - * Fix for SmartGWT Thanks for Mark Erikson - * (https://groups.google.com/forum/#!msg/cesium-dev/ZfyW0CNRsSU/lP6KTaUpEQAJ) - */ - public static native void fixSmartGWT() /*-{ - if ($wnd.buildInDataView !== undefined) { - console.log("Native DataView restored."); - $wnd.DataView = $wnd.buildInDataView; - } else { - console.log("Native DataView not modified."); - } - }-*/; - - /** - * Given a non-relative moduleID, returns an absolute URL to the file - * represented by that module ID, using, in order of preference, require.toUrl, - * the value of a global CESIUM_BASE_URL, or the base URL of the Cesium.js - * script. - */ - @JsMethod(namespace = "Cesium", name = "buildModuleUrl") - public static native String buildModuleUrl(String moduleId); - - @JsMethod(namespace = "Cesium") - public static native boolean defined(Object object); - - /** - * Initiates a terrain height query for an array of {@link Cartographic} - * positions by requesting tiles from a terrain provider, sampling, and - * interpolating. The interpolation matches the triangles used to render the - * terrain at the specified level. The query happens asynchronously, so this - * function returns a promise that is resolved when the query completes. Each - * point height is modified in place. If a height can not be determined because - * no terrain data is available for the specified level at that location, or - * another error occurs, the height is set to undefined. As is typical of the - * {@link Cartographic} type, the supplied height is a height above the - * reference ellipsoid (such as {@link Ellipsoid#WGS84()}) rather than an - * altitude above mean sea level. In other words, it will not necessarily be 0.0 - * if sampled in the ocean. - * - * @param terrainProvider The terrain provider from which to query heights. - * @param level The terrain level-of-detail from which to query - * terrain heights. - * @param positions The positions to update with terrain heights. - * @return A promise that resolves to the provided list of positions when - * terrain the query has completed. - */ - @JsMethod(namespace = "Cesium", name = "sampleTerrain") - public static native Promise sampleTerrain(TerrainProvider terrainProvider, int level, - Cartographic[] positions); - - /** - * Create a Command from a given function, for use with ViewModels. A Command is - * a function with an extra canExecute observable property to determine whether - * the command can be executed. When executed, a Command function will check the - * value of canExecute and throw if false. It also provides events for when a - * command has been or is about to be executed. - * - * @param func The function to execute. - * @return Command function - */ - @JsMethod(namespace = "Cesium", name = "createCommand") - public static native Command createCommand(Function func); - - /** - * Create a Command from a given function, for use with ViewModels. A Command is - * a function with an extra canExecute observable property to determine whether - * the command can be executed. When executed, a Command function will check the - * value of canExecute and throw if false. It also provides events for when a - * command has been or is about to be executed. - * - * @param func The function to execute. - * @param canExecute A boolean indicating whether the function can currently be - * executed. - * @return Command function - */ - @JsMethod(namespace = "Cesium", name = "createCommand") - public static native Command createCommand(Function func, boolean canExecute); - - /** - * A browser-independent function to request a new animation frame. This is used - * to create an application's draw loop as shown in the example below. - * - * @param callback The function to call when the next frame should be drawn. - * @return An ID that can be passed to {@link #cancelAnimationFrame} to cancel - * the request. - */ - // TODO Example - @JsMethod(namespace = "Cesium", name = "requestAnimationFrame") - public static native Number requestAnimationFrame(RequestAnimationFrameCallback callback); - - /** - * A browser-independent function to cancel an animation frame requested using - * requestAnimationFrame. - * - * @param requestID The value returned by requestAnimationFrame. - */ - @JsMethod(namespace = "Cesium", name = "cancelAnimationFrame") - public static native void cancelAnimationFrame(Number requestID); - - /** - * Initiates a sampleTerrain() request at the maximum available tile level for a - * terrain dataset. - * - * @param terrainProvider The terrain provider from which to query heights. - * @param positions The positions to update with terrain heights. - * @return A promise that resolves to the provided list of positions when - * terrain the query has completed. This promise will reject if the - * terrain provider's `availability` property is undefined. - * - *
-   *     Example:
-   *     {@code
-   *     CesiumTerrainProviderOptions options = new CesiumTerrainProviderOptions();
-   *     options.url = "https://assets.agi.com/stk-terrain/world";
-   *     CesiumTerrainProvider terrainProvider = new CesiumTerrainProvider(options);
-   *     Cartographic[] positions = new Cartographic[] {Cartographic.fromDegrees(86.925145, 27.988257), Cartographic.fromDegrees(87.0, 28.0)};
-   *     Promise promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
-   *     promise.then(new Fulfill() {
-   *         {@literal @}Override
-   *         public void onFulfilled(Cartographic[] updatedPositions) {
-   *             //
-   *         }
-   *     });
-   *     }
-   *         
- */ - @JsMethod(namespace = "Cesium", name = "sampleTerrainMostDetailed") - public static native Promise sampleTerrainMostDetailed(TerrainProvider terrainProvider, - Cartographic[] positions); - - // TODO: Example - /** - * Destroys an object. Each of the object's functions, including functions in - * its prototype, is replaced with a function that throws a DeveloperError, - * except for the object's isDestroyed function, which is set to a function that - * returns true. The object's properties are removed with delete. - * - * This function is used by objects that hold native resources, e.g., WebGL - * resources, which need to be - * - * explicitly released. Client code calls an object's destroy function, which - * then releases the native resource and calls destroyObject to put itself in a - * destroyed state. - * - * @param object The object to destroy. - */ - @JsMethod(namespace = "Cesium", name = "destroyObject") - public static native void destroyObject(Object object); - - // TODO: Example - /** - * Destroys an object. Each of the object's functions, including functions in - * its prototype, is replaced with a function that throws a DeveloperError, - * except for the object's isDestroyed function, which is set to a function that - * returns true. The object's properties are removed with delete. - * - * This function is used by objects that hold native resources, e.g., WebGL - * resources, which need to be - * - * explicitly released. Client code calls an object's destroy function, which - * then releases the native resource and calls destroyObject to put itself in a - * destroyed state. - * - * @param object The object to destroy. - * @param message The message to include in the exception that is thrown if a - * destroyed object's function is called. - */ - @JsMethod(namespace = "Cesium", name = "destroyObject") - public static native void destroyObject(Object object, String message); - - /** - * Creates a {@link CesiumTerrainProvider} instance for the - * Cesium World - * Terrain. - * - * @return {@link CesiumTerrainProvider} instance for the - * Cesium World - * Terrain. - */ - @JsMethod(namespace = "Cesium", name = "createWorldTerrain") - public static native CesiumTerrainProvider createWorldTerrain(); - - /** - * Creates a {@link CesiumTerrainProvider} instance for the - * Cesium World - * Terrain. - * - * @param options {@link CreateWorldTerrainOptions} object. - * @return {@link CesiumTerrainProvider} instance for the - * Cesium World - * Terrain. - */ - @JsMethod(namespace = "Cesium", name = "createWorldTerrain") - public static native CesiumTerrainProvider createWorldTerrain(CreateWorldTerrainOptions options); - - /** - * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, - * Path, Polygon, Polyline geometries will be exported. Note that there is not a - * 1 to 1 mapping of Entity properties to KML Feature properties. For example, - * entity properties that are time dynamic but cannot be dynamic in KML are - * exported with their values at options.time or the beginning of the - * EntityCollection's time interval if not specified. For time-dynamic - * properties that are supported in KML, we use the samples if it is a - * {@link org.cesiumjs.cs.datasources.properties.SampledProperty} otherwise we - * sample the value using the options.sampleDuration. Point, Billboard, Model - * and Path geometries with time-dynamic positions will be exported as gx:Track - * Features. Not all Materials are representable in KML, so for more advanced - * Materials just the primary color is used. Canvas objects are exported as PNG - * images. - * - * @param options object with properties - * @return A promise that resolved to an object containing the KML string and a - * dictionary of external file blobs, or a kmz file as a blob if - * options.kmz is true. - */ - @JsMethod(namespace = "Cesium", name = "exportKml") - public static native Promise exportKml(ExportKmlOptions options); - - /** - * Creates a Material that combines multiple layers of color/gradient bands and maps them to terrain heights. - * The shader does a binary search over all the heights to find out which colors are above and below a given height, - * and interpolates between them for the final color. This material supports hundreds of entries relatively cheaply. - * @param options {@link ElevationBandMaterialOptions} with the following properties - * @return A new Material instance. - */ - @JsMethod(namespace = "Cesium", name = "createElevationBandMaterial") - public static native Material createElevationBandMaterial(ElevationBandMaterialOptions options); - - @JsFunction - public interface Function { - Object function(Object... args); - } - - @JsFunction - public interface RequestAnimationFrameCallback { + @JsProperty(namespace = JsPackage.GLOBAL, name = "Cesium") + public static native boolean isInitialized(); + + @JsProperty(namespace = "Cesium", name = "VERSION") + public static native String version(); + + @JsProperty(namespace = JsPackage.GLOBAL, name = "CesiumPath") + public static native String path(); + + public static native void log(Object object) /*-{ + console.log(object); + }-*/; + /** - * A function that will be called when the next frame should be drawn. - * - * @param timestamp A timestamp for the frame, in milliseconds. + * Fix for SmartGWT Thanks for Mark Erikson + * (https://groups.google.com/forum/#!msg/cesium-dev/ZfyW0CNRsSU/lP6KTaUpEQAJ) */ - @SuppressWarnings("unusable-by-js") - void Callback(Number timestamp); - } + public static native void fixSmartGWT() /*-{ + if ($wnd.buildInDataView !== undefined) { + console.log("Native DataView restored."); + $wnd.DataView = $wnd.buildInDataView; + } else { + console.log("Native DataView not modified."); + } + }-*/; - @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object") - public static class CreateWorldTerrainOptions { /** - * Flag that indicates if the client should request additional lighting - * information from the server if available. Default: false + * Given a non-relative moduleID, returns an absolute URL to the file + * represented by that module ID, using, in order of preference, require.toUrl, + * the value of a global CESIUM_BASE_URL, or the base URL of the Cesium.js + * script. */ - @JsProperty - public boolean requestVertexNormals; + @JsMethod(namespace = "Cesium", name = "buildModuleUrl") + public static native String buildModuleUrl(String moduleId); + + @JsMethod(namespace = "Cesium") + public static native boolean defined(Object object); + /** - * Flag that indicates if the client should request per tile water masks from - * the server if available. Default: false + * Initiates a terrain height query for an array of {@link Cartographic} + * positions by requesting tiles from a terrain provider, sampling, and + * interpolating. The interpolation matches the triangles used to render the + * terrain at the specified level. The query happens asynchronously, so this + * function returns a promise that is resolved when the query completes. Each + * point height is modified in place. If a height can not be determined because + * no terrain data is available for the specified level at that location, or + * another error occurs, the height is set to undefined. As is typical of the + * {@link Cartographic} type, the supplied height is a height above the + * reference ellipsoid (such as {@link Ellipsoid#WGS84()}) rather than an + * altitude above mean sea level. In other words, it will not necessarily be 0.0 + * if sampled in the ocean. + * + * @param terrainProvider The terrain provider from which to query heights. + * @param level The terrain level-of-detail from which to query + * terrain heights. + * @param positions The positions to update with terrain heights. + * @return A promise that resolves to the provided list of positions when + * terrain the query has completed. */ - @JsProperty - public boolean requestWaterMask; + @JsMethod(namespace = "Cesium", name = "sampleTerrain") + public static native Promise sampleTerrain(TerrainProvider terrainProvider, int level, + Cartographic[] positions); - @JsConstructor - public CreateWorldTerrainOptions() { - } + /** + * Create a Command from a given function, for use with ViewModels. A Command is + * a function with an extra canExecute observable property to determine whether + * the command can be executed. When executed, a Command function will check the + * value of canExecute and throw if false. It also provides events for when a + * command has been or is about to be executed. + * + * @param func The function to execute. + * @return Command function + */ + @JsMethod(namespace = "Cesium", name = "createCommand") + public static native Command createCommand(Function func); /** - * Create instance for {@link Cesium#createWorldTerrain()}. + * Create a Command from a given function, for use with ViewModels. A Command is + * a function with an extra canExecute observable property to determine whether + * the command can be executed. When executed, a Command function will check the + * value of canExecute and throw if false. It also provides events for when a + * command has been or is about to be executed. * - * @param requestVertexNormals Flag that indicates if the client should request - * additional lighting information from the server - * if available. - * @return instance for {@link Cesium#createWorldTerrain()}. + * @param func The function to execute. + * @param canExecute A boolean indicating whether the function can currently be + * executed. + * @return Command function */ - @JsOverlay - public static CreateWorldTerrainOptions create(boolean requestVertexNormals) { - CreateWorldTerrainOptions options = new CreateWorldTerrainOptions(); - options.requestVertexNormals = requestVertexNormals; - return options; - } + @JsMethod(namespace = "Cesium", name = "createCommand") + public static native Command createCommand(Function func, boolean canExecute); /** - * Create instance for {@link Cesium#createWorldTerrain()}. + * A browser-independent function to request a new animation frame. This is used + * to create an application's draw loop as shown in the example below. * - * @param requestVertexNormals Flag that indicates if the client should request - * additional lighting information from the server - * if available. - * @param requestWaterMask Flag that indicates if the client should request - * per tile water masks from the server if - * available. - * @return instance for {@link Cesium#createWorldTerrain()}. + * @param callback The function to call when the next frame should be drawn. + * @return An ID that can be passed to {@link #cancelAnimationFrame} to cancel + * the request. */ - @JsOverlay - public static CreateWorldTerrainOptions create(boolean requestVertexNormals, boolean requestWaterMask) { - CreateWorldTerrainOptions options = new CreateWorldTerrainOptions(); - options.requestVertexNormals = requestVertexNormals; - options.requestWaterMask = requestWaterMask; - return options; - } - } + // TODO Example + @JsMethod(namespace = "Cesium", name = "requestAnimationFrame") + public static native Number requestAnimationFrame(RequestAnimationFrameCallback callback); - /** - * Options for {@link Cesium#exportKml(ExportKmlOptions)} - */ - @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object") - public static class ExportKmlOptions { /** - * The EntityCollection to export as KML. + * A browser-independent function to cancel an animation frame requested using + * requestAnimationFrame. + * + * @param requestID The value returned by requestAnimationFrame. */ - @JsProperty - public EntityCollection entities; + @JsMethod(namespace = "Cesium", name = "cancelAnimationFrame") + public static native void cancelAnimationFrame(Number requestID); + /** - * The ellipsoid for the output file. Default: {@link Ellipsoid#WGS84()} + * Initiates a sampleTerrain() request at the maximum available tile level for a + * terrain dataset. + * + * @param terrainProvider The terrain provider from which to query heights. + * @param positions The positions to update with terrain heights. + * @return A promise that resolves to the provided list of positions when + * terrain the query has completed. This promise will reject if the + * terrain provider's `availability` property is undefined. + * + *
+     *     Example:
+     *     {@code
+     *     CesiumTerrainProviderOptions options = new CesiumTerrainProviderOptions();
+     *     options.url = "https://assets.agi.com/stk-terrain/world";
+     *     CesiumTerrainProvider terrainProvider = new CesiumTerrainProvider(options);
+     *     Cartographic[] positions = new Cartographic[] {Cartographic.fromDegrees(86.925145, 27.988257), Cartographic.fromDegrees(87.0, 28.0)};
+     *     Promise promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
+     *     promise.then(new Fulfill() {
+     *         {@literal @}Override
+     *         public void onFulfilled(Cartographic[] updatedPositions) {
+     *             //
+     *         }
+     *     });
+     *     }
+     *         
*/ - @JsProperty - public Ellipsoid ellipsoid; + @JsMethod(namespace = "Cesium", name = "sampleTerrainMostDetailed") + public static native Promise sampleTerrainMostDetailed(TerrainProvider terrainProvider, + Cartographic[] positions); + + // TODO: Example + /** - * A callback that will be called with a ModelGraphics instance and should - * return the URI to use in the KML. Required if a model exists in the entity - * collection. + * Destroys an object. Each of the object's functions, including functions in + * its prototype, is replaced with a function that throws a DeveloperError, + * except for the object's isDestroyed function, which is set to a function that + * returns true. The object's properties are removed with delete. + *

+ * This function is used by objects that hold native resources, e.g., WebGL + * resources, which need to be + *

+ * explicitly released. Client code calls an object's destroy function, which + * then releases the native resource and calls destroyObject to put itself in a + * destroyed state. + * + * @param object The object to destroy. */ - @JsProperty - public ModelCallback modelCallback; + @JsMethod(namespace = "Cesium", name = "destroyObject") + public static native void destroyObject(Object object); + + // TODO: Example + /** - * The time value to use to get properties that are not time varying in KML. + * Destroys an object. Each of the object's functions, including functions in + * its prototype, is replaced with a function that throws a DeveloperError, + * except for the object's isDestroyed function, which is set to a function that + * returns true. The object's properties are removed with delete. + *

+ * This function is used by objects that hold native resources, e.g., WebGL + * resources, which need to be + *

+ * explicitly released. Client code calls an object's destroy function, which + * then releases the native resource and calls destroyObject to put itself in a + * destroyed state. + * + * @param object The object to destroy. + * @param message The message to include in the exception that is thrown if a + * destroyed object's function is called. */ - @JsProperty - public JulianDate time; + @JsMethod(namespace = "Cesium", name = "destroyObject") + public static native void destroyObject(Object object, String message); + /** - * The interval that will be sampled if an entity doesn't have an availability. + * Creates a {@link CesiumTerrainProvider} instance for the + * Cesium World + * Terrain. + * + * @return {@link CesiumTerrainProvider} instance for the + * Cesium World + * Terrain. */ - @JsProperty - public TimeInterval defaultAvailability; + @JsMethod(namespace = "Cesium", name = "createWorldTerrain") + public static native CesiumTerrainProvider createWorldTerrain(); + /** - * The number of seconds to sample properties that are varying in KML. Default: - * 60 + * Creates a {@link CesiumTerrainProvider} instance for the + * Cesium World + * Terrain. + * + * @param options {@link CreateWorldTerrainOptions} object. + * @return {@link CesiumTerrainProvider} instance for the + * Cesium World + * Terrain. */ - @JsProperty - public int sampleDuration; + @JsMethod(namespace = "Cesium", name = "createWorldTerrain") + public static native CesiumTerrainProvider createWorldTerrain(CreateWorldTerrainOptions options); + /** - * If true KML and external files will be compressed into a kmz file. Default: - * false + * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, + * Path, Polygon, Polyline geometries will be exported. Note that there is not a + * 1 to 1 mapping of Entity properties to KML Feature properties. For example, + * entity properties that are time dynamic but cannot be dynamic in KML are + * exported with their values at options.time or the beginning of the + * EntityCollection's time interval if not specified. For time-dynamic + * properties that are supported in KML, we use the samples if it is a + * {@link org.cesiumjs.cs.datasources.properties.SampledProperty} otherwise we + * sample the value using the options.sampleDuration. Point, Billboard, Model + * and Path geometries with time-dynamic positions will be exported as gx:Track + * Features. Not all Materials are representable in KML, so for more advanced + * Materials just the primary color is used. Canvas objects are exported as PNG + * images. + * + * @param options object with properties + * @return A promise that resolved to an object containing the KML string and a + * dictionary of external file blobs, or a kmz file as a blob if + * options.kmz is true. */ - @JsProperty - public boolean kmz; + @JsMethod(namespace = "Cesium", name = "exportKml") + public static native Promise exportKml(ExportKmlOptions options); - @JsConstructor - private ExportKmlOptions() { - } + /** + * Creates a Material that combines multiple layers of color/gradient bands and maps them to terrain heights. + * The shader does a binary search over all the heights to find out which colors are above and below a given height, + * and interpolates between them for the final color. This material supports hundreds of entries relatively cheaply. + * + * @param options {@link ElevationBandMaterialOptions} with the following properties + * @return A new Material instance. + */ + @JsMethod(namespace = "Cesium", name = "createElevationBandMaterial") + public static native Material createElevationBandMaterial(ElevationBandMaterialOptions options); - @JsOverlay - public static ExportKmlOptions create(EntityCollection entities) { - ExportKmlOptions options = new ExportKmlOptions(); - options.entities = entities; - return options; + @JsFunction + public interface Function { + Object function(Object... args); } - /** - * Since KML does not support glTF models, this callback is required to specify - * what URL to use for the model in the KML document. It can also be used to add - * additional files to the externalFiles object, which is the list of files - * embedded in the exported KMZ, or otherwise returned with the KML string when - * exporting. - */ @JsFunction - public interface ModelCallback { - /** - * Since KML does not support glTF models, this callback is required to specify - * what URL to use for the model in the KML document. It can also be used to add - * additional files to the externalFiles object, which is the list of files - * embedded in the exported KMZ, or otherwise returned with the KML string when - * exporting. - * - * @param model The ModelGraphics instance for an Entity. - * @param time The time that any properties should use to get the - * value. - * @param externalFiles An object that maps a filename to a Blob or a Promise - * that resolves to a Blob. - * @return The URL to use for the href in the KML document. - */ - String Callback(ModelGraphics model, org.cesiumjs.cs.core.JulianDate time, JsObject externalFiles); + public interface RequestAnimationFrameCallback { + /** + * A function that will be called when the next frame should be drawn. + * + * @param timestamp A timestamp for the frame, in milliseconds. + */ + @SuppressWarnings("unusable-by-js") + void Callback(Number timestamp); + } + + @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object") + public static class CreateWorldTerrainOptions { + /** + * Flag that indicates if the client should request additional lighting + * information from the server if available. Default: false + */ + @JsProperty + public boolean requestVertexNormals; + /** + * Flag that indicates if the client should request per tile water masks from + * the server if available. Default: false + */ + @JsProperty + public boolean requestWaterMask; + + @JsConstructor + public CreateWorldTerrainOptions() { + } + + /** + * Create instance for {@link Cesium#createWorldTerrain()}. + * + * @param requestVertexNormals Flag that indicates if the client should request + * additional lighting information from the server + * if available. + * @return instance for {@link Cesium#createWorldTerrain()}. + */ + @JsOverlay + public static CreateWorldTerrainOptions create(boolean requestVertexNormals) { + CreateWorldTerrainOptions options = new CreateWorldTerrainOptions(); + options.requestVertexNormals = requestVertexNormals; + return options; + } + + /** + * Create instance for {@link Cesium#createWorldTerrain()}. + * + * @param requestVertexNormals Flag that indicates if the client should request + * additional lighting information from the server + * if available. + * @param requestWaterMask Flag that indicates if the client should request + * per tile water masks from the server if + * available. + * @return instance for {@link Cesium#createWorldTerrain()}. + */ + @JsOverlay + public static CreateWorldTerrainOptions create(boolean requestVertexNormals, boolean requestWaterMask) { + CreateWorldTerrainOptions options = new CreateWorldTerrainOptions(); + options.requestVertexNormals = requestVertexNormals; + options.requestWaterMask = requestWaterMask; + return options; + } } - } - /** - * Options for {@link Cesium#createElevationBandMaterial(ElevationBandMaterialOptions)}. - */ - @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object") - public static class ElevationBandMaterialOptions { /** - * The scene where the visualization is taking place. + * Options for {@link Cesium#exportKml(ExportKmlOptions)} */ - @JsProperty - public Scene scene; + @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object") + public static class ExportKmlOptions { + /** + * The EntityCollection to export as KML. + */ + @JsProperty + public EntityCollection entities; + /** + * The ellipsoid for the output file. Default: {@link Ellipsoid#WGS84()} + */ + @JsProperty + public Ellipsoid ellipsoid; + /** + * A callback that will be called with a ModelGraphics instance and should + * return the URI to use in the KML. Required if a model exists in the entity + * collection. + */ + @JsProperty + public ModelCallback modelCallback; + /** + * The time value to use to get properties that are not time varying in KML. + */ + @JsProperty + public JulianDate time; + /** + * The interval that will be sampled if an entity doesn't have an availability. + */ + @JsProperty + public TimeInterval defaultAvailability; + /** + * The number of seconds to sample properties that are varying in KML. Default: + * 60 + */ + @JsProperty + public int sampleDuration; + /** + * If true KML and external files will be compressed into a kmz file. Default: + * false + */ + @JsProperty + public boolean kmz; + + @JsConstructor + private ExportKmlOptions() { + } + + @JsOverlay + public static ExportKmlOptions create(EntityCollection entities) { + ExportKmlOptions options = new ExportKmlOptions(); + options.entities = entities; + return options; + } + + /** + * Since KML does not support glTF models, this callback is required to specify + * what URL to use for the model in the KML document. It can also be used to add + * additional files to the externalFiles object, which is the list of files + * embedded in the exported KMZ, or otherwise returned with the KML string when + * exporting. + */ + @JsFunction + public interface ModelCallback { + /** + * Since KML does not support glTF models, this callback is required to specify + * what URL to use for the model in the KML document. It can also be used to add + * additional files to the externalFiles object, which is the list of files + * embedded in the exported KMZ, or otherwise returned with the KML string when + * exporting. + * + * @param model The ModelGraphics instance for an Entity. + * @param time The time that any properties should use to get the + * value. + * @param externalFiles An object that maps a filename to a Blob or a Promise + * that resolves to a Blob. + * @return The URL to use for the href in the KML document. + */ + String Callback(ModelGraphics model, org.cesiumjs.cs.core.JulianDate time, JsObject externalFiles); + } + } + /** - * A list of bands ordered from lowest to highest precedence. + * Options for {@link Cesium#createElevationBandMaterial(ElevationBandMaterialOptions)}. */ - @JsProperty - public ElevationBandMaterialBand[] layers; - - @JsConstructor - protected ElevationBandMaterialOptions() {} - - @JsOverlay - public static ElevationBandMaterialOptions create(Scene scene, ElevationBandMaterialBand[] layers) { - ElevationBandMaterialOptions options = new ElevationBandMaterialOptions(); - options.scene = scene; - options.layers = layers; - return options; + @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object") + public static class ElevationBandMaterialOptions { + /** + * The scene where the visualization is taking place. + */ + @JsProperty + public Scene scene; + /** + * A list of bands ordered from lowest to highest precedence. + */ + @JsProperty + public ElevationBandMaterialBand[] layers; + + @JsConstructor + protected ElevationBandMaterialOptions() { + } + + @JsOverlay + public static ElevationBandMaterialOptions create(Scene scene, ElevationBandMaterialBand[] layers) { + ElevationBandMaterialOptions options = new ElevationBandMaterialOptions(); + options.scene = scene; + options.layers = layers; + return options; + } } - } } diff --git a/cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/CesiumEntryPoint.java b/cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/CesiumEntryPoint.java index b1eccaa9..ee4ee357 100644 --- a/cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/CesiumEntryPoint.java +++ b/cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/CesiumEntryPoint.java @@ -23,16 +23,16 @@ import com.google.gwt.core.client.GWT; * @author Serge Silaev aka iSergio */ public class CesiumEntryPoint implements EntryPoint { - @Override - public void onModuleLoad() { - Cesium.fixSmartGWT(); - GWT.log("Cesium GTW module loaded"); - if (!Cesium.isInitialized()) { - String message = "The Core of Cesium (Cesium.js) JavaScript libraryes not loaded.\n" - + "If you inherit Cesium from NoScript gwt.xml, \nyou need include ');\n" + "}\n"; - } - - private String getScriptLoadJS(Set scriptsToLoad, String pageRelativeModulePath) { - String result = "if (!window." + LOADED_SCRIPTS + ") window." + LOADED_SCRIPTS + " = {};\n"; - for (ScriptReference script : scriptsToLoad) { - String src = script.getSrc(); - if (!src.startsWith("cs/")) { - continue; - } - result += "if (!" + LOADED_SCRIPTS + "['" + src + "']) {\n " + LOADED_SCRIPTS + "['" + src + "'] = true;\n " - + "document.write('');\n}\n"; - System.out.println(src); + private static final String SCRIPT_LOADER = "loadCesiumScripts.js"; + private static final String LOADED_SCRIPTS = "__gwt_cesiumScriptsLoaded"; + private static final String PAGE_RELATIVE_MODULE_PATH = "cesiumScriptInjector.pageRelativeModulePath"; + + private static String getPageRelativeModulePath(LinkerContext context) { + String moduleName = context.getModuleName(); + + List pathBindings = null; + for (ConfigurationProperty property : context.getConfigurationProperties()) { + if (PAGE_RELATIVE_MODULE_PATH.equals(property.getName())) { + pathBindings = property.getValues(); + } + } + if (pathBindings == null) + return moduleName; + + for (String binding : pathBindings) { + String[] parts = binding.split("="); + if (parts.length == 2 && moduleName.equals(parts[0])) { + System.out + .println(" Setting page-relative module path for module '" + moduleName + "' using gwt.xml config"); + return parts[1]; + } + } + + return moduleName; } - return result; - } - private static String getPageRelativeModulePath(LinkerContext context) { - String moduleName = context.getModuleName(); - - List pathBindings = null; - for (ConfigurationProperty property : context.getConfigurationProperties()) { - if (PAGE_RELATIVE_MODULE_PATH.equals(property.getName())) { - pathBindings = property.getValues(); - } + private boolean forceScriptLoad(TreeLogger logger, String moduleName, Float gwtVersion) { + try { + ModuleDef module; + Method getModuleDef; + + if (gwtVersion < 2.6f) { + getModuleDef = ModuleDefLoader.class.getDeclaredMethod("loadFromClassPath", + TreeLogger.class, String.class); + module = (ModuleDef) getModuleDef.invoke(null, logger, moduleName); + } else if (gwtVersion < 2.8f) { + Class compilerContextClass = Class.forName("com.google.gwt.dev.CompilerContext"); + Object context = compilerContextClass.getDeclaredConstructor().newInstance(); + + getModuleDef = ModuleDefLoader.class.getDeclaredMethod("loadFromClassPath", + TreeLogger.class, compilerContextClass, String.class); + module = (ModuleDef) getModuleDef.invoke(null, logger, compilerContextClass.cast(context), moduleName); + } else { + getModuleDef = ModuleDefLoader.class.getDeclaredMethod("loadFromClassPath", + TreeLogger.class, String.class, boolean.class); + module = (ModuleDef) getModuleDef.invoke(null, logger, moduleName, false); + } + + if (module != null) + return CrossSiteIframeLinker.class.equals(module.getActivePrimaryLinker()); + logger.log(TreeLogger.WARN, "Can't find module reference - not injecting scripts."); + + } catch (Throwable t) { + logger.log(TreeLogger.ERROR, "Encountered an exception while trying to resolve the ModuleDef for " + moduleName, + t); + } + return false; } - if (pathBindings == null) - return moduleName; - - for (String binding : pathBindings) { - String[] parts = binding.split("="); - if (parts.length == 2 && moduleName.equals(parts[0])) { - System.out - .println(" Setting page-relative module path for module '" + moduleName + "' using gwt.xml config"); - return parts[1]; - } + + private String getScriptLoaderJS(String pageRelativeModulePath) { + return "if (!/loaded|complete/.test(document.readyState)) {\n" + " document.write('');\n" + "}\n"; } - return moduleName; - } + private String getScriptLoadJS(Set scriptsToLoad, String pageRelativeModulePath) { + String result = "if (!window." + LOADED_SCRIPTS + ") window." + LOADED_SCRIPTS + " = {};\n"; + for (ScriptReference script : scriptsToLoad) { + String src = script.getSrc(); + if (!src.startsWith("cs/")) { + continue; + } + result += "if (!" + LOADED_SCRIPTS + "['" + src + "']) {\n " + LOADED_SCRIPTS + "['" + src + "'] = true;\n " + + "document.write('');\n}\n"; + System.out.println(src); + } + return result; + } - @Override - public String getDescription() { - return "CesiumScriptInjector"; - } + @Override + public String getDescription() { + return "CesiumScriptInjector"; + } - protected SyntheticArtifact emitString(TreeLogger logger, String what, String partialPath, LinkerContext context) - throws UnableToCompleteException { - if (context.isOutputCompact()) { - what = what.replaceAll("\n\\s*", ""); + protected SyntheticArtifact emitString(TreeLogger logger, String what, String partialPath, LinkerContext context) + throws UnableToCompleteException { + if (context.isOutputCompact()) { + what = what.replaceAll("\n\\s*", ""); + } + return super.emitString(logger, what, partialPath); } - return super.emitString(logger, what, partialPath); - } - @Override - public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts, boolean permutation) - throws UnableToCompleteException { - Float gwtVersion = Float.parseFloat(About.getGwtVersionNum().replaceFirst("([0-9]+\\.[0-9]+).*", "$1")); - String moduleName = context.getModuleName(); + @Override + public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts, boolean permutation) + throws UnableToCompleteException { + Float gwtVersion = Float.parseFloat(About.getGwtVersionNum().replaceFirst("([0-9]+\\.[0-9]+).*", "$1")); + String moduleName = context.getModuleName(); - if (permutation) { - return artifacts; - } + if (permutation) { + return artifacts; + } - Artifact scriptLoader = emitString(logger, "", SCRIPT_LOADER); - ArtifactSet result = new ArtifactSet(artifacts); - result.add(scriptLoader); + Artifact scriptLoader = emitString(logger, "", SCRIPT_LOADER); + ArtifactSet result = new ArtifactSet(artifacts); + result.add(scriptLoader); - if (gwtVersion < 2.5f || !forceScriptLoad(logger, moduleName, gwtVersion)) { - return result; - } + if (gwtVersion < 2.5f || !forceScriptLoad(logger, moduleName, gwtVersion)) { + return result; + } - Set scripts = result.find(ScriptReference.class); - if (scripts.size() == 0) { - return result; - } + Set scripts = result.find(ScriptReference.class); + if (scripts.size() == 0) { + return result; + } - Set emittedArtifacts = artifacts.find(EmittedArtifact.class); - for (EmittedArtifact emittedArtifact : emittedArtifacts) { - String partialPath = emittedArtifact.getPartialPath(); - if (!partialPath.endsWith(moduleName + ".nocache.js")) - continue; + Set emittedArtifacts = artifacts.find(EmittedArtifact.class); + for (EmittedArtifact emittedArtifact : emittedArtifacts) { + String partialPath = emittedArtifact.getPartialPath(); + if (!partialPath.endsWith(moduleName + ".nocache.js")) + continue; - System.out.println(" Invoking Linker CesiumScriptInjector"); + System.out.println(" Invoking Linker CesiumScriptInjector"); - String pageRelativeModulePath = getPageRelativeModulePath(context); + String pageRelativeModulePath = getPageRelativeModulePath(context); - System.out.println(" Creating " + SCRIPT_LOADER + " to manually load the following script tags:"); + System.out.println(" Creating " + SCRIPT_LOADER + " to manually load the following script tags:"); - result.remove(emittedArtifact); - String nocacheJS = CesiumLinkerUtils.getContents(emittedArtifact, logger); - nocacheJS += getScriptLoaderJS(pageRelativeModulePath); - result.add(emitString(logger, nocacheJS, partialPath, context)); + result.remove(emittedArtifact); + String nocacheJS = CesiumLinkerUtils.getContents(emittedArtifact, logger); + nocacheJS += getScriptLoaderJS(pageRelativeModulePath); + result.add(emitString(logger, nocacheJS, partialPath, context)); - result.remove(scriptLoader); - String loadTags = getScriptLoadJS(scripts, pageRelativeModulePath); - result.add(emitString(logger, loadTags, SCRIPT_LOADER, context)); + result.remove(scriptLoader); + String loadTags = getScriptLoadJS(scripts, pageRelativeModulePath); + result.add(emitString(logger, loadTags, SCRIPT_LOADER, context)); - break; - } + break; + } - return result; - } + return result; + } } diff --git a/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/Cesium.gwt.xml b/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/Cesium.gwt.xml index 19151f7c..4c6bff72 100644 --- a/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/Cesium.gwt.xml +++ b/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/Cesium.gwt.xml @@ -20,6 +20,6 @@ - - + + \ No newline at end of file diff --git a/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/CesiumClientBundle.gwt.xml b/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/CesiumClientBundle.gwt.xml index 8c6d4dc7..790919ae 100644 --- a/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/CesiumClientBundle.gwt.xml +++ b/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/CesiumClientBundle.gwt.xml @@ -16,11 +16,11 @@ - - - + + + - + diff --git a/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/CesiumNoScript.gwt.xml b/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/CesiumNoScript.gwt.xml index 2c8cb3f6..97513e81 100644 --- a/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/CesiumNoScript.gwt.xml +++ b/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/CesiumNoScript.gwt.xml @@ -20,16 +20,16 @@ - - + + - + - - + + diff --git a/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/CesiumScript.gwt.xml b/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/CesiumScript.gwt.xml index d31ef129..33ba9a79 100644 --- a/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/CesiumScript.gwt.xml +++ b/cesiumjs4gwt-main/src/main/resources/org/cesiumjs/CesiumScript.gwt.xml @@ -19,9 +19,9 @@ -