public void setHeight(double height) { this.thickness = height; notifyChangedListener(); }
public Graphics3DAddExtrusionInstruction(String text, double thickness, AppearanceDefinition appearance) { this(); this.thickness = thickness; this.setText(text); this.setAppearance(appearance); }
/** * Create an extrusion of a BufferedImage. Black pixels of the image are extruded. * A pixel is considered black when (red+green+blue)/3 < 60 * * @param bufferedImageToExtrude BufferedImage to extrude * @param thickness Thinkness of extrusion * @param appearance Appearance */ public Graphics3DAddExtrusionInstruction(BufferedImage bufferedImageToExtrude, double thickness, AppearanceDefinition appearance) { this(); this.thickness = thickness; this.setBufferedImage(bufferedImageToExtrude); this.setAppearance(appearance); }
@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); }
public Graphics3DAddExtrusionInstruction addText(String text, double thickness, AppearanceDefinition yoAppearance) { Graphics3DAddExtrusionInstruction instruction = new Graphics3DAddExtrusionInstruction(text, thickness, yoAppearance); graphics3DInstructions.add(instruction); return instruction; }
public void setText(String text) { instruction.setText(text); }
public void setAppearance(AppearanceDefinition appearance) { instruction.setAppearance(appearance); }
@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); }
public Graphics3DAddExtrusionInstruction addText(String text, double thickness, AppearanceDefinition yoAppearance) { Graphics3DAddExtrusionInstruction instruction = new Graphics3DAddExtrusionInstruction(text, thickness, yoAppearance); graphics3DInstructions.add(instruction); return instruction; }
public void setText(String text) { instruction.setText(text); }
public void setAppearance(AppearanceDefinition appearance) { instruction.setAppearance(appearance); }
public Graphics3DAddExtrusionInstruction(String text, double thickness, AppearanceDefinition appearance) { this(); this.thickness = thickness; this.setText(text); this.setAppearance(appearance); }
/** * Create an extrusion of a BufferedImage. Black pixels of the image are extruded. * A pixel is considered black when (red+green+blue)/3 < 60 * * @param bufferedImageToExtrude BufferedImage to extrude * @param thickness Thinkness of extrusion * @param appearance Appearance */ public Graphics3DAddExtrusionInstruction(BufferedImage bufferedImageToExtrude, double thickness, AppearanceDefinition appearance) { this(); this.thickness = thickness; this.setBufferedImage(bufferedImageToExtrude); this.setAppearance(appearance); }
public void setBufferedImage(BufferedImage newImage) { this.bufferedImageToExtrude = newImage; notifyChangedListener(); }
/** * Create an extrusion of a BufferedImage. Black pixels of the image are extruded. * A pixel is considered black when (red+green+blue)/3 < 60 * * @param bufferedImageToExtrude BufferedImage to extrude * @param thickness Thinkness of extrusion * @param appearance Appearance */ public Graphics3DAddExtrusionInstruction addExtrusion(BufferedImage bufferedImageToExtrude, double thickness, AppearanceDefinition appearance) { Graphics3DAddExtrusionInstruction instruction = new Graphics3DAddExtrusionInstruction(bufferedImageToExtrude, thickness, appearance); graphics3DInstructions.add(instruction); return instruction; }
public void setHeight(double height) { this.thickness = height; notifyChangedListener(); }
/** * Create an extrusion of a BufferedImage. Black pixels of the image are extruded. * A pixel is considered black when (red+green+blue)/3 < 60 * * @param bufferedImageToExtrude BufferedImage to extrude * @param thickness Thinkness of extrusion * @param appearance Appearance */ public Graphics3DAddExtrusionInstruction addExtrusion(BufferedImage bufferedImageToExtrude, double thickness, AppearanceDefinition appearance) { Graphics3DAddExtrusionInstruction instruction = new Graphics3DAddExtrusionInstruction(bufferedImageToExtrude, thickness, appearance); graphics3DInstructions.add(instruction); return instruction; }
public void setBufferedImage(BufferedImage newImage) { this.bufferedImageToExtrude = newImage; notifyChangedListener(); }
public void setText(String text) { Rectangle2D bounds = font.getStringBounds(text, fontRenderContext); int width = (int) bounds.getWidth(); int height = (int) bounds.getHeight(); bufferedImageToExtrude = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR); Graphics g = bufferedImageToExtrude.getGraphics(); g.setColor(Color.white); g.fillRect(0, 0, width, height); g.setColor(Color.black); g.setFont(font); g.drawString(text, 0, (int) (height + bounds.getCenterY())); g.dispose(); notifyChangedListener(); }
public void setText(String text) { Rectangle2D bounds = font.getStringBounds(text, fontRenderContext); int width = (int) bounds.getWidth(); int height = (int) bounds.getHeight(); bufferedImageToExtrude = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR); Graphics g = bufferedImageToExtrude.getGraphics(); g.setColor(Color.white); g.fillRect(0, 0, width, height); g.setColor(Color.black); g.setFont(font); g.drawString(text, 0, (int) (height + bounds.getCenterY())); g.dispose(); notifyChangedListener(); }