|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.livescribe.penlet.Region
public final class Region
This class encapsulates a region of interest for an application. A region is identified uniquely by a 64-bit number composed of the following attributes.
| Property | Description |
|---|---|
| Area ID | An identifier used by application to identify a region. One or more regions within the app can have the same area ID. |
| Instance ID | The instance identifer of the application. The application
actually does not not have any control over this value. When
creating dynamic regions, the value is set once that region has
has been registered using RegionCollection.addRegion(Shape, Region).
|
| Occlusive | Indicates if the region masks any other regions having a higher Z-order that occupy the same physical space on the page. |
| Subtractive | Not relevant to developers at this time. |
| Z-order | Indicates the order of ovrelapping regions. A lower value
indicates that the region is "closer" to the person drawing on the
page. In other words, the pen will "hit" lower-numbered regions
first. This is another value that may be modified by
adding a region
to the application's region collection.
A Z-order of zero tells the system to assign one. |
| Store Strokes | Indicates that the region should cause any strokes drawn within it to be stored. Please see the method docs for more information. |
| Bitmap | Indicates if the region consists of a shape divided into multiple uniform cells. This is not relevant to developers at this time. |
The following table summarizes the structure of the 64-bit value.
| Bit Count | Property |
|---|---|
| 1 bit | Reserved |
| 15 bits | Z-order |
| 8 bits | Reserved |
| 16 bits | Instance ID |
| 16 bits | Area ID |
| 1 bit | Store Strokes |
| 1 bit | Bitmap |
| 1 bit | Tablet |
| 3 bits | Reserved |
| 1 bit | Occlusive |
| 1 bit | Subtractive |
Note that lower region ID's have a higher precedence than higher ID's. For example, if two regions have the same Z-order but have different area ID's, then the one with the lower area ID is considered to be "on top of" the one with the higher area ID.
| Constructor Summary | |
|---|---|
Region(int area)
Creates a new region having the specified area ID. |
|
Region(int area,
boolean occlusive)
Creates a new region having the specified area ID and occlusive state. |
|
Region(int area,
boolean occlusive,
boolean storeStrokes)
Creates a new region having the specified area ID, and occlusive and store strokes states. |
|
Region(int area,
int zOrder,
boolean occlusive,
boolean subtractive)
Creates a new region having the specified area ID, Z-order, and occlusive and subtractive states. |
|
Region(int area,
int zOrder,
boolean occlusive,
boolean subtractive,
boolean storeStrokes)
Creates a new region having the specified values. |
|
Region(int area,
int zOrder,
boolean occlusive,
boolean subtractive,
boolean storeStrokes,
boolean tablet)
Creates a new region having the specified values. |
|
Region(long id)
Creates a new Region with the specified 64-bit ID. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Checks whether the given object is equal to this region. |
boolean |
equals(Region that)
Deprecated. Use equals(Object). |
int |
getAreaId()
Gets the area ID, a 16-bit unsigned value. |
long |
getId()
Gets the unique 64-bit region ID. |
String |
getIdString()
Returns the ID as a string in hex, having the following format: 0xHIGH_WORD:LOW_WORD. |
int |
getInstance()
Gets the penlet instance that owns this region. |
int |
getZOrder()
Gets the Z-order of the shape. |
int |
hashCode()
Returns a hash code for this region. |
boolean |
isBitmapRegion()
Indicates if the region is a bitmap Region. |
boolean |
isOcclusive()
Indicates if this region physically blocks or hides another region on the page. |
boolean |
isStrokesStored()
Indicates if the region stores strokes or not. |
boolean |
isSubtractive()
Indicates if the shape is subtractive. |
boolean |
isTabletRegion()
Indicates if the region is a tablet Region. |
String |
toString()
Returns a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Region(long id)
id - the 64-bit region IDRegion
public Region(int area,
boolean occlusive)
| Property | Default Value |
|---|---|
| Store Strokes | false |
| Subtractive | false |
| Z-order | Zero (system assigned later) |
| Bitmap | false |
| Tablet | false |
area - the area IDocclusive - true if occlusive and false
otherwise
public Region(int area,
boolean occlusive,
boolean storeStrokes)
| Property | Default Value |
|---|---|
| Subtractive | false |
| Z-order | Zero (system assigned later) |
| Bitmap | false |
area - the area IDocclusive - true if occlusive and false
otherwisestoreStrokes - true to store strokes and
false otherwise
public Region(int area,
int zOrder,
boolean occlusive,
boolean subtractive)
| Property | Default Value |
|---|---|
| Store Strokes | false |
| Bitmap | false |
area - the area IDzOrder - the Z-orderocclusive - true if occlusive and false
otherwisesubtractive - true if subtractive and
false otherwisepublic Region(int area)
| Property | Default Value |
|---|---|
| Store Strokes | false |
| Occlusive | false |
| Subtractive | false |
| Z-order | Zero (system assigned later) |
| Bitmap | false |
| Tablet | false |
area - the area ID
public Region(int area,
int zOrder,
boolean occlusive,
boolean subtractive,
boolean storeStrokes)
| Property | Default Value |
|---|---|
| Bitmap | false |
| Tablet | false |
area - the area IDzOrder - the Z-orderocclusive - true if occlusive and false
otherwisesubtractive - true if subtractive and false
otherwisestoreStrokes - true to store strokes and
false otherwise
public Region(int area,
int zOrder,
boolean occlusive,
boolean subtractive,
boolean storeStrokes,
boolean tablet)
| Property | Default Value |
|---|---|
| Bitmap | false |
area - the area IDzOrder - the Z-orderocclusive - true if occlusive and false
otherwisesubtractive - true if subtractive and false
otherwisestoreStrokes - true to store strokes and
false otherwisetablet - true to work as a paper tablet
false otherwise| Method Detail |
|---|
public long getId()
public int getAreaId()
public int getInstance()
public int getZOrder()
A region created having a Z-order of zero causes the system to choose one for you when it is added to the penlet's region collection.
public boolean isOcclusive()
false the shape is transparent and shapes
behind can trigger events.public boolean isSubtractive()
Composite shapes
true the shape cuts a hole in the shape
false the shape is a normal additive shape.public boolean isBitmapRegion()
true the shape is a bitmap Region
false the shape is not a bitmap Region.public boolean isStrokesStored()
true if the shape stores strokes and
false otherwise.public boolean isTabletRegion()
true if the shape is a tablet region and
false otherwise.public boolean equals(Region that)
equals(Object).
that - compare to this region
public boolean equals(Object obj)
equals in class Objectobj - compare to this object
Boolean.hashCode(),
Hashtablepublic int hashCode()
Long.hashCode() using this region's
64-bit ID.
hashCode in class ObjectObject.equals(java.lang.Object),
Hashtablepublic String toString()
toString in class Objectpublic final String getIdString()
|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||