JOptionPane.showMessageDialog(this, "Please enter an id for the new car type.", "Warning", JOptionPane.WARNING_MESSAGE);
return;
}
// adds car
SumoVehicleType vtype = new SumoVehicleType(idInput.getText(),
(1.0 * accelSlider.getValue()) / ACCL_DECL_FACTOR,
(1.0 * declSlider.getValue()) / ACCL_DECL_FACTOR,
(1.0 * lengthSlider.getValue()), Math
.round((1.0f * maxspeedSlider.getValue())
/ KMPH_TO_MPS_FACTOR),
VTYPE_SIGMA_DEFAULT_VALUE);
Color col = colorDisplay.getBackground();
vtype.setColor((float) col.getRed(), (float) col.getGreen(),
(float) col.getBlue()); // green is custom car
if (curVtype == null) {
if (!SumoManager.getInstance().addVehicleType(vtype))
return;