// Path: src/selfpi/Gui.java
// public static enum SHARE_STATE {ENABLE, ONGOING, DISABLE};


import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.usb.UsbException;
import org.apache.commons.lang3.text.WordUtils;
import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioFactory;
import com.pi4j.io.gpio.GpioPinDigitalInput;
import com.pi4j.io.gpio.GpioPinDigitalOutput;
import com.pi4j.io.gpio.GpioPinPwmOutput;
import com.pi4j.io.gpio.PinPullResistance;
import com.pi4j.io.gpio.RaspiPin;
import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent;
import com.pi4j.io.gpio.event.GpioPinListenerDigital;
import io.nayuki.qrcodegen.QrCode;
import selfpi.Gui.SHARE_STATE;

				if ( (SelfPi.this.facebookSharingThread != null && SelfPi.this.facebookSharingThread.isAlive()) || 
						(SelfPi.this.twitterSharingThread != null && SelfPi.this.twitterSharingThread.isAlive()) ) {
					
					try { Thread.sleep(100); } catch (InterruptedException e) {};
					
				} else break;
				
				loops+=100;
			}

			// end
			setFacebookLedOFF();
			setTwitterLedOFF();
			SelfPi.redButtonLed.startSoftBlink();

			SelfPi.this.stateMachineTransition(SelfPiEvent.END_SHARING);
		}
	}

	private class RunPrinting implements Runnable {

		@Override
		public void run() {
			File fileToPrint = lastSouvenirPictureFile;	//default
			File footToPrint = ticketSouvenirFoot; // default
			boolean randomTicket = souvenirTicketCounter%frequencyRandomTicketSouvenir == 0;

			// if it's a special ticket and according to all the options 
			if (randomTicket){


// Path: src/selfpi/Gui.java
// public static enum SHARE_STATE {ENABLE, ONGOING, DISABLE};


// Path: src/selfpi/SelfPi.java
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.usb.UsbException;
import org.apache.commons.lang3.text.WordUtils;
import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioFactory;
import com.pi4j.io.gpio.GpioPinDigitalInput;
import com.pi4j.io.gpio.GpioPinDigitalOutput;
import com.pi4j.io.gpio.GpioPinPwmOutput;
import com.pi4j.io.gpio.PinPullResistance;
import com.pi4j.io.gpio.RaspiPin;
import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent;
import com.pi4j.io.gpio.event.GpioPinListenerDigital;
import io.nayuki.qrcodegen.QrCode;
import selfpi.Gui.SHARE_STATE;

				if ( (SelfPi.this.facebookSharingThread != null && SelfPi.this.facebookSharingThread.isAlive()) || 
						(SelfPi.this.twitterSharingThread != null && SelfPi.this.twitterSharingThread.isAlive()) ) {
					
					try { Thread.sleep(100); } catch (InterruptedException e) {};
					
				} else break;
				
				loops+=100;
			}

			// end
			setFacebookLedOFF();
			setTwitterLedOFF();
			SelfPi.redButtonLed.startSoftBlink();

			SelfPi.this.stateMachineTransition(SelfPiEvent.END_SHARING);
		}
	}

	private class RunPrinting implements Runnable {

		@Override
		public void run() {
			File fileToPrint = lastSouvenirPictureFile;	//default
			File footToPrint = ticketSouvenirFoot; // default
			boolean randomTicket = souvenirTicketCounter%frequencyRandomTicketSouvenir == 0;

			// if it's a special ticket and according to all the options 
			if (randomTicket){


				if ( SelfPi.useRandomSouvenirImages && SelfPi.useRandomFunnyImages && SelfPi.useRandomDSLRImages ){
