[Polycasso-commit] SF.net SVN: polycasso:[112] trunk/polycasso/src/com/mebigfatguy/polycasso/ Integ
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2009-11-29 02:59:10
|
Revision: 112
http://polycasso.svn.sourceforge.net/polycasso/?rev=112&view=rev
Author: dbrosius
Date: 2009-11-29 02:59:04 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java 2009-11-29 02:57:16 UTC (rev 111)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/IntegerDocument.java 2009-11-29 02:59:04 UTC (rev 112)
@@ -24,10 +24,22 @@
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;
+/**
+ * a Document model class for text components to only allow
+ * integer values
+ */
public class IntegerDocument extends PlainDocument {
private static final long serialVersionUID = -6755728406523769124L;
+ /**
+ * intercepts string insertions to make sure that the values to be put into
+ * a text component is only an integer value
+ *
+ * @param pos where the text is being inserted
+ * @param insertStr the new text that was typed
+ * @param atts the attributes for the text (unused)
+ */
@Override
public void insertString(int pos, String insertStr, AttributeSet atts) throws BadLocationException {
StringBuilder text = new StringBuilder(getText(0, getLength()));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|