"Fossies" - the Fresh Open Source Software Archive

Member "tesseract-ocr/doc/html/classcom_1_1google_1_1scrollview_1_1_scroll_view.html" (26 Oct 2012, 24803 Bytes) of package /linux/misc/old/tesseract-ocr-3.02.02-doc-html.tar.gz:

Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the tesseract-ocr-3.02.02-doc-html.tar.gz project site itself.

Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.google.scrollview.ScrollView Class Reference

List of all members.

Static Public Member Functions

static void addMessage (SVEvent e)
static String receiveMessage () throws IOException
static void exit ()
static void main (String[] args)

Static Public Attributes

static int SERVER_PORT = 8461
static BufferedReader in
static float polylineXCoords []
static float polylineYCoords []
static int polylineSize
static int polylineScanned

Detailed Description

The ScrollView class is the main class which gets started from the command line. It sets up LUA and handles the network processing.


Definition at line 32 of file ScrollView.java.

Member Function Documentation

static void com.google.scrollview.ScrollView.addMessage ( SVEvent  e)

Add a new message to the outgoing queue

Definition at line 60 of file ScrollView.java.

if (debugViewNetworkTraffic) {
System.out.println("(S->c) " + e.toString());
String str = e.toString();
// Send the whole thing as UTF8.
try {
byte [] utf8 = str.getBytes("UTF8");
out.write(utf8, 0, utf8.length);
} catch (java.io.UnsupportedEncodingException ex) {
System.out.println("Oops... can't encode to UTF8... Exiting");
// Flush the output and check for errors.
boolean error = out.checkError();
if (error) {
System.out.println("Connection error. Quitting ScrollView Server...");
static void com.google.scrollview.ScrollView.exit ( )

Called from the client to make the server exit.

Definition at line 379 of file ScrollView.java.

static void com.google.scrollview.ScrollView.main ( String[]  args)

The main function. Sets up LUA and the server connection and then calls the IOLoop.

Definition at line 387 of file ScrollView.java.

if (args.length > 0) {
SERVER_PORT = Integer.parseInt(args[0]);
windows = new ArrayList<SVWindow>(100);
intPattern = Pattern.compile("[0-9-][0-9]*");
floatPattern = Pattern.compile("[0-9-][0-9]*\\.[0-9]*");
try {
// Open a socket to listen on.
ServerSocket serverSocket = new ServerSocket(SERVER_PORT);
System.out.println("Socket started on port " + SERVER_PORT);
// Wait (blocking) for an incoming connection
socket = serverSocket.accept();
System.out.println("Client connected");
// Setup the streams
out = new PrintStream(socket.getOutputStream(), true);
in =
new BufferedReader(new InputStreamReader(socket.getInputStream(),
} catch (IOException e) {
// Something went wrong and we were unable to set up a connection. This is
// pretty
// much a fatal error.
// Note: The server does not get restarted automatically if this happens.
// Enter the main program loop.
static String com.google.scrollview.ScrollView.receiveMessage ( ) throws IOException

Read one message from client (assuming there are any).

Definition at line 83 of file ScrollView.java.

return in.readLine();

Member Data Documentation

BufferedReader com.google.scrollview.ScrollView.in

Definition at line 44 of file ScrollView.java.

int com.google.scrollview.ScrollView.polylineScanned

Definition at line 48 of file ScrollView.java.

int com.google.scrollview.ScrollView.polylineSize

Definition at line 47 of file ScrollView.java.

float com.google.scrollview.ScrollView.polylineXCoords[]

Definition at line 45 of file ScrollView.java.

float com.google.scrollview.ScrollView.polylineYCoords[]

Definition at line 46 of file ScrollView.java.

int com.google.scrollview.ScrollView.SERVER_PORT = 8461

The port our server listens at.

Definition at line 35 of file ScrollView.java.

The documentation for this class was generated from the following file: