@@ -0,0 +1,1334 @@
+/*%0A * JaamSim Discrete Event Simulation%0A * Copyright (C) 2014 Ausenco Engineering Canada Inc.%0A *%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU General Public License as published by%0A * the Free Software Foundation, either version 3 of the License, or%0A * (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU General Public License for more details.%0A */%0Apackage com.jaamsim.input;%0A%0Aimport java.awt.image.BufferedImage;%0Aimport java.net.URI;%0A%0Aimport javax.imageio.ImageIO;%0A%0Apublic class ImageInput extends Input%3CBufferedImage%3E %7B%0A%0A%09public ImageInput(String key, String cat, BufferedImage def) %7B%0A%09%09super(key, cat, def);%0A%09%7D%0A%0A%09@Override%0A%09public void parse(KeywordIndex kw) throws InputErrorException %7B%0A%09%09BufferedImage temp;%0A%09%09URI uri = Input.parseURI(kw);%0A%0A%09%09// Confirm that the file exists%0A%09%09if (!InputAgent.fileExists(uri))%0A%09%09%09throw new InputErrorException(%22The specified file does not exist.%5Cn%22 +%0A%09%09%09%09%09%22File path = %25s%22, kw.getArg(0));%0A%0A%09%09try %7B%0A%09%09%09temp = ImageIO.read(uri.toURL());%0A%09%09%7D%0A%09%09catch (Exception ex) %7B%0A%09%09%09throw new InputErrorException(%22Bad image file%22);%0A%09%09%7D%0A%0A%09%09value = temp;%0A%09%7D%0A%0A%7D%0A

add input object for images