From 83367456e75189a1e6f4f0682395d9aa5ca638cc Mon Sep 17 00:00:00 2001 From: PointerRage Date: Wed, 28 Sep 2016 19:18:05 +0300 Subject: [PATCH 1/3] class & object editors support customize pane --- .../properties/control/EditorContext.java | 41 +++ .../clientmod/properties/control/IEdit.java | 11 + .../skin/PropertiesEditorDefaultSkin.java | 16 +- .../control/skin/PropertyValueCell.java | 298 +++--------------- .../skin/edit/AbstractCustomizeEdit.java | 21 ++ .../control/skin/edit/ArrayEdit.java | 80 +++++ .../control/skin/edit/BoolEdit.java | 31 ++ .../control/skin/edit/ByteEdit.java | 40 +++ .../control/skin/edit/ClassEdit.java | 102 ++++++ .../control/skin/edit/FloatEdit.java | 33 ++ .../properties/control/skin/edit/IntEdit.java | 33 ++ .../control/skin/edit/NameEdit.java | 54 ++++ .../control/skin/edit/ObjectEdit.java | 104 ++++++ .../properties/control/skin/edit/StrEdit.java | 30 ++ .../control/skin/edit/StructEdit.java | 76 +++++ 15 files changed, 715 insertions(+), 255 deletions(-) create mode 100644 src/main/java/acmi/l2/clientmod/properties/control/EditorContext.java create mode 100644 src/main/java/acmi/l2/clientmod/properties/control/IEdit.java create mode 100644 src/main/java/acmi/l2/clientmod/properties/control/skin/edit/AbstractCustomizeEdit.java create mode 100644 src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ArrayEdit.java create mode 100644 src/main/java/acmi/l2/clientmod/properties/control/skin/edit/BoolEdit.java create mode 100644 src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ByteEdit.java create mode 100644 src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ClassEdit.java create mode 100644 src/main/java/acmi/l2/clientmod/properties/control/skin/edit/FloatEdit.java create mode 100644 src/main/java/acmi/l2/clientmod/properties/control/skin/edit/IntEdit.java create mode 100644 src/main/java/acmi/l2/clientmod/properties/control/skin/edit/NameEdit.java create mode 100644 src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ObjectEdit.java create mode 100644 src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StrEdit.java create mode 100644 src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StructEdit.java diff --git a/src/main/java/acmi/l2/clientmod/properties/control/EditorContext.java b/src/main/java/acmi/l2/clientmod/properties/control/EditorContext.java new file mode 100644 index 0000000..84db7f3 --- /dev/null +++ b/src/main/java/acmi/l2/clientmod/properties/control/EditorContext.java @@ -0,0 +1,41 @@ +package acmi.l2.clientmod.properties.control; + +import acmi.l2.clientmod.unreal.core.Property; +import javafx.beans.property.ObjectProperty; +import javafx.scene.control.TreeTableRow; + +/** + * @author PointerRage + * + */ +public class EditorContext { + private final PropertiesEditor propertiesEditor; + private final TreeTableRow> treeTableRow; + private final ObjectProperty property; + private final Property template; + + public EditorContext(PropertiesEditor propertiesEditor, TreeTableRow> treeTableRow, ObjectProperty property, Property template) { + this.propertiesEditor = propertiesEditor; + this.treeTableRow = treeTableRow; + this.property = property; + this.template = template; + } + + public PropertiesEditor getPropertiesEditor() { + return propertiesEditor; + } + + public TreeTableRow> getTreeTableRow() { + return treeTableRow; + } + + public ObjectProperty getProperty() { + return property; + } + + public Property getTemplate() { + return template; + } + + +} diff --git a/src/main/java/acmi/l2/clientmod/properties/control/IEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/IEdit.java new file mode 100644 index 0000000..2a6272a --- /dev/null +++ b/src/main/java/acmi/l2/clientmod/properties/control/IEdit.java @@ -0,0 +1,11 @@ +package acmi.l2.clientmod.properties.control; + +import javafx.scene.layout.Region; + +/** + * @author PointerRage + * + */ +public interface IEdit { + Region create(EditorContext context); +} diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/PropertiesEditorDefaultSkin.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/PropertiesEditorDefaultSkin.java index 5e0a76d..b582c67 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/PropertiesEditorDefaultSkin.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/PropertiesEditorDefaultSkin.java @@ -21,6 +21,13 @@ */ package acmi.l2.clientmod.properties.control.skin; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; + import acmi.l2.clientmod.io.UnrealPackage; import acmi.l2.clientmod.properties.control.PropertiesEditor; import acmi.l2.clientmod.unreal.UnrealSerializerFactory; @@ -34,13 +41,6 @@ import javafx.beans.property.SimpleObjectProperty; import javafx.scene.control.TreeItem; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; - public class PropertiesEditorDefaultSkin extends TreeBasedPropertiesEditorSkin { public PropertiesEditorDefaultSkin(PropertiesEditor editor) { super(editor); @@ -121,7 +121,7 @@ static TreeItem> buildItem(List object, Strin } } - static List>> fillArrayTree(String structName, ArrayProperty property, String name, List list, UnrealPackage up, UnrealSerializerFactory serializer, boolean editableOnly, boolean hideCategories) { + public static List>> fillArrayTree(String structName, ArrayProperty property, String name, List list, UnrealPackage up, UnrealSerializerFactory serializer, boolean editableOnly, boolean hideCategories) { List>> children = new ArrayList<>(); for (int i = 0; i < list.size(); i++) { int ind = i; diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/PropertyValueCell.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/PropertyValueCell.java index cc28642..76ec240 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/PropertyValueCell.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/PropertyValueCell.java @@ -21,43 +21,54 @@ */ package acmi.l2.clientmod.properties.control.skin; +import static acmi.l2.clientmod.properties.control.skin.PropertiesEditorDefaultSkin.fillArrayTree; + +import java.util.List; +import java.util.Locale; +import java.util.Objects; +import java.util.stream.Collectors; + import acmi.l2.clientmod.io.UnrealPackage; -import acmi.l2.clientmod.properties.control.IntSliderEditor; +import acmi.l2.clientmod.properties.control.EditorContext; +import acmi.l2.clientmod.properties.control.IEdit; import acmi.l2.clientmod.properties.control.PropertiesEditor; +import acmi.l2.clientmod.properties.control.skin.edit.ArrayEdit; +import acmi.l2.clientmod.properties.control.skin.edit.BoolEdit; +import acmi.l2.clientmod.properties.control.skin.edit.ByteEdit; +import acmi.l2.clientmod.properties.control.skin.edit.ClassEdit; +import acmi.l2.clientmod.properties.control.skin.edit.FloatEdit; +import acmi.l2.clientmod.properties.control.skin.edit.IntEdit; +import acmi.l2.clientmod.properties.control.skin.edit.NameEdit; +import acmi.l2.clientmod.properties.control.skin.edit.ObjectEdit; +import acmi.l2.clientmod.properties.control.skin.edit.StrEdit; +import acmi.l2.clientmod.properties.control.skin.edit.StructEdit; import acmi.l2.clientmod.unreal.UnrealSerializerFactory; -import acmi.l2.clientmod.unreal.core.*; +import acmi.l2.clientmod.unreal.core.ArrayProperty; +import acmi.l2.clientmod.unreal.core.BoolProperty; +import acmi.l2.clientmod.unreal.core.ByteProperty; +import acmi.l2.clientmod.unreal.core.ClassProperty; import acmi.l2.clientmod.unreal.core.Enum; +import acmi.l2.clientmod.unreal.core.FloatProperty; +import acmi.l2.clientmod.unreal.core.IntProperty; +import acmi.l2.clientmod.unreal.core.NameProperty; +import acmi.l2.clientmod.unreal.core.Property; +import acmi.l2.clientmod.unreal.core.StrProperty; +import acmi.l2.clientmod.unreal.core.StructProperty; import acmi.l2.clientmod.unreal.properties.L2Property; import acmi.l2.clientmod.unreal.properties.PropertiesUtil; -import acmi.util.AutoCompleteComboBox; -import javafx.beans.InvalidationListener; import javafx.beans.property.ObjectProperty; -import javafx.collections.FXCollections; -import javafx.collections.ObservableList; -import javafx.scene.control.*; +import javafx.scene.control.Button; +import javafx.scene.control.ContentDisplay; +import javafx.scene.control.Label; +import javafx.scene.control.TreeItem; +import javafx.scene.control.TreeTableCell; import javafx.scene.layout.ColumnConstraints; import javafx.scene.layout.GridPane; import javafx.scene.layout.Priority; import javafx.scene.layout.Region; -import javafx.scene.paint.Color; - -import java.lang.Object; -import java.util.Collections; -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.function.Predicate; -import java.util.function.Supplier; -import java.util.logging.Logger; -import java.util.stream.Collectors; - -import static acmi.l2.clientmod.properties.control.skin.PropertiesEditorDefaultSkin.fillArrayTree; - -class PropertyValueCell extends TreeTableCell, Object> { - private static final Logger log = Logger.getLogger(PropertyValueCell.class.getName()); +public class PropertyValueCell extends TreeTableCell, Object> { private final PropertiesEditor properties; - { setContentDisplay(ContentDisplay.GRAPHIC_ONLY); } @@ -136,240 +147,33 @@ protected Region createEditor(ObjectProperty property) { if (template.arrayDimension > 1 && property.get() == null) return new Label("..."); - + + IEdit editor = null; if (template instanceof ByteProperty) { - ByteProperty byteProperty = (ByteProperty) template; - if (byteProperty.enumType != null) { - ComboBox cb = new ComboBox<>(); - cb.getItems().addAll(byteProperty.enumType.values); - cb.getSelectionModel().select((Integer) property.get()); - cb.getSelectionModel().selectedIndexProperty().addListener((observable, oldValue, newValue) -> { - property.setValue(newValue); - }); - return cb; - } else { - IntSliderEditor editor = new IntSliderEditor(0, 255, (Integer) property.get()); - editor.valueProperty().bindBidirectional((javafx.beans.property.Property) property); - return editor; - } + editor = ByteEdit.getInstance(); } else if (template instanceof IntProperty) { - TextField tf = new TextField(String.valueOf(property.get())); - tf.textProperty().addListener((observable, oldValue, newValue) -> { - try { - property.setValue(Integer.valueOf(newValue)); - } catch (NumberFormatException ignore) { - } - }); - return tf; + editor = IntEdit.getInstance(); } else if (template instanceof BoolProperty) { - CheckBox cb = new CheckBox(); - cb.setSelected((Boolean) property.getValue()); - cb.selectedProperty().addListener((observable, oldValue, newValue) -> { - property.setValue(newValue); - }); - return cb; + editor = BoolEdit.getInstance(); } else if (template instanceof FloatProperty) { - TextField tf = new TextField(String.valueOf(property.get())); - tf.textProperty().addListener((observable, oldValue, newValue) -> { - try { - property.setValue(Float.parseFloat(newValue)); - } catch (NumberFormatException ignore) { - } - }); - return tf; + editor = FloatEdit.getInstance(); } else if (template instanceof ClassProperty) { - String type = ((ClassProperty) template).clazz.getFullName(); - ObservableList entries = FXCollections.observableArrayList(); - Predicate filter = entry -> entry.getFullClassName().equalsIgnoreCase("Core.Class") && getPropertiesEditor().getSerializer().isSubclass(type, entry.getObjectFullName()); - entries.addAll(getPropertiesEditor().getUnrealPackage().getImportTable().parallelStream().filter(filter).collect(Collectors.toList())); - entries.addAll(getPropertiesEditor().getUnrealPackage().getExportTable().parallelStream().filter(filter).collect(Collectors.toList())); - Collections.sort(entries, (e1, e2) -> e1.getObjectFullName().compareToIgnoreCase(e2.getObjectFullName())); - if (entries.isEmpty()) { - int val = (Integer) property.get(); - if (val != 0) { - log.warning(() -> "No entries found for " + template); - - entries.add(getPropertiesEditor().getUnrealPackage().objectReference(val)); - } - } - entries.add(0, new UnrealPackage.Entry(null, 0, 0, 0) { - @Override - public String getObjectInnerFullName() { - return "None"; - } - - @Override - public String getFullClassName() { - return type; - } - - @Override - public int getObjectReference() { - return 0; - } - - @Override - public List getTable() { - return null; - } - }); - ComboBox cb = new ComboBox<>(entries); - AutoCompleteComboBox.autoCompleteComboBox(cb, AutoCompleteComboBox.AutoCompleteMode.CONTAINING); - UnrealPackage.Entry v = cb.getItems() - .parallelStream() - .filter(entry -> entry.getObjectReference() == (Integer) property.get()) - .findAny() - .orElseThrow(() -> new IllegalStateException("Entry not found: " + property.get() + "(" + getPropertiesEditor().getUnrealPackage().objectReference((Integer) property.get()) + ")")); - cb.getSelectionModel().select(v); - cb.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { - property.setValue(newValue == null ? 0 : newValue.getObjectReference()); - }); - return cb; + editor = ClassEdit.getInstance(); } else if (template instanceof acmi.l2.clientmod.unreal.core.ObjectProperty) { - String type = ((acmi.l2.clientmod.unreal.core.ObjectProperty) template).type.getFullName(); - ObservableList entries = FXCollections.observableArrayList(); - Predicate filter = entry -> getPropertiesEditor().getSerializer().isSubclass(type, entry.getFullClassName()); - entries.addAll(getPropertiesEditor().getUnrealPackage().getImportTable().parallelStream().filter(filter).collect(Collectors.toList())); - entries.addAll(getPropertiesEditor().getUnrealPackage().getExportTable().parallelStream().filter(filter).collect(Collectors.toList())); - Collections.sort(entries, (e1, e2) -> e1.getObjectFullName().compareToIgnoreCase(e2.getObjectFullName())); - if (entries.isEmpty()) { - int val = (Integer) property.get(); - if (val != 0) { - log.warning(() -> "No entries found for " + template); - - entries.add(getPropertiesEditor().getUnrealPackage().objectReference(val)); - } - } - entries.add(0, new UnrealPackage.Entry(null, 0, 0, 0) { - @Override - public String getObjectInnerFullName() { - return "None"; - } - - @Override - public String getFullClassName() { - return type; - } - - @Override - public int getObjectReference() { - return 0; - } - - @Override - public List getTable() { - return null; - } - }); - ComboBox cb = new ComboBox<>(entries); - AutoCompleteComboBox.autoCompleteComboBox(cb, AutoCompleteComboBox.AutoCompleteMode.CONTAINING); - UnrealPackage.Entry v = cb.getItems() - .parallelStream() - .filter(entry -> entry.getObjectReference() == (Integer) property.get()) - .findAny() - .orElseThrow(() -> new IllegalStateException("Entry not found: " + property.get() + "(" + getPropertiesEditor().getUnrealPackage().objectReference((Integer) property.get()) + ")")); - cb.getSelectionModel().select(v); - cb.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { - property.setValue(newValue == null ? 0 : newValue.getObjectReference()); - }); - return cb; + editor = ObjectEdit.getInstance(); } else if (template instanceof NameProperty) { - UnrealPackage.NameEntry noneEntry = getPropertiesEditor().getUnrealPackage().getNameTable() - .parallelStream() - .filter(nameEntry -> nameEntry.getName().equalsIgnoreCase("None")) - .findAny() - .orElseThrow(() -> new IllegalStateException("Name entry not found")); - ObservableList names = FXCollections.observableList(getPropertiesEditor().getUnrealPackage().getNameTable() - .parallelStream() - .sorted((e1, e2) -> e1 == noneEntry ? -1 : e2 == noneEntry ? 1 : - e1.getName().compareToIgnoreCase(e2.getName())) - .collect(Collectors.toList())); - ComboBox cb = new ComboBox<>(names); - AutoCompleteComboBox.autoCompleteComboBox(cb, AutoCompleteComboBox.AutoCompleteMode.CONTAINING); - cb.getSelectionModel().select(names - .parallelStream() - .filter(nameEntry -> nameEntry.getIndex() == (Integer) property.get()) - .findAny() - .orElseThrow(() -> new IllegalStateException("Name entry not found"))); - cb.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { - if (newValue == null) - newValue = noneEntry; - property.setValue(newValue.getIndex()); - }); - return cb; + editor = NameEdit.getInstance(); } else if (template instanceof ArrayProperty) { - TreeItem> item = getTreeTableRow().getTreeItem(); - List list = (List) item.getValue().get(); - Button empty = new Button("Empty"); - empty.setMinWidth(Region.USE_PREF_SIZE); - empty.setOnAction(event -> { - list.clear(); - item.getChildren().clear(); - }); - Button add = new Button("Add"); - add.setMinWidth(Region.USE_PREF_SIZE); - add.setOnAction(event -> { - Object value = PropertiesUtil.defaultValue(((ArrayProperty) template).inner, null, getPropertiesEditor().getSerializer(), getPropertiesEditor().getUnrealPackage()); - list.add(value); - item.getChildren().clear(); - item.getChildren().addAll(fillArrayTree(null, (ArrayProperty) template, template.entry.getObjectName().getName(), list, getPropertiesEditor().getUnrealPackage(), getPropertiesEditor().getSerializer(), getPropertiesEditor().getEditableOnly(), getPropertiesEditor().getHideCategories())); - }); - GridPane pane = new GridPane(); - pane.add(new Label("..."), 0, 0); - pane.add(empty, 2, 0); - pane.add(add, 3, 0); - pane.getColumnConstraints().addAll( - new ColumnConstraints() {{ - setMinWidth(0); - }}, - new ColumnConstraints() {{ - setHgrow(Priority.ALWAYS); - }}, - new ColumnConstraints(), - new ColumnConstraints()); - return pane; + editor = ArrayEdit.getInstance(); } else if (template instanceof StructProperty) { - List struct = (List) property.get(); - if (((StructProperty) template).struct.getFullName().equalsIgnoreCase("Core.Object.Color")) { - java.util.function.Function> f = name -> getTreeTableRow() - .getTreeItem() - .getChildren() - .stream() - .filter(ti -> ti.getValue().getName().equalsIgnoreCase(name)) - .findAny() - .map(TreeItem::getValue) - .orElseThrow(() -> new IllegalThreadStateException("Color component not found: " + name)); - ObjectProperty a = f.apply("A"); - ObjectProperty r = f.apply("R"); - ObjectProperty g = f.apply("G"); - ObjectProperty b = f.apply("B"); - Supplier colorSupplier = () -> Color.rgb((Integer) r.get(), (Integer) g.get(), (Integer) b.get(), ((Integer) a.get()) / 255.0); - ColorPicker cp = new ColorPicker(colorSupplier.get()); - InvalidationListener il = observable -> cp.setValue(colorSupplier.get()); - a.addListener(il); - r.addListener(il); - g.addListener(il); - b.addListener(il); - cp.valueProperty().addListener((observable, oldValue, newValue) -> { - a.set((int) Math.round(255 * newValue.getOpacity())); - r.set((int) Math.round(255 * newValue.getRed())); - g.set((int) Math.round(255 * newValue.getGreen())); - b.set((int) Math.round(255 * newValue.getBlue())); - }); - return cp; - } else { - String text = struct == null ? "" : inlineStruct(struct, getPropertiesEditor().getUnrealPackage(), getPropertiesEditor().getSerializer()).toString(); - return new Label(text); - } + editor = StructEdit.getInstance(); } else if (template instanceof StrProperty) { - TextField tf = new TextField(String.valueOf(property.get())); - tf.textProperty().addListener((observable, oldValue, newValue) -> { - property.setValue(newValue); - }); - return tf; + editor = StrEdit.getInstance(); } - - return null; + + return editor == null ? + null : + editor.create(new EditorContext(getPropertiesEditor(), getTreeTableRow(), property, template)); } public static CharSequence inlineProperty(L2Property property, UnrealPackage up, UnrealSerializerFactory objectFactory, boolean valueOnly) { diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/AbstractCustomizeEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/AbstractCustomizeEdit.java new file mode 100644 index 0000000..41778cc --- /dev/null +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/AbstractCustomizeEdit.java @@ -0,0 +1,21 @@ +package acmi.l2.clientmod.properties.control.skin.edit; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Function; + +import acmi.l2.clientmod.properties.control.EditorContext; +import acmi.l2.clientmod.properties.control.IEdit; +import javafx.scene.Node; + +/** + * @author PointerRage + * + */ +abstract class AbstractCustomizeEdit implements IEdit { + protected final List> customElements = new ArrayList<>(0); + + public void addElement(Function function) { + customElements.add(function); + } +} diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ArrayEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ArrayEdit.java new file mode 100644 index 0000000..6c87b98 --- /dev/null +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ArrayEdit.java @@ -0,0 +1,80 @@ +package acmi.l2.clientmod.properties.control.skin.edit; + +import java.util.List; + +import acmi.l2.clientmod.properties.control.EditorContext; +import acmi.l2.clientmod.properties.control.IEdit; +import acmi.l2.clientmod.properties.control.skin.PropertiesEditorDefaultSkin; +import acmi.l2.clientmod.unreal.core.ArrayProperty; +import acmi.l2.clientmod.unreal.properties.PropertiesUtil; +import javafx.beans.property.ObjectProperty; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TreeItem; +import javafx.scene.layout.ColumnConstraints; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Priority; +import javafx.scene.layout.Region; + +/** + * @author PointerRage + * + */ +public class ArrayEdit implements IEdit { + private final static ArrayEdit instance = new ArrayEdit(); + public static ArrayEdit getInstance() { + return instance; + } + + private ArrayEdit() { + } + + @Override + public Region create(EditorContext context) { + TreeItem> item = context.getTreeTableRow().getTreeItem(); + List list = (List) item.getValue().get(); + Button empty = new Button("Empty"); + empty.setMinWidth(Region.USE_PREF_SIZE); + empty.setOnAction(event -> { + list.clear(); + item.getChildren().clear(); + }); + Button add = new Button("Add"); + add.setMinWidth(Region.USE_PREF_SIZE); + add.setOnAction(event -> { + Object value = PropertiesUtil.defaultValue( + ((ArrayProperty) context.getTemplate()).inner, + null, + context.getPropertiesEditor().getSerializer(), + context.getPropertiesEditor().getUnrealPackage() + ); + list.add(value); + item.getChildren().clear(); + item.getChildren().addAll(PropertiesEditorDefaultSkin.fillArrayTree( + null, + (ArrayProperty) context.getTemplate(), + context.getTemplate().entry.getObjectName().getName(), + list, + context.getPropertiesEditor().getUnrealPackage(), + context.getPropertiesEditor().getSerializer(), + context.getPropertiesEditor().getEditableOnly(), + context.getPropertiesEditor().getHideCategories()) + ); + }); + GridPane pane = new GridPane(); + pane.add(new Label("..."), 0, 0); + pane.add(empty, 2, 0); + pane.add(add, 3, 0); + pane.getColumnConstraints().addAll( + new ColumnConstraints() {{ + setMinWidth(0); + }}, + new ColumnConstraints() {{ + setHgrow(Priority.ALWAYS); + }}, + new ColumnConstraints(), + new ColumnConstraints()); + return pane; + } + +} diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/BoolEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/BoolEdit.java new file mode 100644 index 0000000..62e7622 --- /dev/null +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/BoolEdit.java @@ -0,0 +1,31 @@ +package acmi.l2.clientmod.properties.control.skin.edit; + +import acmi.l2.clientmod.properties.control.EditorContext; +import acmi.l2.clientmod.properties.control.IEdit; +import javafx.scene.control.CheckBox; +import javafx.scene.layout.Region; + +/** + * @author PointerRage + * + */ +public class BoolEdit implements IEdit { + private final static BoolEdit instance = new BoolEdit(); + public static BoolEdit getInstance() { + return instance; + } + + private BoolEdit() { + } + + @Override + public Region create(EditorContext context) { + CheckBox cb = new CheckBox(); + cb.setSelected((Boolean) context.getProperty().getValue()); + cb.selectedProperty().addListener((observable, oldValue, newValue) -> { + context.getProperty().setValue(newValue); + }); + return cb; + } + +} diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ByteEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ByteEdit.java new file mode 100644 index 0000000..2526ce6 --- /dev/null +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ByteEdit.java @@ -0,0 +1,40 @@ +package acmi.l2.clientmod.properties.control.skin.edit; + +import acmi.l2.clientmod.properties.control.EditorContext; +import acmi.l2.clientmod.properties.control.IEdit; +import acmi.l2.clientmod.properties.control.IntSliderEditor; +import acmi.l2.clientmod.unreal.core.ByteProperty; +import javafx.scene.control.ComboBox; +import javafx.scene.layout.Region; + +/** + * @author PointerRage + * + */ +public class ByteEdit implements IEdit { + private final static ByteEdit instance = new ByteEdit(); + public static ByteEdit getInstance() { + return instance; + } + + private ByteEdit() { + } + + @Override + public Region create(EditorContext context) { + ByteProperty byteProperty = (ByteProperty) context.getTemplate(); + if (byteProperty.enumType != null) { + ComboBox cb = new ComboBox<>(); + cb.getItems().addAll(byteProperty.enumType.values); + cb.getSelectionModel().select((Integer) context.getProperty().get()); + cb.getSelectionModel().selectedIndexProperty().addListener((observable, oldValue, newValue) -> { + context.getProperty().setValue(newValue); + }); + return cb; + } else { + IntSliderEditor editor = new IntSliderEditor(0, 255, (Integer) context.getProperty().get()); + editor.valueProperty().bindBidirectional((javafx.beans.property.Property) context.getProperty()); + return editor; + } + } +} diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ClassEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ClassEdit.java new file mode 100644 index 0000000..d9fe466 --- /dev/null +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ClassEdit.java @@ -0,0 +1,102 @@ +package acmi.l2.clientmod.properties.control.skin.edit; + +import java.util.Collections; +import java.util.List; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +import acmi.l2.clientmod.io.UnrealPackage; +import acmi.l2.clientmod.properties.control.EditorContext; +import acmi.l2.clientmod.properties.control.PropertiesEditor; +import acmi.l2.clientmod.unreal.core.ClassProperty; +import acmi.l2.clientmod.unreal.core.Property; +import acmi.util.AutoCompleteComboBox; +import javafx.beans.property.ObjectProperty; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.scene.Node; +import javafx.scene.control.ComboBox; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Region; + +/** + * @author PointerRage + * + */ +public class ClassEdit extends AbstractCustomizeEdit { + private final static Logger log = Logger.getLogger(ClassEdit.class.getName()); + private final static ClassEdit instance = new ClassEdit(); + public static ClassEdit getInstance() { + return instance; + } + + @Override + public Region create(EditorContext context) { + final Property template = context.getTemplate(); + final PropertiesEditor propertiesEditor = context.getPropertiesEditor(); + final ObjectProperty property = context.getProperty(); + + String type = ((ClassProperty) template).clazz.getFullName(); + ObservableList entries = FXCollections.observableArrayList(); + Predicate filter = entry -> entry.getFullClassName().equalsIgnoreCase("Core.Class") && propertiesEditor.getSerializer().isSubclass(type, entry.getObjectFullName()); + entries.addAll(propertiesEditor.getUnrealPackage().getImportTable().parallelStream().filter(filter).collect(Collectors.toList())); + entries.addAll(propertiesEditor.getUnrealPackage().getExportTable().parallelStream().filter(filter).collect(Collectors.toList())); + Collections.sort(entries, (e1, e2) -> e1.getObjectFullName().compareToIgnoreCase(e2.getObjectFullName())); + if (entries.isEmpty()) { + int val = (Integer) property.get(); + if (val != 0) { + log.warning(() -> "No entries found for " + template); + + entries.add(propertiesEditor.getUnrealPackage().objectReference(val)); + } + } + entries.add(0, new UnrealPackage.Entry(null, 0, 0, 0) { + @Override + public String getObjectInnerFullName() { + return "None"; + } + + @Override + public String getFullClassName() { + return type; + } + + @Override + public int getObjectReference() { + return 0; + } + + @Override + public List getTable() { + return null; + } + }); + + final GridPane pane = new GridPane(); + + ComboBox cb = new ComboBox<>(entries); + AutoCompleteComboBox.autoCompleteComboBox(cb, AutoCompleteComboBox.AutoCompleteMode.CONTAINING); + UnrealPackage.Entry v = cb.getItems() + .parallelStream() + .filter(entry -> entry.getObjectReference() == (Integer) property.get()) + .findAny() + .orElseThrow(() -> new IllegalStateException("Entry not found: " + property.get() + "(" + propertiesEditor.getUnrealPackage().objectReference((Integer) property.get()) + ")")); + cb.getSelectionModel().select(v); + cb.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { + property.setValue(newValue == null ? 0 : newValue.getObjectReference()); + }); + pane.add(cb, 0, 0); + + for(int i = 0, paneCounter = 1; i < customElements.size(); i++) { + final Function function = customElements.get(i); + Node node = function.apply(context); + if(node != null) { + pane.add(node, paneCounter++, 0); + } + } + return cb; + } + +} diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/FloatEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/FloatEdit.java new file mode 100644 index 0000000..0973241 --- /dev/null +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/FloatEdit.java @@ -0,0 +1,33 @@ +package acmi.l2.clientmod.properties.control.skin.edit; + +import acmi.l2.clientmod.properties.control.EditorContext; +import acmi.l2.clientmod.properties.control.IEdit; +import javafx.scene.control.TextField; +import javafx.scene.layout.Region; + +/** + * @author PointerRage + * + */ +public class FloatEdit implements IEdit { + private final static FloatEdit instance = new FloatEdit(); + public static FloatEdit getInstance() { + return instance; + } + + private FloatEdit() { + } + + @Override + public Region create(EditorContext context) { + TextField tf = new TextField(String.valueOf(context.getProperty().get())); + tf.textProperty().addListener((observable, oldValue, newValue) -> { + try { + context.getProperty().setValue(Float.parseFloat(newValue)); + } catch (NumberFormatException ignore) { + } + }); + return tf; + } + +} diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/IntEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/IntEdit.java new file mode 100644 index 0000000..d3f7ec4 --- /dev/null +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/IntEdit.java @@ -0,0 +1,33 @@ +package acmi.l2.clientmod.properties.control.skin.edit; + +import acmi.l2.clientmod.properties.control.EditorContext; +import acmi.l2.clientmod.properties.control.IEdit; +import javafx.scene.control.TextField; +import javafx.scene.layout.Region; + +/** + * @author PointerRage + * + */ +public class IntEdit implements IEdit { + private final static IntEdit instance = new IntEdit(); + public static IntEdit getInstance() { + return instance; + } + + private IntEdit() { + } + + @Override + public Region create(EditorContext context) { + TextField tf = new TextField(String.valueOf(context.getProperty().get())); + tf.textProperty().addListener((observable, oldValue, newValue) -> { + try { + context.getProperty().setValue(Integer.valueOf(newValue)); + } catch (NumberFormatException ignore) { + } + }); + return tf; + } + +} diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/NameEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/NameEdit.java new file mode 100644 index 0000000..78b0d7c --- /dev/null +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/NameEdit.java @@ -0,0 +1,54 @@ +package acmi.l2.clientmod.properties.control.skin.edit; + +import java.util.stream.Collectors; + +import acmi.l2.clientmod.io.UnrealPackage; +import acmi.l2.clientmod.properties.control.EditorContext; +import acmi.l2.clientmod.properties.control.IEdit; +import acmi.util.AutoCompleteComboBox; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.scene.control.ComboBox; +import javafx.scene.layout.Region; + +/** + * @author PointerRage + * + */ +public class NameEdit implements IEdit { + private final static NameEdit instance = new NameEdit(); + public static NameEdit getInstance() { + return instance; + } + + private NameEdit() { + } + + @Override + public Region create(EditorContext context) { + UnrealPackage.NameEntry noneEntry = context.getPropertiesEditor().getUnrealPackage().getNameTable() + .parallelStream() + .filter(nameEntry -> nameEntry.getName().equalsIgnoreCase("None")) + .findAny() + .orElseThrow(() -> new IllegalStateException("Name entry not found")); + ObservableList names = FXCollections.observableList(context.getPropertiesEditor().getUnrealPackage().getNameTable() + .parallelStream() + .sorted((e1, e2) -> e1 == noneEntry ? -1 : e2 == noneEntry ? 1 : + e1.getName().compareToIgnoreCase(e2.getName())) + .collect(Collectors.toList())); + ComboBox cb = new ComboBox<>(names); + AutoCompleteComboBox.autoCompleteComboBox(cb, AutoCompleteComboBox.AutoCompleteMode.CONTAINING); + cb.getSelectionModel().select(names + .parallelStream() + .filter(nameEntry -> nameEntry.getIndex() == (Integer) context.getProperty().get()) + .findAny() + .orElseThrow(() -> new IllegalStateException("Name entry not found"))); + cb.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { + if (newValue == null) + newValue = noneEntry; + context.getProperty().setValue(newValue.getIndex()); + }); + return cb; + } + +} diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ObjectEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ObjectEdit.java new file mode 100644 index 0000000..d74df03 --- /dev/null +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ObjectEdit.java @@ -0,0 +1,104 @@ +package acmi.l2.clientmod.properties.control.skin.edit; + +import java.util.Collections; +import java.util.List; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +import acmi.l2.clientmod.io.UnrealPackage; +import acmi.l2.clientmod.properties.control.EditorContext; +import acmi.l2.clientmod.properties.control.PropertiesEditor; +import acmi.l2.clientmod.unreal.core.Property; +import acmi.util.AutoCompleteComboBox; +import javafx.beans.property.ObjectProperty; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.scene.Node; +import javafx.scene.control.ComboBox; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Region; + +/** + * @author PointerRage + * + */ +public class ObjectEdit extends AbstractCustomizeEdit { + private final static Logger log = Logger.getLogger(ObjectEdit.class.getName()); + private final static ObjectEdit instance = new ObjectEdit(); + + public static ObjectEdit getInstance() { + return instance; + } + + @Override + public Region create(EditorContext context) { + final Property template = context.getTemplate(); + final PropertiesEditor propertiesEditor = context.getPropertiesEditor(); + final ObjectProperty property = context.getProperty(); + + String type = ((acmi.l2.clientmod.unreal.core.ObjectProperty) template).type.getFullName(); + ObservableList entries = FXCollections.observableArrayList(); + Predicate filter = entry -> propertiesEditor.getSerializer().isSubclass(type, entry.getFullClassName()); + entries.addAll(propertiesEditor.getUnrealPackage().getImportTable().parallelStream().filter(filter).collect(Collectors.toList())); + entries.addAll(propertiesEditor.getUnrealPackage().getExportTable().parallelStream().filter(filter).collect(Collectors.toList())); + Collections.sort(entries, (e1, e2) -> e1.getObjectFullName().compareToIgnoreCase(e2.getObjectFullName())); + if (entries.isEmpty()) { + int val = (Integer) property.get(); + if (val != 0) { + log.warning(() -> "No entries found for " + template); + + entries.add(propertiesEditor.getUnrealPackage().objectReference(val)); + } + } + + entries.add(0, new UnrealPackage.Entry(null, 0, 0, 0) { + @Override + public String getObjectInnerFullName() { + return "None"; + } + + @Override + public String getFullClassName() { + return type; + } + + @Override + public int getObjectReference() { + return 0; + } + + @Override + public List getTable() { + return null; + } + }); + + final GridPane pane = new GridPane(); + + ComboBox cb = new ComboBox<>(entries); + AutoCompleteComboBox.autoCompleteComboBox(cb, AutoCompleteComboBox.AutoCompleteMode.CONTAINING); + UnrealPackage.Entry v = cb.getItems() + .parallelStream() + .filter(entry -> entry.getObjectReference() == (Integer) property.get()) + .findAny() + .orElseThrow(() -> new IllegalStateException("Entry not found: " + property.get() + "(" + propertiesEditor.getUnrealPackage().objectReference((Integer) property.get()) + ")")); + cb.getSelectionModel().select(v); + cb.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { + property.setValue(newValue == null ? 0 : newValue.getObjectReference()); + }); + pane.add(cb, 0, 0); + + for(int i = 0, paneCounter = 1; i < customElements.size(); i++) { + final Function function = customElements.get(i); + Node node = function.apply(context); + if(node != null) { + pane.add(node, paneCounter++, 0); + } + } + + return pane; + } + +} diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StrEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StrEdit.java new file mode 100644 index 0000000..4591b3e --- /dev/null +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StrEdit.java @@ -0,0 +1,30 @@ +package acmi.l2.clientmod.properties.control.skin.edit; + +import acmi.l2.clientmod.properties.control.EditorContext; +import acmi.l2.clientmod.properties.control.IEdit; +import javafx.scene.control.TextField; +import javafx.scene.layout.Region; + +/** + * @author PointerRage + * + */ +public class StrEdit implements IEdit { + private final static StrEdit instance = new StrEdit(); + public static StrEdit getInstance() { + return instance; + } + + private StrEdit() { + } + + @Override + public Region create(EditorContext context) { + TextField tf = new TextField(String.valueOf(context.getProperty().get())); + tf.textProperty().addListener((observable, oldValue, newValue) -> { + context.getProperty().setValue(newValue); + }); + return tf; + } + +} diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StructEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StructEdit.java new file mode 100644 index 0000000..a6525ae --- /dev/null +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StructEdit.java @@ -0,0 +1,76 @@ +package acmi.l2.clientmod.properties.control.skin.edit; + +import java.util.List; +import java.util.function.Supplier; + +import acmi.l2.clientmod.properties.control.EditorContext; +import acmi.l2.clientmod.properties.control.IEdit; +import acmi.l2.clientmod.properties.control.PropertiesEditor; +import acmi.l2.clientmod.properties.control.skin.PropertyValueCell; +import acmi.l2.clientmod.unreal.core.Property; +import acmi.l2.clientmod.unreal.core.StructProperty; +import acmi.l2.clientmod.unreal.properties.L2Property; +import javafx.beans.InvalidationListener; +import javafx.beans.property.ObjectProperty; +import javafx.scene.control.ColorPicker; +import javafx.scene.control.Label; +import javafx.scene.control.TreeItem; +import javafx.scene.control.TreeTableRow; +import javafx.scene.layout.Region; +import javafx.scene.paint.Color; + +/** + * @author PointerRage + * + */ +public class StructEdit implements IEdit { + private final static StructEdit instance = new StructEdit(); + public static StructEdit getInstance() { + return instance; + } + + private StructEdit() { + } + + @Override + public Region create(EditorContext context) { + final Property template = context.getTemplate(); + final PropertiesEditor propertiesEditor = context.getPropertiesEditor(); + final ObjectProperty property = context.getProperty(); + final TreeTableRow> treeTableRow = context.getTreeTableRow(); + + List struct = (List) property.get(); + if (((StructProperty) template).struct.getFullName().equalsIgnoreCase("Core.Object.Color")) { + java.util.function.Function> f = name -> treeTableRow + .getTreeItem() + .getChildren() + .stream() + .filter(ti -> ti.getValue().getName().equalsIgnoreCase(name)) + .findAny() + .map(TreeItem::getValue) + .orElseThrow(() -> new IllegalThreadStateException("Color component not found: " + name)); + ObjectProperty a = f.apply("A"); + ObjectProperty r = f.apply("R"); + ObjectProperty g = f.apply("G"); + ObjectProperty b = f.apply("B"); + Supplier colorSupplier = () -> Color.rgb((Integer) r.get(), (Integer) g.get(), (Integer) b.get(), ((Integer) a.get()) / 255.0); + ColorPicker cp = new ColorPicker(colorSupplier.get()); + InvalidationListener il = observable -> cp.setValue(colorSupplier.get()); + a.addListener(il); + r.addListener(il); + g.addListener(il); + b.addListener(il); + cp.valueProperty().addListener((observable, oldValue, newValue) -> { + a.set((int) Math.round(255 * newValue.getOpacity())); + r.set((int) Math.round(255 * newValue.getRed())); + g.set((int) Math.round(255 * newValue.getGreen())); + b.set((int) Math.round(255 * newValue.getBlue())); + }); + return cp; + } else { + String text = struct == null ? "" : PropertyValueCell.inlineStruct(struct, propertiesEditor.getUnrealPackage(), propertiesEditor.getSerializer()).toString(); + return new Label(text); + } + } + +} From d241a4d202b2cc9aa6bce9143d17156d40346f4a Mon Sep 17 00:00:00 2001 From: PointerRage Date: Wed, 28 Sep 2016 20:37:39 +0300 Subject: [PATCH 2/3] some changes for l2pe --- .../clientmod/properties/control/EditorContext.java | 12 ++++++++++-- .../properties/control/skin/edit/ClassEdit.java | 4 +++- .../properties/control/skin/edit/ObjectEdit.java | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/acmi/l2/clientmod/properties/control/EditorContext.java b/src/main/java/acmi/l2/clientmod/properties/control/EditorContext.java index 84db7f3..31a9f4b 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/EditorContext.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/EditorContext.java @@ -2,6 +2,7 @@ import acmi.l2.clientmod.unreal.core.Property; import javafx.beans.property.ObjectProperty; +import javafx.scene.Node; import javafx.scene.control.TreeTableRow; /** @@ -13,6 +14,7 @@ public class EditorContext { private final TreeTableRow> treeTableRow; private final ObjectProperty property; private final Property template; + private Node editorNode; public EditorContext(PropertiesEditor propertiesEditor, TreeTableRow> treeTableRow, ObjectProperty property, Property template) { this.propertiesEditor = propertiesEditor; @@ -36,6 +38,12 @@ public ObjectProperty getProperty() { public Property getTemplate() { return template; } - - + + public Node getEditorNode() { + return editorNode; + } + + public void setEditorNode(Node editorNode) { + this.editorNode = editorNode; + } } diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ClassEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ClassEdit.java index d9fe466..2a63ddb 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ClassEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ClassEdit.java @@ -89,6 +89,7 @@ public List getTable() { }); pane.add(cb, 0, 0); + context.setEditorNode(cb); for(int i = 0, paneCounter = 1; i < customElements.size(); i++) { final Function function = customElements.get(i); Node node = function.apply(context); @@ -96,7 +97,8 @@ public List getTable() { pane.add(node, paneCounter++, 0); } } - return cb; + + return pane; } } diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ObjectEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ObjectEdit.java index d74df03..cc3056a 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ObjectEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ObjectEdit.java @@ -90,6 +90,7 @@ public List getTable() { }); pane.add(cb, 0, 0); + context.setEditorNode(cb); for(int i = 0, paneCounter = 1; i < customElements.size(); i++) { final Function function = customElements.get(i); Node node = function.apply(context); From 2d8bd74ec5f90f1bb5196d6eeb69e56940dbaca5 Mon Sep 17 00:00:00 2001 From: PointerRage Date: Wed, 28 Sep 2016 20:42:57 +0300 Subject: [PATCH 3/3] missing license --- .../properties/control/EditorContext.java | 21 +++++++++++++++++++ .../clientmod/properties/control/IEdit.java | 21 +++++++++++++++++++ .../skin/edit/AbstractCustomizeEdit.java | 21 +++++++++++++++++++ .../control/skin/edit/ArrayEdit.java | 21 +++++++++++++++++++ .../control/skin/edit/BoolEdit.java | 21 +++++++++++++++++++ .../control/skin/edit/ByteEdit.java | 21 +++++++++++++++++++ .../control/skin/edit/ClassEdit.java | 21 +++++++++++++++++++ .../control/skin/edit/FloatEdit.java | 21 +++++++++++++++++++ .../properties/control/skin/edit/IntEdit.java | 21 +++++++++++++++++++ .../control/skin/edit/NameEdit.java | 21 +++++++++++++++++++ .../control/skin/edit/ObjectEdit.java | 21 +++++++++++++++++++ .../properties/control/skin/edit/StrEdit.java | 21 +++++++++++++++++++ .../control/skin/edit/StructEdit.java | 21 +++++++++++++++++++ 13 files changed, 273 insertions(+) diff --git a/src/main/java/acmi/l2/clientmod/properties/control/EditorContext.java b/src/main/java/acmi/l2/clientmod/properties/control/EditorContext.java index 31a9f4b..bf29ddf 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/EditorContext.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/EditorContext.java @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2016 acmi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package acmi.l2.clientmod.properties.control; import acmi.l2.clientmod.unreal.core.Property; diff --git a/src/main/java/acmi/l2/clientmod/properties/control/IEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/IEdit.java index 2a6272a..68333b3 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/IEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/IEdit.java @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2016 acmi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package acmi.l2.clientmod.properties.control; import javafx.scene.layout.Region; diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/AbstractCustomizeEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/AbstractCustomizeEdit.java index 41778cc..42393f3 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/AbstractCustomizeEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/AbstractCustomizeEdit.java @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2016 acmi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package acmi.l2.clientmod.properties.control.skin.edit; import java.util.ArrayList; diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ArrayEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ArrayEdit.java index 6c87b98..421f1d7 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ArrayEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ArrayEdit.java @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2016 acmi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package acmi.l2.clientmod.properties.control.skin.edit; import java.util.List; diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/BoolEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/BoolEdit.java index 62e7622..f93525e 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/BoolEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/BoolEdit.java @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2016 acmi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package acmi.l2.clientmod.properties.control.skin.edit; import acmi.l2.clientmod.properties.control.EditorContext; diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ByteEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ByteEdit.java index 2526ce6..edc58fb 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ByteEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ByteEdit.java @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2016 acmi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package acmi.l2.clientmod.properties.control.skin.edit; import acmi.l2.clientmod.properties.control.EditorContext; diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ClassEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ClassEdit.java index 2a63ddb..491f175 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ClassEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ClassEdit.java @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2016 acmi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package acmi.l2.clientmod.properties.control.skin.edit; import java.util.Collections; diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/FloatEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/FloatEdit.java index 0973241..21fd48e 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/FloatEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/FloatEdit.java @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2016 acmi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package acmi.l2.clientmod.properties.control.skin.edit; import acmi.l2.clientmod.properties.control.EditorContext; diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/IntEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/IntEdit.java index d3f7ec4..8f3e31b 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/IntEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/IntEdit.java @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2016 acmi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package acmi.l2.clientmod.properties.control.skin.edit; import acmi.l2.clientmod.properties.control.EditorContext; diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/NameEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/NameEdit.java index 78b0d7c..4447eb3 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/NameEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/NameEdit.java @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2016 acmi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package acmi.l2.clientmod.properties.control.skin.edit; import java.util.stream.Collectors; diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ObjectEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ObjectEdit.java index cc3056a..31f8674 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ObjectEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/ObjectEdit.java @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2016 acmi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package acmi.l2.clientmod.properties.control.skin.edit; import java.util.Collections; diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StrEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StrEdit.java index 4591b3e..9608fa7 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StrEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StrEdit.java @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2016 acmi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package acmi.l2.clientmod.properties.control.skin.edit; import acmi.l2.clientmod.properties.control.EditorContext; diff --git a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StructEdit.java b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StructEdit.java index a6525ae..5c187d5 100644 --- a/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StructEdit.java +++ b/src/main/java/acmi/l2/clientmod/properties/control/skin/edit/StructEdit.java @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2016 acmi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package acmi.l2.clientmod.properties.control.skin.edit; import java.util.List;