use of com.vaadin.server.Sizeable.Unit in project charts by vaadin.
the class YAxis method setTop.
/**
* Sets the top using String presentation. String presentation is similar to
* what is used in Cascading Style Sheets. Size can be pixels or percentage,
* otherwise IllegalArgumentException is thrown. The empty string ("") or
* null will unset the height and set the units to pixels.
*
* @param top
* CSS style string representation
*/
public void setTop(String top) {
SizeWithUnit sizeWithUnit = SizeWithUnit.parseStringSize(top);
if (sizeWithUnit != null) {
Unit unit = sizeWithUnit.getUnit();
if (!(unit.equals(Unit.PERCENTAGE) || unit.equals(Unit.PIXELS))) {
throw new IllegalArgumentException(unit.toString() + "is not a valid unit for sizing. Only percentage and pixels are allowed.");
}
setTop(sizeWithUnit.getSize(), sizeWithUnit.getUnit());
} else {
setTop(-1, Unit.PIXELS);
}
}
use of com.vaadin.server.Sizeable.Unit in project charts by vaadin.
the class PlotOptionsBubble method setMinSize.
/**
* Sets the minSize using String presentation. String presentation is
* similar to what is used in Cascading Style Sheets. Size can be pixels or
* percentage, otherwise IllegalArgumentException is thrown. The empty
* string ("") or null will unset the height and set the units to pixels.
*
* @param minSize
* CSS style string representation
*/
public void setMinSize(String minSize) {
SizeWithUnit sizeWithUnit = SizeWithUnit.parseStringSize(minSize);
if (sizeWithUnit != null) {
Unit unit = sizeWithUnit.getUnit();
if (!(unit.equals(Unit.PERCENTAGE) || unit.equals(Unit.PIXELS))) {
throw new IllegalArgumentException(unit.toString() + "is not a valid unit for sizing. Only percentage and pixels are allowed.");
}
setMinSize(sizeWithUnit.getSize(), sizeWithUnit.getUnit());
} else {
setMinSize(-1, Unit.PIXELS);
}
}
use of com.vaadin.server.Sizeable.Unit in project charts by vaadin.
the class PlotOptionsFunnel method setWidth.
/**
* Sets the width using String presentation. String presentation is similar
* to what is used in Cascading Style Sheets. Size can be pixels or
* percentage, otherwise IllegalArgumentException is thrown. The empty
* string ("") or null will unset the height and set the units to pixels.
*
* @param width
* CSS style string representation
*/
public void setWidth(String width) {
SizeWithUnit sizeWithUnit = SizeWithUnit.parseStringSize(width);
if (sizeWithUnit != null) {
Unit unit = sizeWithUnit.getUnit();
if (!(unit.equals(Unit.PERCENTAGE) || unit.equals(Unit.PIXELS))) {
throw new IllegalArgumentException(unit.toString() + "is not a valid unit for sizing. Only percentage and pixels are allowed.");
}
setWidth(sizeWithUnit.getSize(), sizeWithUnit.getUnit());
} else {
setWidth(-1, Unit.PIXELS);
}
}
use of com.vaadin.server.Sizeable.Unit in project charts by vaadin.
the class PlotOptionsPie method setSize.
/**
* Sets the size using String presentation. String presentation is similar
* to what is used in Cascading Style Sheets. Size can be pixels or
* percentage, otherwise IllegalArgumentException is thrown. The empty
* string ("") or null will unset the height and set the units to pixels.
*
* @param size
* CSS style string representation
*/
public void setSize(String size) {
SizeWithUnit sizeWithUnit = SizeWithUnit.parseStringSize(size);
if (sizeWithUnit != null) {
Unit unit = sizeWithUnit.getUnit();
if (!(unit.equals(Unit.PERCENTAGE) || unit.equals(Unit.PIXELS))) {
throw new IllegalArgumentException(unit.toString() + "is not a valid unit for sizing. Only percentage and pixels are allowed.");
}
setSize(sizeWithUnit.getSize(), sizeWithUnit.getUnit());
} else {
setSize(-1, Unit.PIXELS);
}
}
use of com.vaadin.server.Sizeable.Unit in project charts by vaadin.
the class PlotOptionsPyramid method setHeight.
/**
* Sets the height using String presentation. String presentation is similar
* to what is used in Cascading Style Sheets. Size can be pixels or
* percentage, otherwise IllegalArgumentException is thrown. The empty
* string ("") or null will unset the height and set the units to pixels.
*
* @param height
* CSS style string representation
*/
public void setHeight(String height) {
SizeWithUnit sizeWithUnit = SizeWithUnit.parseStringSize(height);
if (sizeWithUnit != null) {
Unit unit = sizeWithUnit.getUnit();
if (!(unit.equals(Unit.PERCENTAGE) || unit.equals(Unit.PIXELS))) {
throw new IllegalArgumentException(unit.toString() + "is not a valid unit for sizing. Only percentage and pixels are allowed.");
}
setHeight(sizeWithUnit.getSize(), sizeWithUnit.getUnit());
} else {
setHeight(-1, Unit.PIXELS);
}
}
Aggregations