<repo_name>haji4ref/Future<file_sep>/FutureProj/src/classes/Tashvigh.java
package classes;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * Created by Reza on 1/22/2016.
 */
public class Tashvigh extends JLabel {

    public Tashvigh(boolean correctness) {
        this.correctness = correctness;
        x = 0;
        y = 0;
        xSpeed = 5;
        ySpeed = 2;
        icon_temp = new ImageIcon(getClass().getClassLoader().getResource("icons/star.png"));
        image_true = icon_temp.getImage();
        icon_temp = new ImageIcon(getClass().getClassLoader().getResource("icons/error.png"));
        image_false = icon_temp.getImage();
        al = new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                x += xSpeed;
            //    y += ySpeed;
                repaint();
            }
        };
    }

    public ActionListener getActionListener() {
        return al;
    }

    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (correctness == true) {
            g.drawImage(image_true, x, y, 500, 400, null);
        } else g.drawImage(image_false, x, y, 500, 400, null);
    }

    private boolean correctness;
    private int x;
    private int y;
    private double xSpeed;
    private double ySpeed;
    private ImageIcon icon_temp;
    private Image image_true;
    private Image image_false;
    private ActionListener al;
}
<file_sep>/README.md
# Future
this is a start ... a start for future !
<file_sep>/FutureProj/src/classes/LearningUI.java
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package classes;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.util.ArrayList;

import javafx.embed.swing.JFXPanel;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;

import javax.swing.*;

/**
 * @author Reza
 */
public class LearningUI extends StepUI {

    public LearningUI(int stepNumber, int subjectNumber, Dimension screenSize, Font font, boolean isSoundDisable, boolean isTextDisable, int picNumber) {
        this.setLayout(null);
        this.screenSize = screenSize;
        this.subjectNumber = subjectNumber;
        this.stepNumber = stepNumber;
        this.setBackground(Color.white);
        this.setSize(screenSize.width * 3 / 4, screenSize.height);
        this.setLocation(0, 0);
        this.pictureNumber = picNumber;
        stepText = new ArrayList<>();
        loadText();
        fxpanel = new JFXPanel();
        checkBox_sound = new JCheckBox("صدا پخش نشود");
        checkBox_sound.setSize(300, 40);
        checkBox_sound.setLocation(1200, 20);
        checkBox_sound.setFont(font.deriveFont(Font.PLAIN, 30));
        checkBox_text = new JCheckBox("متن نشان داده نشود");
        checkBox_text.setSize(300, 40);
        checkBox_text.setLocation(1200, 70);
        checkBox_text.setFont(font.deriveFont(Font.PLAIN, 30));
        checkBox_sound.setSelected(isSoundDisable);
        checkBox_text.setSelected(isTextDisable);
        this.add(checkBox_sound);
        this.add(checkBox_text);
        icon_next = new ImageIcon(getClass().getClassLoader().getResource("icons/next.png"));
        Image image = icon_next.getImage();
        Image newimg = image.getScaledInstance(icon_next.getIconWidth() * screenSize.height / 1080, icon_next.getIconHeight() * screenSize.height / 1080, java.awt.Image.SCALE_SMOOTH);
        icon_next = new ImageIcon(newimg);
        icon_next_Rollover = new ImageIcon(getClass().getClassLoader().getResource("icons/nextro.png"));
        image = icon_next_Rollover.getImage();
        newimg = image.getScaledInstance(icon_next_Rollover.getIconWidth() * screenSize.height / 1080, icon_next_Rollover.getIconHeight() * screenSize.height / 1080, java.awt.Image.SCALE_SMOOTH);
        icon_next_Rollover = new ImageIcon(newimg);
        icon_next_Pressed = new ImageIcon(getClass().getClassLoader().getResource("icons/nextp.png"));
        image = icon_next_Pressed.getImage();
        newimg = image.getScaledInstance(icon_next_Pressed.getIconWidth() * screenSize.height / 1080, icon_next_Pressed.getIconHeight() * screenSize.height / 1080, java.awt.Image.SCALE_SMOOTH);
        icon_next_Pressed = new ImageIcon(newimg);
        icon_previous = new ImageIcon(getClass().getClassLoader().getResource("icons/prev.png"));
        image = icon_previous.getImage();
        newimg = image.getScaledInstance(icon_previous.getIconWidth() * screenSize.height / 1080, icon_previous.getIconHeight() * screenSize.height / 1080, java.awt.Image.SCALE_SMOOTH);
        icon_previous = new ImageIcon(newimg);
        icon_prevoius_Rollover = new ImageIcon(getClass().getClassLoader().getResource("icons/prevro.png"));
        image = icon_prevoius_Rollover.getImage();
        newimg = image.getScaledInstance(icon_prevoius_Rollover.getIconWidth() * screenSize.height / 1080, icon_prevoius_Rollover.getIconHeight() * screenSize.height / 1080, java.awt.Image.SCALE_SMOOTH);
        icon_prevoius_Rollover = new ImageIcon(newimg);
        icon_previous_Pressed = new ImageIcon(getClass().getClassLoader().getResource("icons/prevp.png"));
        image = icon_previous_Pressed.getImage();
        newimg = image.getScaledInstance(icon_previous_Pressed.getIconWidth() * screenSize.height / 1080, icon_previous_Pressed.getIconHeight() * screenSize.height / 1080, java.awt.Image.SCALE_SMOOTH);
        icon_previous_Pressed = new ImageIcon(newimg);
        icon_repeat = new ImageIcon(getClass().getClassLoader().getResource("icons/hint.png"));
        image = icon_repeat.getImage();
        newimg = image.getScaledInstance(icon_repeat.getIconWidth() * screenSize.height / 1080, icon_repeat.getIconHeight() * screenSize.height / 1080, java.awt.Image.SCALE_SMOOTH);
        icon_repeat = new ImageIcon(newimg);
        icon_repeat_Rollover = new ImageIcon(getClass().getClassLoader().getResource("icons/hintro.png"));
        image = icon_repeat_Rollover.getImage();
        newimg = image.getScaledInstance(icon_repeat_Rollover.getIconWidth() * screenSize.height / 1080, icon_repeat_Rollover.getIconHeight() * screenSize.height / 1080, java.awt.Image.SCALE_SMOOTH);
        icon_repeat_Rollover = new ImageIcon(newimg);
        icon_repeat_Pressed = new ImageIcon(getClass().getClassLoader().getResource("icons/hintp.png"));
        image = icon_repeat_Pressed.getImage();
        newimg = image.getScaledInstance(icon_repeat_Pressed.getIconWidth() * screenSize.height / 1080, icon_repeat_Pressed.getIconHeight() * screenSize.height / 1080, java.awt.Image.SCALE_SMOOTH);
        icon_repeat_Pressed = new ImageIcon(newimg);
        label_text = new JLabel();
        if (!checkBox_text.isSelected()) label_text.setText(stepText.get(pictureNumber));
        label_text.setSize(this.getWidth(), 150);
        label_text.setLocation(this.getWidth() * 5 / 10 - this.getWidth() / 2, screenSize.height * 82 / 100);
        label_text.setHorizontalAlignment(SwingConstants.CENTER);
        label_text.setVerticalAlignment(SwingConstants.CENTER);
        label_text.setFont(font.deriveFont(Font.PLAIN, 80));
        btn_next = new JButton(icon_next);
        btn_previous = new JButton(icon_previous);
        btn_repeat = new JButton(icon_repeat);
        btn_next.setRolloverIcon(icon_next_Rollover);
        btn_next.setPressedIcon(icon_next_Pressed);
        btn_previous.setRolloverIcon(icon_prevoius_Rollover);
        btn_previous.setPressedIcon(icon_previous_Pressed);
        btn_repeat.setRolloverIcon(icon_repeat_Rollover);
        btn_repeat.setPressedIcon(icon_repeat_Pressed);
        btn_next.setSize(icon_next.getIconWidth(), icon_next.getIconHeight());
        btn_previous.setSize(icon_previous.getIconWidth(), icon_previous.getIconHeight());
        btn_repeat.setSize(icon_repeat.getIconWidth(), icon_repeat.getIconHeight());
        btn_next.setLocation(this.getWidth() * 9 / 10, screenSize.height * 4 / 10);
        btn_previous.setLocation(this.getWidth() * 5 / 100, screenSize.height * 4 / 10);
        btn_repeat.setLocation(this.getWidth() * 80 / 100, screenSize.height * 82 / 100);
        btn_next.addActionListener((ActionEvent e) -> {
            btn_previous.setEnabled(true);
            if (pictureNumber < stepElementsNumber) {
                pictureNumber++;
                icon_picture = new ImageIcon(getClass().getClassLoader().getResource("stepdata/step" + stepNumber + "/pictures/" + subjectNumber + "/" + pictureNumber + ".jpg"));
                Image image2 = icon_picture.getImage();
                Image newimg2 = image2.getScaledInstance(icon_picture.getIconWidth() * screenSize.height / 1080, icon_picture.getIconHeight() * screenSize.height / 1080, java.awt.Image.SCALE_SMOOTH);
                icon_picture = new ImageIcon(newimg2);
                media = new Media(getClass().getClassLoader().getResource("stepdata/step" + stepNumber + "/sounds/" + subjectNumber + "/" + pictureNumber + ".mp3").toString());
                if (isMediaPlaying) {
                    mediaplayer.stop();
                }
                mediaplayer = new MediaPlayer(media);
                if (!checkBox_sound.isSelected()) mediaplayer.play();
                isMediaPlaying = true;
                label_picture.setIcon(icon_picture);
                if (!checkBox_text.isSelected()) label_text.setText(stepText.get(pictureNumber));
                else label_text.setText("");
                if (pictureNumber == stepElementsNumber) {
                    btn_next.setEnabled(false);
                }
            }
        });
        btn_previous.addActionListener((ActionEvent e) -> {
            btn_next.setEnabled(true);
            if (pictureNumber > 1) {
                pictureNumber--;
                icon_picture = new ImageIcon(getClass().getClassLoader().getResource("stepdata/step" + stepNumber + "/pictures/" + subjectNumber + "/" + pictureNumber + ".jpg"));
                Image image2 = icon_picture.getImage();
                Image newimg2 = image2.getScaledInstance(icon_picture.getIconWidth() * screenSize.height / 1080, icon_picture.getIconHeight() * screenSize.height / 1080, java.awt.Image.SCALE_SMOOTH);
                icon_picture = new ImageIcon(newimg2);
                media = new Media(getClass().getClassLoader().getResource("stepdata/step" + stepNumber + "/sounds/" + subjectNumber + "/" + pictureNumber + ".mp3").toString());
                if (isMediaPlaying) {
                    mediaplayer.stop();
                }
                mediaplayer = new MediaPlayer(media);
                if (!checkBox_sound.isSelected()) mediaplayer.play();
                isMediaPlaying = true;
                label_picture.setIcon(icon_picture);
                if (!checkBox_text.isSelected()) label_text.setText(stepText.get(pictureNumber));
                else label_text.setText("");
                if (pictureNumber == 1) {
                    btn_previous.setEnabled(false);
                }
            }
        });
        btn_repeat.addActionListener((ActionEvent e) -> {
            if (isMediaPlaying) {
                mediaplayer.stop();
            }
            mediaplayer = new MediaPlayer(media);
            mediaplayer.play();
            isMediaPlaying = true;
        });
        btn_next.setBorderPainted(false);
        btn_next.setFocusPainted(false);
        btn_next.setContentAreaFilled(false);
        btn_previous.setBorderPainted(false);
        btn_previous.setFocusPainted(false);
        btn_previous.setContentAreaFilled(false);
        btn_repeat.setBorderPainted(false);
        btn_repeat.setFocusPainted(false);
        btn_repeat.setContentAreaFilled(false);
        icon_picture = new ImageIcon(getClass().getClassLoader().getResource("stepdata/step" + stepNumber + "/pictures/" + subjectNumber + "/" + pictureNumber + ".jpg"));
        image = icon_picture.getImage();
        newimg = image.getScaledInstance(icon_picture.getIconWidth() * screenSize.height / 1080, icon_picture.getIconHeight() * screenSize.height / 1080, java.awt.Image.SCALE_SMOOTH);
        icon_picture = new ImageIcon(newimg);
        label_picture = new JLabel(icon_picture);
        label_picture.setSize(icon_picture.getIconWidth(), icon_picture.getIconHeight());
        label_picture.setLocation((this.getWidth() - icon_picture.getIconWidth()) / 2 + 10, (this.getHeight() - icon_picture.getIconHeight()) / 2 - 50);
        icon_frame = new ImageIcon(getClass().getClassLoader().getResource("icons/mainBack.png"));
//        image = icon_frame.getImage();
//        newimg = image.getScaledInstance(550, 500, java.awt.Image.SCALE_SMOOTH);
//        icon_frame = new ImageIcon(newimg);
        label_frame = new JLabel(icon_frame);
        label_frame.setSize(icon_frame.getIconWidth(), icon_frame.getIconHeight());
        label_frame.setLocation(this.getWidth() * 3 / 20, this.getHeight() / 9);
        media = new Media(getClass().getClassLoader().getResource("stepdata/step" + stepNumber + "/sounds/" + subjectNumber + "/" + pictureNumber + ".mp3").toString());
        mediaplayer = new MediaPlayer(media);
        if (!checkBox_sound.isSelected()) mediaplayer.play();
        isMediaPlaying = true;
        this.add(btn_next);
        this.add(btn_previous);
        this.add(btn_repeat);
        this.add(label_picture);
        this.add(label_text);
        this.add(label_frame);
    }

    public boolean isSoundDisable() {
        return checkBox_sound.isSelected();
    }

    public boolean isTextDisable() {
        return checkBox_text.isSelected();
    }

    public void deleteComponentsForHintFrame() {
        this.remove(checkBox_sound);
        this.remove(checkBox_text);
        this.remove(btn_next);
        this.remove(btn_previous);
    }

    public void resetComponentsLocationForHintFrame() {
        btn_repeat.setLocation(this.getWidth() * 80 / 100 - 200, screenSize.height * 82 / 100 - 200);
        label_frame.setLocation(this.getWidth() * 3 / 20 - 100, this.getHeight() / 9 - 100);
        label_picture.setLocation((this.getWidth() - icon_picture.getIconWidth()) / 2 + 10 - 100, (this.getHeight() - icon_picture.getIconHeight()) / 2 - 50 - 100);
        label_text.setLocation(this.getWidth() * 5 / 10 - this.getWidth() / 2 - 200, screenSize.height * 82 / 100 - 200);
    }

    private boolean isMediaPlaying;
    private int pictureNumber;
    private JLabel label_picture;
    private JLabel label_text;
    private JLabel label_frame;
    private JCheckBox checkBox_sound;
    private JCheckBox checkBox_text;
    private JButton btn_next;
    private JButton btn_previous;
    private JButton btn_repeat;
    private ImageIcon icon_frame;
    private ImageIcon icon_picture;
    private ImageIcon icon_next;
    private ImageIcon icon_next_Rollover;
    private ImageIcon icon_next_Pressed;
    private ImageIcon icon_previous;
    private ImageIcon icon_prevoius_Rollover;
    private ImageIcon icon_previous_Pressed;
    private ImageIcon icon_repeat;
    private ImageIcon icon_repeat_Rollover;
    private ImageIcon icon_repeat_Pressed;
    private final JFXPanel fxpanel;
    private Media media;
    private MediaPlayer mediaplayer;
}


/*
 lpPicture.add(lblPicture);
 lpPicture.add(lblFrame);
 mainPanel.add(lpPicture);
 mainPanel.add(lblText);
 */
<file_sep>/FutureProj/src/classes/Step.java
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package classes;

import classes.KalameApp.StepType;

/**
 *
 * @author Reza
 */
public class Step {

    public Step(int numberOfLearnings, int numberOfExams, String[] stepNames, StepType[] examTypes) {
        this.numberOfLearnings = numberOfLearnings;
        this.numberOfExams = numberOfExams;
        this.stepNames = stepNames;
        this.examTypes = examTypes;
    }

    public int getNumberOfLearnings() {
        return numberOfLearnings;
    }

    public int getNumberOfExams() {
        return numberOfExams;
    }

    public String[] getStepNames() {
        return stepNames;
    }

    public StepType[] getExamTypes() {
        return examTypes;
    }

    private final int numberOfLearnings;
    private final int numberOfExams;
    private final String[] stepNames;
    private final StepType[] examTypes;
}
