我使用UndoFX将撤消和重做功能转换为矩形。
到目前为止它的位置,大小和旋转都很好,除了形状的fillProperty
颜色。
问题在于我无法将我的形状与ColorPicker
组件绑定,我得到了无限的例外:
Rectangle.fill:无法设置绑定值。
我如何使用undofx函数和绑定?
colorField.valueProperty().setValue((Color) (currentSelected.getRect().fillProperty().getValue()));
currentSelected.getRect().fillProperty().bind(colorField.valueProperty());
previousSelected.getRect().fillProperty().unbind();