App
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
appandroid
src
mhr
appandroid
adapters
APDImagePresentation.java
Go to the documentation of this file.
1
package
mhr.appandroid.adapters;
2
3
import
android.app.Activity;
4
import
android.graphics.Bitmap;
5
6
import
mhr.appcore.interfaces.PDBitmap;
7
import
mhr.appcore.interfaces.PDImageDataPresentation;
8
12
public
class
APDImagePresentation
extends
PDImageDataPresentation
{
13
14
//===== INTERFACES, CLASSES, ENUMS ==========================================================================================================//
15
//----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
16
//----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
20
public
interface
OnImagePresentationChangedListener
{
25
public
void
onImagePresentationChanged
(
APDImagePresentation
p);
26
}
27
28
//===== FIELDS ==============================================================================================================================//
29
//----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
30
protected
int
layerThumbWidth
;
31
protected
int
layerThumbHeight
;
32
protected
int
maskThumbWidth
;
33
protected
int
maskThumbHeight
;
34
35
protected
OnImagePresentationChangedListener
listener
= null;
36
protected
Activity
activity
= null;
37
//----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
38
39
//===== CONSTRUCTORS, DESTRUCTORS, RELATED METHODS ==========================================================================================//
40
//----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
41
//----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
49
public
APDImagePresentation
(
int
layerThumbWidth
,
int
layerThumbHeight
,
int
maskThumbWidth
,
int
maskThumbHeight
) {
50
this.layerThumbWidth =
layerThumbWidth
;
51
this.layerThumbHeight =
layerThumbHeight
;
52
this.maskThumbWidth =
maskThumbWidth
;
53
this.maskThumbHeight =
maskThumbHeight
;
54
}
55
56
//===== METHODS =============================================================================================================================//
57
//----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
58
//----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
64
public
void
setOnImagePresentationChangedListener
(
OnImagePresentationChangedListener
listener
, Activity
activity
) {
65
this.listener =
listener
;
66
this.activity =
activity
;
67
}
68
69
@Override
70
public
PDBitmap
createLayerThumb
() {
71
return
new
APDBitmap
(Bitmap.createBitmap(
layerThumbWidth
,
layerThumbHeight
, Bitmap.Config.ARGB_8888));
72
}
73
74
@Override
75
public
PDBitmap
createMaskThumb
() {
76
return
new
APDBitmap
(Bitmap.createBitmap(
maskThumbWidth
,
maskThumbHeight
, Bitmap.Config.ALPHA_8));
77
}
78
79
@Override
80
public
void
hasChanged
() {
81
if
(
listener
!= null &&
activity
!= null) {
82
activity
.runOnUiThread(
new
Runnable() {
83
@Override
84
public
void
run() {
85
listener
.
onImagePresentationChanged
(
APDImagePresentation
.this);
86
}
87
});
88
}
89
}
90
91
}
Generated on Thu May 23 2013 22:10:53 for App by
1.8.3