From 2b31a9fef7a808ee8496e1254971df618c533acc Mon Sep 17 00:00:00 2001 From: esoe Date: Mon, 16 May 2022 18:06:50 +0300 Subject: [PATCH] qqq --- src/main/java/ru/egspt/App.java | 9 ++- src/main/java/ru/egspt/BaseControls.java | 1 + src/main/java/ru/egspt/Data.java | 32 +++++++- src/main/java/ru/egspt/Quiz.java | 36 +++++++++ src/main/java/ru/egspt/QuizesListModel.java | 5 ++ src/main/java/ru/egspt/ReportPane.java | 2 +- src/main/java/ru/egspt/Result.java | 70 ++++++++++++++++++ src/main/java/ru/egspt/ResultsListModel.java | 5 ++ target/classes/ru/egspt/App.class | Bin 2421 -> 2606 bytes target/classes/ru/egspt/BaseControls.class | Bin 2074 -> 2074 bytes target/classes/ru/egspt/Data.class | Bin 261 -> 1164 bytes target/classes/ru/egspt/Quiz.class | Bin 0 -> 846 bytes target/classes/ru/egspt/QuizesListModel.class | Bin 0 -> 288 bytes target/classes/ru/egspt/ReportPane.class | Bin 2320 -> 2326 bytes target/classes/ru/egspt/Result.class | Bin 0 -> 1276 bytes .../classes/ru/egspt/ResultsListModel.class | Bin 0 -> 291 bytes 16 files changed, 155 insertions(+), 5 deletions(-) create mode 100644 src/main/java/ru/egspt/Quiz.java create mode 100644 src/main/java/ru/egspt/QuizesListModel.java create mode 100644 src/main/java/ru/egspt/Result.java create mode 100644 src/main/java/ru/egspt/ResultsListModel.java create mode 100644 target/classes/ru/egspt/Quiz.class create mode 100644 target/classes/ru/egspt/QuizesListModel.class create mode 100644 target/classes/ru/egspt/Result.class create mode 100644 target/classes/ru/egspt/ResultsListModel.class 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 87a1265889e481b07812f27cfdc27183c8ff35f1..8d92cca15f63bc16ecb0f5ff81d8403e09fa9b92 100644 GIT binary patch delta 949 zcmZ8fO-vI}5dPk7p{1@`7Fq;^qA3PiW1}&Osel41mGWm5s9I#93l!-Vmjwh-@c$3N z_>LMqdNaYpl1O5_>fO61?;ead5su_`7?MX!& z3wIAss3S(cYNv!Qbo0+b!0SRURgF`hcGb9q^SHo&2|=F={S1YzR7cel9Ex<+NiE%R5y|smQailz9?3>l29d#VvN5Q0|e4mvlIM<5cVfADIo)m z!AWz7rx#S>uZu=4y-6hackyNQ0v4UP!QioHWA`7QpElHtgqyg<-#BX6GXLaQYrcbf zPTXZEu@lqTaF3qWjJTnz3gzC%2(e6AN0XW*!G4BE5-vlw;1j-D@S{qC1KY6^J5WKk z79JcV8I6z;g~VSK`j;{gDH{j}HxWr}pwUEAFleGhK5e4i@?vsN-a9AvS)Rkhz&c$K zaD;3H3dwr04L-7E@M9P1QH}!?IZ6>JR~`*GMu=Jcku4$LqFxfnsog{}Az#^m5(^cY zNQH=XygyVdEEltHCa#8vG5bH`Zn#lJqN<72PhSlJ*kd#Ls52^>XLO?yLzp5?hHKFC z++iC7{H@c=_VIO>SDc2yzd8eKzl~-v%Vk%99kP+Nr`?1aY-DZG3ZW(&+1o~_jZleE zggIQ#lO(ATtCjNin3tDK+};GE5kH89OgyCj@jp#I6i{M2T=Xy=+NV-<&>TCr=qblj TtWb^zMR-QDwDhbJ7O?gQquamA delta 811 zcmYjP-BMCf6#h1cpTqG~a1c@`lfo(Cf@vo0$4o6nAu5al$t+KSgaH|lfBj$&&~&k< zD{p#$rpYdjGda@(^bk#tkQd!GO=}-0y*TTv^{u_vx4*U4$If4x^6k%;uK>>A^_DVj zQ4}y-R56T8{DURz65*(dF^bUYJr5M}p5wVKYpsxQ6Te zy>vV}&7dvn%lc}xzEY|dqls8euM}jY8JrcpR9z6Ef)sA6a3jNaCBK})jEWrYaE~<< zN?}x_=TzLoeFjIp&`6io3k z=)*yrrf3*060P7YHBY6pKmzA*p8gCMppo^EKMRYQ3x>l6h762kg>&VfGif?j16Q}` zumyu;eXx=Bz==*O<3%$-P%jSeV+#IfqKCGbDv+oE(6@tBPP@5{TgiysKsG{rv)PE- zvf*Yw4BU+n+x#AzA9lLbO+x%6DnNWka12KgLXS!410R%K9ck#q!|(tP`LrBjC-_g< zE9Ft3$fNaqq8hE&+fBLsW_kfdk>=lJH;bBxSSx`9oNhK?B4Td@GDFCaiHOA#$UCRI zIkr!D;oSYc5}iVsNTsXzi% z0*MFUp%DM9ixY@ZE;8Ajo%!dR8UOtC?FWGS@NJY7>QUMYhw*9BdlV#rjfz4$cfE|m zXrSZd$>eo7Qn22q`ePU?v<7d34?!MJ;hdN>Y}Gzt}ViemN#x%L6I z`uj|>qcBcK31$5SDbG!yNwW6zSSR}mWxsQzP!oAe%siS#7% zSu5bm+;wiNx!=YG2eqgx@5^y zy9-O^xy(GAq|r(ESj(^-8RI=!8Me8VGC$E0e_Rr8wz)0Qa#i`=<*Sl))7JTRz%0f8 z&F(ptyWg?$>Ku))Xikr<&qipKwt)(5mDYmC0vkN9(IaA%z&btPc@tL&k^x*ZWuEaa zXjXTZ;-XlFD7wa5r_QobYG+XwN{r`=z+Y!N?AB{0B9g^DL^v1_kx@4C5cc1_lNb27!rOM$$H!d6^}4j10^gnqiC#EYA5Usay=q44ga+tdm6; zT_$%iDR?n3FajYf0~?TJ2Wr&^^BEXewYD>GYy=80F>nD%kTi(R4J3KMY*rx63*<2} I@PTFc0hE>w*Z=?k diff --git a/target/classes/ru/egspt/Quiz.class b/target/classes/ru/egspt/Quiz.class new file mode 100644 index 0000000000000000000000000000000000000000..89b152041375aa6a66aa0ddae54a5b823ce4e61b GIT binary patch literal 846 zcmZ{iUu)A)7{;GBP1`kQ>#S@2Q|Ih-kXA7_yW7}}AOyxlCIv6kF4Qx+RMK=8`%GRa zY!kfj1Nfn2&zl5`Z6%PCbI$WT@9(@PzyJLF1z;b0Rak=cWadYs>6g_1Ff&(G*n-XT z@G|trVLbBR56+`uDzMC%KmvgshZm8caXiiA{PWD0$sJrEe!^k%JP} zUDV(R>c=LIPG%Q_DESx;##zi{7>@g4Vsu_C+UaLARrNn)%x`(Ya@lU*fndu;6D>h` z8l?eIZ7;|-9=UjoCxR+BPBQeSwPkb8aP(C!`|?Hk29a6a4h$J!2O=dHVTnS>-=_e z0XA`;Gc`B(R`Vx@YmvH|d+l31=)Jzh!+A^tHn(}htX$)>!MYmxJhv5*49FOjqprtd zte}mjMVUF{HMYM}WHBf|h#FQg@@5M25!IHed+i%+&(WN0waLP*ETNUF{vuThB*6}G n7n^mB&bI}S_DT@`2}>ZaZqQi->9E}He?YV&dP^^|iZAZ~=ag>3 literal 0 HcmV?d00001 diff --git a/target/classes/ru/egspt/QuizesListModel.class b/target/classes/ru/egspt/QuizesListModel.class new file mode 100644 index 0000000000000000000000000000000000000000..669b615e770c0987a834c8016c6b9e4655c87699 GIT binary patch literal 288 zcmZ`!yKcfj5S%qO28RR-Q6M_Hkb-N{C89y1G9Uz^KbsRdWbDX3r^sKWLZZkAmA>iJEG=rF-XZWUXNUHp1_KBUuBCJ~MIUfcJ7l`NI-N2G9Lo>lRRXCx#P)AdhFRFhkrW)Dc`-|w$xii=*_0% z$CN*Dr>@@?NScj4h0kUqCyyky3|zt{L3-}gISnobj(27cCJa*U&4%`*Z+oshhnFe; zojVuU>P5JjAw75eE_qUBx6#i*;HrT%G7?b#U}iobN7*a&2C2DjAS*RFYV@sEyj72r zikk*D{wnmXzy@Qy(63IJ9i6RiAcs8vF;e)C30adY#b>H4+h(*b+V!r10t_nYs+DE4 z5tRz$-^>DU=sb62bqcy)$Fk63i&K$39l^Slw~H`0zFuFu0@_KT0xs` zen;sWHwl!vX4GX8+uR#kfE`@sNnjUOxJu_X)d{I?R+iXXdFR#bCZUQd!md_@5oC0B zhcN{9Q3+$MKo;2h%%J~*?8Jgxiw8M~g6uP0Wetd|l?1sF3vv(zIgAB4j0dSkL23l4 zuK|(Gk|4KYL8?)ZRxHSE++hganxvYGOtZd3Eedi%kOyl(8W1_I669D7>HovJK5>%LCS4*Lq*MkZK=f;8MHVe~ZmJ74t9O~IRx&e+&`--;nzgL7_vd2hKD8x` z(yIWkgk)LPRj%H(KQp)_eD-j-2cz&u;7A^UHD)JH9*CayX#H>@K*H+V;DuY(_9>4z M-mxQeSOawb0eQASL;wH) literal 0 HcmV?d00001