/*
 * CAS - Cellular Automata Simulator
 * Copyright (C) 2016  Guilherme Humberto Jansen
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.ghjansen.cas.ui.desktop.swing;

import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.JPanel;

import com.ghjansen.cas.ui.desktop.processing.SimulationViewProcessing;

/**
 * @author Guilherme Humberto Jansen (contact.ghjansen@gmail.com)
 */
public class HelpPanel extends JPanel {

	private BufferedImage image;

	public HelpPanel() {
		try {
			image = ImageIO.read(getClass().getResourceAsStream("/com/ghjansen/cas/ui/desktop/processing/welcome-pt-br.png"));
		} catch (IOException ex) {
			System.out.println(ex.getMessage());
		}
	}
	
	@Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawImage(image, 0, 0, null);            
    }

}

@@ -975,16 +975,68 @@
 Panel;%0A%0A
+import com.ghjansen.cas.ui.desktop.i18n.Translator;%0A
 import c
@@ -1099,16 +1099,16 @@
 essing;%0A
-
 %0A/**%0A * 
@@ -1249,232 +1249,181 @@
 ge;%0A
-%0A
 %09p
-ublic HelpPanel() %7B%0A%09%09try %7B%0A%09%09%09image = ImageIO.read(getClass().getResourceAsStream(%22/com/ghjansen/cas/ui/desktop/processing/welcome-pt-br.png%22));%0A%09%09%7D catch (IOException ex) %7B%0A%09%09%09System.out.println(ex.getMessage());%0A%09%09%7D%0A%09%7D
+rivate final String filePath = %22/com/ghjansen/cas/ui/desktop/processing/%22;%0A%09private final String fileNamePrefix = %22welcome-%22;%0A%09private final String fileExtension = %22.png%22;
 %0A%09%0A%09
@@ -1480,16 +1480,31 @@
 cs g) %7B%0A
+%09%09loadImage();%0A
         
@@ -1584,13 +1584,323 @@
    %0A
-
     %7D
+%0A%09%0A%09private void loadImage()%7B%0A%09%09try %7B%0A%09%09%09String langTag = Translator.getInstance().getLanguage().getLangtag().toLowerCase();%0A%09%09%09image = ImageIO.read(getClass().getResourceAsStream(filePath + fileNamePrefix + langTag + fileExtension));%0A%09%09%7D catch (IOException ex) %7B%0A%09%09%09System.out.println(ex.getMessage());%0A%09%09%7D%0A%09%7D
 %0A%0A%7D%0A

Fix to show the help window according to the language selected. Issue #31