diff --git a/OutlawEditor/src/main/java/org/badvision/outlaweditor/apple/AppleImageEditor.java b/OutlawEditor/src/main/java/org/badvision/outlaweditor/apple/AppleImageEditor.java index ffbdf32b..39d2bd37 100644 --- a/OutlawEditor/src/main/java/org/badvision/outlaweditor/apple/AppleImageEditor.java +++ b/OutlawEditor/src/main/java/org/badvision/outlaweditor/apple/AppleImageEditor.java @@ -73,6 +73,7 @@ public class AppleImageEditor extends ImageEditor implements EventHandler imageSelector; // Value injected by FXMLLoader @FXML // fx:id="imageWidthField" protected TextField imageWidthField; // Value injected by FXMLLoader + @FXML + protected Label zoomLabel; @FXML public void initalize() { - assert imageCategoryField != null : "fx:id=\"imageCategoryField\" was not injected: check your FXML file 'ApplicationUI.fxml'."; - assert imageEditorAnchorPane != null : "fx:id=\"imageEditorAnchorPane\" was not injected: check your FXML file 'ApplicationUI.fxml'."; - assert imageHeightField != null : "fx:id=\"imageHeightField\" was not injected: check your FXML file 'ApplicationUI.fxml'."; - assert imageNameField != null : "fx:id=\"imageNameField\" was not injected: check your FXML file 'ApplicationUI.fxml'."; - assert imagePatternMenu != null : "fx:id=\"imagePatternMenu\" was not injected: check your FXML file 'ApplicationUI.fxml'."; - assert imageSelector != null : "fx:id=\"imageSelector\" was not injected: check your FXML file 'ApplicationUI.fxml'."; - assert imageWidthField != null : "fx:id=\"imageWidthField\" was not injected: check your FXML file 'ApplicationUI.fxml'."; - assert imageEditorScrollPane != null : "fx:id\"imageEditorScrollPane\" was not injected: check your FXML file 'ApplicationUI.fxml'"; - assert imageEditorZoomGroup != null : "fx:id\"imageEditorZoomGroup\" was not injected: check your FXML file 'ApplicationUI.fxml'"; - assert imageEditorScrollAnchorPane != null : "fx:id\"imageEditorScrollAnchorPane\" was not injected: check your FXML file 'ApplicationUI.fxml'"; + assert imageCategoryField != null : "fx:id=\"imageCategoryField\" was not injected: check your FXML file 'imageEditorTab.fxml'."; + assert imageEditorAnchorPane != null : "fx:id=\"imageEditorAnchorPane\" was not injected: check your FXML file 'imageEditorTab.fxml'."; + assert imageHeightField != null : "fx:id=\"imageHeightField\" was not injected: check your FXML file 'imageEditorTab.fxml'."; + assert imageNameField != null : "fx:id=\"imageNameField\" was not injected: check your FXML file 'imageEditorTab.fxml'."; + assert imagePatternMenu != null : "fx:id=\"imagePatternMenu\" was not injected: check your FXML file 'imageEditorTab.fxml'."; + assert imageSelector != null : "fx:id=\"imageSelector\" was not injected: check your FXML file 'imageEditorTab.fxml'."; + assert imageWidthField != null : "fx:id=\"imageWidthField\" was not injected: check your FXML file 'imageEditorTab.fxml'."; + assert imageEditorScrollPane != null : "fx:id\"imageEditorScrollPane\" was not injected: check your FXML file 'imageEditorTab.fxml'"; + assert imageEditorZoomGroup != null : "fx:id\"imageEditorZoomGroup\" was not injected: check your FXML file 'imageEditorTab.fxml'"; + assert imageEditorScrollAnchorPane != null : "fx:id\"imageEditorScrollAnchorPane\" was not injected: check your FXML file 'imageEditorTab.fxml'"; + assert zoomLabel != null : "fx:id=\"zoomLabel\" was not injected: check your FXML file 'imageEditorTab.fxml'."; } abstract public void rebuildImageSelector(); diff --git a/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/impl/ImageEditorTabControllerImpl.java b/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/impl/ImageEditorTabControllerImpl.java index a32e73a1..7f549f7c 100644 --- a/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/impl/ImageEditorTabControllerImpl.java +++ b/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/impl/ImageEditorTabControllerImpl.java @@ -5,6 +5,7 @@ import java.util.List; import org.badvision.outlaweditor.ui.EntitySelectorCell; import java.util.logging.Level; import java.util.logging.Logger; +import javafx.beans.binding.Bindings; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.event.ActionEvent; @@ -108,10 +109,15 @@ public class ImageEditorTabControllerImpl extends ImageEditorTabController { } } + private void updateZoomLabel() { + zoomLabel.setText(String.format("%1.1fx",currentImageEditor.getZoomScale())); + } + @Override public void imageZoomIn(ActionEvent event) { if (currentImageEditor != null) { currentImageEditor.zoomIn(); + updateZoomLabel(); updateScrollAreaWithScale(currentImageEditor.getZoomScale()); } } @@ -120,6 +126,7 @@ public class ImageEditorTabControllerImpl extends ImageEditorTabController { public void imageZoomOut(ActionEvent event) { if (currentImageEditor != null) { currentImageEditor.zoomOut(); + updateZoomLabel(); updateScrollAreaWithScale(currentImageEditor.getZoomScale()); } } @@ -208,8 +215,8 @@ public class ImageEditorTabControllerImpl extends ImageEditorTabController { currentImageEditor.setEntity(i); currentImageEditor.buildEditorUI(imageEditorScrollAnchorPane); currentImageEditor.buildPatternSelector(imagePatternMenu); - imageEditorZoomGroup.setScaleX(1.0); - imageEditorZoomGroup.setScaleY(1.0); +// imageEditorZoomGroup.setScaleX(1.0); +// imageEditorZoomGroup.setScaleY(1.0); imageNameField.textProperty().addListener(rebuildListener); imageCategoryField.textProperty().addListener(rebuildListener); if (oldEditorState != null) { diff --git a/OutlawEditor/src/main/resources/imageEditorTab.fxml b/OutlawEditor/src/main/resources/imageEditorTab.fxml index 47065b89..ff3b9680 100644 --- a/OutlawEditor/src/main/resources/imageEditorTab.fxml +++ b/OutlawEditor/src/main/resources/imageEditorTab.fxml @@ -1,5 +1,6 @@ + @@ -67,6 +68,11 @@