Class com.symantec.itools.swing.MaskEngine
All Packages Class Hierarchy This Package Previous Next Index
Class com.symantec.itools.swing.MaskEngine
Object
|
+----com.symantec.itools.swing.MaskEngine
- public class MaskEngine
- extends Object
-
datetype
-
-
numbtype
-
-
texttype
-
-
timetype
-
-
com.symantec.itools.swing.MaskEngine(String, int)
-
-
com.symantec.itools.swing.MaskEngine()
-
-
cut(String, int, int, StringBuffer)
-
-
getDatatype()
-
-
getMask()
-
-
getMatchedText(String)
-
-
initDisplay(String, StringBuffer)
-
-
isHandledKey(KeyEvent)
-
-
lastFilterPosition()
- Returns the position of the last character in the mask which is
a filter.
-
paste(String, String, int, StringBuffer, int, int)
-
-
processKey(KeyEvent, int, String, StringBuffer, int, int)
- Called for every key stroke corresponding to displayable characters
once editing begins.
-
setDatatype(int)
-
-
setMask(String)
-
-
stripMask(String, StringBuffer)
- Strips the mask from a data string and checks if the data is
complete according to the mask.
datetype
public static final int datetype
numbtype
public static final int numbtype
texttype
public static final int texttype
timetype
public static final int timetype
MaskEngine
public MaskEngine(String mask,
int datatype)
MaskEngine
public MaskEngine()
cut
public java.lang.String cut(String data,
int selStart,
int selEnd,
StringBuffer newData)
getDatatype
public int getDatatype()
getMask
public java.lang.String getMask()
getMatchedText
public java.lang.String getMatchedText(String t)
initDisplay
public int initDisplay(String data,
StringBuffer newData)
isHandledKey
public boolean isHandledKey(KeyEvent e)
lastFilterPosition
public int lastFilterPosition()
- Returns the position of the last character in the mask which is
a filter. The cursor should not move past this character.
- Returns:
- Last character index
paste
public int paste(String data,
String pasteData,
int pos,
StringBuffer newData,
int selStart,
int selEnd)
processKey
public int processKey(KeyEvent e,
int pos,
String data,
StringBuffer newData,
int selStart,
int selEnd)
- Called for every key stroke corresponding to displayable characters
once editing begins. This is the main workhorse method.
- Parameters:
- e - User keystroke event object
- pos - Current cursor position (zero based)
- data - Current text from the component
- newData - What should be displayed in the component
(modified by this method)
- selStart - Selection start
- selEnd - Selection end
- Returns:
-
- If >= 0: new cursor position within
newData
- If == -1: the input is inconsistent (position not in
range or not on a filter)
- If == -2: the input keystroke is not accepted by the
relevant filter
- If <= -3: cursor out of range, carret should be
set at position (x + 3)*(-1)
setDatatype
public void setDatatype(int datatype)
setMask
public void setMask(String mask)
stripMask
public boolean stripMask(String data,
StringBuffer newData)
- Strips the mask from a data string and checks if the data is
complete according to the mask.
- Parameters:
- data - The analyzed string
- newData - Content of data without the mask characters,
this is an out parameter
- Returns:
- Returns true if the data is complete according to
the mask, false otherwise (data not complete or does
not match the mask)
All Packages Class Hierarchy This Package Previous Next Index