SK.gnome.sane
Class SaneConnection

java.lang.Object
  extended by SK.gnome.morena.MorenaBase
      extended by SK.gnome.sane.SaneConnection
All Implemented Interfaces:
MorenaConstants, SaneConstants

public class SaneConnection
extends MorenaBase
implements SaneConstants

Connection to single host with SANE daemon running.


Nested Class Summary
static class SaneBase.CloseHook
           
 
Field Summary
 
Fields inherited from interface SK.gnome.sane.SaneConstants
SANE_ACTION_GET_VALUE, SANE_ACTION_SET_AUTO, SANE_ACTION_SET_VALUE, SANE_CAP_ADVANCED, SANE_CAP_AUTOMATIC, SANE_CAP_EMULATED, SANE_CAP_HARD_SELECT, SANE_CAP_INACTIVE, SANE_CAP_SOFT_DETECT, SANE_CAP_SOFT_SELECT, SANE_CONSTRAINT_NONE, SANE_CONSTRAINT_RANGE, SANE_CONSTRAINT_STRING_LIST, SANE_CONSTRAINT_WORD_LIST, SANE_FRAME_BLUE, SANE_FRAME_GRAY, SANE_FRAME_GREEN, SANE_FRAME_RED, SANE_FRAME_RGB, SANE_NET_AUTHORIZE, SANE_NET_CANCEL, SANE_NET_CLOSE, SANE_NET_CONTROL_OPTION, SANE_NET_EXIT, SANE_NET_GET_DEVICES, SANE_NET_GET_OPTION_DESCRIPTORS, SANE_NET_GET_PARAMETERS, SANE_NET_INIT, SANE_NET_OPEN, SANE_NET_START, SANE_STATUS_ACCESS_DENIED, SANE_STATUS_CANCELLED, SANE_STATUS_COVER_OPEN, SANE_STATUS_DEVICE_BUSY, SANE_STATUS_EOF, SANE_STATUS_GOOD, SANE_STATUS_INVAL, SANE_STATUS_IO_ERROR, SANE_STATUS_JAMMED, SANE_STATUS_NO_DOCS, SANE_STATUS_NO_MEM, SANE_STATUS_UNSUPPORTED, SANE_TYPE_BOOL, SANE_TYPE_BUTTON, SANE_TYPE_FIXED, SANE_TYPE_GROUP, SANE_TYPE_INT, SANE_TYPE_STRING, SANE_UNIT_BIT, SANE_UNIT_DPI, SANE_UNIT_MICROSECOND, SANE_UNIT_MM, SANE_UNIT_NONE, SANE_UNIT_PERCENT, SANE_UNIT_PIXEL, SANE_VERSION, STATUS_CODE, UNFIX_CONST
 
Fields inherited from interface SK.gnome.morena.MorenaConstants
MORENA_MESSAGES, VERSION
 
Method Summary
 void close()
          Close connection.
static SaneConnection connect(java.lang.String host)
          Create connection to specified host on default port with null user name.
static SaneConnection connect(java.lang.String host, int port, java.lang.String userName)
          Create connection to specified host on specified port with specified user name.
static SaneConnection connect(java.lang.String host, java.lang.String userName)
          Create connection to specified host on default port with specified user name.
 SaneSource getDefaultSource()
          Get default source on this host.
 int getResultCode()
           
 SaneSource[] listSources()
          List available sources on this host.
static SaneSource selectSource(java.awt.Component parent)
          Show Morena-like select source dialog to choose SANE source.
 SaneSource selectSource(java.awt.Component parent, SaneSource defaultSource)
          Show TWAIN-like select source dialog to choose SANE source.
 void setResultCode(int lastStatus)
           
 java.lang.String toString()
          For debugging purposes only.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

close

public void close()
           throws java.lang.Exception
Close connection.

Throws:
java.lang.Exception

listSources

public SaneSource[] listSources()
List available sources on this host.


getDefaultSource

public SaneSource getDefaultSource()
Get default source on this host.


selectSource

public SaneSource selectSource(java.awt.Component parent,
                               SaneSource defaultSource)
Show TWAIN-like select source dialog to choose SANE source.


selectSource

public static SaneSource selectSource(java.awt.Component parent)
Show Morena-like select source dialog to choose SANE source.


connect

public static SaneConnection connect(java.lang.String host,
                                     int port,
                                     java.lang.String userName)
                              throws SaneException,
                                     java.io.IOException
Create connection to specified host on specified port with specified user name.

Throws:
SaneException
java.io.IOException

connect

public static SaneConnection connect(java.lang.String host,
                                     java.lang.String userName)
                              throws SaneException,
                                     java.io.IOException
Create connection to specified host on default port with specified user name.

Throws:
SaneException
java.io.IOException

connect

public static SaneConnection connect(java.lang.String host)
                              throws SaneException,
                                     java.io.IOException
Create connection to specified host on default port with null user name.

Throws:
SaneException
java.io.IOException

toString

public java.lang.String toString()
For debugging purposes only.

Overrides:
toString in class java.lang.Object

getResultCode

public int getResultCode()

setResultCode

public void setResultCode(int lastStatus)