net.sf.tomp.el.author.gui
Class Author

java.lang.Object
  extended by net.sf.tomp.el.author.gui.Author

public class Author
extends java.lang.Object

Author:
RNDr. Tomáš Pitner, Ph.D.

Nested Class Summary
protected static class Author.AppCloser
          Closes the application.
 class Author.CourseItemListener
          ItemListener for "Course" menu RadioButtonMenuItems.
 class Author.CourseListener
          ActionListener for "Course" menu.
 class Author.LectureItemListener
          ItemListener for "Lecture" menu RadioButtonMenuItems.
 class Author.LectureListener
          ActionListener for "Lecture" menu.
 class Author.MenuListener
          ActionListener for "File" menu.
 class Author.TaskItemListener
          ItemListener for "Task" menu RadioButtonMenuItems.
 class Author.TaskListener
          ActionListener for "Task" menu.
 
Field Summary
static java.lang.String APP_TITLE
           
 Course emptyCourse
           
 Lecture emptyLecture
           
static java.lang.String root
           
 
Constructor Summary
Author()
           
 
Method Summary
protected  void addCourseMenuItems(javax.swing.JMenu courseMenu)
          Adds open course(s) to the "Course" menu.
protected  void addLectureMenuItems(javax.swing.JMenu lecturesMenu)
          Adds lectures of selected course to the "Lecture" menu.
protected  void addTaskMenuItems(javax.swing.JMenu tasksMenu)
          Adds tasks of selected course to the "Task" menu.
protected  javax.swing.JMenu createCourseMenu()
          Creates the GUI "Course" item in menu bar.
protected  javax.swing.JPanel createCoursePanel()
          Creates the GUI "Course" panel.
protected  javax.swing.JMenu createFileMenu()
          Creates the GUI "File" item in menu bar (items Select Tree, Save Tree, Exit)
protected  void createFrame()
          Creates the application's main GUI frame.
protected  javax.swing.JMenu createHelpMenu()
          Creates the GUI "Help" item in menu bar.
protected  javax.swing.JMenu createLectureMenu()
          Creates the GUI "Lecture" item in menu bar.
protected  javax.swing.JPanel createLecturePanel()
          Creates the GUI "Lecture" panel.
protected  void createMenuBar()
          Creates the GUI menu bar.
protected  void createPanel()
          Creates the GUI panel (panels Tree, Course, Lecture, Practices, Task, Project) and calls updatePanel to update it.
protected  javax.swing.JPanel createPracticesPanel()
          Creates the GUI "Practises" panel.
protected  javax.swing.JPanel createProjectPanel()
          Creates the GUI "Project" panel.
protected  javax.swing.JMenu createTaskMenu()
          Creates the GUI "Task" item in menu bar.
protected  javax.swing.JPanel createTaskPanel()
          Creates the GUI "Task" panel.
protected  javax.swing.JPanel createTreePanel()
          Creates the GUI "Tree" panel.
protected  void changeTree(java.lang.String id)
          Changes the tree.
protected  void initComponents()
          Initializes the GUI menu and panel.
 void main()
          main() method of the whole project
static void main(java.lang.String[] args)
          Creates a new instance of Author and calls its method main().
protected  void selectCourse(java.lang.String id)
          Selects the course.
protected  java.io.File selectDir()
          Dialog for selecting the directory (tree)
protected  void selectLecture(java.lang.String id)
          Selects the lecture.
protected  void selectTask(java.lang.String id)
          Selects the task.
protected  void updateCourse(Course c)
          Updates the title and body of the course.
protected  void updateLecture(Lecture lect)
          Updates the title and body of the lecture.
protected  void updateMenu()
          Updates the menubar when i. e. a course is selected.
protected  void updatePanel()
          Updates the tabbedpane when i. e. a course is selected.
protected  void updateTask(Task t)
          Updates the title and body of the task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APP_TITLE

public static final java.lang.String APP_TITLE
See Also:
Constant Field Values

root

public static final java.lang.String root
See Also:
Constant Field Values

emptyCourse

public Course emptyCourse

emptyLecture

public Lecture emptyLecture
Constructor Detail

Author

public Author()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Creates a new instance of Author and calls its method main().

Parameters:
args - Command-line arguments
Throws:
java.lang.Exception

main

public void main()
          throws java.lang.Exception
main() method of the whole project

Throws:
java.lang.Exception

createMenuBar

protected void createMenuBar()
Creates the GUI menu bar. (items File, Course, Lecture, Help) and calls updateMenu to update it.


updateMenu

protected void updateMenu()
Updates the menubar when i. e. a course is selected.


selectDir

protected java.io.File selectDir()
Dialog for selecting the directory (tree)

Returns:
Selected directory (tree) or null (directory not selected)

createFileMenu

protected javax.swing.JMenu createFileMenu()
Creates the GUI "File" item in menu bar (items Select Tree, Save Tree, Exit)

Returns:
Selected item

changeTree

protected void changeTree(java.lang.String id)
                   throws java.net.MalformedURLException,
                          org.dom4j.DocumentException
Changes the tree. Loads the directory, course(s) and lecture(s). If the operations is successful, the message box shows the name of the selected tree.

Parameters:
id - Directory path.
Throws:
java.net.MalformedURLException
org.dom4j.DocumentException

createCourseMenu

protected javax.swing.JMenu createCourseMenu()
Creates the GUI "Course" item in menu bar. (items New, Save, Delete) Items Save and Delete are shown only if a course is open. Calls addCourseMenuItems() to show the open course(s).

Returns:
Selected item

updateCourse

protected void updateCourse(Course c)
Updates the title and body of the course.

Parameters:
c - Course

addCourseMenuItems

protected void addCourseMenuItems(javax.swing.JMenu courseMenu)
Adds open course(s) to the "Course" menu.

Parameters:
courseMenu - Course menu

selectCourse

protected void selectCourse(java.lang.String id)
Selects the course. If the operations is successful, the message box shows the name of the selected course.

Parameters:
id - Course ID

createLectureMenu

protected javax.swing.JMenu createLectureMenu()
Creates the GUI "Lecture" item in menu bar. (items New, Save, Delete) Items Save and Delete are shown only if a course is open. Calls addLectureMenuItems to show the lectures of the selected course.

Returns:
Selected item

addLectureMenuItems

protected void addLectureMenuItems(javax.swing.JMenu lecturesMenu)
Adds lectures of selected course to the "Lecture" menu.

Parameters:
lecturesMenu - Lectures menu

updateLecture

protected void updateLecture(Lecture lect)
Updates the title and body of the lecture.

Parameters:
lect - Lecture

selectLecture

protected void selectLecture(java.lang.String id)
Selects the lecture. If the operations is successful, the message box shows the name of the selected lecture.

Parameters:
id - ID of lecture to select

createTaskMenu

protected javax.swing.JMenu createTaskMenu()
Creates the GUI "Task" item in menu bar. (items New, Save, Delete) Items Save and Delete are shown only if a course is open. Calls addTaskMenuItems to show the tasks of the selected course.

Returns:
Selected item

addTaskMenuItems

protected void addTaskMenuItems(javax.swing.JMenu tasksMenu)
Adds tasks of selected course to the "Task" menu.

Parameters:
tasksMenu - Tasks menu

updateTask

protected void updateTask(Task t)
Updates the title and body of the task.

Parameters:
t - Task

selectTask

protected void selectTask(java.lang.String id)
Selects the task. If the operations is successful, the message box shows the name of the selected task.

Parameters:
id - ID of task to select

createHelpMenu

protected javax.swing.JMenu createHelpMenu()
Creates the GUI "Help" item in menu bar. (item Content)

Returns:
Selected item

createTreePanel

protected javax.swing.JPanel createTreePanel()
Creates the GUI "Tree" panel. (Root directory, Current term, Current course, Current lecture)

Returns:
created Panel

createCoursePanel

protected javax.swing.JPanel createCoursePanel()
Creates the GUI "Course" panel. (Course id, Title, Description)

Returns:
created panel

createLecturePanel

protected javax.swing.JPanel createLecturePanel()
Creates the GUI "Lecture" panel. (Lecture id, Title, Description)

Returns:
created panel

createPracticesPanel

protected javax.swing.JPanel createPracticesPanel()
Creates the GUI "Practises" panel. (no items yet)

Returns:
created tab

createTaskPanel

protected javax.swing.JPanel createTaskPanel()
Creates the GUI "Task" panel. (no items yet)

Returns:
created tab

createProjectPanel

protected javax.swing.JPanel createProjectPanel()
Creates the GUI "Project" panel. (no items yet)

Returns:
created tab

updatePanel

protected void updatePanel()
Updates the tabbedpane when i. e. a course is selected.


createPanel

protected void createPanel()
Creates the GUI panel (panels Tree, Course, Lecture, Practices, Task, Project) and calls updatePanel to update it.


createFrame

protected void createFrame()
Creates the application's main GUI frame.


initComponents

protected void initComponents()
Initializes the GUI menu and panel.