Search in sources :

Example 1 with PropertyNodeConfiguration

use of com.gempukku.libgdx.graph.config.PropertyNodeConfiguration in project gdx-graph by MarcinSc.

the class PropertyBoxImpl method createPropertyBox.

@Override
public GraphBox createPropertyBox(Skin skin, String id, float x, float y) {
    final String name = getName();
    GraphBoxImpl result = new GraphBoxImpl(id, new PropertyNodeConfiguration(name, propertyType)) {

        @Override
        public JsonValue getData() {
            JsonValue result = new JsonValue(JsonValue.ValueType.object);
            result.addChild("name", new JsonValue(name));
            result.addChild("type", new JsonValue(propertyType));
            return result;
        }
    };
    result.addOutputGraphPart(new ValueGraphNodeOutput(name, propertyType));
    ShaderFieldType shaderFieldType = ShaderFieldTypeRegistry.findShaderFieldType(propertyType);
    if (shaderFieldType != null && shaderFieldType.isTexture()) {
        result.addGraphBoxPart(new TextureSettingsGraphBoxPart());
    }
    return result;
}
Also used : GraphBoxImpl(com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl) PropertyNodeConfiguration(com.gempukku.libgdx.graph.config.PropertyNodeConfiguration) JsonValue(com.badlogic.gdx.utils.JsonValue) ValueGraphNodeOutput(com.gempukku.libgdx.graph.ui.producer.ValueGraphNodeOutput) ShaderFieldType(com.gempukku.libgdx.graph.shader.field.ShaderFieldType)

Example 2 with PropertyNodeConfiguration

use of com.gempukku.libgdx.graph.config.PropertyNodeConfiguration in project gdx-graph by MarcinSc.

the class PropertyShaderGraphBoxProducer method createPipelineGraphBox.

@Override
public GraphBox createPipelineGraphBox(Skin skin, String id, JsonValue data) {
    final String name = data.getString("name");
    final String propertyType = data.getString("type");
    GraphBoxImpl result = new GraphBoxImpl(id, new PropertyNodeConfiguration(name, propertyType)) {

        @Override
        public JsonValue getData() {
            JsonValue result = super.getData();
            if (result == null)
                result = new JsonValue(JsonValue.ValueType.object);
            result.addChild("name", new JsonValue(name));
            result.addChild("type", new JsonValue(propertyType));
            return result;
        }
    };
    result.addOutputGraphPart(new ValueGraphNodeOutput(name, propertyType));
    if (ShaderFieldTypeRegistry.findShaderFieldType(propertyType).isTexture()) {
        TextureSettingsGraphBoxPart textureSettings = new TextureSettingsGraphBoxPart();
        textureSettings.initialize(data);
        result.addGraphBoxPart(textureSettings);
    }
    return result;
}
Also used : GraphBoxImpl(com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl) TextureSettingsGraphBoxPart(com.gempukku.libgdx.graph.ui.graph.property.TextureSettingsGraphBoxPart) PropertyNodeConfiguration(com.gempukku.libgdx.graph.config.PropertyNodeConfiguration) JsonValue(com.badlogic.gdx.utils.JsonValue) ValueGraphNodeOutput(com.gempukku.libgdx.graph.ui.producer.ValueGraphNodeOutput)

Example 3 with PropertyNodeConfiguration

use of com.gempukku.libgdx.graph.config.PropertyNodeConfiguration in project gdx-graph by MarcinSc.

the class PropertyPipelineGraphBoxProducer method createPipelineGraphBox.

@Override
public GraphBox createPipelineGraphBox(Skin skin, String id, JsonValue data) {
    final String name = data.getString("name");
    final String propertyType = data.getString("type");
    GraphBoxImpl result = new GraphBoxImpl(id, new PropertyNodeConfiguration(name, propertyType)) {

        @Override
        public JsonValue getData() {
            JsonValue result = super.getData();
            if (result == null)
                result = new JsonValue(JsonValue.ValueType.object);
            result.addChild("name", new JsonValue(name));
            result.addChild("type", new JsonValue(propertyType));
            return result;
        }
    };
    result.addOutputGraphPart(new ValueGraphNodeOutput(name, propertyType));
    return result;
}
Also used : GraphBoxImpl(com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl) PropertyNodeConfiguration(com.gempukku.libgdx.graph.config.PropertyNodeConfiguration) JsonValue(com.badlogic.gdx.utils.JsonValue) ValueGraphNodeOutput(com.gempukku.libgdx.graph.ui.producer.ValueGraphNodeOutput)

Aggregations

JsonValue (com.badlogic.gdx.utils.JsonValue)3 PropertyNodeConfiguration (com.gempukku.libgdx.graph.config.PropertyNodeConfiguration)3 GraphBoxImpl (com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl)3 ValueGraphNodeOutput (com.gempukku.libgdx.graph.ui.producer.ValueGraphNodeOutput)3 ShaderFieldType (com.gempukku.libgdx.graph.shader.field.ShaderFieldType)1 TextureSettingsGraphBoxPart (com.gempukku.libgdx.graph.ui.graph.property.TextureSettingsGraphBoxPart)1