de.softpro.signdocmobile.foundations
Class TabletTraceCollection

java.lang.Object
  extended by de.softpro.signdocmobile.foundations.TabletTraceCollection
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
TabletTraceCollectionHelper

public class TabletTraceCollection
extends java.lang.Object
implements java.io.Serializable

TabletTraceCollection represents collection of pen strokes that represent the signature

TabletTraceCollection the class used to collect all the pen traces during a single signature capture.

See Also:
Serialized Form

Nested Class Summary
static class TabletTraceCollection.BinaryFormat
           
 class TabletTraceCollection.TabletSpec
          TabletSpec contains information about the captured device
 
Field Summary
static float SC_SIGNATURE_MAX_PRESSURE
           
 
Constructor Summary
TabletTraceCollection()
           
TabletTraceCollection(TabletTraceCollection aSrc)
           
 
Method Summary
 void addTrace(TabletTrace trace)
           
 void clear()
           
static byte[] createBiometricData(TabletTraceCollection aTabletTraceCollection, TabletTraceCollection.BinaryFormat format, boolean raw)
          Helper method to create a binary blob used to store the biometric data.
 TabletTraceCollection.TabletSpec getTabletSpecs()
          Get the TabletSpec for the TraceCollection
 java.util.List<TabletTrace> getTraces()
          Get a list of the TabletTrace
 boolean isEmpty()
          Returns of if the trace collection has at least one trace with one point
 boolean isEqual(TabletTraceCollection b)
          Check if TabletTraceCollection are equal
static TabletTraceCollection normalize(TabletTraceCollection aTabletTraceCollection, float screenDpi)
           
static TabletTraceCollection normalize(TabletTraceCollection aTabletTraceCollection, float screenDpi, float targetDpi)
          Deprecated. 
static android.graphics.Bitmap render(TabletTraceCollection aTabletTraceCollection, PenSetting aPen, int dpi)
          Deprecated. 
static android.graphics.Bitmap render(TabletTraceCollection aTabletTraceCollection, PenSetting aPen, int dpi, int backgroundColor)
          Helper method to render a tablet trace collection to a bitmap
static boolean renderInBitmap(android.graphics.Bitmap bitmap, TabletTraceCollection aTabletTraceCollection, PenSetting aPen)
          Helper method to render a TabletTraceCollection to a pre-existing bitmap.
static boolean renderInBitmap(android.graphics.Bitmap bitmap, TabletTraceCollection aTabletTraceCollection, PenSetting aPen, android.graphics.Rect rect)
          Helper method to render a TabletTraceCollection to a pre-existing bitmap.
 java.lang.String toString()
           
 java.lang.String toString(int numlines)
           
 void writeBinaryBlob(java.io.ByteArrayOutputStream bs, TabletTraceCollection.BinaryFormat format)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SC_SIGNATURE_MAX_PRESSURE

public static float SC_SIGNATURE_MAX_PRESSURE
Constructor Detail

TabletTraceCollection

public TabletTraceCollection()

TabletTraceCollection

public TabletTraceCollection(TabletTraceCollection aSrc)
Method Detail

addTrace

public void addTrace(TabletTrace trace)

clear

public void clear()

writeBinaryBlob

public void writeBinaryBlob(java.io.ByteArrayOutputStream bs,
                            TabletTraceCollection.BinaryFormat format)
                     throws java.io.IOException
Throws:
java.io.IOException

getTraces

public java.util.List<TabletTrace> getTraces()
Get a list of the TabletTrace

Returns:
list of TabletPoint

isEmpty

public boolean isEmpty()
Returns of if the trace collection has at least one trace with one point

Returns:
true if empty

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(int numlines)

getTabletSpecs

public TabletTraceCollection.TabletSpec getTabletSpecs()
Get the TabletSpec for the TraceCollection

Returns:
TabletSpec

isEqual

public boolean isEqual(TabletTraceCollection b)
Check if TabletTraceCollection are equal

Parameters:
b - TabletTraceCollection to compare to
Returns:
true if equal

normalize

@Deprecated
public static TabletTraceCollection normalize(TabletTraceCollection aTabletTraceCollection,
                                                         float screenDpi,
                                                         float targetDpi)
Deprecated. 

Helper method to normalize the TabletTraceCollection Normalizes the dpi and pressure

Parameters:
aTabletTraceCollection - input TabletTraceCollection
screenDpi - screen dpi
targetDpi - dpi to convert the tablet trace collection
Returns:
normalized TabletTraceCollection
See Also:
DisplayMetrics

normalize

public static TabletTraceCollection normalize(TabletTraceCollection aTabletTraceCollection,
                                              float screenDpi)

render

@Deprecated
public static android.graphics.Bitmap render(TabletTraceCollection aTabletTraceCollection,
                                                        PenSetting aPen,
                                                        int dpi)
Deprecated. 

Helper method to render a tablet trace collection to a bitmap

Parameters:
aTabletTraceCollection - input TabletTraceCollection
aPen - input pen
dpi - dpi for output bitmap
Returns:
Signature rendered in a bitmap

render

public static android.graphics.Bitmap render(TabletTraceCollection aTabletTraceCollection,
                                             PenSetting aPen,
                                             int dpi,
                                             int backgroundColor)
Helper method to render a tablet trace collection to a bitmap

Parameters:
aTabletTraceCollection - input TabletTraceCollection
aPen - input pen
dpi - dpi for output bitmap
backgroundColor - background color of output bitmap
Returns:
Signature rendered in a bitmap

renderInBitmap

public static boolean renderInBitmap(android.graphics.Bitmap bitmap,
                                     TabletTraceCollection aTabletTraceCollection,
                                     PenSetting aPen)
Helper method to render a TabletTraceCollection to a pre-existing bitmap.

Parameters:
bitmap - input bitmap to render signature into
aTabletTraceCollection - input TabletTraceCollection
aPen - input pen
Returns:
boolean true if successful

renderInBitmap

public static boolean renderInBitmap(android.graphics.Bitmap bitmap,
                                     TabletTraceCollection aTabletTraceCollection,
                                     PenSetting aPen,
                                     android.graphics.Rect rect)
Helper method to render a TabletTraceCollection to a pre-existing bitmap.

Parameters:
bitmap - input bitmap to render signature into
aTabletTraceCollection - input TabletTraceCollection
aPen - input pen
rect - bounding rect
Returns:
boolean true if successful

createBiometricData

public static byte[] createBiometricData(TabletTraceCollection aTabletTraceCollection,
                                         TabletTraceCollection.BinaryFormat format,
                                         boolean raw)
                                  throws java.io.IOException
Helper method to create a binary blob used to store the biometric data.

Parameters:
aTabletTraceCollection - input TabletTraceCollection
format - Ignored raw is not used
raw - return only the signature data without the the container
Returns:
byte array
Throws:
java.io.IOException