@Override protected void doAddExtrusionInstruction(final Graphics3DAddExtrusionInstruction graphics3dObjectAddExtrusion) { BufferedImage bufferedImage = graphics3dObjectAddExtrusion.getBufferedImage(); AppearanceDefinition appearance = graphics3dObjectAddExtrusion.getAppearance(); double thickness = graphics3dObjectAddExtrusion.getHeight(); Geometry textGeometry = getExtrusionGeometry(bufferedImage, thickness, appearance); final Node textHolder = new Node(); textHolder.attachChild(textGeometry); currentNode.attachChild(textHolder); graphics3dObjectAddExtrusion.setTextChangedListener(new ExtrusionChangedListener() { public void extrusionChanged(final BufferedImage newImage, final double thickness) { checkIfNotImmutable(); application.enqueue(new Callable<Object>() { public Object call() throws Exception { textHolder.detachAllChildren(); Geometry textGeometry = getExtrusionGeometry(newImage, thickness, graphics3dObjectAddExtrusion.getAppearance()); textHolder.attachChild(textGeometry); addAppearanceChangedListener(graphics3dObjectAddExtrusion, textGeometry); return null; } }); } }); addAppearanceChangedListener(graphics3dObjectAddExtrusion, textGeometry); }
@Override protected void doAddExtrusionInstruction(final Graphics3DAddExtrusionInstruction graphics3dObjectAddExtrusion) { BufferedImage bufferedImage = graphics3dObjectAddExtrusion.getBufferedImage(); AppearanceDefinition appearance = graphics3dObjectAddExtrusion.getAppearance(); double thickness = graphics3dObjectAddExtrusion.getHeight(); Geometry textGeometry = getExtrusionGeometry(bufferedImage, thickness, appearance); final Node textHolder = new Node(); textHolder.attachChild(textGeometry); currentNode.attachChild(textHolder); graphics3dObjectAddExtrusion.setTextChangedListener(new ExtrusionChangedListener() { public void extrusionChanged(final BufferedImage newImage, final double thickness) { checkIfNotImmutable(); application.enqueue(new Callable<Object>() { public Object call() throws Exception { textHolder.detachAllChildren(); Geometry textGeometry = getExtrusionGeometry(newImage, thickness, graphics3dObjectAddExtrusion.getAppearance()); textHolder.attachChild(textGeometry); addAppearanceChangedListener(graphics3dObjectAddExtrusion, textGeometry); return null; } }); } }); addAppearanceChangedListener(graphics3dObjectAddExtrusion, textGeometry); }