use of net.sf.latexdraw.commands.shape.InsertPicture in project latexdraw by arnobl.
the class Pencil method configureBindings.
@Override
protected void configureBindings() {
bindPressToAddShape();
// Binds a pressure to insert a picture
nodeBinder(InsertPicture.class, new Press()).on(canvas).map(i -> new InsertPicture(ShapeFactory.INST.createPicture(getAdaptedPoint(i.getSrcLocalPoint())), canvas.getDrawing(), getPictureFileChooser())).when(i -> currentChoice.get() == EditionChoice.PICTURE && i.getButton() == MouseButton.PRIMARY).bind();
bindDnDToDrawRectangularShape();
bindDnDToDrawSquaredShape();
bindDnDToDrawFreeHandShape();
bindMultiClic2AddShape();
// Binds a pressure to show the text setter
nodeBinder(InitTextSetter.class, new Press()).on(canvas).map(i -> new InitTextSetter(textSetter, textSetter, "", getAdaptedPoint(i.getSrcLocalPoint()), null, null)).when(i -> (currentChoice.get() == EditionChoice.TEXT || currentChoice.get() == EditionChoice.PLOT) && i.getButton() == MouseButton.PRIMARY).bind();
}
Aggregations