GuiReflectAppbuild.xml Builds, tests, and runs the pro.docx
1. GuiReflectApp/build.xml
Builds, tests, and runs the project GuiReflectApp.
GuiReflectApp/build/built-jar.properties
#Fri, 06 Mar 2020 09:57:03 -0700
C:UsersLenovo -
HomeOneDriveNetBeansProjectsGuiReflectApp=
GuiReflectApp/build/classes/edu/t10/GuiReflectApp.classpacka
ge edu.t10;
publicsynchronizedclass GuiReflectApp {
public void GuiReflectApp();
publicstatic void main(String[]);
}
GuiReflectApp/build/classes/edu/t10/model/Student.classpackag
e edu.t10.model;
publicsynchronizedclass Student {
private String name;
public void Student();
public String getName();
2. public void setName(String);
public String getViewClass();
public String toString();
}
GuiReflectApp/build/classes/edu/t10/view/MainFrame.classpack
age edu.t10.view;
publicsynchronizedclass MainFrame extends
javax.swing.JFrame {
private StudentView view;
private edu.t10.model.Student model;
public void MainFrame();
public edu.t10.model.Student getModel();
public void setModel(edu.t10.model.Student);
private void initializeComponents();
private void layoutComponents();
}
GuiReflectApp/build/classes/edu/t10/view/StudentView.classpa
ckage edu.t10.view;
publicsynchronizedclass StudentView extends
javax.swing.JLabel {
private edu.t10.model.Student model;
public void StudentView();
public edu.t10.model.Student getModel();
public void setModel(edu.t10.model.Student);
private void updateDisplay();
}
GuiReflectApp/dist/GuiReflectApp.jar
META-INF/MANIFEST.MF
Manifest-Version: 1.0
3. Ant-Version: Apache Ant 1.9.7
Created-By: 1.8.0_111-b14 (Oracle Corporation)
Class-Path:
X-COMMENT: Main-Class will be added automatically by build
Main-Class: edu.t10.GuiReflectApp
edu/t10/GuiReflectApp.classpackage edu.t10;
publicsynchronizedclass GuiReflectApp {
public void GuiReflectApp();
publicstatic void main(String[]);
}
edu/t10/model/Student.classpackage edu.t10.model;
publicsynchronizedclass Student {
private String name;
public void Student();
public String getName();
public void setName(String);
public String getViewClass();
public String toString();
}
edu/t10/view/MainFrame.classpackage edu.t10.view;
publicsynchronizedclass MainFrame extends
javax.swing.JFrame {
4. private StudentView view;
private edu.t10.model.Student model;
public void MainFrame();
public edu.t10.model.Student getModel();
public void setModel(edu.t10.model.Student);
private void initializeComponents();
private void layoutComponents();
}
edu/t10/view/StudentView.classpackage edu.t10.view;
publicsynchronizedclass StudentView extends
javax.swing.JLabel {
private edu.t10.model.Student model;
public void StudentView();
public edu.t10.model.Student getModel();
public void setModel(edu.t10.model.Student);
private void updateDisplay();
}
GuiReflectApp/dist/README.TXT
========================
BUILD OUTPUT DESCRIPTION
========================
When you build an Java application project that has a main
class, the IDE
automatically copies all of the JAR
files on the projects classpath to your projects dist/lib folder.
The IDE
also adds each of the JAR files to the Class-Path element in the
application
JAR files manifest file (MANIFEST.MF).
To run the project from the command line, go to the dist folder
5. and
type the following:
java -jar "GuiReflectApp.jar"
To distribute this project, zip up the dist folder (including the
lib folder)
and distribute the ZIP file.
Notes:
* If two JAR files on the project classpath have the same name,
only the first
JAR file is copied to the lib folder.
* Only JAR files are copied to the lib folder.
If the classpath contains other types of files or folders, these
files (folders)
are not copied.
* If a library on the projects classpath also has a Class-Path
element
specified in the manifest,the content of the Class-Path element
has to be on
the projects runtime path.
* To set a main class in a standard Java project, right-click the
project node
in the Projects window and choose Properties. Then click Run
and enter the
class name in the Main Class field. Alternatively, you can
manually type the
class name in the manifest Main-Class element.
GuiReflectApp/manifest.mf
Manifest-Version: 1.0
12. Must set build.dir
Must set dist.dir
Must set build.classes.dir
Must set dist.javadoc.dir
Must set build.test.classes.dir
Must set build.test.results.dir
Must set build.classes.excludes
Must set dist.jar
34. Must select one file in the IDE or set run.class
Must select one file in the IDE or set run.class
35. Must select one file in the IDE or set debug.class
Must select one file in the IDE or set debug.class
Must set fix.includes
This target only works when run from inside the NetBeans
IDE.
Must select one file in the IDE or set profile.class
This target only works when run from inside the NetBeans
IDE.
36. This target only works when run from inside the NetBeans
IDE.
This target only works when run from inside the NetBeans
IDE.
37. Must select one file in the IDE or set run.class
Must select some files in the IDE or set test.includes
Must select one file in the IDE or set run.class
40. Some tests failed; see details above.
Must select some files in the IDE or set test.includes
Some tests failed; see details above.
41. Must select some files in the IDE or set test.class
Must select some method in the IDE or set test.method
Some tests failed; see details above.
Must select one file in the IDE or set test.class
Must select one file in the IDE or set test.class
Must select some method in the IDE or set test.method
Must select one file in the IDE or set applet.url
46. ${run.classpath}
debug.test.classpath=
${run.test.classpath}
# Files in build.classes.dir which should be excluded from
distribution jar
dist.archive.excludes=
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/GuiReflectApp.jar
dist.javadoc.dir=${dist.dir}/javadoc
excludes=
includes=**
jar.compress=false
javac.classpath=
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.external.vm=true
javac.processorpath=
50. /**
* A single frame application that displays a Student model with
a StudentView
*
* @author rickb
*/
publicclassGuiReflectApp{
/**
* Main entry point for this application
*
* @param args the command line arguments (ignored)
*/
publicstaticvoid main(String[] args){
Student model =newStudent();
model.setName("Rick");// Change this to using reflection.
MainFrame frame =newMainFrame();
frame.setModel(model);
}
}
GuiReflectApp/src/edu/t10/model/Student.javaGuiReflectApp/sr
c/edu/t10/model/Student.java/*
* To change this license header, choose License Headers in Pro
ject Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package edu.t10.model;
/**
* A simple (MVC) model for a Student
*
* @author rickb
51. */
publicclassStudent{
privateString name;
publicStudent(){
this.name ="";
}
publicString getName(){
return name;
}
publicvoid setName(String name){
this.name = name;
}
publicString getViewClass(){
return"";// TODO
}
@Override
publicString toString(){
return name;
}
}
GuiReflectApp/src/edu/t10/view/MainFrame.javaGuiReflectApp
/src/edu/t10/view/MainFrame.java/*
* To change this license header, choose License Headers in Pro
ject Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package edu.t10.view;
53. view.setModel(model);
}
privatevoid initializeComponents(){
// TODO load via reflection
view =newStudentView();
}
privatevoid layoutComponents(){
getContentPane().add(view);
}
}
GuiReflectApp/src/edu/t10/view/StudentView.javaGuiReflectAp
p/src/edu/t10/view/StudentView.java/*
* To change this license header, choose License Headers in Pro
ject Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package edu.t10.view;
import edu.t10.model.Student;
import javax.swing.JLabel;
/**
* A simple view that displays a Student model.
*
* @author rickb
*/
publicclassStudentViewextendsJLabel{
/**
* The Student model displayed in this view.
*/
privateStudent model;
54. publicStudent getModel(){
return model;
}
/**
* Display the given model in this view
*
* @param model
*/
publicvoid setModel(Student model){
this.model = model;
updateDisplay();
}
/**
* Display the current model in this view.
*/
privatevoid updateDisplay(){
// TODO: Use reflection here.
setText(model.getName());
}
}