

//
// Core Program for TETDM 
// PopUpWindow.java Version 1.00
// Copyright(C) 2012-2018 TETDM CORE MEMBER ALL RIGHTS RESERVED.
// This program is provided under the license.
//

package source;

import java.awt.*;
import java.awt.event.*;
import javax.swing.JFrame;
import javax.swing.JTextPane;
import javax.swing.JScrollPane;
import javax.swing.event.*;

import javax.swing.border.*;


//Window for module information
public class PopUpWindow extends JFrame
{
	JTextPane textPanel;
	JScrollPane scrollPanel;
	Container pane = getContentPane();
	
	String windowName = "README";
		
	public PopUpWindow(String titleText, String displayText, int X, int Y, int width, int height, int fontSize, Color color, String fontName, Control control, int panelID, int option, String windowTitle)
	{
		super(windowTitle);
		setBounds(X, Y, width, height);
		
		if(option == 1)
			windowName += (panelID+"MINING");
		else if(option == 2)
			windowName += (panelID+"VISUAL");

		
//		setAlwaysOnTop(true);
		pane.setBackground(Color.white);
//		setUndecorated(true);
		
        WINDOWACTIONLOG windowActionLog = new WINDOWACTIONLOG(this, windowName);
        this.addComponentListener(windowActionLog.componentListener);                    //FOR LOG
        this.addWindowListener(windowActionLog.windowListener);
        



		
		textPanel = new JTextPane();
		textPanel.setContentType("text/plain");
		scrollPanel = new JScrollPane(textPanel);
		pane.add(scrollPanel);
		
		textPanel.setText(displayText);
		textPanel.setCaretPosition(0);
		textPanel.setFont(new Font(fontName, Font.BOLD, fontSize));
		
		scrollPanel.setBorder(new CompoundBorder(new BevelBorder(BevelBorder.RAISED), new TitledBorder(new LineBorder(Color.red), titleText, TitledBorder.CENTER, TitledBorder.TOP)));
				
		scrollPanel.setBackground(color);
		textPanel.setBackground(color);		
		
		setVisible(true);
		

	}
}
