All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.talk2object.plum.interaction.view.annotation.parameter.helper.ImageParameterWrapper Maven / Gradle / Ivy

There is a newer version: 0.1.22
Show newest version
package com.talk2object.plum.interaction.view.annotation.parameter.helper;

import com.talk2object.plum.interaction.rich.field.ImageField;
import com.talk2object.plum.interaction.rich.field.InteractiveField;
import com.talk2object.plum.interaction.view.annotation.parameter.ImageParameter;

public class ImageParameterWrapper extends AbstractParameterWrapper {

	private ImageParameter getImageParameter() {
		return (ImageParameter) parameter;
	}

	@Override
	public Object getInitValue() {
		// not support
		return null;
	}

	@Override
	Object[] getOptionValues() {
		// not support
		return new Object[0];

	}

	@Override
	public Object value2Object(Object value) {
		if (value == null)
			return null;
		else
			throw new RuntimeException("not support");
	}

	@Override
	public void enrich(InteractiveField input) {

		super.enrich(input);

		ImageField imageInput = (ImageField) input;

		ImageParameter imageParameter = getImageParameter();

		imageInput.setWidth(imageParameter.width());
		imageInput.setHeight(imageParameter.height());

	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy