App

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mhr.appandroid.views.imagepresentationview.MasterMaskView Class Reference
Inheritance diagram for mhr.appandroid.views.imagepresentationview.MasterMaskView:

## Classes
interface | OnMasterMaskEventListener

## Public Member Functions
void | setMasterMaskEventListener (OnMasterMaskEventListener listener)
void | setState (boolean selected, boolean applied)
boolean | isSelected ()
boolean | isApplied ()
| MasterMaskView (Context context)
| MasterMaskView (Context context, AttributeSet attrs)
| MasterMaskView (Context context, AttributeSet attrs, int defStyle)
void | setMaskPreview (Bitmap preview)
void | onCheckedChanged (CompoundButton buttonView, boolean isChecked)
void | onClick (View v)
boolean | onLongClick (View v)
boolean | onMenuItemClick (MenuItem item)

## Protected Member Functions
void | init ()

## Protected Attributes
ImageView | maskThumbIV
SimpleBitmapView | maskPreviewSBV
CheckBox | maskAppliedChB
View | maskPreviewCheckedV
View | LayerViewOverlay
boolean | selected
boolean | applied
int | checkedColor
int | uncheckedColor
OnMasterMaskEventListener | listener = null
PopupMenu | maskPopup

## Detailed Description

Definition at line 37 of file MasterMaskView.java.

## Constructor & Destructor Documentation

mhr.appandroid.views.imagepresentationview.MasterMaskView.MasterMaskView | ( | Context | context | ) |
| inline

Definition at line 71 of file MasterMaskView.java.

{
super(context);
init();
}

mhr.appandroid.views.imagepresentationview.MasterMaskView.MasterMaskView | ( | Context | context,
|  | AttributeSet | attrs
| ) |  |
| inline

Definition at line 76 of file MasterMaskView.java.

{
super(context, attrs);
init();
}

mhr.appandroid.views.imagepresentationview.MasterMaskView.MasterMaskView | ( | Context | context,
|  | AttributeSet | attrs,
|  | int | defStyle
| ) |  |
| inline

Definition at line 81 of file MasterMaskView.java.

{
super(context, attrs, defStyle);
init();
}

## Member Function Documentation

void mhr.appandroid.views.imagepresentationview.MasterMaskView.init | ( |  | ) |
| inlineprotected

Definition at line 121 of file MasterMaskView.java.

{
try {
((Activity) getContext()).getLayoutInflater().inflate(R.layout.view_master_mask, this, true);
} catch (ClassCastException exc) {
// Tento kod probehne, pokud je poroblem s pretypovanim, napriklad pro nahled v Eclipse
TextView tv = new TextView(getContext());
tv.setText("Prewiew not available, requires Activity to be Context.");
addView(tv);
return;
}
maskThumbIV = (ImageView) findViewById(R.id.MasterMaskThumb);
maskPreviewSBV = (SimpleBitmapView) findViewById(R.id.MasterMaskPreview);
maskAppliedChB = (CheckBox) findViewById(R.id.MasterMaskAppliedChckB);
maskPreviewCheckedV = findViewById(R.id.MasterMaskPreviewChecked);
LayerViewOverlay = findViewById(R.id.LayerViewOverlay);
maskPreviewCheckedV.setOnClickListener(this);
maskPreviewCheckedV.setOnLongClickListener(this);
maskAppliedChB.setOnCheckedChangeListener(this);
maskPreviewSBV.getBitmapBackground().setShader(new BitmapShader(BitmapFactory.decodeResource(getResources(), R.drawable.checkboard), TileMode.REPEAT, TileMode.REPEAT));
uncheckedColor = 0x00000000;
checkedColor = getResources().getColor(R.color.SelectedToolBackground);
maskPopup = new PopupMenu(getContext(), this);
maskPopup.inflate(R.menu.view_layer_view_mask);
maskPopup.setOnMenuItemClickListener(this);
}

boolean mhr.appandroid.views.imagepresentationview.MasterMaskView.isApplied | ( |  | ) |
| inline

Definition at line 66 of file MasterMaskView.java.

{
return applied;
}

boolean mhr.appandroid.views.imagepresentationview.MasterMaskView.isSelected | ( |  | ) |
| inline

Definition at line 62 of file MasterMaskView.java.

{
return selected;
}

void mhr.appandroid.views.imagepresentationview.MasterMaskView.onCheckedChanged | ( | CompoundButton | buttonView,
|  | boolean | isChecked
| ) |  |
| inline

Definition at line 154 of file MasterMaskView.java.

{
if (buttonView == maskAppliedChB) {
if (listener != null) {
listener.onMasterMaskEvent(this, new ImagePresentationEvent(EventType.MASTER_MASK_APPLIED_CHANGED, -1, isChecked));
}
}
}

void mhr.appandroid.views.imagepresentationview.MasterMaskView.onClick | ( | View | v | ) |
| inline

Definition at line 163 of file MasterMaskView.java.

{
if (v == maskPreviewCheckedV) {
if (!selected) {
selected = true;
setState(selected, applied);
if (listener != null) {
listener.onMasterMaskEvent(this, new ImagePresentationEvent(EventType.MASTER_MASK_SELECTED, -1));
}
}
}
}

boolean mhr.appandroid.views.imagepresentationview.MasterMaskView.onLongClick | ( | View | v | ) |
| inline

Definition at line 178 of file MasterMaskView.java.

{
maskPopup.show();
return true;
}

boolean mhr.appandroid.views.imagepresentationview.MasterMaskView.onMenuItemClick | ( | MenuItem | item | ) |
| inline

Definition at line 184 of file MasterMaskView.java.

{
final int id = item.getItemId();
if (id == R.id.LayerPopUpCopyMaskBitmap) {
if (listener != null) {
listener.onMasterMaskEvent(this, new ImagePresentationEvent(EventType.MASTER_MASK_COPY_BITMAP, -1));
}
} else if (id == R.id.LayerPopUpPasteMaskBitmap) {
if (listener != null) {
listener.onMasterMaskEvent(this, new ImagePresentationEvent(EventType.MASTER_MASK_PASTE_BITMAP, -1));
}
} else if (id == R.id.LayerPopUpClearMaskBitmap) {
if (listener != null) {
listener.onMasterMaskEvent(this, new ImagePresentationEvent(EventType.MASTER_MASK_CLEAR_BITMAP, -1));
}
} else if (id == R.id.LayerPopUpFillMaskBitmap) {
if (listener != null) {
listener.onMasterMaskEvent(this, new ImagePresentationEvent(EventType.MASTER_MASK_FILL_BITMAP, -1));
}
} else if (id == R.id.LayerPopUpInvertMaskBitmap) {
if (listener != null) {
listener.onMasterMaskEvent(this, new ImagePresentationEvent(EventType.MASTER_MASK_INVERT_BITMAP, -1));
}
} else if (id == R.id.LayerPopUpAddMaskBitmap) {
if (listener != null) {
listener.onMasterMaskEvent(this, new ImagePresentationEvent(EventType.MASTER_MASK_ADD_BITMAP, -1));
}
} else if (id == R.id.LayerPopUpRemoveMaskBitmap) {
if (listener != null) {
listener.onMasterMaskEvent(this, new ImagePresentationEvent(EventType.MASTER_MASK_REMOVE_BITMAP, -1));
}
}
return true;
}

void mhr.appandroid.views.imagepresentationview.MasterMaskView.setMaskPreview | ( | Bitmap | preview | ) |
| inline

Definition at line 86 of file MasterMaskView.java.

{
maskPreviewSBV.setBitmap(preview);
maskPreviewSBV.setVisibility(VISIBLE);
maskThumbIV.setVisibility(INVISIBLE);
}

void mhr.appandroid.views.imagepresentationview.MasterMaskView.setMasterMaskEventListener | ( | OnMasterMaskEventListener | listener | ) |
| inline

Definition at line 47 of file MasterMaskView.java.

{
this.listener = listener;
}

void mhr.appandroid.views.imagepresentationview.MasterMaskView.setState | ( | boolean | selected,
|  | boolean | applied
| ) |  |
| inline

Definition at line 51 of file MasterMaskView.java.

{
this.selected = selected;
if (selected) {
maskPreviewCheckedV.setBackgroundColor(checkedColor);
} else {
maskPreviewCheckedV.setBackgroundColor(uncheckedColor);
}
this.applied = applied;
maskAppliedChB.setChecked(applied);
}

## Member Data Documentation

boolean mhr.appandroid.views.imagepresentationview.MasterMaskView.applied
| protected

Definition at line 109 of file MasterMaskView.java.

int mhr.appandroid.views.imagepresentationview.MasterMaskView.checkedColor
| protected

Definition at line 111 of file MasterMaskView.java.

View mhr.appandroid.views.imagepresentationview.MasterMaskView.LayerViewOverlay
| protected

Definition at line 103 of file MasterMaskView.java.

OnMasterMaskEventListener mhr.appandroid.views.imagepresentationview.MasterMaskView.listener = null
| protected

Definition at line 114 of file MasterMaskView.java.

CheckBox mhr.appandroid.views.imagepresentationview.MasterMaskView.maskAppliedChB
| protected

Definition at line 101 of file MasterMaskView.java.

PopupMenu mhr.appandroid.views.imagepresentationview.MasterMaskView.maskPopup
| protected

Definition at line 116 of file MasterMaskView.java.

View mhr.appandroid.views.imagepresentationview.MasterMaskView.maskPreviewCheckedV
| protected

Definition at line 102 of file MasterMaskView.java.

SimpleBitmapView mhr.appandroid.views.imagepresentationview.MasterMaskView.maskPreviewSBV
| protected

Definition at line 100 of file MasterMaskView.java.

ImageView mhr.appandroid.views.imagepresentationview.MasterMaskView.maskThumbIV
| protected

Definition at line 99 of file MasterMaskView.java.

boolean mhr.appandroid.views.imagepresentationview.MasterMaskView.selected
| protected

Definition at line 108 of file MasterMaskView.java.

int mhr.appandroid.views.imagepresentationview.MasterMaskView.uncheckedColor
| protected

Definition at line 112 of file MasterMaskView.java.

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

- /home/xxx/eclipse_workspaces/app/appandroid/src/mhr/appandroid/views/imagepresentationview/MasterMaskView.java