Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* 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;
import javafx.beans.property.ObjectProperty;
import javafx.scene.Node;
import javafx.scene.control.TreeTableRow;

/**
* @author PointerRage
*
*/
public class EditorContext {
private final PropertiesEditor propertiesEditor;
private final TreeTableRow<ObjectProperty<Object>> treeTableRow;
private final ObjectProperty<Object> property;
private final Property template;
private Node editorNode;

public EditorContext(PropertiesEditor propertiesEditor, TreeTableRow<ObjectProperty<Object>> treeTableRow, ObjectProperty<Object> property, Property template) {
this.propertiesEditor = propertiesEditor;
this.treeTableRow = treeTableRow;
this.property = property;
this.template = template;
}

public PropertiesEditor getPropertiesEditor() {
return propertiesEditor;
}

public TreeTableRow<ObjectProperty<Object>> getTreeTableRow() {
return treeTableRow;
}

public ObjectProperty<Object> getProperty() {
return property;
}

public Property getTemplate() {
return template;
}

public Node getEditorNode() {
return editorNode;
}

public void setEditorNode(Node editorNode) {
this.editorNode = editorNode;
}
}
32 changes: 32 additions & 0 deletions src/main/java/acmi/l2/clientmod/properties/control/IEdit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* 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;

/**
* @author PointerRage
*
*/
public interface IEdit {
Region create(EditorContext context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -121,7 +121,7 @@ static TreeItem<ObjectProperty<Object>> buildItem(List<L2Property> object, Strin
}
}

static List<TreeItem<ObjectProperty<Object>>> fillArrayTree(String structName, ArrayProperty property, String name, List<Object> list, UnrealPackage up, UnrealSerializerFactory serializer, boolean editableOnly, boolean hideCategories) {
public static List<TreeItem<ObjectProperty<Object>>> fillArrayTree(String structName, ArrayProperty property, String name, List<Object> list, UnrealPackage up, UnrealSerializerFactory serializer, boolean editableOnly, boolean hideCategories) {
List<TreeItem<ObjectProperty<Object>>> children = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
int ind = i;
Expand Down
Loading