Added some assertions about null icons.
This commit is contained in:
parent
db1495085f
commit
dd74fce634
4 changed files with 16 additions and 0 deletions
|
@ -10,6 +10,10 @@ public class FlipableIcon implements IIcon
|
||||||
boolean flip_v;
|
boolean flip_v;
|
||||||
|
|
||||||
public FlipableIcon(IIcon o) {
|
public FlipableIcon(IIcon o) {
|
||||||
|
|
||||||
|
if ( o == null )
|
||||||
|
throw new RuntimeException("Cannot create a wrapper icon with a null icon.");
|
||||||
|
|
||||||
original = o;
|
original = o;
|
||||||
flip_u = false;
|
flip_u = false;
|
||||||
flip_v = false;
|
flip_v = false;
|
||||||
|
|
|
@ -10,6 +10,10 @@ public class FullIcon implements IIcon
|
||||||
private IIcon p;
|
private IIcon p;
|
||||||
|
|
||||||
public FullIcon(IIcon o) {
|
public FullIcon(IIcon o) {
|
||||||
|
|
||||||
|
if ( o == null )
|
||||||
|
throw new RuntimeException("Cannot create a wrapper icon with a null icon.");
|
||||||
|
|
||||||
p = o;
|
p = o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,10 @@ public class OffsetIcon implements IIcon
|
||||||
private IIcon p;
|
private IIcon p;
|
||||||
|
|
||||||
public OffsetIcon(IIcon o, float x, float y) {
|
public OffsetIcon(IIcon o, float x, float y) {
|
||||||
|
|
||||||
|
if ( o == null )
|
||||||
|
throw new RuntimeException("Cannot create a wrapper icon with a null icon.");
|
||||||
|
|
||||||
p = o;
|
p = o;
|
||||||
offsetX = x;
|
offsetX = x;
|
||||||
offsetY = y;
|
offsetY = y;
|
||||||
|
|
|
@ -12,6 +12,10 @@ public class TaughtIcon implements IIcon
|
||||||
private IIcon p;
|
private IIcon p;
|
||||||
|
|
||||||
public TaughtIcon(IIcon o, float tightness) {
|
public TaughtIcon(IIcon o, float tightness) {
|
||||||
|
|
||||||
|
if ( o == null )
|
||||||
|
throw new RuntimeException("Cannot create a wrapper icon with a null icon.");
|
||||||
|
|
||||||
p = o;
|
p = o;
|
||||||
this.tightness = tightness * 0.4f;
|
this.tightness = tightness * 0.4f;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue