1 package mhr.app.fragments.layers;
3 import java.util.HashMap;
5 import mhr.app.AppMainActivity;
7 import mhr.app.fragments.layers.filter.DifferenceOfGaussianSharpenLayerSettingsFragment;
8 import mhr.app.fragments.layers.filter.GaussianBlurLayerSettingsFragment;
9 import mhr.app.fragments.layers.filter.GaussianSharpenLayerSettingsFragment;
10 import mhr.app.fragments.layers.filter.LaplaceSharpenLayerSettingsFragment;
11 import mhr.app.fragments.layers.filter.LaplacianOfGaussianSharpenLayerSettingsFragment;
12 import mhr.app.fragments.layers.lut.BrightnessLayerSettingsFragment;
13 import mhr.app.fragments.layers.lut.ContrastLayerSettingsFragment;
14 import mhr.app.fragments.layers.lut.CurvesLayerSettingsFragment;
15 import mhr.app.fragments.layers.lut.GammaLayerSettingsFragment;
16 import mhr.appandroid.adapters.APDImagePresentation;
17 import mhr.appandroid.adapters.APDImagePresentation.OnImagePresentationChangedListener;
18 import mhr.appandroid.feedback.APDFeedback;
19 import mhr.appandroid.views.imagepresentationview.ImagePresentationView;
20 import mhr.appandroid.views.imagepresentationview.ImagePresentationView.OnImagePresentationEventListener;
21 import mhr.appandroid.views.imagepresentationview.ImagePresentationEvent;
22 import mhr.appcore.commands.AppCommand;
23 import mhr.appcore.commands.imagecommands.CreateLayerCommand;
24 import mhr.appcore.commands.imagecommands.DeleteLayerCommand;
25 import mhr.appcore.commands.imagecommands.DuplicateLayerCommand;
26 import mhr.appcore.commands.imagecommands.MergeAllCommand;
27 import mhr.appcore.commands.imagecommands.MoveLayerCommand;
28 import mhr.appcore.commands.imagecommands.SetImageSelectedStateCommand;
29 import mhr.appcore.commands.imagecommands.SetLayerMaskActiveCommand;
30 import mhr.appcore.commands.imagecommands.SetLayerOpacityCommand;
31 import mhr.appcore.commands.imagecommands.SetLayerVisibilityCommand;
32 import mhr.appcore.commands.imagecommands.SetMasterMaskActiveCommand;
33 import mhr.appcore.commands.imagecommands.UpdateLayerFromPresentationCommand;
34 import mhr.appcore.commands.imagecommands.rasterdatacommands.AddRasterDataCommand;
35 import mhr.appcore.commands.imagecommands.rasterdatacommands.BlendRasterDataCommand;
36 import mhr.appcore.commands.imagecommands.rasterdatacommands.ClearRasterDataCommand;
37 import mhr.appcore.commands.imagecommands.rasterdatacommands.CopyRasterDataCommand;
38 import mhr.appcore.commands.imagecommands.rasterdatacommands.FillRasterDataCommand;
39 import mhr.appcore.commands.imagecommands.rasterdatacommands.InvertRasterDataCommand;
40 import mhr.appcore.commands.imagecommands.rasterdatacommands.PasteRasterDataCommand;
41 import mhr.appcore.commands.imagecommands.rasterdatacommands.RemoveRasterDataCommand;
42 import mhr.appcore.image.ImageSelectedState;
43 import mhr.appcore.image.layers.LayerPDInfo;
44 import mhr.appcore.image.layers.LayerType;
45 import mhr.appcore.interfaces.PDFeedback;
46 import android.app.Activity;
47 import android.app.Fragment;
48 import android.app.FragmentTransaction;
49 import android.graphics.Rect;
50 import android.os.Bundle;
51 import android.util.SparseArray;
52 import android.view.LayoutInflater;
53 import android.view.View;
54 import android.view.View.OnClickListener;
55 import android.view.ViewGroup;
56 import android.widget.Toast;
76 protected SparseArray<LayerSettingsFragment>
fragments =
new SparseArray<LayerSettingsFragment>();
92 protected View
initView(LayoutInflater
inflater, ViewGroup container, Bundle savedInstanceState) {
93 root = inflater.inflate(
R.layout.fragment_layers_pane, container,
false);
97 root.findViewById(
R.id.LayersToolbarBorder).setOnClickListener(
this);
98 root.findViewById(
R.id.LayersCaptionTV).setOnClickListener(
this);
204 FragmentTransaction ft = getFragmentManager().beginTransaction();
205 ft.replace(
R.id.LayerSettingPlaceholder, f);
228 case R.id.LayersToolbarBorder:
231 case R.id.LayersCaptionTV:
255 case LAYER_MASK_SELECTED:
261 case MASTER_MASK_SELECTED:
268 case LAYER_VISIBILITY_CHANGED:
274 case LAYER_MASK_ACTIVE_CHANGED:
280 case MASTER_MASK_APPLIED_CHANGED:
285 case LAYER_OPACITY_CHANGED:
304 case LAYER_DUPLICATED:
319 case LAYER_COPY_BITMAP:
323 case LAYER_MASK_COPY_BITMAP:
327 case MASTER_MASK_COPY_BITMAP:
332 case LAYER_PASTE_BITMAP:
336 case LAYER_MASK_PASTE_BITMAP:
340 case MASTER_MASK_PASTE_BITMAP:
345 case LAYER_CLEAR_BITMAP:
349 case LAYER_MASK_CLEAR_BITMAP:
353 case MASTER_MASK_CLEAR_BITMAP:
358 case LAYER_MASK_FILL_BITMAP:
362 case MASTER_MASK_FILL_BITMAP:
367 case LAYER_MASK_INVERT_BITMAP:
371 case MASTER_MASK_INVERT_BITMAP:
376 case LAYER_ADD_BITMAP:
380 case LAYER_MASK_ADD_BITMAP:
384 case MASTER_MASK_ADD_BITMAP:
389 case LAYER_REMOVE_BITMAP:
393 case LAYER_MASK_REMOVE_BITMAP:
397 case MASTER_MASK_REMOVE_BITMAP:
402 case LAYER_BLEND_BITMAP:
407 case IMAGE_MERGE_LAYERS:
424 super.onAttach(activity);
463 return initView(inflater, container, savedInstanceState);