Search in sources :

Example 1 with PropertyBoxPart

use of com.gempukku.libgdx.graph.ui.graph.property.PropertyBoxPart in project gdx-graph by MarcinSc.

the class PipelinePropertyBoxProducerImpl method createPropertyBox.

@Override
public PropertyBox createPropertyBox(Skin skin, String name, PropertyLocation location, JsonValue jsonObject, PropertyLocation[] propertyLocations) {
    PropertyBoxImpl result = new PropertyBoxImpl(name, type, null, propertyLocations);
    for (Supplier<PropertyBoxPart> propertyBoxPart : propertyBoxParts) {
        result.addPropertyBoxPart(propertyBoxPart.get());
    }
    result.initialize(jsonObject);
    return result;
}
Also used : PropertyBoxImpl(com.gempukku.libgdx.graph.ui.graph.property.PropertyBoxImpl) PropertyBoxPart(com.gempukku.libgdx.graph.ui.graph.property.PropertyBoxPart)

Example 2 with PropertyBoxPart

use of com.gempukku.libgdx.graph.ui.graph.property.PropertyBoxPart 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

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