Search in sources :

Example 1 with MultiParameter

use of main.content.values.parameters.MultiParameter in project Eidolons by IDemiurge.

the class ParamElement method paintParamIcon.

private void paintParamIcon(Graphics g) {
    if (value instanceof MultiParameter) {
        MultiParameter multiParameter = (MultiParameter) value;
        if (image == null) {
            image = ImageManager.getValueIcon(multiParameter.getParameters()[0]);
        }
        if (image == null) {
            image = ImageManager.getEmptyEmblem().getImage();
        }
        g.drawImage(image, x, (getVisuals().getHeight() - image.getHeight(null)) / 2, null);
    }
}
Also used : MultiParameter(main.content.values.parameters.MultiParameter)

Example 2 with MultiParameter

use of main.content.values.parameters.MultiParameter in project Eidolons by IDemiurge.

the class DataModel method getValue.

public String getValue(VALUE val, boolean base) {
    String value = "";
    if (val instanceof MultiParameter) {
        MultiParameter multiParameter = (MultiParameter) val;
        for (PARAMETER p : multiParameter.getParameters()) {
            value += getParamRounded(p, base) + multiParameter.getSeparator();
        // % sign?
        }
        value = StringMaster.cropLast(value, multiParameter.getSeparator().length());
    } else if (val instanceof PARAMETER) {
        value = getDoubleParam((PARAMETER) val, base);
    } else if (val instanceof PROPERTY) {
        value = getProperty((PROPERTY) val);
    }
    if (value == null) {
        LogMaster.log(LogMaster.VALUE_DEBUG, "Value not found: " + val.getName());
    }
    return value;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) MultiParameter(main.content.values.parameters.MultiParameter) PARAMETER(main.content.values.parameters.PARAMETER)

Aggregations

MultiParameter (main.content.values.parameters.MultiParameter)2 PARAMETER (main.content.values.parameters.PARAMETER)1 PROPERTY (main.content.values.properties.PROPERTY)1