KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > event > SDocumentEvent


1 /* $Id: SDocumentEvent.java,v 1.3 2004/12/01 07:54:07 hengels Exp $ */
2 /*
3  * $Id: SDocumentEvent.java,v 1.3 2004/12/01 07:54:07 hengels Exp $
4  * Copyright 2000,2005 wingS development team.
5  *
6  * This file is part of wingS (http://www.j-wings.org).
7  *
8  * wingS is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1
11  * of the License, or (at your option) any later version.
12  *
13  * Please see COPYING for the complete licence.
14  */

15 package org.wings.event;
16
17 import org.wings.text.SDocument;
18
19 import java.awt.*;
20
21 /**
22  * @author hengels
23  * @version $Revision: 1.3 $
24  */

25 public class SDocumentEvent extends AWTEvent {
26     public final static int CHANGE = 1;
27     public final static int INSERT = 2;
28     public final static int REMOVE = 3;
29
30     private int offset;
31     private int length;
32
33     public SDocumentEvent(SDocument document, int offset, int length, int type) {
34         super(document, type);
35         this.offset = offset;
36         this.length = length;
37     }
38
39     public SDocument getDocument() {
40         return (SDocument) getSource();
41     }
42
43     public int getOffset() {
44         return offset;
45     }
46
47     public int getLength() {
48         return length;
49     }
50
51     public int getType() {
52         return getID();
53     }
54 }
55
Popular Tags