org.zaval.data.event
Class TextEvent
java.lang.Object
|
+--java.util.EventObject
|
+--org.zaval.data.event.TextEvent
- All Implemented Interfaces:
- java.io.Serializable
- public class TextEvent
- extends java.util.EventObject
This class describes event that is performed by TextModel interface implementation.
Using the event class the text implementation notifies listeners about the text content changes.
- See Also:
- Serialized Form
|
Field Summary |
static int |
INSERTED
The text inserted event type. |
static int |
REMOVED
The text removed event type. |
static int |
UPDATED
The text updated event type. |
| Fields inherited from class java.util.EventObject |
source |
|
Constructor Summary |
TextEvent(java.lang.Object target,
int id,
int offset,
int size,
int pl)
Constructs a new text event class with the given source, event id, text offset,
text size and line number that the text has had before its changing. |
|
Method Summary |
int |
getFirstUpdatedLine()
Gets the start updated line number from that the text has been modified. |
int |
getID()
Gets the text event id |
int |
getOffset()
Returns the offset that defines where the removing or inserting operation has been
performed. |
int |
getPrevLines()
Returns the previous line numbers. |
int |
getSize()
Returns the size that defines size of removed or inserted text part. |
int |
getUpdatedLines()
Gets the number of updated lines that has been modified for the text. |
void |
setUpdatedLines(int first,
int lines)
Sets the set of lines that has been updated. |
| Methods inherited from class java.util.EventObject |
getSource, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
INSERTED
public static final int INSERTED
- The text inserted event type.
REMOVED
public static final int REMOVED
- The text removed event type.
UPDATED
public static final int UPDATED
- The text updated event type.
TextEvent
public TextEvent(java.lang.Object target,
int id,
int offset,
int size,
int pl)
- Constructs a new text event class with the given source, event id, text offset,
text size and line number that the text has had before its changing. The offset
defines where removing or inserting operation has been performed
and size defines size of removed or inserted part.
- Parameters:
target - the source of the event.id - the type of the event.offset - the text offset.size - the text size.pl - the number of lines that the text has had before changing. The
argument can help to understand how much lines has been added or removed from the text.
setUpdatedLines
public void setUpdatedLines(int first,
int lines)
- Sets the set of lines that has been updated.
- Parameters:
first - the specified start updated line number.lines - the specified number of updated lines.
getFirstUpdatedLine
public int getFirstUpdatedLine()
- Gets the start updated line number from that the text has been modified.
- Returns:
- a line number.
getUpdatedLines
public int getUpdatedLines()
- Gets the number of updated lines that has been modified for the text.
- Returns:
- a number of lines.
getOffset
public int getOffset()
- Returns the offset that defines where the removing or inserting operation has been
performed.
- Returns:
- a text offset.
getSize
public int getSize()
- Returns the size that defines size of removed or inserted text part.
- Returns:
- a text size.
getPrevLines
public int getPrevLines()
- Returns the previous line numbers. The information can help to define how many lines have been
inserted or removed depending on the event type.
- Returns:
- a previous line numbers.
getID
public int getID()
- Gets the text event id
- Returns:
- a text event id.
|