Browse Source

Bug fix: new long setting for simulator max path not read properly (shows up in GUI).

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@7803 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 12 years ago
parent
commit
13cce4f8da
  1. 5
      prism/src/settings/NumericConstraint.java
  2. 20
      prism/src/settings/RangeConstraint.java
  3. 42
      prism/src/userinterface/graph/AxisSettings.java

5
prism/src/settings/NumericConstraint.java

@ -44,6 +44,10 @@ public abstract class NumericConstraint implements SettingConstraint
{
checkValueInteger(((Integer)value).intValue());
}
else if(value instanceof Long)
{
checkValueLong(((Long)value).longValue());
}
else
{
throw new SettingException("Invalid type for property, should be numeric.");
@ -54,4 +58,5 @@ public abstract class NumericConstraint implements SettingConstraint
public abstract void checkValueInteger(int value) throws SettingException;
public abstract void checkValueLong(long value) throws SettingException;
}

20
prism/src/settings/RangeConstraint.java

@ -151,4 +151,24 @@ public class RangeConstraint extends NumericConstraint
}
}
public void checkValueLong(long value) throws SettingException
{
if(inclusiveLower)
{
if(value < lower) throw new SettingException("The value: "+value+" should be >="+(long)lower);
}
else
{
if(value <= lower) throw new SettingException("The value: "+value+" should be >"+(long)lower);
}
if(inclusiveUpper)
{
if(value > upper) throw new SettingException("The value: "+value+"should be <="+(long)upper);
}
else
{
if(value >= upper) throw new SettingException("The value: "+value+"should be <"+(long)upper);
}
}
}

42
prism/src/userinterface/graph/AxisSettings.java

@ -146,11 +146,16 @@ public class AxisSettings extends Observable implements SettingOwner
{
if(activated && d >= maxValue.getDoubleValue()) throw new SettingException("Minimum value should be < Maximum value");
}
public void checkValueInteger(int i) throws SettingException
{
if(activated && i >= maxValue.getDoubleValue()) throw new SettingException("Minimum value should be < Maximum value");
}
public void checkValueInteger(int i) throws SettingException
{
if(activated && i >= maxValue.getDoubleValue()) throw new SettingException("Minimum value should be < Maximum value");
}
public void checkValueLong(long i) throws SettingException
{
if(activated && i >= maxValue.getDoubleValue()) throw new SettingException("Minimum value should be < Maximum value");
}
});
maxValue.addConstraint(new NumericConstraint()
{
@ -163,6 +168,11 @@ public class AxisSettings extends Observable implements SettingOwner
{
if(activated && i <= minValue.getDoubleValue()) throw new SettingException("Maximum value should be > Minimum value");
}
public void checkValueLong(long i) throws SettingException
{
if(activated && i <= maxValue.getDoubleValue()) throw new SettingException("Minimum value should be > Maximum value");
}
});
minimumPower.addConstraint(new NumericConstraint()
{
@ -170,11 +180,16 @@ public class AxisSettings extends Observable implements SettingOwner
{
if(activated && d >= maximumPower.getDoubleValue()) throw new SettingException("Minimum power should be < Maximum power");
}
public void checkValueInteger(int i) throws SettingException
{
if(activated && i >= maximumPower.getDoubleValue()) throw new SettingException("Minimum power should be < Maximum power");
}
public void checkValueInteger(int i) throws SettingException
{
if(activated && i >= maximumPower.getDoubleValue()) throw new SettingException("Minimum power should be < Maximum power");
}
public void checkValueLong(long i) throws SettingException
{
if(activated && i >= maximumPower.getDoubleValue()) throw new SettingException("Minimum power should be < Maximum power");
}
});
maximumPower.addConstraint(new NumericConstraint()
{
@ -182,8 +197,13 @@ public class AxisSettings extends Observable implements SettingOwner
{
if(activated && d <= minimumPower.getDoubleValue()) throw new SettingException("Maximum power should be > Minimum power");
}
public void checkValueInteger(int i) throws SettingException
{
if(activated && i <= minimumPower.getDoubleValue()) throw new SettingException("Maximum power should be > Minimum power");
}
public void checkValueInteger(int i) throws SettingException
public void checkValueLong(long i) throws SettingException
{
if(activated && i <= minimumPower.getDoubleValue()) throw new SettingException("Maximum power should be > Minimum power");
}

Loading…
Cancel
Save