[Patchanim-commit] SF.net SVN: patchanim: [31] trunk/patchanim/src/com/mebigfatguy/patchanim/ gui/I
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-01-27 01:45:10
|
Revision: 31
http://patchanim.svn.sourceforge.net/patchanim/?rev=31&view=rev
Author: dbrosius
Date: 2008-01-26 17:45:15 -0800 (Sat, 26 Jan 2008)
Log Message:
-----------
Removed file/folder
Removed Paths:
-------------
trunk/patchanim/src/com/mebigfatguy/patchanim/gui/IntegerDocument.java
Deleted: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/IntegerDocument.java
===================================================================
--- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/IntegerDocument.java 2008-01-27 01:44:22 UTC (rev 30)
+++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/IntegerDocument.java 2008-01-27 01:45:15 UTC (rev 31)
@@ -1,46 +0,0 @@
-/*
- * patchanim - A bezier surface patch color blend gif builder
- * Copyright (C) 2008 Dave Brosius
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package com.mebigfatguy.patchanim.gui;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.swing.text.AttributeSet;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.PlainDocument;
-
-
-public class IntegerDocument extends PlainDocument
-{
- private static final long serialVersionUID = -1526356835854424028L;
-
- private static final Pattern INTEGERPATTERN = Pattern.compile("-?(:?-?[0-9]*)?");
-
- @Override
- public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
- String start = getText(0, offs);
- String end = getText(offs, this.getLength() - offs);
- String newIntegerString = (start + str + end).trim();
-
- Matcher m = INTEGERPATTERN.matcher(newIntegerString);
- if (m.matches()) {
- super.insertString(offs, str, a);
- }
- }
-}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|