diff --git a/OutlawEditor/src/main/java/org/badvision/outlaweditor/data/PropertyHelper.java b/OutlawEditor/src/main/java/org/badvision/outlaweditor/data/PropertyHelper.java index 6e7bbaa6..c17a8af8 100644 --- a/OutlawEditor/src/main/java/org/badvision/outlaweditor/data/PropertyHelper.java +++ b/OutlawEditor/src/main/java/org/badvision/outlaweditor/data/PropertyHelper.java @@ -32,7 +32,7 @@ public class PropertyHelper { return new JavaBeanStringPropertyBuilder().bean(t).name(fieldName).build(); } - static private Map boundProperties = new HashMap<>(); + private static final Map boundProperties = new HashMap<>(); static public void bind(Property formProp, Property sourceProp) { if (boundProperties.containsKey(formProp)) { diff --git a/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/EntitySelectorCell.java b/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/EntitySelectorCell.java index 00efb1ab..01a11317 100644 --- a/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/EntitySelectorCell.java +++ b/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/EntitySelectorCell.java @@ -10,7 +10,6 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import javafx.beans.binding.Bindings; -import javafx.scene.control.ListCell; import javafx.scene.control.TextField; import javafx.scene.control.cell.ComboBoxListCell; import org.badvision.outlaweditor.data.PropertyHelper; @@ -33,21 +32,7 @@ public abstract class EntitySelectorCell extends ComboBoxListCell { @Override public void updateSelected(boolean sel) { -// if (sel) { -// Object o = lastSelected.get(nameField); -// if (o != null && !o.equals(getItem())) { -// ((ListCell) o).updateSelected(false); -// } -// textProperty().unbind(); -// if (categoryField != null) { -// textProperty().bind(Bindings.concat(categoryField.textProperty(), "/", nameField.textProperty())); -// } else { -// textProperty().bind(Bindings.concat(nameField.textProperty())); -// } -// lastSelected.put(nameField, this); -// } else { - updateItem(getItem(), false); -// } + updateItem(getItem(), false); } @Override @@ -59,8 +44,8 @@ public abstract class EntitySelectorCell extends ComboBoxListCell { if (categoryField != null) { textProperty().bind( Bindings.concat( - PropertyHelper.stringProp(item, "category"), - "/", + PropertyHelper.stringProp(item, "category"), + "/", PropertyHelper.stringProp(item, "name") ) ); 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 85cbf168..7eaba8f4 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 @@ -4,12 +4,10 @@ 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; import javafx.scene.control.ListView; -import javafx.scene.control.cell.ComboBoxListCell; import javafx.util.StringConverter; import org.badvision.outlaweditor.Application; import org.badvision.outlaweditor.Editor; diff --git a/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/impl/MapEditorTabControllerImpl.java b/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/impl/MapEditorTabControllerImpl.java index 6dfe49ab..0903e2bb 100644 --- a/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/impl/MapEditorTabControllerImpl.java +++ b/OutlawEditor/src/main/java/org/badvision/outlaweditor/ui/impl/MapEditorTabControllerImpl.java @@ -20,6 +20,7 @@ import static org.badvision.outlaweditor.data.PropertyHelper.stringProp; import org.badvision.outlaweditor.data.TileUtils; import org.badvision.outlaweditor.data.xml.Map; import org.badvision.outlaweditor.data.xml.Script; +import org.badvision.outlaweditor.data.xml.Tile; import org.badvision.outlaweditor.ui.EntitySelectorCell; import org.badvision.outlaweditor.ui.MapEditorTabController; import org.badvision.outlaweditor.ui.ToolType; @@ -278,12 +279,12 @@ public class MapEditorTabControllerImpl extends MapEditorTabController { @Override public void rebuildTileSelectors() { mapSelectTile.getItems().clear(); - Application.gameData.getTile().stream().map((t) -> { + Application.gameData.getTile().stream().map((Tile t) -> { WritableImage img = TileUtils.getImage(t, currentPlatform); ImageView iv = new ImageView(img); MenuItem mapSelectItem = new MenuItem(String.valueOf(t.getCategory())+"/"+String.valueOf(t.getName()), iv); mapSelectItem.setGraphic(new ImageView(TileUtils.getImage(t, currentPlatform))); - mapSelectItem.setOnAction((ActionEvent event) -> { + mapSelectItem.setOnAction((event) -> { if (getCurrentEditor() != null) { getCurrentEditor().setCurrentTile(t); }