App

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

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

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mhr.app.fragments.layers.LayersPaneFragment Class Reference

Třída reprezentuje fragment pro panel vrstev. More...

Inheritance diagram for mhr.app.fragments.layers.LayersPaneFragment:

## Public Member Functions
APDImagePresentation | getImagePresentation ()
| Vrací prezentaci obrazu.
void | reseImagePresentation ()
| Znovu vytvoří prezentaci obrazu.
void | updateLayerFromPresentation (int layerId)
| Zadá příkaz jádru, aby aktualizovalo danou vrstvu dle prezentace.
void | updateLayers ()
| aktualizuje náhledy vrstev a spojené elementy UI.
void | changeVisibility ()
| Minimalizuje/obnoví panel.
void | onClick (View v)
void | onImagePresentationChanged (APDImagePresentation p)
| Voláno když dojde ke změně prezentace.
void | onImagePresentationEvent (ImagePresentationEvent e)
void | onAttach (Activity activity)
View | onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void | onResume ()

## Protected Member Functions
View | initView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
| Provede inicializaci obsahu fragmentu. Parametry odpovídají metodě životního cyklu.

## Protected Attributes
View | root
ImagePresentationView | layers
ViewGroup | layersToolbarContent
LayoutInflater | inflater
AppMainActivity | activity
APDImagePresentation | presentation
PDFeedback | hideProgressBarFeedback
SparseArray < LayerSettingsFragment > | fragments = new SparseArray<LayerSettingsFragment>()
| Zde jsou cachované fragmenty pro nastavení vrstev.
LayerSettingsFragment | currentSettings = null
boolean | firstCreated = true

## Detailed Description

Třída reprezentuje fragment pro panel vrstev.

Definition at line 61 of file LayersPaneFragment.java.

## Member Function Documentation

void mhr.app.fragments.layers.LayersPaneFragment.changeVisibility | ( |  | ) |
| inline

Minimalizuje/obnoví panel.

Definition at line 216 of file LayersPaneFragment.java.

{
if (layersToolbarContent.getVisibility() == View.VISIBLE) {
layersToolbarContent.setVisibility(View.GONE);
} else {
layersToolbarContent.setVisibility(View.VISIBLE);
}
}

APDImagePresentation mhr.app.fragments.layers.LayersPaneFragment.getImagePresentation | ( |  | ) |
| inline

Vrací prezentaci obrazu.

Returns

Definition at line 163 of file LayersPaneFragment.java.

{
return presentation;
}

View mhr.app.fragments.layers.LayersPaneFragment.initView | ( | LayoutInflater | inflater,
|  | ViewGroup | container,
|  | Bundle | savedInstanceState
| ) |  |
| inlineprotected

Provede inicializaci obsahu fragmentu. Parametry odpovídají metodě životního cyklu.

Parameters

  inflater |
  container |
  savedInstanceState |

Returns

Definition at line 92 of file LayersPaneFragment.java.

{
root = inflater.inflate(R.layout.fragment_layers_pane, container, false);
layers = (ImagePresentationView) root.findViewById(R.id.ImageLayersView);
layers.setOnLayerEventListener(this);
layersToolbarContent = (ViewGroup) root.findViewById(R.id.LayersToolbarContent);
root.findViewById(R.id.LayersToolbarBorder).setOnClickListener(this);
root.findViewById(R.id.LayersCaptionTV).setOnClickListener(this);
Rect thumb = layers.getLayerPreviewRect();
presentation = new APDImagePresentation(thumb.width(), thumb.height(), thumb.width(), thumb.height());
layers.setImagePresentation(presentation);
presentation.setOnImagePresentationChangedListener(this, activity);
//===== PŘIDÁNÍ FRAGMENTŮ ===================================================================================================================//
LayerSettingsFragment f;
f = new RasterLayerSettingsFragment();
f.setParent(this);
fragments.put(LayerType.LAYER_RASTER.ordinal(), f);
f = new ColorLayerSettingsFragment();
f.setParent(this);
fragments.put(LayerType.LAYER_COLOR.ordinal(), f);
f = new BrightnessLayerSettingsFragment();
f.setParent(this);
fragments.put(LayerType.LAYER_BRIGHTNESS.ordinal(), f);
f = new ContrastLayerSettingsFragment();
f.setParent(this);
fragments.put(LayerType.LAYER_CONTRAST.ordinal(), f);
f = new GammaLayerSettingsFragment();
f.setParent(this);
fragments.put(LayerType.LAYER_GAMMA.ordinal(), f);
f = new CurvesLayerSettingsFragment();
f.setParent(this);
fragments.put(LayerType.LAYER_CURVES.ordinal(), f);
f = new GaussianBlurLayerSettingsFragment();
f.setParent(this);
fragments.put(LayerType.LAYER_GAUSSIAN_BLUR.ordinal(), f);
f = new LaplaceSharpenLayerSettingsFragment();
f.setParent(this);
fragments.put(LayerType.LAYER_LAPLACE_SHARPEN.ordinal(), f);
f = new GaussianSharpenLayerSettingsFragment();
f.setParent(this);
fragments.put(LayerType.LAYER_GAUSSIAN_SHARPEN.ordinal(), f);
f = new LaplacianOfGaussianSharpenLayerSettingsFragment();
f.setParent(this);
fragments.put(LayerType.LAYER_LAPLACIAN_OF_GAUSSIAN_SHARPEN.ordinal(), f);
f = new DifferenceOfGaussianSharpenLayerSettingsFragment();
f.setParent(this);
fragments.put(LayerType.LAYER_DIFFERENCE_OF_GAUSSIAN_SHARPEN.ordinal(), f);
return root;
}

void mhr.app.fragments.layers.LayersPaneFragment.onAttach | ( | Activity | activity | ) |
| inline

Definition at line 423 of file LayersPaneFragment.java.

{
super.onAttach(activity);
/*
* called once the fragment is associated with its activity.
*/
this.activity = (AppMainActivity) getActivity();
hideProgressBarFeedback = new APDFeedback(activity) {
@Override
public void run() {
LayersPaneFragment.this.activity.hideProgressBar();
}
};
}

void mhr.app.fragments.layers.LayersPaneFragment.onClick | ( | View | v | ) |
| inline

Definition at line 226 of file LayersPaneFragment.java.

{
switch (v.getId()) {
case R.id.LayersToolbarBorder:
changeVisibility();
break;
case R.id.LayersCaptionTV:
changeVisibility();
break;
default:
break;
}
}

View mhr.app.fragments.layers.LayersPaneFragment.onCreateView | ( | LayoutInflater | inflater,
|  | ViewGroup | container,
|  | Bundle | savedInstanceState
| ) |  |
| inline

Definition at line 451 of file LayersPaneFragment.java.

{
//return super.onCreateView(inflater, container, savedInstanceState);
/*
* creates and returns the view hierarchy associated with the fragment.
*
* The system calls this when it's time for the fragment to draw its user interface for the first time. To draw a UI for your fragment, you must return a
* View from this method that is the root of your fragment's layout. You can return null if the fragment does not provide a UI.
*
* Zde začíná životní cyklus při návratu z backstacku
*/
if (firstCreated) {
firstCreated = false;
return initView(inflater, container, savedInstanceState);
} else {
return root;
}
}

void mhr.app.fragments.layers.LayersPaneFragment.onImagePresentationChanged | ( | APDImagePresentation | p | ) |
| inline

Voláno když dojde ke změně prezentace.

Parameters

  p |

Implements mhr.appandroid.adapters.APDImagePresentation.OnImagePresentationChangedListener.

Definition at line 240 of file LayersPaneFragment.java.

{
updateLayers();
}

void mhr.app.fragments.layers.LayersPaneFragment.onImagePresentationEvent | ( | ImagePresentationEvent | e | ) |
| inline

Implements mhr.appandroid.views.imagepresentationview.ImagePresentationView.OnImagePresentationEventListener.

Definition at line 245 of file LayersPaneFragment.java.

{
AppCommand cmd;
switch (e.type) {
case LAYER_SELECTED:
activity.showProgressBar();
cmd = new SetImageSelectedStateCommand(ImageSelectedState.SELECTED_LAYER, e.layerId);
cmd.setPDFeedback(hideProgressBarFeedback);
activity.addCommand(cmd);
break;
case LAYER_MASK_SELECTED:
activity.showProgressBar();
cmd = new SetImageSelectedStateCommand(ImageSelectedState.SELECTED_MASK, e.layerId);
cmd.setPDFeedback(hideProgressBarFeedback);
activity.addCommand(cmd);
break;
case MASTER_MASK_SELECTED:
activity.showProgressBar();
cmd = new SetImageSelectedStateCommand(ImageSelectedState.SELECTED_MASTER_MASK, -1);
cmd.setPDFeedback(hideProgressBarFeedback);
activity.addCommand(cmd);
break;
case LAYER_VISIBILITY_CHANGED:
activity.showProgressBar();
cmd = new SetLayerVisibilityCommand(e.layerId, ((Boolean) e.extra));
cmd.setPDFeedback(hideProgressBarFeedback);
activity.addCommand(cmd);
break;
case LAYER_MASK_ACTIVE_CHANGED:
activity.showProgressBar();
cmd = new SetLayerMaskActiveCommand(e.layerId, ((Boolean) e.extra));
cmd.setPDFeedback(hideProgressBarFeedback);
activity.addCommand(cmd);
break;
case MASTER_MASK_APPLIED_CHANGED:
cmd = new SetMasterMaskActiveCommand((Boolean) e.extra);
activity.addCommand(cmd);
break;
case LAYER_OPACITY_CHANGED:
activity.showProgressBar();
cmd = new SetLayerOpacityCommand(e.layerId, ((Double) e.extra));
cmd.setPDFeedback(hideProgressBarFeedback);
activity.addCommand(cmd);
break;
case LAYER_MOVED:
activity.showProgressBar();
cmd = new MoveLayerCommand(e.layerId, ((Integer) e.extra));
cmd.setPDFeedback(hideProgressBarFeedback);
activity.addCommand(cmd);
break;
case LAYER_CREATED:
activity.showProgressBar();
cmd = new CreateLayerCommand((LayerType) e.extra, e.layerId);
cmd.setPDFeedback(hideProgressBarFeedback);
activity.addCommand(cmd);
break;
case LAYER_DUPLICATED:
activity.showProgressBar();
cmd = new DuplicateLayerCommand(e.layerId);
cmd.setPDFeedback(hideProgressBarFeedback);
activity.addCommand(cmd);
break;
case LAYER_DELETED:
activity.showProgressBar();
cmd = new DeleteLayerCommand(e.layerId);
cmd.setPDFeedback(hideProgressBarFeedback);
activity.addCommand(cmd);
break;
//---------------------------------------------------------------------------------------------------------------------------------------------------//
case LAYER_COPY_BITMAP:
activity.addCommand(new CopyRasterDataCommand(ImageSelectedState.SELECTED_LAYER, e.layerId));
break;
case LAYER_MASK_COPY_BITMAP:
activity.addCommand(new CopyRasterDataCommand(ImageSelectedState.SELECTED_MASK, e.layerId));
break;
case MASTER_MASK_COPY_BITMAP:
activity.addCommand(new CopyRasterDataCommand(ImageSelectedState.SELECTED_MASTER_MASK, e.layerId));
break;
//---------------------------------------------------------------------------------------------------------------------------------------------------//
case LAYER_PASTE_BITMAP:
activity.addCommand(new PasteRasterDataCommand(ImageSelectedState.SELECTED_LAYER, e.layerId));
break;
case LAYER_MASK_PASTE_BITMAP:
activity.addCommand(new PasteRasterDataCommand(ImageSelectedState.SELECTED_MASK, e.layerId));
break;
case MASTER_MASK_PASTE_BITMAP:
activity.addCommand(new PasteRasterDataCommand(ImageSelectedState.SELECTED_MASTER_MASK, e.layerId));
break;
//---------------------------------------------------------------------------------------------------------------------------------------------------//
case LAYER_CLEAR_BITMAP:
activity.addCommand(new ClearRasterDataCommand(ImageSelectedState.SELECTED_LAYER, e.layerId));
break;
case LAYER_MASK_CLEAR_BITMAP:
activity.addCommand(new ClearRasterDataCommand(ImageSelectedState.SELECTED_MASK, e.layerId));
break;
case MASTER_MASK_CLEAR_BITMAP:
activity.addCommand(new ClearRasterDataCommand(ImageSelectedState.SELECTED_MASTER_MASK, e.layerId));
break;
//---------------------------------------------------------------------------------------------------------------------------------------------------//
case LAYER_MASK_FILL_BITMAP:
activity.addCommand(new FillRasterDataCommand(ImageSelectedState.SELECTED_MASK, e.layerId));
break;
case MASTER_MASK_FILL_BITMAP:
activity.addCommand(new FillRasterDataCommand(ImageSelectedState.SELECTED_MASTER_MASK, e.layerId));
break;
//---------------------------------------------------------------------------------------------------------------------------------------------------//
case LAYER_MASK_INVERT_BITMAP:
activity.addCommand(new InvertRasterDataCommand(ImageSelectedState.SELECTED_MASK, e.layerId));
break;
case MASTER_MASK_INVERT_BITMAP:
activity.addCommand(new InvertRasterDataCommand(ImageSelectedState.SELECTED_MASTER_MASK, e.layerId));
break;
//---------------------------------------------------------------------------------------------------------------------------------------------------//
case LAYER_ADD_BITMAP:
activity.addCommand(new AddRasterDataCommand(ImageSelectedState.SELECTED_LAYER, e.layerId));
break;
case LAYER_MASK_ADD_BITMAP:
activity.addCommand(new AddRasterDataCommand(ImageSelectedState.SELECTED_MASK, e.layerId));
break;
case MASTER_MASK_ADD_BITMAP:
activity.addCommand(new AddRasterDataCommand(ImageSelectedState.SELECTED_MASTER_MASK, e.layerId));
break;
//---------------------------------------------------------------------------------------------------------------------------------------------------//
case LAYER_REMOVE_BITMAP:
activity.addCommand(new RemoveRasterDataCommand(ImageSelectedState.SELECTED_LAYER, e.layerId));
break;
case LAYER_MASK_REMOVE_BITMAP:
activity.addCommand(new RemoveRasterDataCommand(ImageSelectedState.SELECTED_MASK, e.layerId));
break;
case MASTER_MASK_REMOVE_BITMAP:
activity.addCommand(new RemoveRasterDataCommand(ImageSelectedState.SELECTED_MASTER_MASK, e.layerId));
break;
//---------------------------------------------------------------------------------------------------------------------------------------------------//
case LAYER_BLEND_BITMAP:
activity.addCommand(new BlendRasterDataCommand(ImageSelectedState.SELECTED_LAYER, e.layerId));
break;
//---------------------------------------------------------------------------------------------------------------------------------------------------//
case IMAGE_MERGE_LAYERS:
activity.showProgressBar();
cmd = new MergeAllCommand();
cmd.setPDFeedback(hideProgressBarFeedback);
activity.addCommand(cmd);
break;
default:
break;
}
}

void mhr.app.fragments.layers.LayersPaneFragment.onResume | ( |  | ) |
| inline

Definition at line 495 of file LayersPaneFragment.java.

{
super.onResume();
/*
* makes the fragment interacting with the user (based on its containing activity being resumed).
*/
layers.updateFromPresentation();
}

void mhr.app.fragments.layers.LayersPaneFragment.reseImagePresentation | ( |  | ) |
| inline

Znovu vytvoří prezentaci obrazu.

Definition at line 170 of file LayersPaneFragment.java.

{
Rect thumb = layers.getLayerPreviewRect();
presentation = new APDImagePresentation(thumb.width(), thumb.height(), thumb.width(), thumb.height());
layers.setImagePresentation(presentation);
presentation.setOnImagePresentationChangedListener(this, activity);
activity.getAppCore().setImagePresentation(presentation);
layers.updateFromPresentation();
}

void mhr.app.fragments.layers.LayersPaneFragment.updateLayerFromPresentation | ( | int | layerId | ) |
| inline

Zadá příkaz jádru, aby aktualizovalo danou vrstvu dle prezentace.

Parameters

  layerId |

Definition at line 183 of file LayersPaneFragment.java.

{
activity.showProgressBar();
AppCommand cmd = new UpdateLayerFromPresentationCommand(layerId);
cmd.setPDFeedback(hideProgressBarFeedback);
activity.addCommand(cmd);
}

void mhr.app.fragments.layers.LayersPaneFragment.updateLayers | ( |  | ) |
| inline

aktualizuje náhledy vrstev a spojené elementy UI.

Definition at line 193 of file LayersPaneFragment.java.

{
layers.updateFromPresentation();
synchronized (presentation) {
if (presentation.selectedLayerId >= 0) {
LayerSettingsFragment f = null;
LayerPDInfo i = presentation.getLayerInfo(presentation.selectedLayerId);
f = fragments.get(i.type.ordinal());
f.setAssociatedLayerId(presentation.selectedLayerId);
if (f == currentSettings) {
return;
}
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.replace(R.id.LayerSettingPlaceholder, f);
ft.commit();
currentSettings = f;
} else {
}
}
}

## Member Data Documentation

AppMainActivity mhr.app.fragments.layers.LayersPaneFragment.activity
| protected

Definition at line 73 of file LayersPaneFragment.java.

LayerSettingsFragment mhr.app.fragments.layers.LayersPaneFragment.currentSettings = null
| protected

Definition at line 77 of file LayersPaneFragment.java.

boolean mhr.app.fragments.layers.LayersPaneFragment.firstCreated = true
| protected

Definition at line 79 of file LayersPaneFragment.java.

SparseArray<LayerSettingsFragment> mhr.app.fragments.layers.LayersPaneFragment.fragments = new SparseArray<LayerSettingsFragment>()
| protected

Zde jsou cachované fragmenty pro nastavení vrstev.

Definition at line 76 of file LayersPaneFragment.java.

PDFeedback mhr.app.fragments.layers.LayersPaneFragment.hideProgressBarFeedback
| protected

Definition at line 75 of file LayersPaneFragment.java.

LayoutInflater mhr.app.fragments.layers.LayersPaneFragment.inflater
| protected

Definition at line 72 of file LayersPaneFragment.java.

ImagePresentationView mhr.app.fragments.layers.LayersPaneFragment.layers
| protected

Definition at line 70 of file LayersPaneFragment.java.

ViewGroup mhr.app.fragments.layers.LayersPaneFragment.layersToolbarContent
| protected

Definition at line 71 of file LayersPaneFragment.java.

APDImagePresentation mhr.app.fragments.layers.LayersPaneFragment.presentation
| protected

Definition at line 74 of file LayersPaneFragment.java.

View mhr.app.fragments.layers.LayersPaneFragment.root
| protected

Definition at line 69 of file LayersPaneFragment.java.

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

- /home/xxx/eclipse_workspaces/app/app/src/mhr/app/fragments/layers/LayersPaneFragment.java