Search in sources :

Example 1 with PipelinePropertyBoxProducerImpl

use of com.gempukku.libgdx.graph.ui.pipeline.producer.PipelinePropertyBoxProducerImpl in project gdx-graph by MarcinSc.

the class UIPipelineConfigurer method processPropertyType.

private static void processPropertyType(JsonValue propertyType) {
    final String typeName = propertyType.name();
    final String defaultName = propertyType.getString("defaultName");
    PipelinePropertyBoxProducerImpl producer = new PipelinePropertyBoxProducerImpl(defaultName, typeName);
    JsonValue fields = propertyType.get("fields");
    if (fields != null) {
        for (final JsonValue field : fields) {
            final String fieldType = field.getString("type");
            producer.addPropertyBoxPart(new Supplier<PropertyBoxPart>() {

                @Override
                public PropertyBoxPart get() {
                    GraphBoxPart propertyBoxPart = createFieldGraphBoxPart(fieldType, field);
                    if (propertyBoxPart != null)
                        return propertyBoxPart;
                    throw new IllegalArgumentException("Unable to resolve field type: " + fieldType);
                }
            });
        }
    }
    UIPipelineConfiguration.registerPropertyType(producer);
}
Also used : GraphBoxPart(com.gempukku.libgdx.graph.ui.graph.GraphBoxPart) PipelinePropertyBoxProducerImpl(com.gempukku.libgdx.graph.ui.pipeline.producer.PipelinePropertyBoxProducerImpl) JsonValue(com.badlogic.gdx.utils.JsonValue) PropertyBoxPart(com.gempukku.libgdx.graph.ui.graph.property.PropertyBoxPart)

Aggregations

JsonValue (com.badlogic.gdx.utils.JsonValue)1 GraphBoxPart (com.gempukku.libgdx.graph.ui.graph.GraphBoxPart)1 PropertyBoxPart (com.gempukku.libgdx.graph.ui.graph.property.PropertyBoxPart)1 PipelinePropertyBoxProducerImpl (com.gempukku.libgdx.graph.ui.pipeline.producer.PipelinePropertyBoxProducerImpl)1