diff --git a/src/main/java/ru/egspt/App.java b/src/main/java/ru/egspt/App.java index 4c308ba..353af4a 100644 --- a/src/main/java/ru/egspt/App.java +++ b/src/main/java/ru/egspt/App.java @@ -1,5 +1,7 @@ package ru.egspt; +import java.awt.BorderLayout; + import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.WindowConstants; @@ -16,9 +18,10 @@ public class App extends JPanel{ private TagPane tagPane = new TagPane(this); public void init(){ - this.add(getAccessPane()); - this.add(getTagPane()); - this.add(getReportPane()); + this.setLayout(new BorderLayout()); + this.add(getAccessPane(), BorderLayout.NORTH); + this.add(getTagPane(), BorderLayout.SOUTH); + this.add(getReportPane(), BorderLayout.CENTER); this.setVisible(true); } public void initFrame(){ diff --git a/src/main/java/ru/egspt/BaseControls.java b/src/main/java/ru/egspt/BaseControls.java index 2f1b8cc..328d195 100644 --- a/src/main/java/ru/egspt/BaseControls.java +++ b/src/main/java/ru/egspt/BaseControls.java @@ -16,6 +16,7 @@ public class BaseControls { //данные в панель отчетов app.getReportPane().init(); app.getReportPane().setData(app.getData()); + //app.getReportPane().getPreferredSize(); app.getReportPane().setVisible(true); } diff --git a/src/main/java/ru/egspt/Data.java b/src/main/java/ru/egspt/Data.java index 2924ac5..6efe2f0 100644 --- a/src/main/java/ru/egspt/Data.java +++ b/src/main/java/ru/egspt/Data.java @@ -1,3 +1,33 @@ package ru.egspt; -public class Data extends UserListModel{ + +import java.util.ArrayList; + +public class Data extends UserListModel { + ArrayList quizes = new ArrayList<>(); + ArrayList results = new ArrayList<>(); + + /** + * @param quizes the quizes to set + */ + public void setQuizes(ArrayList quizes) { + this.quizes = quizes; + } + /** + * @return the quizes + */ + public ArrayList getQuizes() { + return quizes; + } + /** + * @param results the results to set + */ + public void setResults(ArrayList results) { + this.results = results; + } + /** + * @return the results + */ + public ArrayList getResults() { + return results; + } } diff --git a/src/main/java/ru/egspt/Quiz.java b/src/main/java/ru/egspt/Quiz.java new file mode 100644 index 0000000..06b4af0 --- /dev/null +++ b/src/main/java/ru/egspt/Quiz.java @@ -0,0 +1,36 @@ +package ru.egspt; + +public class Quiz { + private int id; + private String name; + public Quiz(){} + public Quiz(int id, String name){ + this.setId(id); + this.setName(name); + } + /** + * @return the id + */ + public int getId() { + return id; + } + /** + * @param id the id to set + */ + public void setId(int id) { + this.id = id; + } + /** + * @return the name + */ + public String getName() { + return name; + } + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + +} diff --git a/src/main/java/ru/egspt/QuizesListModel.java b/src/main/java/ru/egspt/QuizesListModel.java new file mode 100644 index 0000000..e9fc63a --- /dev/null +++ b/src/main/java/ru/egspt/QuizesListModel.java @@ -0,0 +1,5 @@ +package ru.egspt; + +public class QuizesListModel { + +} diff --git a/src/main/java/ru/egspt/ReportPane.java b/src/main/java/ru/egspt/ReportPane.java index 89c1bb9..4206e1c 100644 --- a/src/main/java/ru/egspt/ReportPane.java +++ b/src/main/java/ru/egspt/ReportPane.java @@ -23,7 +23,7 @@ public class ReportPane extends JPanel{ table = new JTable(tableModel); table.setPreferredScrollableViewportSize(new Dimension(500, 70)); table.setFillsViewportHeight(true); - JScrollPane scrollPane = new JScrollPane(table); + JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); tabPane.add(scrollPane); } diff --git a/src/main/java/ru/egspt/Result.java b/src/main/java/ru/egspt/Result.java new file mode 100644 index 0000000..2518a9c --- /dev/null +++ b/src/main/java/ru/egspt/Result.java @@ -0,0 +1,70 @@ +package ru.egspt; + +public class Result { + int id; + int quizid; + int userid; + double grade; + Long time; + + /** + * @param id the id to set + */ + public void setId(int id) { + this.id = id; + } + /** + * @return the id + */ + public int getId() { + return id; + } + /** + * @param quizid the quizid to set + */ + public void setQuizid(int quizid) { + this.quizid = quizid; + } + /** + * @return the quizid + */ + public int getQuizid() { + return quizid; + } + /** + * @param userid the userid to set + */ + public void setUserid(int userid) { + this.userid = userid; + } + /** + * @return the userid + */ + public int getUserid() { + return userid; + } + /** + * @param grade the grade to set + */ + public void setGrade(double grade) { + this.grade = grade; + } + /** + * @return the grade + */ + public double getGrade() { + return grade; + } + /** + * @param time the time to set + */ + public void setTime(Long time) { + this.time = time; + } + /** + * @return the time + */ + public Long getTime() { + return time; + } +} diff --git a/src/main/java/ru/egspt/ResultsListModel.java b/src/main/java/ru/egspt/ResultsListModel.java new file mode 100644 index 0000000..7e35066 --- /dev/null +++ b/src/main/java/ru/egspt/ResultsListModel.java @@ -0,0 +1,5 @@ +package ru.egspt; + +public class ResultsListModel { + +} diff --git a/target/classes/ru/egspt/App.class b/target/classes/ru/egspt/App.class index 87a1265..8d92cca 100644 Binary files a/target/classes/ru/egspt/App.class and b/target/classes/ru/egspt/App.class differ diff --git a/target/classes/ru/egspt/BaseControls.class b/target/classes/ru/egspt/BaseControls.class index 797702d..4e9a46a 100644 Binary files a/target/classes/ru/egspt/BaseControls.class and b/target/classes/ru/egspt/BaseControls.class differ diff --git a/target/classes/ru/egspt/Data.class b/target/classes/ru/egspt/Data.class index 3a81209..7693bdf 100644 Binary files a/target/classes/ru/egspt/Data.class and b/target/classes/ru/egspt/Data.class differ diff --git a/target/classes/ru/egspt/Quiz.class b/target/classes/ru/egspt/Quiz.class new file mode 100644 index 0000000..89b1520 Binary files /dev/null and b/target/classes/ru/egspt/Quiz.class differ diff --git a/target/classes/ru/egspt/QuizesListModel.class b/target/classes/ru/egspt/QuizesListModel.class new file mode 100644 index 0000000..669b615 Binary files /dev/null and b/target/classes/ru/egspt/QuizesListModel.class differ diff --git a/target/classes/ru/egspt/ReportPane.class b/target/classes/ru/egspt/ReportPane.class index 5c9e198..0c67f75 100644 Binary files a/target/classes/ru/egspt/ReportPane.class and b/target/classes/ru/egspt/ReportPane.class differ diff --git a/target/classes/ru/egspt/Result.class b/target/classes/ru/egspt/Result.class new file mode 100644 index 0000000..dd5f8ac Binary files /dev/null and b/target/classes/ru/egspt/Result.class differ diff --git a/target/classes/ru/egspt/ResultsListModel.class b/target/classes/ru/egspt/ResultsListModel.class new file mode 100644 index 0000000..11c0b73 Binary files /dev/null and b/target/classes/ru/egspt/ResultsListModel.class differ