[Patchanim-commit] SF.net SVN: patchanim: [19] trunk/patchanim/src/com/mebigfatguy/patchanim/ gui
Brought to you by:
dbrosius
From: <dbr...@us...> - 2008-01-26 06:42:04
|
Revision: 19 http://patchanim.svn.sourceforge.net/patchanim/?rev=19&view=rev Author: dbrosius Date: 2008-01-25 22:42:09 -0800 (Fri, 25 Jan 2008) Log Message: ----------- allow for typing - signs Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/IntegerDocument.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/IntegerDocument.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/IntegerDocument.java 2008-01-26 06:34:57 UTC (rev 18) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/IntegerDocument.java 2008-01-26 06:42:09 UTC (rev 19) @@ -30,7 +30,7 @@ { private static final long serialVersionUID = -1526356835854424028L; - private static final Pattern INTEGERPATTERN = Pattern.compile("-?(:?[0-9]*)?"); + private static final Pattern INTEGERPATTERN = Pattern.compile("-?(:?-?[0-9]*)?"); @Override public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java 2008-01-26 06:34:57 UTC (rev 18) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java 2008-01-26 06:42:09 UTC (rev 19) @@ -164,9 +164,9 @@ private void processChange() { int value; - String color = colorField.getText(); - if (color.length() == 0) - value = 0; + String color = colorField.getText().trim(); + if ((color.length() == 0) || ("-".equals(color))) + return; else value = Integer.parseInt(colorField.getText()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |