Browse Source

curr

master
esoe 3 years ago
parent
commit
246f70c009
  1. BIN
      report.xlsx
  2. 6
      src/main/java/ru/egspt/moodle/Access.java
  3. 9
      src/main/java/ru/egspt/moodle/App.java
  4. 24
      src/main/java/ru/egspt/moodle/events/ConnactionListener.java
  5. 46
      src/main/java/ru/egspt/moodle/panel/Account.java
  6. 34
      src/main/java/ru/egspt/moodle/panel/ReportSample.java
  7. 2
      src/main/java/ru/egspt/moodle/panel/UserByTag.java
  8. BIN
      target/classes/ru/egspt/moodle/Access.class
  9. BIN
      target/classes/ru/egspt/moodle/App.class
  10. BIN
      target/classes/ru/egspt/moodle/events/ConnactionListener.class
  11. BIN
      target/classes/ru/egspt/moodle/panel/Account$1.class
  12. BIN
      target/classes/ru/egspt/moodle/panel/Account.class
  13. BIN
      target/classes/ru/egspt/moodle/panel/ReportSample.class
  14. BIN
      target/classes/ru/egspt/moodle/panel/UserByTag.class
  15. BIN
      target/classes/ru/egspt/moodle/panel/Users.class

BIN
report.xlsx

Binary file not shown.

6
src/main/java/ru/egspt/moodle/Access.java

@ -9,15 +9,15 @@ public class Access { @@ -9,15 +9,15 @@ public class Access {
//если значение userName отсутствует, запросить его у пользователя
public static String getUserName(){
setUserName();
//setUserName();
return userName;
}
public static String getPassword(){
setPassword();
//setPassword();
return password;
}
public static String getURL(){
setUrl();
//setUrl();
return url;
}
/**

9
src/main/java/ru/egspt/moodle/App.java

@ -4,6 +4,9 @@ import javax.swing.JFrame; @@ -4,6 +4,9 @@ import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
import ru.egspt.moodle.panel.Account;
import ru.egspt.moodle.panel.UserByTag;
/**
* графический интерфейс для
* moodle.anyreport
@ -11,9 +14,13 @@ import javax.swing.WindowConstants; @@ -11,9 +14,13 @@ import javax.swing.WindowConstants;
*/
public class App extends JPanel {
JFrame mainframe = new JFrame("moodle-anyreport");
Account account = new Account();
//Users pUsers = new Users();
//Заполняем панельку компонентами
App(){
this.add(account);
}
//устанавливаем панельку на форму
public void init(){
@ -29,5 +36,7 @@ public class App extends JPanel { @@ -29,5 +36,7 @@ public class App extends JPanel {
System.out.println( "Работает подготовщик отчетов по результатам тестирования пользователей ..." );
App anyreport = new App();
anyreport.init();
//System.out.println( "Работа с приложением завершена." );
}
}

24
src/main/java/ru/egspt/moodle/events/ConnactionListener.java

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
package ru.egspt.moodle.events;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import ru.egspt.moodle.Access;
import ru.egspt.moodle.panel.Account;
public class ConnactionListener implements ActionListener{
Account account;
public ConnactionListener(Account account){
this.account = account;
}
public void actionPerformed(ActionEvent e) {
System.out.println("Нажата кнопка Connect");
Access.setUserName(account.getLoginField().getText());
Access.setPassword(String.valueOf(account.getPassField().getPassword()));
Access.setUrl(account.getUrlField().getText());
System.out.println(Access.getUserName());
System.out.println(Access.getPassword());
System.out.println(Access.getURL());
account.getMainframe().dispose();
}
}

46
src/main/java/ru/egspt/moodle/panel/Account.java

@ -1,10 +1,6 @@ @@ -1,10 +1,6 @@
package ru.egspt.moodle.panel;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
@ -15,9 +11,11 @@ import javax.swing.WindowConstants; @@ -15,9 +11,11 @@ import javax.swing.WindowConstants;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;
import ru.egspt.moodle.Access;
import ru.egspt.moodle.events.ConnactionListener;
public class Account extends JPanel{
private JFrame mainframe = new JFrame("connaction");
private JLabel loginLabel = new JLabel("Имя пользователя: ");
private JTextField loginField = new JTextField(25);
private JLabel passLabel = new JLabel("Пароль: ");
@ -36,7 +34,6 @@ public class Account extends JPanel{ @@ -36,7 +34,6 @@ public class Account extends JPanel{
this.add(passField);
this.add(urlLabel);
this.add(urlField);
this.add(connButton);
this.add(connCloseButton);
TitledBorder border = new TitledBorder(new LineBorder(Color.black), "connection to mysql", TitledBorder.CENTER, TitledBorder.CENTER);
@ -46,26 +43,37 @@ public class Account extends JPanel{ @@ -46,26 +43,37 @@ public class Account extends JPanel{
this.setVisible(true);
}
public void init(){
JFrame mainframe = new JFrame("connaction");
mainframe.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
mainframe.add(this);
mainframe.setSize(320, 240);
mainframe.setVisible(true);
//настройка кнопки connButton
connButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("Нажата кнопка Connect");
Access.setUserName(loginField.getText());
Access.setPassword(String.valueOf(passField.getPassword()));
Access.setUrl(urlField.getText());
//tmpFrame.dispose();
System.out.println(Access.getUserName());
System.out.println(Access.getPassword());
System.out.println(Access.getURL());
mainframe.dispose();
connButton.addActionListener(new ConnactionListener(this));
}
/**
* @return the loginField
*/
public JTextField getLoginField() {
return loginField;
}
/**
* @return the passField
*/
public JPasswordField getPassField() {
return passField;
}
/**
* @return the urlField
*/
public JTextField getUrlField() {
return urlField;
}
});
/**
* @return the mainframe
*/
public JFrame getMainframe() {
return mainframe;
}
public static void main( String[] args )
{

34
src/main/java/ru/egspt/moodle/panel/ReportSample.java

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
package ru.egspt.moodle.panel;
import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.WindowConstants;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;
public class ReportSample extends JPanel{
private JFrame mainframe = new JFrame("report-sample");
private JTextArea ReportArea = new JTextArea();
public ReportSample(){
TitledBorder border = new TitledBorder(new LineBorder(Color.black), "Report-Sample", TitledBorder.CENTER, TitledBorder.CENTER);
this.setBorder(border);
this.add(ReportArea);
}
public void init(){
mainframe.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
mainframe.add(this);
mainframe.setSize(320, 240);
mainframe.setVisible(true);
}
public static void main( String[] args )
{
System.out.println( "Проверка работоспособности класса ReportSample ..." );
ReportSample rs = new ReportSample();
rs.init();
}
}

2
src/main/java/ru/egspt/moodle/panel/Users.java → src/main/java/ru/egspt/moodle/panel/UserByTag.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
package ru.egspt.moodle.panel;
public class Users {
public class UserByTag {
}

BIN
target/classes/ru/egspt/moodle/Access.class

Binary file not shown.

BIN
target/classes/ru/egspt/moodle/App.class

Binary file not shown.

BIN
target/classes/ru/egspt/moodle/events/ConnactionListener.class

Binary file not shown.

BIN
target/classes/ru/egspt/moodle/panel/Account$1.class

Binary file not shown.

BIN
target/classes/ru/egspt/moodle/panel/Account.class

Binary file not shown.

BIN
target/classes/ru/egspt/moodle/panel/ReportSample.class

Binary file not shown.

BIN
target/classes/ru/egspt/moodle/panel/UserByTag.class

Binary file not shown.

BIN
target/classes/ru/egspt/moodle/panel/Users.class

Binary file not shown.
Loading…
Cancel
Save