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.toolbox.transforms.ResizePopUpFragment Class Reference
Inheritance diagram for mhr.app.fragments.toolbox.transforms.ResizePopUpFragment:

## Public Member Functions
void | onClick (View v)
void | onAttach (Activity activity)
View | onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void | onResume ()
void | onPause ()
void | onValueChanged (LabelledSeekBar sb, float value, boolean fromUser)
void | onValueChangeStart (LabelledSeekBar sb)
void | onValueChangeStop (LabelledSeekBar sb)

## Protected Member Functions
View | initView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
| Provede inicializaci view.

## Protected Attributes
View | root
AppMainActivity | activity
boolean | firstCreated = true
int | origWidth
int | origHeight
double | origRatio
LabelledSeekBar | nWidth
LabelledSeekBar | nHeight
LabelledSeekBar | forceLSB
ToggleButton | keepRatioTBtn
RadioGroup | interpType

## Detailed Description

Definition at line 21 of file ResizePopUpFragment.java.

## Member Function Documentation

View mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.initView | ( | LayoutInflater | inflater,
|  | ViewGroup | container,
|  | Bundle | savedInstanceState
| ) |  |
| inlineprotected

Provede inicializaci view.

Parameters

  inflater |
  container |
  savedInstanceState |

Returns

Definition at line 54 of file ResizePopUpFragment.java.

{
root = inflater.inflate(R.layout.fragment_resize_tool_settings, container, false);
nWidth = (LabelledSeekBar) root.findViewById(R.id.WidthValueLSB);
nWidth.setLabelledSBChangeListener(this);
nHeight = (LabelledSeekBar) root.findViewById(R.id.HeightValueLSB);
nHeight.setLabelledSBChangeListener(this);
forceLSB = (LabelledSeekBar) root.findViewById(R.id.ForceValueLSB);
keepRatioTBtn = (ToggleButton) root.findViewById(R.id.FixedRatioTBtn);
keepRatioTBtn.setOnClickListener(this);
interpType = (RadioGroup) root.findViewById(R.id.InterpolationTypeRG);
root.findViewById(R.id.ResizeImageBtn).setOnClickListener(this);
root.findViewById(R.id.PreviewResizeBtn).setOnClickListener(this);
root.findViewById(R.id.CancelBtn).setOnClickListener(this);
firstCreated = false;
return root;
}

void mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.onAttach | ( | Activity | activity | ) |
| inline

Definition at line 124 of file ResizePopUpFragment.java.

{
super.onAttach(activity);
/*
* called once the fragment is associated with its activity.
*/
this.activity = (AppMainActivity) activity;
}

void mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.onClick | ( | View | v | ) |
| inline

Definition at line 85 of file ResizePopUpFragment.java.

{
int id = v.getId();
if (id == R.id.FixedRatioTBtn) {
if (keepRatioTBtn.isChecked()) {
nHeight.setProgress((float)(nWidth.getProgress() * origRatio));
}
return;
}
InterpolatorType iType = null;
switch (interpType.getCheckedRadioButtonId()) {
case R.id.NearestNeighbourR:
iType = InterpolatorType.NEAREST_NEIGHBOUR;
break;
case R.id.BilinearR:
iType = InterpolatorType.LINEAR_INTERPOLATOR;
break;
case R.id.BicubicR:
iType = InterpolatorType.CUBIC_INTERPOLATOR;
break;
}
switch (id) {
case R.id.ResizeImageBtn:
activity.addCommand(new ResizeImageCommand((int) nWidth.getProgress(), (int) nHeight.getProgress(), iType, forceLSB.getProgress(), ResizeAction.COMMIT));
activity.dismissDialog();
break;
case R.id.PreviewResizeBtn:
activity.addCommand(new ResizeImageCommand((int) nWidth.getProgress(), (int) nHeight.getProgress(), iType, forceLSB.getProgress(), ResizeAction.PREVIEW));
break;
case R.id.CancelBtn:
activity.dismissDialog();
break;
}
}

View mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.onCreateView | ( | LayoutInflater | inflater,
|  | ViewGroup | container,
|  | Bundle | savedInstanceState
| ) |  |
| inline

Definition at line 144 of file ResizePopUpFragment.java.

{
/*
* 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.toolbox.transforms.ResizePopUpFragment.onPause | ( |  | ) |
| inline

Definition at line 202 of file ResizePopUpFragment.java.

{
super.onPause();
/*
* fragment is no longer interacting with the user either because its activity is being paused or a fragment operation is modifying it in the activity.
*
* The system calls this method as the first indication that the user is leaving the fragment (though it does not always mean the fragment is being destroyed).
* This is usually where you should commit any changes that should be persisted beyond the current user session (because the user might not come back).
*/
activity.addCommand(new ResizeImageCommand(0, 0, null, 1, ResizeAction.CANCEL));
}

void mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.onResume | ( |  | ) |
| inline

Definition at line 186 of file ResizePopUpFragment.java.

{
super.onResume();
/*
* makes the fragment interacting with the user (based on its containing activity being resumed).
*/
activity.addCommand(new ResizeImageCommand(0, 0, null, 1, ResizeAction.INIT));
origWidth = activity.getAppCore().getImg().getWidth();
origHeight = activity.getAppCore().getImg().getHeight();
origRatio = origHeight / (double) origWidth;
nWidth.setProgress(origWidth);
nHeight.setProgress(origHeight);
}

void mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.onValueChanged | ( | LabelledSeekBar | sb,
|  | float | value,
|  | boolean | fromUser
| ) |  |
| inline

Implements mhr.appandroid.views.LabelledSeekBar.LabelledSBChangeListener.

Definition at line 214 of file ResizePopUpFragment.java.

{
}

void mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.onValueChangeStart | ( | LabelledSeekBar | sb | ) |
| inline

Implements mhr.appandroid.views.LabelledSeekBar.LabelledSBChangeListener.

Definition at line 220 of file ResizePopUpFragment.java.

{
}

void mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.onValueChangeStop | ( | LabelledSeekBar | sb | ) |
| inline

Implements mhr.appandroid.views.LabelledSeekBar.LabelledSBChangeListener.

Definition at line 225 of file ResizePopUpFragment.java.

{
if (keepRatioTBtn.isChecked()) {
if (sb == nWidth) {
nHeight.setProgress((float)(nWidth.getProgress() * origRatio));
} else if ( sb == nHeight) {
nWidth.setProgress((float)(nHeight.getProgress() / origRatio));
}
}
}

## Member Data Documentation

AppMainActivity mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.activity
| protected

Definition at line 30 of file ResizePopUpFragment.java.

boolean mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.firstCreated = true
| protected

Definition at line 31 of file ResizePopUpFragment.java.

LabelledSeekBar mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.forceLSB
| protected

Definition at line 39 of file ResizePopUpFragment.java.

RadioGroup mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.interpType
| protected

Definition at line 41 of file ResizePopUpFragment.java.

ToggleButton mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.keepRatioTBtn
| protected

Definition at line 40 of file ResizePopUpFragment.java.

LabelledSeekBar mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.nHeight
| protected

Definition at line 38 of file ResizePopUpFragment.java.

LabelledSeekBar mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.nWidth
| protected

Definition at line 37 of file ResizePopUpFragment.java.

int mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.origHeight
| protected

Definition at line 34 of file ResizePopUpFragment.java.

double mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.origRatio
| protected

Definition at line 35 of file ResizePopUpFragment.java.

int mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.origWidth
| protected

Definition at line 33 of file ResizePopUpFragment.java.

View mhr.app.fragments.toolbox.transforms.ResizePopUpFragment.root
| protected

Definition at line 29 of file ResizePopUpFragment.java.

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

- /home/xxx/eclipse_workspaces/app/app/src/mhr/app/fragments/toolbox/transforms/ResizePopUpFragment.java