public void setCaretColor(final ReadOnlyColorRGBA caretColor) { _strip.setDefaultColor(caretColor); }
public void setCaretColor(final ReadOnlyColorRGBA caretColor) { _strip.setDefaultColor(caretColor); }
public void setDefaultColor(final ReadOnlyColorRGBA color) { for (int x = 0; x < getNumberOfChildren(); x++) { if (getChild(x) instanceof Mesh) { ((Mesh) getChild(x)).setDefaultColor(color); } } }
public void setDefaultColor(final ReadOnlyColorRGBA color) { for (int x = 0; x < getNumberOfChildren(); x++) { if (getChild(x) instanceof Mesh) { ((Mesh) getChild(x)).setDefaultColor(color); } } }
protected Mesh clone(final Mesh original) { Mesh copy = null; try { copy = original.getClass().newInstance(); } catch (final InstantiationException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } catch (final IllegalAccessException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } copy.setName(original.getName() + "_copy"); copy.getSceneHints().set(original.getSceneHints()); copy.setTransform(original.getTransform()); copy.setDefaultColor(original.getDefaultColor()); for (final StateType type : StateType.values()) { final RenderState state = original.getLocalRenderState(type); if (state != null) { copy.setRenderState(state); } } return copy; }
protected Mesh clone(final Mesh original) { Mesh copy = null; try { copy = original.getClass().newInstance(); } catch (final InstantiationException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } catch (final IllegalAccessException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } copy.setName(original.getName() + "_copy"); copy.getSceneHints().set(original.getSceneHints()); copy.setTransform(original.getTransform()); copy.setDefaultColor(original.getDefaultColor()); for (final StateType type : StateType.values()) { final RenderState state = original.getLocalRenderState(type); if (state != null) { copy.setRenderState(state); } } return copy; }
/** * Interpolates between the given colors using the * {@link ColorRGBA#lerpLocal(ReadOnlyColorRGBA, ReadOnlyColorRGBA, float)} method. */ @Override protected void interpolate(final ReadOnlyColorRGBA from, final ReadOnlyColorRGBA to, final double delta, final Mesh caller) { assert (null != from) : "parameter 'from' can not be null"; assert (null != to) : "parameter 'to' can not be null"; assert (null != caller) : "parameter 'caller' can not be null"; final ColorRGBA color = ColorRGBA.fetchTempInstance().set(caller.getDefaultColor()); color.lerpLocal(from, to, (float) delta); caller.setDefaultColor(color); ColorRGBA.releaseTempInstance(color); }
/** * Interpolates between the given colors using the * {@link ColorRGBA#lerpLocal(ReadOnlyColorRGBA, ReadOnlyColorRGBA, float)} method. */ @Override protected void interpolate(final ReadOnlyColorRGBA from, final ReadOnlyColorRGBA to, final double delta, final Mesh caller) { assert (null != from) : "parameter 'from' can not be null"; assert (null != to) : "parameter 'to' can not be null"; assert (null != caller) : "parameter 'caller' can not be null"; final ColorRGBA color = ColorRGBA.fetchTempInstance().set(caller.getDefaultColor()); color.lerpLocal(from, to, (float) delta); caller.setDefaultColor(color); ColorRGBA.releaseTempInstance(color); }
@Override public Mesh makeCopy(final boolean shareGeometricData) { // get copy of basic spatial info final Mesh mesh = (Mesh) super.makeCopy(shareGeometricData); // if we are sharing, just reuse meshdata if (shareGeometricData) { mesh.setMeshData(_meshData); } else { // make a copy of our data mesh.setMeshData(_meshData.makeCopy()); } // copy our basic properties mesh.setModelBound(_modelBound != null ? _modelBound.clone(null) : null); mesh.setDefaultColor(_defaultColor); mesh.setVisible(_isVisible); // return return mesh; }
public void draw(final Renderer renderer, final ReadOnlyTransform xform) { if (getSelectionLength() == 0) { return; } // set our alpha final ColorRGBA color = ColorRGBA.fetchTempInstance(); color.set(_standin.getDefaultColor()).setAlpha(UIComponent.getCurrentOpacity()); _standin.setDefaultColor(color); ColorRGBA.releaseTempInstance(color); // set our location _standin.setWorldTransform(xform); // draw _standin.render(renderer); }
public void draw(final Renderer renderer, final ReadOnlyTransform xform) { if (getSelectionLength() == 0) { return; } // set our alpha final ColorRGBA color = ColorRGBA.fetchTempInstance(); color.set(_standin.getDefaultColor()).setAlpha(UIComponent.getCurrentOpacity()); _standin.setDefaultColor(color); ColorRGBA.releaseTempInstance(color); // set our location _standin.setWorldTransform(xform); // draw _standin.render(renderer); }
protected Mesh createSelectionMesh() { final Mesh mesh = new Mesh("selectionMesh"); final MeshData mData = mesh.getMeshData(); mData.setVertexBuffer(BufferUtils.createVector3Buffer(6)); mData.setIndexMode(IndexMode.Triangles); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); mesh.setRenderState(blend); mesh.updateWorldRenderStates(false); mesh.setDefaultColor(ColorRGBA.LIGHT_GRAY); return mesh; }
protected Mesh createSelectionMesh() { final Mesh mesh = new Mesh("selectionMesh"); mesh.setRenderMaterial("ui/untextured/default_color.yaml"); final MeshData mData = mesh.getMeshData(); mData.setVertexBuffer(BufferUtils.createVector3Buffer(6)); mData.setIndexMode(IndexMode.Triangles); final BlendState blend = new BlendState(); blend.setBlendEnabled(true); blend.setSourceFunction(SourceFunction.SourceAlpha); blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha); mesh.setRenderState(blend); mesh.updateWorldRenderStates(false); mesh.setDefaultColor(ColorRGBA.LIGHT_GRAY); return mesh; }
public AreaEntry(final int maxSamples, final StatType type) { this.maxSamples = maxSamples; area = new Mesh("a"); area.getMeshData().setVertexBuffer(BufferUtils.createVector3Buffer(maxSamples * 2)); area.getSceneHints().setRenderBucketType(RenderBucketType.Ortho); area.getMeshData().setIndexMode(IndexMode.LineStrip); area.setDefaultColor(getColorConfig(type, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.LIGHT_GRAY))); if (!getBooleanConfig(type, ConfigKeys.ShowAreas.name(), true)) { area.getSceneHints().setCullHint(CullHint.Always); } } }
public AreaEntry(final int maxSamples, final StatType type) { this.maxSamples = maxSamples; area = new Mesh("a"); area.getMeshData().setVertexBuffer(BufferUtils.createVector3Buffer(maxSamples * 2)); area.getSceneHints().setRenderBucketType(RenderBucketType.OrthoOrder); area.getMeshData().setIndexMode(IndexMode.LineStrip); area.setDefaultColor(getColorConfig(type, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.LIGHT_GRAY))); if (!getBooleanConfig(type, ConfigKeys.ShowAreas.name(), true)) { area.getSceneHints().setCullHint(CullHint.Always); } } }
public void update(final double time, final Spatial caller) { if (_target == null) { return; } final ColorRGBA color = ColorRGBA.fetchTempInstance().set(_target.getDefaultColor()); float alpha = color.getAlpha(); alpha += _rate * time; if (_dir && alpha <= _targetAlpha) { alpha = _targetAlpha; } else if (!_dir && alpha >= _targetAlpha) { alpha = _targetAlpha; } if (alpha != 0) { _target.getSceneHints().setCullHint(CullHint.Inherit); } else { _target.getSceneHints().setCullHint(CullHint.Always); } color.setAlpha(alpha); _target.setDefaultColor(color); ColorRGBA.releaseTempInstance(color); if (alpha == _targetAlpha) { _target.removeController(this); // enable gc _target = null; } }
public void update(final double time, final Spatial caller) { if (_target == null) { return; } final ColorRGBA color = ColorRGBA.fetchTempInstance().set(_target.getDefaultColor()); float alpha = color.getAlpha(); alpha += _rate * time; if (_dir && alpha <= _targetAlpha) { alpha = _targetAlpha; } else if (!_dir && alpha >= _targetAlpha) { alpha = _targetAlpha; } if (alpha != 0) { _target.getSceneHints().setCullHint(CullHint.Inherit); } else { _target.getSceneHints().setCullHint(CullHint.Always); } color.setAlpha(alpha); _target.setDefaultColor(color); ColorRGBA.releaseTempInstance(color); if (alpha == _targetAlpha) { _target.removeController(this); // enable gc _target = null; } }
defaultColor.setAlpha(UIComponent.getCurrentOpacity()); SubTexUtil._mesh.setDefaultColor(defaultColor); ColorRGBA.releaseTempInstance(defaultColor);
defaultColor.setAlpha(UIComponent.getCurrentOpacity()); SubTexUtil._mesh.setDefaultColor(defaultColor); ColorRGBA.releaseTempInstance(defaultColor);
defaultColor.setAlpha(UIComponent.getCurrentOpacity()); SubTexUtil._mesh.setDefaultColor(defaultColor); ColorRGBA.releaseTempInstance(defaultColor);