001package com.studentgui.apppages;
002
003import java.awt.BorderLayout;
004
005import javax.swing.JLabel;
006import javax.swing.JPanel;
007import javax.swing.JScrollPane;
008import javax.swing.JTextArea;
009import javax.swing.SwingConstants;
010
011/**
012 * Simple homepage panel with application overview/help text.
013 *
014 * <p>Provides a small, static help and overview text area that can be
015 * embedded into the main application frame.</p>
016 */
017public class Homepage {
018    /**
019     * Create the homepage panel which contains a title and an overview/help
020     * text area.
021     *
022     * @return a ready-to-add {@link JPanel} containing the application overview
023     */
024    public static JPanel create() {
025        JPanel p = new JPanel(new BorderLayout());
026    JLabel title = new JLabel("Student Skills Progressions", SwingConstants.LEFT);
027        title.setFont(title.getFont().deriveFont(24f));
028        title.getAccessibleContext().setAccessibleName("Student Skills Progressions title");
029        title.setName("homepage_title");
030        p.add(title, BorderLayout.NORTH);
031
032    JTextArea body = new JTextArea();
033                body.setLineWrap(true);
034                body.setWrapStyleWord(true);
035                String text = """
036                                Welcome to the Student Skills Progressions application.
037
038                                This tool helps educators track and record student progress across a set of vision and access skill areas (Braille, Abacus, Digital Literacy, iOS access, Screen Reader, CVI, Keyboarding, and more).
039
040                                How to use:
041                                    1. Select a student from the Student dropdown at the top-left.
042                                    2. Use the Date field to set the session date and click Apply to recreate pages for that date.
043                                    3. Navigate to a skill page using the Navigate menu (or the top control bar). Each skill page contains standardized rows for entering phase/score values.
044                                    4. Enter assessment data and notes on each page. Use the Save / Submit buttons on pages where available to persist data to the local SQLite database.
045                                    5. The shared graph shows progress trends for the selected student. Session notes and contact logs provide a place for free-form observations and structured contact records.
046
047                                Data storage and export:
048                                    • All data is stored locally in a SQLite database under the application data folder.
049                                    • Use the Instructional Materials page to open and manage student-facing materials and reports.
050
051                                Support and workflow tips:
052                                    • Start each session by verifying the student and date, then move through skill pages, entering scores and notes.
053                                    • Use Contact Log to record family/guardian contact; structured fields make later reporting easier.
054                                    • If you need to reset or recreate pages for a student/date, use the Apply button after changing the date.
055
056                                Thanks for using the Student Skills Progressions application.
057                                """;
058                body.setText(text);
059        body.setEditable(false);
060        body.setToolTipText("Overview and quick help about the application");
061        body.getAccessibleContext().setAccessibleName("Homepage overview");
062        JScrollPane bodyScroll = new JScrollPane(body);
063        bodyScroll.getAccessibleContext().setAccessibleName("Homepage overview scroll pane");
064        body.setName("homepage_body");
065        p.add(bodyScroll, BorderLayout.CENTER);
066        return p;
067    }
068
069    /**
070     * Private constructor to prevent instantiation of this utility class.
071     */
072    private Homepage() {
073        throw new AssertionError("Not instantiable");
074    }
075}