First Pass

This commit is contained in:
Bruce Eckel 2015-04-20 23:01:41 -07:00
parent 0808069789
commit 5f693601fa
78 changed files with 363 additions and 899 deletions

1
.gitignore vendored
View File

@ -43,3 +43,4 @@ Temporary Items
.apdisk
*.class
failures

View File

@ -8,7 +8,7 @@ for Java 8
[Click here](https://github.com/BruceEckel/TIJ4-Refreshed-Examples/archive/master.zip) to download the zip file. Unzip the file into a directory of your choice.
## Build the Examples ##
1. Install the latest version of Java 8 (JDK8).
1. Install the latest version of Java 8 (JDK8). (Use 32-bit version on Windows).
1. Install Apache Ant. Follow the instructions [here](https://ant.apache.org/manual/install.html#getting).

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -30,7 +30,7 @@
</target>
<target name="net_mindview_simple">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/simple/">
<compilerarg value="-Xmaxerrs"/>
@ -44,7 +44,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'access'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -30,7 +30,7 @@
</target>
<target name="net_mindview_atunit">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/atunit/">
<compilerarg value="-Xmaxerrs"/>
@ -44,7 +44,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'annotations'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">
@ -153,7 +153,7 @@
fork="true"/>
</target>
<target name="TableCreator">
<!-- <target name="TableCreator">
<java
classname="annotations.database.TableCreator"
classpath="${java.class.path};${basedir};${basedir}/.."
@ -184,7 +184,7 @@
<arg value="-s"/>
<arg value="database"/>
</exec>
</target>
</target> -->
<target
depends="build"
@ -203,8 +203,8 @@
<antcall target="StackLStringTest"/>
<antcall target="UseCaseTracker"/>
<antcall target="TableCreator"/>
<antcall target="InterfaceExtractorProcessor"/>
<antcall target="TableCreationProcessorFactory"/>
<!-- <antcall target="InterfaceExtractorProcessor"/>
<antcall target="TableCreationProcessorFactory"/> -->
<delete file="failures"/>
</target>

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -35,7 +35,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'arrays'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -1,81 +0,0 @@
//: bangbean/BangBean.java
// A graphical Bean.
package bangbean;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
public class
BangBean extends JPanel implements Serializable {
private int xm, ym;
private int cSize = 20; // Circle size
private String text = "Bang!";
private int fontSize = 48;
private Color tColor = Color.RED;
private ActionListener actionListener;
public BangBean() {
addMouseListener(new ML());
addMouseMotionListener(new MML());
}
public int getCircleSize() { return cSize; }
public void setCircleSize(int newSize) {
cSize = newSize;
}
public String getBangText() { return text; }
public void setBangText(String newText) {
text = newText;
}
public int getFontSize() { return fontSize; }
public void setFontSize(int newSize) {
fontSize = newSize;
}
public Color getTextColor() { return tColor; }
public void setTextColor(Color newColor) {
tColor = newColor;
}
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.BLACK);
g.drawOval(xm - cSize/2, ym - cSize/2, cSize, cSize);
}
// This is a unicast listener, which is
// the simplest form of listener management:
public void addActionListener(ActionListener l)
throws TooManyListenersException {
if(actionListener != null)
throw new TooManyListenersException();
actionListener = l;
}
public void removeActionListener(ActionListener l) {
actionListener = null;
}
class ML extends MouseAdapter {
public void mousePressed(MouseEvent e) {
Graphics g = getGraphics();
g.setColor(tColor);
g.setFont(
new Font("TimesRoman", Font.BOLD, fontSize));
int width = g.getFontMetrics().stringWidth(text);
g.drawString(text, (getSize().width - width) /2,
getSize().height/2);
g.dispose();
// Call the listener's method:
if(actionListener != null)
actionListener.actionPerformed(
new ActionEvent(BangBean.this,
ActionEvent.ACTION_PERFORMED, null));
}
}
class MML extends MouseMotionAdapter {
public void mouseMoved(MouseEvent e) {
xm = e.getX();
ym = e.getY();
repaint();
}
}
public Dimension getPreferredSize() {
return new Dimension(200, 200);
}
} ///:~

View File

@ -1,32 +0,0 @@
//: bangbean/BangBeanTest.java
// {Timeout: 5} Abort after 5 seconds when testing
package bangbean;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import static net.mindview.util.SwingConsole.*;
public class BangBeanTest extends JFrame {
private JTextField txt = new JTextField(20);
// During testing, report actions:
class BBL implements ActionListener {
private int count = 0;
public void actionPerformed(ActionEvent e) {
txt.setText("BangBean action "+ count++);
}
}
public BangBeanTest() {
BangBean bb = new BangBean();
try {
bb.addActionListener(new BBL());
} catch(TooManyListenersException e) {
txt.setText("Too many listeners");
}
add(bb);
add(BorderLayout.SOUTH, txt);
}
public static void main(String[] args) {
run(new BangBeanTest(), 400, 500);
}
} ///:~

View File

@ -1,71 +0,0 @@
<?xml version="1.0" ?>
<project
basedir="."
default="run"
name="Thinking in Java, 4th Edition (Refreshed) by Bruce Eckel (chapter: bangbean)">
<description>
build.xml for the source code for the bangbean chapter of
Thinking in Java, 4th Edition (Refreshed) by Bruce Eckel
Source code available at http://www.MindView.net
See copyright notice in CopyRight.txt
Ant available from: http://ant.apache.org/
To see options, type: ant -p
</description>
<condition property="version1.8">
<equals arg1="1.8" arg2="${ant.java.version}"/>
</condition>
<target
depends=""
description="Build all classes in this directory"
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'bangbean'"/>
<javac
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
<echo message="Build 'bangbean' succeeded"/>
</target>
<target name="BangBeanTest">
<java
classname="bangbean.BangBeanTest"
classpath="${java.class.path};${basedir};${basedir}/.."
dir="../bangbean/"
failonerror="false"
fork="true"
timeout="5000"/>
<echo message="* Exception was expected *"/>
</target>
<target
depends="build"
description="Compile and run"
name="run">
<touch file="failures"/>
<antcall target="BangBeanTest"/>
<delete file="failures"/>
</target>
<target description="delete all byproducts" name="clean">
<delete>
<fileset dir="${basedir}" includes="**/*.class"/>
<fileset dir="${basedir}" includes="**/*Output.txt"/>
<fileset dir="${basedir}" includes="**/log.txt"/>
<fileset dir="${basedir}" includes="failures"/>
</delete>
<echo message="clean successful"/>
</target>
</project>

View File

@ -41,8 +41,6 @@
annotations/build.xml
concurrency/build.xml
gui/build.xml
frogbean/build.xml
bangbean/build.xml
swt/build.xml
"/>

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -30,7 +30,7 @@
</target>
<target name="enumerated_menu">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../enumerated/menu/">
<compilerarg value="-Xmaxerrs"/>
@ -44,7 +44,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'concurrency'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -21,7 +21,7 @@
</condition>
<target name="typeinfo_pets">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../typeinfo/pets/">
<compilerarg value="-Xmaxerrs"/>
@ -30,7 +30,7 @@
</target>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -39,7 +39,7 @@
</target>
<target name="holding">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../holding/">
<compilerarg value="-Xmaxerrs"/>
@ -53,7 +53,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'containers'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -35,7 +35,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'control'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -35,7 +35,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'enumerated'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -35,7 +35,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'exceptions'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -1,44 +0,0 @@
//: frogbean/Frog.java
// A trivial JavaBean.
package frogbean;
import java.awt.*;
import java.awt.event.*;
class Spots {}
public class Frog {
private int jumps;
private Color color;
private Spots spots;
private boolean jmpr;
public int getJumps() { return jumps; }
public void setJumps(int newJumps) {
jumps = newJumps;
}
public Color getColor() { return color; }
public void setColor(Color newColor) {
color = newColor;
}
public Spots getSpots() { return spots; }
public void setSpots(Spots newSpots) {
spots = newSpots;
}
public boolean isJumper() { return jmpr; }
public void setJumper(boolean j) { jmpr = j; }
public void addActionListener(ActionListener l) {
//...
}
public void removeActionListener(ActionListener l) {
// ...
}
public void addKeyListener(KeyListener l) {
// ...
}
public void removeKeyListener(KeyListener l) {
// ...
}
// An "ordinary" public method:
public void croak() {
System.out.println("Ribbet!");
}
} ///:~

View File

@ -1,59 +0,0 @@
<?xml version="1.0" ?>
<project
basedir="."
default="run"
name="Thinking in Java, 4th Edition (Refreshed) by Bruce Eckel (chapter: frogbean)">
<description>
build.xml for the source code for the frogbean chapter of
Thinking in Java, 4th Edition (Refreshed) by Bruce Eckel
Source code available at http://www.MindView.net
See copyright notice in CopyRight.txt
Ant available from: http://ant.apache.org/
To see options, type: ant -p
</description>
<condition property="version1.8">
<equals arg1="1.8" arg2="${ant.java.version}"/>
</condition>
<target
depends=""
description="Build all classes in this directory"
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'frogbean'"/>
<javac
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
<echo message="Build 'frogbean' succeeded"/>
</target>
<target
depends="build"
description="Compile and run"
name="run">
<touch file="failures"/>
<delete file="failures"/>
</target>
<target description="delete all byproducts" name="clean">
<delete>
<fileset dir="${basedir}" includes="**/*.class"/>
<fileset dir="${basedir}" includes="**/*Output.txt"/>
<fileset dir="${basedir}" includes="**/log.txt"/>
<fileset dir="${basedir}" includes="failures"/>
</delete>
<echo message="clean successful"/>
</target>
</project>

View File

@ -21,7 +21,7 @@
</condition>
<target name="typeinfo_pets">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../typeinfo/pets/">
<compilerarg value="-Xmaxerrs"/>
@ -30,7 +30,7 @@
</target>
<target name="generics_coffee">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../generics/coffee/">
<compilerarg value="-Xmaxerrs"/>
@ -39,7 +39,7 @@
</target>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -53,7 +53,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'generics'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
excludes="Erased.java,HijackedInterface.java,Manipulation.java,MultipleInterfaceVariants.java,NonCovariantGenerics.java,UseList.java"

View File

@ -1,111 +0,0 @@
//: gui/BangBean2.java
// You should write your Beans this way so they
// can run in a multithreaded environment.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import static net.mindview.util.SwingConsole.*;
public class BangBean2 extends JPanel
implements Serializable {
private int xm, ym;
private int cSize = 20; // Circle size
private String text = "Bang!";
private int fontSize = 48;
private Color tColor = Color.RED;
private ArrayList<ActionListener> actionListeners =
new ArrayList<ActionListener>();
public BangBean2() {
addMouseListener(new ML());
addMouseMotionListener(new MM());
}
public synchronized int getCircleSize() { return cSize; }
public synchronized void setCircleSize(int newSize) {
cSize = newSize;
}
public synchronized String getBangText() { return text; }
public synchronized void setBangText(String newText) {
text = newText;
}
public synchronized int getFontSize(){ return fontSize; }
public synchronized void setFontSize(int newSize) {
fontSize = newSize;
}
public synchronized Color getTextColor(){ return tColor;}
public synchronized void setTextColor(Color newColor) {
tColor = newColor;
}
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.BLACK);
g.drawOval(xm - cSize/2, ym - cSize/2, cSize, cSize);
}
// This is a multicast listener, which is more typically
// used than the unicast approach taken in BangBean.java:
public synchronized void
addActionListener(ActionListener l) {
actionListeners.add(l);
}
public synchronized void
removeActionListener(ActionListener l) {
actionListeners.remove(l);
}
// Notice this isn't synchronized:
public void notifyListeners() {
ActionEvent a = new ActionEvent(BangBean2.this,
ActionEvent.ACTION_PERFORMED, null);
ArrayList<ActionListener> lv = null;
// Make a shallow copy of the List in case
// someone adds a listener while we're
// calling listeners:
synchronized(this) {
lv = new ArrayList<ActionListener>(actionListeners);
}
// Call all the listener methods:
for(ActionListener al : lv)
al.actionPerformed(a);
}
class ML extends MouseAdapter {
public void mousePressed(MouseEvent e) {
Graphics g = getGraphics();
g.setColor(tColor);
g.setFont(
new Font("TimesRoman", Font.BOLD, fontSize));
int width = g.getFontMetrics().stringWidth(text);
g.drawString(text, (getSize().width - width) /2,
getSize().height/2);
g.dispose();
notifyListeners();
}
}
class MM extends MouseMotionAdapter {
public void mouseMoved(MouseEvent e) {
xm = e.getX();
ym = e.getY();
repaint();
}
}
public static void main(String[] args) {
BangBean2 bb2 = new BangBean2();
bb2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("ActionEvent" + e);
}
});
bb2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("BangBean2 action");
}
});
bb2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("More action");
}
});
JFrame frame = new JFrame();
frame.add(bb2);
run(frame, 300, 300);
}
} ///:~

View File

@ -1,85 +0,0 @@
//: gui/BeanDumper.java
// Introspecting a Bean.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.beans.*;
import java.lang.reflect.*;
import static net.mindview.util.SwingConsole.*;
public class BeanDumper extends JFrame {
private JTextField query = new JTextField(20);
private JTextArea results = new JTextArea();
public void print(String s) { results.append(s + "\n"); }
public void dump(Class<?> bean) {
results.setText("");
BeanInfo bi = null;
try {
bi = Introspector.getBeanInfo(bean, Object.class);
} catch(IntrospectionException e) {
print("Couldn't introspect " + bean.getName());
return;
}
for(PropertyDescriptor d: bi.getPropertyDescriptors()){
Class<?> p = d.getPropertyType();
if(p == null) continue;
print("Property type:\n " + p.getName() +
"Property name:\n " + d.getName());
Method readMethod = d.getReadMethod();
if(readMethod != null)
print("Read method:\n " + readMethod);
Method writeMethod = d.getWriteMethod();
if(writeMethod != null)
print("Write method:\n " + writeMethod);
print("====================");
}
print("Public methods:");
for(MethodDescriptor m : bi.getMethodDescriptors())
print(m.getMethod().toString());
print("======================");
print("Event support:");
for(EventSetDescriptor e: bi.getEventSetDescriptors()){
print("Listener type:\n " +
e.getListenerType().getName());
for(Method lm : e.getListenerMethods())
print("Listener method:\n " + lm.getName());
for(MethodDescriptor lmd :
e.getListenerMethodDescriptors() )
print("Method descriptor:\n " + lmd.getMethod());
Method addListener= e.getAddListenerMethod();
print("Add Listener Method:\n " + addListener);
Method removeListener = e.getRemoveListenerMethod();
print("Remove Listener Method:\n "+ removeListener);
print("====================");
}
}
class Dumper implements ActionListener {
public void actionPerformed(ActionEvent e) {
String name = query.getText();
Class<?> c = null;
try {
c = Class.forName(name);
} catch(ClassNotFoundException ex) {
results.setText("Couldn't find " + name);
return;
}
dump(c);
}
}
public BeanDumper() {
JPanel p = new JPanel();
p.setLayout(new FlowLayout());
p.add(new JLabel("Qualified bean name:"));
p.add(query);
add(BorderLayout.NORTH, p);
add(new JScrollPane(results));
Dumper dmpr = new Dumper();
query.addActionListener(dmpr);
query.setText("frogbean.Frog");
// Force evaluation
dmpr.actionPerformed(new ActionEvent(dmpr, 0, ""));
}
public static void main(String[] args) {
run(new BeanDumper(), 600, 500);
}
} ///:~

View File

@ -20,12 +20,8 @@
<equals arg1="1.8" arg2="${ant.java.version}"/>
</condition>
<available
classname="javax.jnlp.FileOpenService"
property="javax.jnlp.FileOpenService"/>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -38,11 +34,8 @@
description="Build all classes in this directory"
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<fail
Unless="javax.jnlp.FileOpenService"
message="You must have javaws.jar in your classpath"/>
<echo message="Building 'gui'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">
@ -52,28 +45,6 @@
<echo message="Build 'gui' succeeded"/>
</target>
<target name="BangBean2">
<java
classname="BangBean2"
classpath="${java.class.path};${basedir};${basedir}/.."
dir="../gui/"
failonerror="false"
fork="true"
timeout="4000"/>
<echo message="* Exception was expected *"/>
</target>
<target name="BeanDumper">
<java
classname="BeanDumper"
classpath="${java.class.path};${basedir};${basedir}/.."
dir="../gui/"
failonerror="false"
fork="true"
timeout="4000"/>
<echo message="* Exception was expected *"/>
</target>
<target name="BorderLayout1">
<java
classname="BorderLayout1"
@ -516,24 +487,11 @@
<echo message="* Exception was expected *"/>
</target>
<target name="JnlpFileChooser">
<java
classname="gui.jnlp.JnlpFileChooser"
classpath="${java.class.path};${basedir};${basedir}/.."
dir="../gui/jnlp/"
failonerror="false"
fork="true"
timeout="4000"/>
<echo message="* Exception was expected *"/>
</target>
<target
depends="build"
description="Compile and run"
name="run">
<touch file="failures"/>
<antcall target="BangBean2"/>
<antcall target="BeanDumper"/>
<antcall target="BorderLayout1"/>
<antcall target="Borders"/>
<antcall target="Button1"/>
@ -574,7 +532,6 @@
<antcall target="TextPane"/>
<antcall target="TicTacToe"/>
<antcall target="TrackEvent"/>
<antcall target="JnlpFileChooser"/>
<delete file="failures"/>
</target>

View File

@ -1,35 +0,0 @@
//: gui/flex/Song.java
package gui.flex;
public class Song implements java.io.Serializable {
private String name;
private String artist;
private String album;
private String albumImageUrl;
private String songMediaUrl;
public Song() {}
public Song(String name, String artist, String album,
String albumImageUrl, String songMediaUrl) {
this.name = name;
this.artist = artist;
this.album = album;
this.albumImageUrl = albumImageUrl;
this.songMediaUrl = songMediaUrl;
}
public void setAlbum(String album) { this.album = album;}
public String getAlbum() { return album; }
public void setAlbumImageUrl(String albumImageUrl) {
this.albumImageUrl = albumImageUrl;
}
public String getAlbumImageUrl() { return albumImageUrl;}
public void setArtist(String artist) {
this.artist = artist;
}
public String getArtist() { return artist; }
public void setName(String name) { this.name = name; }
public String getName() { return name; }
public void setSongMediaUrl(String songMediaUrl) {
this.songMediaUrl = songMediaUrl;
}
public String getSongMediaUrl() { return songMediaUrl; }
} ///:~

View File

@ -1,22 +0,0 @@
//: gui/flex/SongService.java
package gui.flex;
import java.util.*;
public class SongService {
private List<Song> songs = new ArrayList<Song>();
public SongService() { fillTestData(); }
public List<Song> getSongs() { return songs; }
public void addSong(Song song) { songs.add(song); }
public void removeSong(Song song) { songs.remove(song); }
private void fillTestData() {
addSong(new Song("Chocolate", "Snow Patrol",
"Final Straw", "sp-final-straw.jpg",
"chocolate.mp3"));
addSong(new Song("Concerto No. 2 in E", "Hilary Hahn",
"Bach: Violin Concertos", "hahn.jpg",
"bachviolin2.mp3"));
addSong(new Song("'Round Midnight", "Wes Montgomery",
"The Artistry of Wes Montgomery",
"wesmontgomery.jpg", "roundmidnight.mp3"));
}
} ///:~

View File

@ -1 +0,0 @@
mxmlc -flexlib C:/"Program Files"/Macromedia/Flex/jrun4/servers/default/flex/WEB-INF/flex songs.mxml

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.macromedia.com/2003/mxml"
backgroundColor="#ffffff">
<mx:Label id="output" text="Hello, Flex!" />
</mx:Application>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.macromedia.com/2003/mxml"
backgroundColor="#ffffff">
<mx:Script>
<![CDATA[
function updateOutput() {
output.text = "Hello! " + input.text;
}
]]>
</mx:Script>
<mx:TextInput id="input" width="200"
change="updateOutput()" />
<mx:Label id="output" text="Hello!" />
</mx:Application>

View File

@ -1,22 +0,0 @@
//: gui/flex/songScript.as
function getSongs() {
songService.getSongs();
}
function selectSong(event) {
var song = songGrid.getItemAt(event.itemIndex);
showSongInfo(song);
}
function showSongInfo(song) {
songInfo.text = song.name + newline;
songInfo.text += song.artist + newline;
songInfo.text += song.album + newline;
albumImage.source = song.albumImageUrl;
songPlayer.contentPath = song.songMediaUrl;
songPlayer.visible = true;
}
function onSongs(songs) {
songGrid.dataProvider = songs;
} ///:~

View File

@ -1,11 +0,0 @@
.headerText {
font-family: Arial, "_sans";
font-size: 16;
font-weight: bold;
}
.boldText {
font-family: Arial, "_sans";
font-size: 11;
font-weight: bold;
}

View File

@ -1,64 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.macromedia.com/2003/mxml"
backgroundColor="#B9CAD2" pageTitle="Flex Song Manager"
initialize="getSongs()">
<mx:Script source="songScript.as" />
<mx:Style source="songStyles.css"/>
<mx:Panel id="songListPanel"
titleStyleDeclaration="headerText"
title="Flex MP3 Library">
<mx:HBox verticalAlign="bottom">
<mx:DataGrid id="songGrid"
cellPress="selectSong(event)" rowCount="8">
<mx:columns>
<mx:Array>
<mx:DataGridColumn columnName="name"
headerText="Song Name" width="120" />
<mx:DataGridColumn columnName="artist"
headerText="Artist" width="180" />
<mx:DataGridColumn columnName="album"
headerText="Album" width="160" />
</mx:Array>
</mx:columns>
</mx:DataGrid>
<mx:VBox>
<mx:HBox height="100" >
<mx:Image id="albumImage" source=""
height="80" width="100"
mouseOverEffect="resizeBig"
mouseOutEffect="resizeSmall" />
<mx:TextArea id="songInfo"
styleName="boldText" height="100%" width="120"
vScrollPolicy="off" borderStyle="none" />
</mx:HBox>
<mx:MediaPlayback id="songPlayer"
contentPath=""
mediaType="MP3"
height="70"
width="230"
controllerPolicy="on"
autoPlay="false"
visible="false" />
</mx:VBox>
</mx:HBox>
<mx:ControlBar horizontalAlign="right">
<mx:Button id="refreshSongsButton"
label="Refresh Songs" width="100"
toolTip="Refresh Song List"
click="songService.getSongs()" />
</mx:ControlBar>
</mx:Panel>
<mx:Effect>
<mx:Resize name="resizeBig" heightTo="100"
duration="500"/>
<mx:Resize name="resizeSmall" heightTo="80"
duration="500"/>
</mx:Effect>
<mx:RemoteObject id="songService"
source="gui.flex.SongService"
result="onSongs(event.result)"
fault="alert(event.fault.faultstring, 'Error')">
<mx:method name="getSongs"/>
</mx:RemoteObject>
</mx:Application>

View File

@ -1,95 +0,0 @@
//: gui/jnlp/JnlpFileChooser.java
// Opening files on a local machine with JNLP.
// {Requires: javax.jnlp.FileOpenService;
// You must have javaws.jar in your classpath}
// To create the jnlpfilechooser.jar file, do this:
// cd ..
// cd ..
// jar cvf gui/jnlp/jnlpfilechooser.jar gui/jnlp/*.class
package gui.jnlp;
import javax.jnlp.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class JnlpFileChooser extends JFrame {
private JTextField fileName = new JTextField();
private JButton
open = new JButton("Open"),
save = new JButton("Save");
private JEditorPane ep = new JEditorPane();
private JScrollPane jsp = new JScrollPane();
private FileContents fileContents;
public JnlpFileChooser() {
JPanel p = new JPanel();
open.addActionListener(new OpenL());
p.add(open);
save.addActionListener(new SaveL());
p.add(save);
jsp.getViewport().add(ep);
add(jsp, BorderLayout.CENTER);
add(p, BorderLayout.SOUTH);
fileName.setEditable(false);
p = new JPanel();
p.setLayout(new GridLayout(2,1));
p.add(fileName);
add(p, BorderLayout.NORTH);
ep.setContentType("text");
save.setEnabled(false);
}
class OpenL implements ActionListener {
public void actionPerformed(ActionEvent e) {
FileOpenService fs = null;
try {
fs = (FileOpenService)ServiceManager.lookup(
"javax.jnlp.FileOpenService");
} catch(UnavailableServiceException use) {
throw new RuntimeException(use);
}
if(fs != null) {
try {
fileContents = fs.openFileDialog(".",
new String[]{"txt", "*"});
if(fileContents == null)
return;
fileName.setText(fileContents.getName());
ep.read(fileContents.getInputStream(), null);
} catch(Exception exc) {
throw new RuntimeException(exc);
}
save.setEnabled(true);
}
}
}
class SaveL implements ActionListener {
public void actionPerformed(ActionEvent e) {
FileSaveService fs = null;
try {
fs = (FileSaveService)ServiceManager.lookup(
"javax.jnlp.FileSaveService");
} catch(UnavailableServiceException use) {
throw new RuntimeException(use);
}
if(fs != null) {
try {
fileContents = fs.saveFileDialog(".",
new String[]{"txt"},
new ByteArrayInputStream(
ep.getText().getBytes()),
fileContents.getName());
if(fileContents == null)
return;
fileName.setText(fileContents.getName());
} catch(Exception exc) {
throw new RuntimeException(exc);
}
}
}
}
public static void main(String[] args) {
JnlpFileChooser fc = new JnlpFileChooser();
fc.setSize(400, 300);
fc.setVisible(true);
}
} ///:~

View File

@ -1,5 +0,0 @@
<html>
Follow the instructions in JnlpFileChooser.java to
build jnlpfilechooser.jar, then:
<a href="filechooser.jnlp">click here</a>
</html>

View File

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec = "1.0+"
codebase="file:C:/AAA-TIJ4/code/gui/jnlp"
href="filechooser.jnlp">
<information>
<title>FileChooser demo application</title>
<vendor>Mindview Inc.</vendor>
<description>
Jnlp File chooser Application
</description>
<description kind="short">
Demonstrates opening, reading and writing a text file
</description>
<icon href="mindview.gif"/>
<offline-allowed/>
</information>
<resources>
<j2se version="1.3+"
href="http://java.sun.com/products/autodl/j2se"/>
<jar href="jnlpfilechooser.jar" download="eager"/>
</resources>
<application-desc
main-class="gui.jnlp.JnlpFileChooser"/>
</jnlp>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -21,7 +21,7 @@
</condition>
<target name="typeinfo_pets">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../typeinfo/pets/">
<compilerarg value="-Xmaxerrs"/>
@ -30,7 +30,7 @@
</target>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -44,7 +44,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'holding'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -35,7 +35,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'initialization'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
excludes="OverloadingVarargs2.java"

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -35,7 +35,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'innerclasses'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -30,7 +30,7 @@
</target>
<target name="polymorphism_music">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../polymorphism/music/">
<compilerarg value="-Xmaxerrs"/>
@ -44,7 +44,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'interfaces'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

21
io/BasicFileOutput.out Normal file
View File

@ -0,0 +1,21 @@
1: //: io/BasicFileOutput.java
2: import java.io.*;
3:
4: public class BasicFileOutput {
5: static String file = "BasicFileOutput.out";
6: public static void main(String[] args)
7: throws IOException {
8: BufferedReader in = new BufferedReader(
9: new StringReader(
10: BufferedInputFile.read("BasicFileOutput.java")));
11: PrintWriter out = new PrintWriter(
12: new BufferedWriter(new FileWriter(file)));
13: int lineCount = 1;
14: String s;
15: while((s = in.readLine()) != null )
16: out.println(lineCount++ + ": " + s);
17: out.close();
18: // Show the stored file:
19: System.out.println(BufferedInputFile.read(file));
20: }
21: } /* (Execute to see output) *///:~

BIN
io/Blip3.out Normal file

Binary file not shown.

BIN
io/Blips.out Normal file

Binary file not shown.

BIN
io/CADState.out Normal file

Binary file not shown.

21
io/FileOutputShortcut.out Normal file
View File

@ -0,0 +1,21 @@
1: //: io/FileOutputShortcut.java
2: import java.io.*;
3:
4: public class FileOutputShortcut {
5: static String file = "FileOutputShortcut.out";
6: public static void main(String[] args)
7: throws IOException {
8: BufferedReader in = new BufferedReader(
9: new StringReader(
10: BufferedInputFile.read("FileOutputShortcut.java")));
11: // Here's the shortcut:
12: PrintWriter out = new PrintWriter(file);
13: int lineCount = 1;
14: String s;
15: while((s = in.readLine()) != null )
16: out.println(lineCount++ + ": " + s);
17: out.close();
18: // Show the stored file:
19: System.out.println(BufferedInputFile.read(file));
20: }
21: } /* (Execute to see output) *///:~

BIN
io/Logon.out Normal file

Binary file not shown.

20
io/TransferTo.txt Normal file
View File

@ -0,0 +1,20 @@
//: io/TransferTo.java
// Using transferTo() between channels
// {Args: TransferTo.java TransferTo.txt}
import java.nio.channels.*;
import java.io.*;
public class TransferTo {
public static void main(String[] args) throws Exception {
if(args.length != 2) {
System.out.println("arguments: sourcefile destfile");
System.exit(1);
}
FileChannel
in = new FileInputStream(args[0]).getChannel(),
out = new FileOutputStream(args[1]).getChannel();
in.transferTo(0, in.size(), out);
// Or:
// out.transferFrom(in, 0, in.size());
}
} ///:~

BIN
io/X.file Normal file

Binary file not shown.

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -35,7 +35,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'io'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

BIN
io/data.txt Normal file

Binary file not shown.

BIN
io/data2.txt Normal file

Binary file not shown.

0
io/file.txt Normal file
View File

BIN
io/rtest.dat Normal file

Binary file not shown.

BIN
io/temp.tmp Normal file

Binary file not shown.

BIN
io/test.gz Normal file

Binary file not shown.

25
io/test.out Normal file
View File

@ -0,0 +1,25 @@
//: io/Redirecting.java
// Demonstrates standard I/O redirection.
import java.io.*;
public class Redirecting {
public static void main(String[] args)
throws IOException {
PrintStream console = System.out;
BufferedInputStream in = new BufferedInputStream(
new FileInputStream("Redirecting.java"));
PrintStream out = new PrintStream(
new BufferedOutputStream(
new FileOutputStream("test.out")));
System.setIn(in);
System.setOut(out);
System.setErr(out);
BufferedReader br = new BufferedReader(
new InputStreamReader(System.in));
String s;
while((s = br.readLine()) != null)
System.out.println(s);
out.close(); // Remember this!
System.setOut(console);
}
} ///:~

25
io/test.txt Normal file
View File

@ -0,0 +1,25 @@
//: io/ChannelCopy.java
// Copying a file using channels and buffers
// {Args: ChannelCopy.java test.txt}
import java.nio.*;
import java.nio.channels.*;
import java.io.*;
public class ChannelCopy {
private static final int BSIZE = 1024;
public static void main(String[] args) throws Exception {
if(args.length != 2) {
System.out.println("arguments: sourcefile destfile");
System.exit(1);
}
FileChannel
in = new FileInputStream(args[0]).getChannel(),
out = new FileOutputStream(args[1]).getChannel();
ByteBuffer buffer = ByteBuffer.allocate(BSIZE);
while(in.read(buffer) != -1) {
buffer.flip(); // Prepare for writing
out.write(buffer);
buffer.clear(); // Prepare for reading
}
}
} ///:~

BIN
io/test.zip Normal file

Binary file not shown.

BIN
io/worm.out Normal file

Binary file not shown.

View File

@ -25,7 +25,7 @@
property="javassist.bytecode.ClassFile"/>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -40,9 +40,9 @@
<fail message="J2SE8 required" unless="version1.8"/>
<fail
Unless="javassist.bytecode.ClassFile"
message="You must install the Javassist library from http://sourceforge.net/projects/jboss/"/>
message="You must install the Javassist library from www.javassist.org"/>
<echo message="Building 'net'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -4,7 +4,7 @@
// {Args: ..}
// {Requires: javassist.bytecode.ClassFile;
// You must install the Javassist library from
// http://sourceforge.net/projects/jboss/ }
// www.javassist.org }
package net.mindview.atunit;
import javassist.*;
import javassist.expr.*;

View File

@ -0,0 +1,82 @@
//: net/mindview/util/TextFile.java
// Static functions for reading and writing text files as
// a single string, and treating a file as an ArrayList.
package net.mindview.util;
import java.io.*;
import java.util.*;
public class TextFile extends ArrayList<String> {
// Read a file as a single string:
public static String read(String fileName) {
StringBuilder sb = new StringBuilder();
try {
BufferedReader in= new BufferedReader(new FileReader(
new File(fileName).getAbsoluteFile()));
try {
String s;
while((s = in.readLine()) != null) {
sb.append(s);
sb.append("\n");
}
} finally {
in.close();
}
} catch(IOException e) {
throw new RuntimeException(e);
}
return sb.toString();
}
// Write a single file in one method call:
public static void write(String fileName, String text) {
try {
PrintWriter out = new PrintWriter(
new File(fileName).getAbsoluteFile());
try {
out.print(text);
} finally {
out.close();
}
} catch(IOException e) {
throw new RuntimeException(e);
}
}
// Read a file, split by any regular expression:
public TextFile(String fileName, String splitter) {
super(Arrays.asList(read(fileName).split(splitter)));
// Regular expression split() often leaves an empty
// String at the first position:
if(get(0).equals("")) remove(0);
}
// Normally read by lines:
public TextFile(String fileName) {
this(fileName, "\n");
}
public void write(String fileName) {
try {
PrintWriter out = new PrintWriter(
new File(fileName).getAbsoluteFile());
try {
for(String item : this)
out.println(item);
} finally {
out.close();
}
} catch(IOException e) {
throw new RuntimeException(e);
}
}
// Simple test:
public static void main(String[] args) {
String file = read("TextFile.java");
write("test.txt", file);
TextFile text = new TextFile("test.txt");
text.write("test2.txt");
// Break into unique sorted list of words:
TreeSet<String> words = new TreeSet<String>(
new TextFile("TextFile.java", "\\W+"));
// Display the capitalized words:
System.out.println(words.headSet("a"));
}
} /* Output:
[0, ArrayList, Arrays, Break, BufferedReader, BufferedWriter, Clean, Display, File, FileReader, FileWriter, IOException, Normally, Output, PrintWriter, Read, Regular, RuntimeException, Simple, Static, String, StringBuilder, System, TextFile, Tools, TreeSet, W, Write]
*///:~

View File

@ -0,0 +1,82 @@
//: net/mindview/util/TextFile.java
// Static functions for reading and writing text files as
// a single string, and treating a file as an ArrayList.
package net.mindview.util;
import java.io.*;
import java.util.*;
public class TextFile extends ArrayList<String> {
// Read a file as a single string:
public static String read(String fileName) {
StringBuilder sb = new StringBuilder();
try {
BufferedReader in= new BufferedReader(new FileReader(
new File(fileName).getAbsoluteFile()));
try {
String s;
while((s = in.readLine()) != null) {
sb.append(s);
sb.append("\n");
}
} finally {
in.close();
}
} catch(IOException e) {
throw new RuntimeException(e);
}
return sb.toString();
}
// Write a single file in one method call:
public static void write(String fileName, String text) {
try {
PrintWriter out = new PrintWriter(
new File(fileName).getAbsoluteFile());
try {
out.print(text);
} finally {
out.close();
}
} catch(IOException e) {
throw new RuntimeException(e);
}
}
// Read a file, split by any regular expression:
public TextFile(String fileName, String splitter) {
super(Arrays.asList(read(fileName).split(splitter)));
// Regular expression split() often leaves an empty
// String at the first position:
if(get(0).equals("")) remove(0);
}
// Normally read by lines:
public TextFile(String fileName) {
this(fileName, "\n");
}
public void write(String fileName) {
try {
PrintWriter out = new PrintWriter(
new File(fileName).getAbsoluteFile());
try {
for(String item : this)
out.println(item);
} finally {
out.close();
}
} catch(IOException e) {
throw new RuntimeException(e);
}
}
// Simple test:
public static void main(String[] args) {
String file = read("TextFile.java");
write("test.txt", file);
TextFile text = new TextFile("test.txt");
text.write("test2.txt");
// Break into unique sorted list of words:
TreeSet<String> words = new TreeSet<String>(
new TextFile("TextFile.java", "\\W+"));
// Display the capitalized words:
System.out.println(words.headSet("a"));
}
} /* Output:
[0, ArrayList, Arrays, Break, BufferedReader, BufferedWriter, Clean, Display, File, FileReader, FileWriter, IOException, Normally, Output, PrintWriter, Read, Regular, RuntimeException, Simple, Static, String, StringBuilder, System, TextFile, Tools, TreeSet, W, Write]
*///:~

View File

@ -26,7 +26,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'object'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -1,15 +1,15 @@
//: annotations/InterfaceExtractorProcessorFactory.java
// APT-based annotation processing.
package annotations;
import com.sun.mirror.apt.*;
import com.sun.mirror.declaration.*;
/*import com.sun.mirror.apt.*;
import com.sun.mirror.declaration.*;*/
import java.util.*;
public class InterfaceExtractorProcessorFactory
implements AnnotationProcessorFactory {
public AnnotationProcessor getProcessorFor(
Set<AnnotationTypeDeclaration> atds,
AnnotationProcessorEnvironment env) {
implements javax.annotation.processing.Processor {
public javax.annotation.processing.Processor getProcessorFor(
Set<javax.lang.model.element.TypeElement> atds,
javax.annotation.processing.ProcessingEnvironment env) {
return new InterfaceExtractorProcessor(env);
}
public Collection<String> supportedAnnotationTypes() {

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -35,7 +35,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'operators'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -30,7 +30,7 @@
</target>
<target name="polymorphism_music">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../polymorphism/music/">
<compilerarg value="-Xmaxerrs"/>
@ -44,7 +44,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'polymorphism'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -21,7 +21,7 @@
</condition>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -35,7 +35,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'reusing'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
excludes="Lisa.java"

View File

@ -21,7 +21,7 @@
</condition>
<target name="generics_coffee">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../generics/coffee/">
<compilerarg value="-Xmaxerrs"/>
@ -30,7 +30,7 @@
</target>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -44,7 +44,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'strings'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -25,7 +25,7 @@
property="org.eclipse.swt.widgets.Display"/>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -42,7 +42,7 @@
Unless="org.eclipse.swt.widgets.Display"
message="You must install the SWT library from http://www.eclipse.org"/>
<echo message="Building 'swt'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

View File

@ -21,7 +21,7 @@
</condition>
<target name="typeinfo_pets">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../typeinfo/pets/">
<compilerarg value="-Xmaxerrs"/>
@ -30,7 +30,7 @@
</target>
<target name="net_mindview_util">
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
srcdir="${basedir}/../net/mindview/util/">
<compilerarg value="-Xmaxerrs"/>
@ -44,7 +44,7 @@
name="build">
<fail message="J2SE8 required" unless="version1.8"/>
<echo message="Building 'typeinfo'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">

15
xml/People.xml Normal file
View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<people>
<person>
<first>Dr. Bunsen</first>
<last>Honeydew</last>
</person>
<person>
<first>Gonzo</first>
<last>The Great</last>
</person>
<person>
<first>Phillip J.</first>
<last>Fry</last>
</person>
</people>

View File

@ -31,7 +31,7 @@
Unless="nu.xom.Node"
message="You must install the XOM library from http://www.xom.nu"/>
<echo message="Building 'xml'"/>
<javac
<javac includeantruntime="false"
classpath="${basedir}/.."
debug="true"
srcdir="${basedir}">