KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwtx > swing > text > View


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
4
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7
8    Contact me by electronic mail: bobintetley@users.sourceforge.net
9
10    $Log: View.java,v $
11    Revision 1.1 2004/05/04 09:31:43 bobintetley
12    PlainDocument/View support and implementation. Build script supports java/javax
13    packages - fix to build script to use nested args in bootclasspath (single path broke on my Ant 1.6.1/Linux)
14
15
16 */

17
18 package swingwtx.swing.text;
19
20 import swingwtx.swing.SwingConstants;
21
22 /**
23  * View superclass that maps Document models between viewable
24  * components. Basically assumes your component is a descendant
25  * of JTextComponent (why it's vitally important for subclasses
26  * to override functionality, even if they aren't that similar).
27  *
28  * @author Robin Rawson-Tetley
29  */

30 public abstract class View implements SwingConstants {
31     
32     protected Document doc;
33     
34     public View(Document doc) { this.doc = doc; }
35
36     public boolean isVisible() { return true; }
37     public float getAlignment(int axis) { return (float) 0.5; }
38     public int getViewCount() { return 0; }
39     public View getView(int n) { return null; }
40
41 }
42
Popular Tags