本文整理汇总了Java中com.vaadin.server.Sizeable.Unit方法的典型用法代码示例。如果您正苦于以下问题:Java Sizeable.Unit方法的具体用法?Java Sizeable.Unit怎么用?Java Sizeable.Unit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.server.Sizeable
的用法示例。
在下文中一共展示了Sizeable.Unit方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWidth
import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
@Override
public String getWidth() {
if (composition != null && isWrapped()) {
float width = composition.getWidth();
Sizeable.Unit widthUnit = composition.getWidthUnits();
return width + widthUnit.getSymbol();
}
if (component != null) {
return ComponentsHelper.getComponentWidth(component);
}
return targetWidth;
}
示例2: toVaadinUnit
import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
public static Sizeable.Unit toVaadinUnit(SizeUnit sizeUnit) {
checkNotNullArgument(sizeUnit);
switch (sizeUnit) {
case PIXELS:
return Sizeable.Unit.PIXELS;
case PERCENTAGE:
return Sizeable.Unit.PERCENTAGE;
default:
throw new UnsupportedOperationException("Unsupported Size Unit");
}
}
示例3: toSizeUnit
import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
public static SizeUnit toSizeUnit(Sizeable.Unit units) {
checkNotNullArgument(units);
switch (units) {
case PIXELS:
return SizeUnit.PIXELS;
case PERCENTAGE:
return SizeUnit.PERCENTAGE;
default:
throw new UnsupportedOperationException("Unsupported Size Unit");
}
}
示例4: MSize
import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
private MSize(float width, Sizeable.Unit widthUnit, float height, Sizeable.Unit heightUnit) {
this.width = width;
this.widthUnit = widthUnit;
this.height = height;
this.heightUnit = heightUnit;
}
示例5: getWidthUnit
import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
public Sizeable.Unit getWidthUnit() {
return widthUnit;
}
示例6: getHeightUnit
import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
public Sizeable.Unit getHeightUnit() {
return heightUnit;
}
示例7: size
import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
public static MSize size(float width, Sizeable.Unit widthUnit, float height, Sizeable.Unit heightUnit) {
return new MSize(width, widthUnit, height, heightUnit);
}
示例8: testSizeDefined
import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
@Test
public void testSizeDefined() {
IntegerField integerField = new IntegerField() {
private static final long serialVersionUID = -2915829267538851760L;
@Override
public void setWidth(float width, Sizeable.Unit unit) {
super.setWidth(width, unit);
underlayingField = tf;
}
};
Assert.assertEquals(-1, integerField.getWidth(),0.001);
integerField.setWidth("99%");
Assert.assertEquals(99, integerField.getWidth(),0.001);
Assert.assertEquals(100, underlayingField.getWidth(),0.001);
integerField.setSizeUndefined();;
Assert.assertEquals(-1, integerField.getWidth(),0.001);
Assert.assertEquals(-1, underlayingField.getWidth(),0.001);
}