private void bind() { EVENT_BUS.addHandler(BeforeDragStartEvent.TYPE, this); EVENT_BUS.addHandler(DragStartEvent.TYPE, this); EVENT_BUS.addHandler(DragStopEvent.TYPE, this); EVENT_BUS.addHandler(DragEvent.TYPE, this); EVENT_BUS.addHandler(DropEvent.TYPE, this); EVENT_BUS.addHandler(DeactivateDroppableEvent.TYPE, this); EVENT_BUS.addHandler(ActivateDroppableEvent.TYPE, this); EVENT_BUS.addHandler(OutDroppableEvent.TYPE, this); EVENT_BUS.addHandler(OverDroppableEvent.TYPE, this); }
@Override public void refreshUniforms(Camera camera, boolean isGammaInput) { super.refreshUniforms(camera, isGammaInput); final Map<String, Uniform> uniforms = getShader().getUniforms(); uniforms.get("psColor").setValue(getColor()); uniforms.get("opacity").setValue(getOpacity()); uniforms.get("size").setValue(getSize()); EVENT_BUS.addHandler( ViewportResizeEvent.TYPE, new ViewportResizeHandler() { @Override public void onResize(ViewportResizeEvent event) { uniforms.get("scale").setValue(event.getRenderer().getAbsoluteHeight() / 2.0); } }); // Default uniforms.get("scale").setValue(500 / 2.0); uniforms.get("map").setValue(getMap()); }