The Student Management panel (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/kenri89/PROYECTO_UTP_AED_1_1/llms.txt
Use this file to discover all available pages before exploring further.
PanelEstudiantes) is accessible to users with the Administrator (admin) and Secretary (secretaria) roles. It provides a full CRUD interface for maintaining the student registry, backed by a Binary Search Tree (BST) keyed on the carnet field. Every mutation is also persisted to the SQL Server database through EstudianteDAO, and the BST is re-hydrated from the database on each load to keep the in-memory structure in sync.
The Estudiante Data Model
Each student record contains three fields. The carnet is the primary key used as the BST sort key; no two students may share the same value.
| Field | Type | Description | Constraint |
|---|---|---|---|
carnet | String | Unique student identifier — acts as the BST key. | Non-null (Guava checkNotNull) |
nombre | String | Student’s full name. | Non-null |
carrera | String | Degree programme (e.g. DESARROLLO DE SISTEMAS). | Non-null |
Preconditions.checkNotNull:
CRUD Operations
Register a New Student
Fill in the Carnet, Nombre, and select a Carrera from the combo-box, then click Registrar.The panel calls
EstudianteDAO.insertar(carnet, nombre, carrera). On success, cargarDatosDesdeSQL() reloads the BST and refreshes the table. If any field is empty the operation is blocked with a dialog before the DAO is ever reached.Search by Carnet
Click Buscar por carnet and enter the carnet in the prompt dialog. The panel delegates to The result is displayed in a message dialog showing the student’s name and programme.
ArbolEstudiantes.buscar(carnet), which performs a BST lookup in O(log n) average time by comparing the target against each node’s carnet string and traversing left or right accordingly.Update a Student
Right-click any row in the table and choose Actualizar from the context menu. The row’s data is loaded into the form fields. Edit Nombre and/or Carrera (the carnet is pre-populated and read-only at this point), then click Actualizar.The panel calls
EstudianteDAO.actualizar(carnetSeleccionado, nuevoNombre, nuevaCarrera) and refreshes the BST from SQL on success. The in-memory BST is also updated via ArbolEstudiantes.actualizar(), which finds the node by carnet and calls the setters directly — no removal and re-insertion needed.Delete a Student
Right-click a row and choose Eliminar. A confirmation dialog is shown. On approval,
EstudianteDAO.eliminar(carnet) removes the record from the database, and cargarDatosDesdeSQL() rebuilds the BST.The BST deletion itself promotes the in-order successor (leftmost node in the right subtree) when the removed node has two children, preserving the BST invariant:In-Order Traversal
The methodArbolEstudiantes.inorden(Consumer<Estudiante>) performs a left-root-right recursive traversal, visiting every node in ascending carnet order. PanelEstudiantes uses it to populate the table view after every database reload:
MenuPrincipal to populate the carnet combo-box in the enrollment panel, and by ExportadorExcel to collect the ordered student list for export.
Excel Export
Click Exportar a Excel in the toolbar below the table. A file-chooser dialog opens, defaulting toestudiantes.xls. The export is handled by the static utility:
exportarEstudiantes calls arbol.inorden(estudiantes::add) to collect all students in carnet order, then writes them to an HSSFWorkbook (Apache POI .xls format) with three columns:
| Column A | Column B | Column C |
|---|---|---|
| Carnet | Nombre | Carrera |