method size() with single parameter

This commit is contained in:
Konstantin Bulenkov
2015-01-29 20:56:27 +01:00
parent 15b3fc6979
commit 5bd5436b7b
@@ -35,6 +35,10 @@ public class JBUI {
return new JBDimension(width, height);
}
public static JBDimension size(int widthAndHeight) {
return new JBDimension(widthAndHeight, widthAndHeight);
}
public static JBDimension size(Dimension size) {
return size instanceof JBDimension ? ((JBDimension)size) : new JBDimension(size.width, size.height);
}