diff src/org/tn5250j/framework/tn5250/Screen5250.java @ 25:5949eb469a79 tn5250

adding tn5250 files, native android logging
author Carl Byington <carl@five-ten-sg.com>
date Tue, 03 Jun 2014 12:10:21 -0700
parents e773d0952613
children 9ae1c889a64c
line wrap: on
line diff
--- a/src/org/tn5250j/framework/tn5250/Screen5250.java	Tue Jun 03 11:44:37 2014 -0700
+++ b/src/org/tn5250j/framework/tn5250/Screen5250.java	Tue Jun 03 12:10:21 2014 -0700
@@ -35,8 +35,8 @@
 
 import org.tn5250j.TN5250jConstants;
 import org.tn5250j.event.ScreenListener;
-import org.tn5250j.tools.logging.TN5250jLogFactory;
-import org.tn5250j.tools.logging.TN5250jLogger;
+import android.util.Log;
+
 
 public class Screen5250 {
 
@@ -98,7 +98,7 @@
 	//Added by Barry
 	private StringBuffer keybuf;
 
-	private TN5250jLogger log = TN5250jLogFactory.getLogger(this.getClass());
+
 
 	public Screen5250() {
 
@@ -108,7 +108,7 @@
 		try {
 			jbInit();
 		} catch (Exception ex) {
-			log.warn("In constructor: ", ex);
+			Log.w(TAG,"In constructor: ", ex);
 		}
 	}
 
@@ -197,7 +197,7 @@
 		StringBuilder sb = new StringBuilder();
 		Rect workR = new Rect();
 		workR.setBounds(area);
-		log.debug("Copying " + workR);
+		Log.d(TAG,"Copying " + workR);
 
 		// loop through all the screen characters to send them to the clip board
 		int m = workR.x;
@@ -231,9 +231,7 @@
 	 * @see {@link #copyText(Rectangle)}
 	 */
 	public final void pasteText(String content, boolean special) {
-		if (log.isDebugEnabled()) {
-			log.debug("Pasting, special:"+special);
-		}
+		Log.d(TAG,"Pasting, special:"+special);
 		setCursorActive(false);
 
 		StringBuilder sb = new StringBuilder(content);
@@ -262,7 +260,7 @@
 
 			if ((c == '\n') || (c == '\r')) {
 
-				log.info("pasted cr-lf>" + pd + "<");
+				Log.i(TAG,"pasted cr-lf>" + pd + "<");
 				pd.setLength(0);
 				// if we read in a cr lf in the data stream we need to go
 				// to the starting column of the next row and start from there
@@ -300,7 +298,7 @@
 
 		// if we have anything else not logged then log it out.
 		if (pd.length() > 0)
-			log.info("pasted >" + pd + "<");
+			Log.i(TAG,"pasted >" + pd + "<");
 
 		// restore out position within the FFT.
 		screenFields.restoreCurrentField();
@@ -350,7 +348,7 @@
 		//      gui.rubberband.reset();
 		//      gui.repaint();
 
-		log.debug("Summing");
+		Log.d(TAG,"Summing");
 
 		// obtain the decimal format for parsing
 		DecimalFormat df = (DecimalFormat) NumberFormat.getInstance();
@@ -406,14 +404,14 @@
 					sumVector.add(new Double(n.doubleValue()));
 					sum += n.doubleValue();
 				} catch (ParseException pe) {
-					log.warn(pe.getMessage() + " at "
+					Log.w(TAG,pe.getMessage() + " at "
 							+ pe.getErrorOffset());
 				}
 			}
 			sb.setLength(0);
 			m++;
 		}
-		log.debug("" + sum);
+		Log.d(TAG,"" + sum);
 		return sumVector;
 	}
 
@@ -456,12 +454,12 @@
 					if (planes.getChar(pos + 1) != '='
 						&& planes.getChar(pos + 1) != '.'
 							&& planes.getChar(pos + 1) != '/') {
-						log.debug(" Hotspot clicked!!! we will send characters "
+						Log.d(TAG," Hotspot clicked!!! we will send characters "
 								+ planes.getChar(pos) + " " + planes.getChar(pos+1));
 						aid.append(planes.getChar(pos));
 						aid.append(planes.getChar(pos + 1));
 					} else {
-						log.debug(" Hotspot clicked!!! we will send character "
+						Log.d(TAG," Hotspot clicked!!! we will send character "
 								+ planes.getChar(pos));
 						aid.append(planes.getChar(pos));
 					}
@@ -501,7 +499,7 @@
                         sessionVT.showURL(eb.toString());
 						// take out the log statement when we are sure it is
 						// working
-						log.info("Send to external Browser: " + eb.toString());
+						Log.i(TAG,"Send to external Browser: " + eb.toString());
 						break;
 
 					default:
@@ -1695,7 +1693,7 @@
 			simulated = true;
 			break;
 		default:
-			log.info(" Mnemonic not supported " + mnem);
+			Log.i(TAG," Mnemonic not supported " + mnem);
 			break;
 
 		}
@@ -3186,7 +3184,7 @@
 			}
 			break;
 		default:
-			log.warn(" Invalid roll parameter - please report this");
+			Log.w(TAG," Invalid roll parameter - please report this");
 		}
 		//      System.out.println(" end roll");
 		//      dumpScreen();
@@ -3207,7 +3205,7 @@
 				col = 0;
 			}
 		}
-		log.info(sb.toString());
+		Log.i(TAG,sb.toString());
 
 	}
 
@@ -3874,7 +3872,7 @@
 	 */
 	private synchronized void fireScreenChanged(int update) {
 		if (dirtyScreen.x > dirtyScreen.y) {
-			//         log.info(" x < y " + dirtyScreen);
+			//         Log.i(TAG," x < y " + dirtyScreen);
 			return;
 		}