1 package com.calipso.reportgenerator.userinterface; 2 3 import com.calipso.reportgenerator.reportcalculator.SharedFloat; 4 5 import javax.swing.text.Document ; 6 7 12 13 public class UPFloatTextField extends UPTextField { 14 15 public UPFloatTextField() { 16 } 17 18 public UPFloatTextField(String text) { 19 super(text); 20 } 21 22 public UPFloatTextField(int columns) { 23 super(columns); 24 } 25 26 public UPFloatTextField(String text, int columns) { 27 super(text, columns); 28 } 29 30 public UPFloatTextField(Document doc, String text, int columns) { 31 super(doc, text, columns); 32 } 33 34 public boolean isLessThan(UPTextField upTextField) { 35 SharedFloat sharedFloat = (SharedFloat) getComponentValue(); 36 int result = sharedFloat.compareTo(upTextField.getComponentValue()); 37 if(result > 0) { 38 return false; 39 } else { 40 return true; 41 } 42 } 43 44 public Object getComponentValue() { 45 String text = super.getText(); 46 return SharedFloat.newFrom(Float.valueOf(text)); 47 } 48 } 49 | Popular Tags |