Lecture Topics:
|
Report # |
version |
02/20/97 |
1 |
Beta 1 |
03/07/97 |
2 |
Beta 2 |
03/21/97 |
3 |
Beta 3 |
04/10/97 |
4 |
Beta 4 |
04/21/97 |
5 |
final version 1.0 |
05/08/97 |
6 |
code with report |
A Progress report should contain
- a disk in an envelope
- printouts & envelope stapled.
import java.io.*; import java.util.*; public class FileFilter implements FilenameFilter { public boolean accept(File dir, String name) { return new File(dir, name).isFile(); } }
import java.io.*; import java.util.*; public class DirFilter implements FilenameFilter { public boolean accept(File dir, String name) { return new File(dir, name).isDirectory(); } }
To Filter .java files ( The Java Filter )
import java.io.*; import java.util.*; class JavaFilter implements FilenameFilter { public boolean accept(File dir, String name) { String match = ".java"; int ml = match.length(); int nl = name.length(); if (nl > ml) { String post_fix = name.substring(nl - ml, nl); return post_fix.equals(match); } return false; } }
Images in Java
Computer Vision
Rendering in Java :
AWT Architecture
public void paint( Graphics g );
Who calls repaint( )?
Component calls back : update( )
public void update( Graphics g );
- called in response to repaint( )
- background will not be cleared
- cliparea will be set to the repaint area
- default implemenetation clears the background and calls paint( )
callback paint( )
public void paint( Graphics g );
- component first becomes visible
- damage occurs
paint( ) and update( ) methods are called from the AWT callback thread.
public abstract class Graphics{// you cannot make a graphics instance as a result Graphics g = myPanel.getGraphics( ); g.dispose( );