Package com.datasquad.task
Class MenuBar
- java.lang.Object
-
- com.datasquad.task.MenuBar
-
class MenuBar extends java.lang.ObjectThis class is used in order to implements all the options in this menu.- Author:
- CADOUL Michael AND VERY-GRIETTE Milan
-
-
Method Summary
Modifier and Type Method Description (package private) javax.swing.JMenuBargetMenuBar()Getter(package private) voidloadFileDat(java.io.File file, MainPanel context)Used to load a .dat file and restore the state of a TaskStorage instanceprivate voidshowDialog(MainPanel mainPanel, java.lang.String message)Used to show a personalized JOptionPane, with a specific messageprivate voidwriteFileDat(java.io.File file, TaskStorage object, MainPanel context)Used in order to save all the informations stored in the memory with the TaskStorage class.private voidwriteFileTxt(java.io.File file, MainPanel context)Used to write a txt file with all the saved tasks
-
-
-
Constructor Detail
-
MenuBar
MenuBar(MainPanel mainPanel)
Class constructor- Parameters:
mainPanel- Using a reference to the MainPanel
-
-
Method Detail
-
writeFileTxt
private void writeFileTxt(java.io.File file, MainPanel context)Used to write a txt file with all the saved tasks- Parameters:
file- The File element given thanks to the fileChooser (used to get the path basically)context- Using a reference to the MainPanel.
-
writeFileDat
private void writeFileDat(java.io.File file, TaskStorage object, MainPanel context)Used in order to save all the informations stored in the memory with the TaskStorage class. So, we can save a .dat file, which going to write the current state of the Task storage instance, and reload it after when we run this app again for example. Thanks to this, the tasks data are persistent.- Parameters:
file- The File element given thanks to the fileChooser (used to get the path basically)object- The object that we want to savecontext- Using a reference to the MainPanel.
-
loadFileDat
void loadFileDat(java.io.File file, MainPanel context)Used to load a .dat file and restore the state of a TaskStorage instance- Parameters:
file- The File element given thanks to the fileChooser (used to get the path basically)context- Using a reference to the MainPanel.
-
showDialog
private void showDialog(MainPanel mainPanel, java.lang.String message)
Used to show a personalized JOptionPane, with a specific message- Parameters:
mainPanel- Using the reference of the MainPanel.message- The message we want to show
-
getMenuBar
javax.swing.JMenuBar getMenuBar()
Getter- Returns:
- The JMeneBar
-
-