gitsvn преди 15 години
родител
ревизия
c191d0be5b
променени са 100 файла, в които са добавени 59450 реда и са изтрити 0 реда
  1. 13850
    0
      .metadata/.bak_0.log
  2. 12876
    0
      .metadata/.bak_1.log
  3. 12926
    0
      .metadata/.bak_2.log
  4. 0
    0
      .metadata/.lock
  5. 7622
    0
      .metadata/.log
  6. Двоични данни
      .metadata/.mylyn/.tasks.xml.zip
  7. Двоични данни
      .metadata/.mylyn/repositories.xml.zip
  8. Двоични данни
      .metadata/.mylyn/tasks.xml.zip
  9. Двоични данни
      .metadata/.plugins/com.swtdesigner/PropertyTracking.data
  10. 25
    0
      .metadata/.plugins/org.eclipse.actf.model.flash.proxy/proxy.pac
  11. 243
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/0/204afc4f174b001019f1c5d8b799da37
  12. 51
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/12/20ef687ac64b001014c0b77f85c62fe3
  13. 90
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/12/20f5fadd244c00101d0f80b0b7ec80cc
  14. 59
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/15/10908b3adf4b001014c0b77f85c62fe3
  15. 199
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/16/105a26800d4b001019f1c5d8b799da37
  16. 242
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/17/3039d479164b001019f1c5d8b799da37
  17. 244
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/17/40941a59174b001019f1c5d8b799da37
  18. 83
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/18/f0771a3fe84b001014e4d4fb24de02af
  19. 177
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/1a/409b169e0b4b001019f1c5d8b799da37
  20. 198
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/1a/a0e6339c0d4b001019f1c5d8b799da37
  21. 56
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/1a/c05feea5c84b001014c0b77f85c62fe3
  22. 43
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/1b/10d8c559ca4b001014c0b77f85c62fe3
  23. 83
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/1b/900fa4fce14b001014c0b77f85c62fe3
  24. 315
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/1c/c077e3c40b4b001019f1c5d8b799da37
  25. 83
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/1c/f04d027de24b001014c0b77f85c62fe3
  26. 312
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/1d/001bf40b0d4b001019f1c5d8b799da37
  27. 66
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/1d/00fac612c74b001014c0b77f85c62fe3
  28. 242
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/1d/4054a33d174b001019f1c5d8b799da37
  29. 243
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/1d/50a8eb4f174b001019f1c5d8b799da37
  30. 155
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/1e/e0fa0d20f64b001014e4d4fb24de02af
  31. 66
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/1f/c0d7d259c74b001014c0b77f85c62fe3
  32. 315
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/2/707102c50b4b001019f1c5d8b799da37
  33. 20
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/2/e068e25b59f2001f1304a5e85d67cce9
  34. 190
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/20/501acf630d4b001019f1c5d8b799da37
  35. 189
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/22/f05cca580d4b001019f1c5d8b799da37
  36. 168
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/23/40304ce0f44a001019f1c5d8b799da37
  37. 74
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/23/f0437f0cd14b001014c0b77f85c62fe3
  38. 242
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/24/70eae580164b001019f1c5d8b799da37
  39. 78
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/24/80bb78edf84b001014e4d4fb24de02af
  40. 22
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/25/f0e9c563ba4b001014c0b77f85c62fe3
  41. 109
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/26/90a63fc79ded001f164fc7c9580306b8
  42. 74
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/27/c0ec7b5fd14b001014c0b77f85c62fe3
  43. 106
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/2a/e060ae6c9ded001f164fc7c9580306b8
  44. 102
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/2b/90336782244c00101d0f80b0b7ec80cc
  45. 169
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/2e/30cabde8f54a001019f1c5d8b799da37
  46. 157
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/2e/4064e51ff64b001014e4d4fb24de02af
  47. 242
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/2f/30de9536164b001019f1c5d8b799da37
  48. 59
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/2f/50d1c04cdf4b001014c0b77f85c62fe3
  49. 247
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/2f/50de4b7d174b001019f1c5d8b799da37
  50. 89
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/2f/901348aae14b001014c0b77f85c62fe3
  51. 147
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/3/00e5027df44b001014e4d4fb24de02af
  52. 51
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/3/10e77274c64b001014c0b77f85c62fe3
  53. 74
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/30/20d1d7fcde4b001014c0b77f85c62fe3
  54. 155
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/30/30e425acf54b001014e4d4fb24de02af
  55. 94
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/32/808984f1294c00101d5afee2c5ac3559
  56. 155
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/33/80bc1b0bf64b001014e4d4fb24de02af
  57. 68
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/33/90aed1b1ce4b001014c0b77f85c62fe3
  58. 41
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/34/706a1f8ecc4b001014c0b77f85c62fe3
  59. 240
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/34/e07182d3164b001019f1c5d8b799da37
  60. 43
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/36/f0eaf17ecc4b001014c0b77f85c62fe3
  61. 72
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/38/10402915df4b001014c0b77f85c62fe3
  62. 168
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/38/808821f0f44a001019f1c5d8b799da37
  63. 83
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/3a/60b7ec8ae84b001014e4d4fb24de02af
  64. 91
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/3c/300aedb0ea4b001014e4d4fb24de02af
  65. 153
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/3c/d0476191f44b001014e4d4fb24de02af
  66. 178
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/3d/5089e6280d4b001019f1c5d8b799da37
  67. 169
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/3d/c0ba09f0f44a001019f1c5d8b799da37
  68. 79
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/3f/503c4304f94b001014e4d4fb24de02af
  69. 63
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/3f/80b14383cf4b001014c0b77f85c62fe3
  70. 99
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/3f/905dcd51fc4b001014e4d4fb24de02af
  71. 102
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/3f/e0510c38244c00101d0f80b0b7ec80cc
  72. 240
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/4/2010bb1c164b001019f1c5d8b799da37
  73. 248
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/4/90cab58c174b001019f1c5d8b799da37
  74. 83
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/41/30dc6964e84b001014e4d4fb24de02af
  75. 136
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/42/70b2858cde4b001014c0b77f85c62fe3
  76. 175
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/45/2085182d0b4b001019f1c5d8b799da37
  77. 102
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/47/204447012a4c00101d5afee2c5ac3559
  78. 51
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/47/7016194aca4b001014c0b77f85c62fe3
  79. 82
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/47/9096bd13e94b001014e4d4fb24de02af
  80. 74
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/47/a0894573d14b001014c0b77f85c62fe3
  81. 247
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/47/c0ddf077174b001019f1c5d8b799da37
  82. 169
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/48/007cefeff44a001019f1c5d8b799da37
  83. 199
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/4a/e036179c0d4b001019f1c5d8b799da37
  84. 156
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/4c/406c380bf64b001014e4d4fb24de02af
  85. 105
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/4c/80df6a559ded001f164fc7c9580306b8
  86. 79
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/4d/2013e4f0ce4b001014c0b77f85c62fe3
  87. 82
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/4d/400dd315e24b001014c0b77f85c62fe3
  88. 43
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/4e/706d8efaca4b001014c0b77f85c62fe3
  89. 161
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/4e/e0bf825ef64b001014e4d4fb24de02af
  90. 152
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/4f/8012242af64b001014e4d4fb24de02af
  91. 82
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/50/00eccc8fcf4b001014c0b77f85c62fe3
  92. 247
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/51/f074747d174b001019f1c5d8b799da37
  93. 83
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/52/10e54343e24b001014c0b77f85c62fe3
  94. 240
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/52/50b3f680164b001019f1c5d8b799da37
  95. 52
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/53/1063b957c64b001014c0b77f85c62fe3
  96. 152
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/53/507dec3af64b001014e4d4fb24de02af
  97. 54
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/53/a0a054cdc94b001014c0b77f85c62fe3
  98. 241
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/54/60d1a01c164b001019f1c5d8b799da37
  99. 189
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/54/c051e2580d4b001019f1c5d8b799da37
  100. 0
    0
      .metadata/.plugins/org.eclipse.core.resources/.history/54/c0fbbae3f54a001019f1c5d8b799da37

+ 13850
- 0
.metadata/.bak_0.log
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 12876
- 0
.metadata/.bak_1.log
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 12926
- 0
.metadata/.bak_2.log
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 0
- 0
.metadata/.lock Целия файл


+ 7622
- 0
.metadata/.log
Файловите разлики са ограничени, защото са твърде много
Целия файл


Двоични данни
.metadata/.mylyn/.tasks.xml.zip Целия файл


Двоични данни
.metadata/.mylyn/repositories.xml.zip Целия файл


Двоични данни
.metadata/.mylyn/tasks.xml.zip Целия файл


Двоични данни
.metadata/.plugins/com.swtdesigner/PropertyTracking.data Целия файл


+ 25
- 0
.metadata/.plugins/org.eclipse.actf.model.flash.proxy/proxy.pac Целия файл

@@ -0,0 +1,25 @@
var NO_PROXY = "";
function FindProxyForURL(url, host) {
if( url.substring(0,5) == "http:" ) {
if( NO_PROXY.length > 0 && url.indexOf("?") == -1 ) {
var extPos = url.lastIndexOf(".");
if( extPos != -1 ) {
if( NO_PROXY.indexOf("|"+url.substring(extPos+1).toLowerCase()+"|") != -1 ) {
return "DIRECT";
}
}
}
return "PROXY localhost:2267; DIRECT";
}
if( url.substring(0,6) == "https:" ) {
return "DIRECT";
}
if( url.substring(0,4) == "ftp:" ) {
return "DIRECT";
}
if( url.substring(0,7) == "gopher:" ) {
return "DIRECT";
}
return "DIRECT";
}

+ 243
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/0/204afc4f174b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,243 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
private static DisplayMetrics metrics;
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure) {
super(context);
this.setOrientation(HORIZONTAL);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private static DisplayMetrics metrics;
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure);
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
int width = getMetrics(context).widthPixels;
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(Math.round(0.20833f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(Math.round(0.35417f * width), LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics(Context context) {
if (metrics == null) {
metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
}
return metrics;
}
}

+ 51
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/12/20ef687ac64b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>

<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/ug_Text" android:ellipsize="none" android:text="@string/AppVersion">
</TextView>
</LinearLayout>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_fs"
android:id="@+id/btn_ugClose"
android:text="Close"
android:textColor="@color/white"
android:layout_gravity="center_horizontal">
</Button>


</LinearLayout>

+ 90
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/12/20f5fadd244c00101d0f80b0b7ec80cc Целия файл

@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>

<ScrollView
android:id="@+id/ug_ScrollView"
android:layout_width="wrap_content"
android:addStatesFromChildren="true"
android:layout_height="250dp">
<LinearLayout
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ug_hdr_GenPourpose"
android:textColor="@color/black"
android:textStyle="bold"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:text="@string/header_GeneralPurpose"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ug_txt_GenPourpose"
android:textColor="@color/black"
android:text="@string/text_GeneralPurpose"
android:paddingRight="3dp" android:textSize="12dp">
</TextView>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ug_hdr_HowTo"
android:textColor="@color/black"
android:textStyle="bold"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:text="@string/header_HowTo"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ug_txt_HowTo"
android:textColor="@color/black"
android:text="@string/text_HowTo" android:lineSpacingExtra="1dp" android:textSize="12dp"></TextView>

</LinearLayout>
</ScrollView>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_fs"
android:id="@+id/btn_ugClose"
android:textColor="@color/white"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp" android:text="@string/BtnClose">
</Button>


</LinearLayout>

+ 59
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/15/10908b3adf4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:padding="10dp"
android:layout_height="fill_parent"
android:background="@drawable/bg_about"
android:orientation="vertical"
android:id="@+id/layout_AboutRoot">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_aboutVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/about_imageAppIcon" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/layout_aboutVersionText"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/about_TextDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/about_TextVersion"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<TextView
android:text="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/about_TextAutor"
android:textColor="@color/black"
android:paddingBottom="20dip"
android:paddingTop="20dip"></TextView>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_fs"
android:id="@+id/btn_AboutClose"
android:text="@+id/BtnClose"
android:textColor="@color/white"
android:layout_gravity="center_horizontal"></Button>

</LinearLayout>

+ 199
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/16/105a26800d4b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,199 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import android.util.DisplayMetrics;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
final int twentyPercentGray = Math.round(255f * 0.8f);
int deltaRGB = twentyPercentGray;
int iSize;
int iSize_r;
int iStart;
DisplayMetrics metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
switch (metrics.densityDpi) {
case DisplayMetrics.DENSITY_LOW:
iSize = 18;
iSize_r = 17;
iStart = 1;
break;
case DisplayMetrics.DENSITY_MEDIUM:
iSize = 24;
iSize_r = 22;
iStart = 2;
break;
default:
iSize = 36;
iSize_r = 33;
iStart = 2;
break;
}
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
// The background
mIconBG = Bitmap.createBitmap(36, 36, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(2, 2, 33, 33, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 242
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/17/3039d479164b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,242 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
private static DisplayMetrics metrics;
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure, int nbrExposures) {
super(context);
this.setOrientation(HORIZONTAL);
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private static DisplayMetrics metrics;
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure, this.exposureList.size());
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics() {
if (metrics == null) {
metrics = new DisplayMetrics();
}
return metrics;
}
}

+ 244
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/17/40941a59174b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,244 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
private static DisplayMetrics metrics;
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure) {
super(context);
this.setOrientation(HORIZONTAL);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private static DisplayMetrics metrics;
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure);
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
int width = getMetrics(context).widthPixels;
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(Math.round(0.20833f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(Math.round(0.35417f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width), LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width), LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics(Context context) {
if (metrics == null) {
metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
}
return metrics;
}
}

+ 83
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/18/f0771a3fe84b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder gleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="BtnClose">Schliessen</string>
<string
name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string>
<string
name="text_GeneralPurpose">
Beim Erstellen einer Belichtungsreihe für ein späteres HDR-Bild, stellt sich oftmals das Problem,
dass der Kontrastumfang zu gross ist um von der typischen \"+2LW/0LW/-2LW\"-Vorgehensweise abgedeckt zu werden.\n
Hier kommt \"EasyBracketing\" zum Zug.\n
Ausgehend von gemessenen Werten für den hellsten Punkt resp. den dunkelsten Punkt
werden über definierbare Parameter alle notwendigen Belichtungen einer Belichtungsreihe berechnet. Diese können dann
an der Kamera sukzessive eingestellt und die Aufnahme ausgelöst werden.
</string>
<string
name="header_HowTo">2. Vorgehensweise</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 177
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/1a/409b169e0b4b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,177 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import android.util.DisplayMetrics;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
final int twentyPercentGray = Math.round(255f * 0.8f);
int deltaRGB = twentyPercentGray;
int iSize;
int iSize_r;
int iStart;
DisplayMetrics metrics = new DisplayMetrics();
((Activity) context).getApplicationContext().getDefaultDisplay().getMetrics(metrics);
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
// The background
mIconBG = Bitmap.createBitmap(36, 36, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(2, 2, 33, 33, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 198
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/1a/a0e6339c0d4b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,198 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import android.util.DisplayMetrics;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
final int twentyPercentGray = Math.round(255f * 0.8f);
int deltaRGB = twentyPercentGray;
int iSize;
int iSize_r;
int iStart;
DisplayMetrics metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
switch (metrics.densityDpi) {
case DisplayMetrics.DENSITY_LOW:
iSize = 18;
iSize_r = 17;
iStart = 1;
break;
case DisplayMetrics.DENSITY_MEDIUM:
iSize = 24;
iSize_r = 22;
iStart = 2;
break;
default:
iSize = 36;
iSize_r = 33;
iStart = 2;
break;
}
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
// The background
mIconBG = Bitmap.createBitmap(iSize, iSize, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(iStart, iStart, iSize_r, iSize_r, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 56
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/1a/c05feea5c84b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" android:scrollbars="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ug_Text"
android:ellipsize="none" android:text="@string/userGuidePourpose" android:textColor="@color/black">
</TextView>
</LinearLayout>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_fs"
android:id="@+id/btn_ugClose"
android:text="Close"
android:textColor="@color/white"
android:layout_gravity="center_horizontal">
</Button>


</LinearLayout>

+ 43
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/1b/10d8c559ca4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>


<ScrollView android:layout_height="fill_parent" android:layout_width="fill_parent" android:fillViewport="true" android:id="@+id/ug_ScrollView"><LinearLayout android:orientation="vertical" android:layout_height="fill_parent" android:layout_width="fill_parent">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/ug_Text" android:text="@string/userGuidePourpose" android:textColor="@color/black">
</TextView></LinearLayout></ScrollView><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/btn_fs" android:id="@+id/btn_ugClose" android:text="Close" android:textColor="@color/white" android:layout_gravity="center_horizontal">
</Button>


</LinearLayout>

+ 83
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/1b/900fa4fce14b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder gleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="BtnClose">Schliessen</string>
<string
name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string>
<string
name="text_GeneralPurpose">
Beim Erstellen einer Belichtungsreihe für ein späteres HDR-Bild, stellt sich oftmals das Problem,
dass der Kontrastumfang zu gross ist um von der typischen "+2LW/0LW/-2LW"-Vorgehensweise abgedeckt zu werden.
Hier kommt EasyBracketing zum Zug. Ausgehend von gemessenen Werten für den hellsten Punkt resp. den dunkelsten Punkt
werden über definierbare Parameter alle notwendigen Belichtungen einer Belichtreihe berechnet. Diese können dann
an der Kamera sukzessive eingstellt und die Aufnahme ausgelöst werden.
</string>
<string
name="header_HowTo">2. Vorgehensweise</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 315
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/1c/c077e3c40b4b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,315 @@
package ch.spherIC;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemSelectedListener;
import ch.spherIC.components.ApertureSpinner;
import ch.spherIC.components.ShutterSpeedSpinner;
import ch.spherIC.components.XSpinner;
import ch.spherIC.resultlist.Exposure;
import ch.spherIC.resultlist.ExposureAdapter;
import ch.spherIC.resultlist.ExposureFactory;
import ch.spherIC.settings.SettingsDlg;
/**
* Main class EasyBracketing
*/
public class EasyBracketMain extends Activity {
public static final int ABOUT_DLG = 0;
public static final int SETTINGS_DLG = 1;
public static final int USERGUIDE_DLG = 2;
private static String DEF_SHUTTER_SPEED = "1/125";
private static String DEF_APERTURE = "f/8";
private static String DEF_EVSTEP = "2.0";
private ShutterSpeedSpinner spnDPShutterSpeed;
private ApertureSpinner spnDPAperture;
private ShutterSpeedSpinner spnBPShutterSpeed;
private ApertureSpinner spnBPAperture;
private TextView txtDPEVValue;
private TextView txtBPEVValue;
private TextView txtCalcPDeltaEV;
private ApertureSpinner spnCalcPAperture;
private XSpinner spnCalcPEVStep;
private Button resetBtn;
private Button calculateBtn;
private ListView resultList;
private LinearLayout resultsHeader;
private double bpCorrection;
private double dpCorrection;
private boolean fixBP;
private double dpEV;
private double bpEV;
public static final DecimalFormat DF = new DecimalFormat("0.##");
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
initComponents();
setDefaults();
loadSettings();
}
/**
* Loads and stores the settings
*/
public void loadSettings() {
// Load settings
SharedPreferences settings = getSharedPreferences(SettingsDlg.PREFS_NAME, Context.MODE_PRIVATE);
this.fixBP = settings.getBoolean("fixBrightPoint", true);
this.bpCorrection = settings.getFloat("brightPointCorrection", 0f);
this.dpCorrection = settings.getFloat("darkPointCorrection", 0f);
}
/**
* {@inheritDoc}
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.mainmenu, menu);
return true;
}
/**
* @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)
*/
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.itemAbout:
showDialog(ABOUT_DLG);
return true;
case R.id.itemSettings:
showDialog(SETTINGS_DLG);
return true;
case R.id.itemUserGuide:
showDialog(USERGUIDE_DLG);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
/**
* Initialization method
*/
private void initComponents() {
// initialize dropdowns
OnItemSelectedListener evRangeItemSelListener = new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
EasyBracketMain.this.dpEV = EVFormula.calcEV(EasyBracketMain.this.spnDPAperture.getSelectedAperture(),
EasyBracketMain.this.spnDPShutterSpeed
.getSelectedShutterSpeed());
EasyBracketMain.this.bpEV = EVFormula.calcEV(EasyBracketMain.this.spnBPAperture.getSelectedAperture(),
EasyBracketMain.this.spnBPShutterSpeed
.getSelectedShutterSpeed());
EasyBracketMain.this.txtDPEVValue.setText(EasyBracketMain.DF.format(EasyBracketMain.this.dpEV));
EasyBracketMain.this.txtBPEVValue.setText(EasyBracketMain.DF.format(EasyBracketMain.this.bpEV));
EasyBracketMain.this.txtCalcPDeltaEV.setText(EasyBracketMain.DF.format((EasyBracketMain.this.bpEV
+ EasyBracketMain.this.bpCorrection)
- (EasyBracketMain.this.dpEV
- EasyBracketMain.this.dpCorrection)));
EasyBracketMain.this.calculateBtn.setEnabled(EasyBracketMain.this.bpEV > EasyBracketMain.this.dpEV);
EasyBracketMain.this.resultsHeader.setVisibility(View.INVISIBLE);
findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.INVISIBLE);
EasyBracketMain.this.resultList.setAdapter(null);
if (EasyBracketMain.this.bpEV < EasyBracketMain.this.dpEV) {
Toast toast = Toast.makeText(EasyBracketMain.this, R.string.toastWarningDP_BP, Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL, 0, 0);
toast.show();
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
};
OnItemSelectedListener calcPItemSelListener = new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
toggleResultsList(false);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
};
this.spnDPShutterSpeed = (ShutterSpeedSpinner) findViewById(R.id.Spinner_DP_Shutter);
this.spnDPAperture = (ApertureSpinner) findViewById(R.id.Spinner_DP_Aperture);
this.spnBPShutterSpeed = (ShutterSpeedSpinner) findViewById(R.id.Spinner_BP_Shutter);
this.spnBPAperture = (ApertureSpinner) findViewById(R.id.Spinner_BP_Aperture);
this.spnCalcPAperture = (ApertureSpinner) findViewById(R.id.Spinner_calcP_Aperture);
this.spnCalcPEVStep = (XSpinner) findViewById(R.id.Spinner_calcP_EVStep);
this.txtDPEVValue = (TextView) findViewById(R.id.Text_EVVal_DP);
this.txtBPEVValue = (TextView) findViewById(R.id.Text_EVVal_BP);
this.txtCalcPDeltaEV = (TextView) findViewById(R.id.label_deltaEV_Val);
this.resultsHeader = (LinearLayout) ExposureAdapter.getHeaderView(this,
(LinearLayout)
findViewById(R.id.LinearLayout_ResultsHeader));
this.resultsHeader.setVisibility(View.INVISIBLE);
findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.INVISIBLE);
this.resultList = (ListView) findViewById(R.id.ListView_ExpResults);
this.resultList.setAdapter(null);
this.resetBtn = (Button) findViewById(R.id.Btn_Reset);
this.calculateBtn = (Button) findViewById(R.id.Btn_Calculate);
this.calculateBtn.setEnabled(false);
this.spnDPShutterSpeed.setOnItemSelectedListener(evRangeItemSelListener);
this.spnDPAperture.setOnItemSelectedListener(evRangeItemSelListener);
this.spnBPShutterSpeed.setOnItemSelectedListener(evRangeItemSelListener);
this.spnBPAperture.setOnItemSelectedListener(evRangeItemSelListener);
this.resetBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
setDefaults();
toggleResultsList(false);
}
});
this.calculateBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
toggleResultsList(true);
calculateExposures();
}
});
this.spnCalcPAperture.setOnItemSelectedListener(calcPItemSelListener);
this.spnCalcPEVStep.setOnItemSelectedListener(calcPItemSelListener);
}
/**
* Clears the results list.
*/
private void toggleResultsList(boolean visible) {
if (visible) {
EasyBracketMain.this.resultsHeader.setVisibility(View.VISIBLE);
findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.VISIBLE);
} else {
EasyBracketMain.this.resultsHeader.setVisibility(View.INVISIBLE);
findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.INVISIBLE);
EasyBracketMain.this.resultList.setAdapter(null);
}
}
/**
* Sets the default values.
*/
public void setDefaults() {
this.spnDPShutterSpeed.setSelectionByVal(DEF_SHUTTER_SPEED);
this.spnDPAperture.setSelectionByVal(DEF_APERTURE);
this.spnBPShutterSpeed.setSelectionByVal(DEF_SHUTTER_SPEED);
this.spnBPAperture.setSelectionByVal(DEF_APERTURE);
this.spnCalcPAperture.setSelectionByVal(DEF_APERTURE);
this.spnCalcPEVStep.setSelectionByVal(DEF_EVSTEP);
this.txtDPEVValue.setText(DF.format(EVFormula.calcEV(this.spnDPAperture.getSelectedAperture(),
this.spnDPShutterSpeed.getSelectedShutterSpeed())));
this.txtBPEVValue.setText(DF.format(EVFormula.calcEV(this.spnBPAperture.getSelectedAperture(),
this.spnBPShutterSpeed.getSelectedShutterSpeed())));
this.txtCalcPDeltaEV.setText(DF.format(this.bpEV + this.bpCorrection - (this.dpEV - this.dpCorrection)));
}
/**
* Initiates the calculation of the exposure values according to the input parameters.
*/
private void calculateExposures() {
List<Exposure> exposureList;
double calcPrmAperture = this.spnCalcPAperture.getSelectedAperture();
double calcPrmEvStep = Double.valueOf(this.spnCalcPEVStep.getSelectedItem().toString());
List<Double> allowedShutters = getShutterSpeeds();
exposureList = ExposureFactory.calculateExposures(this, this.dpEV - this.dpCorrection, this.bpEV + this.bpCorrection,
calcPrmAperture, calcPrmEvStep, this.fixBP, allowedShutters);
this.resultList.setAdapter(new ExposureAdapter(this, exposureList));
DisplayMetrics metrics = new DisplayMetrics();
getApplicationContext().getDefaultDisplay().getMetrics(metrics);
}
/**
* Retrieves the list of all shutter speeds in drop down list as Double's.
*
* @return list of all shutter speeds in drop down list as Double's
*/
private List<Double> getShutterSpeeds() {
List<Double> shutterSpeeds = new ArrayList<Double>();
for (int i = 0; i < this.spnBPShutterSpeed.getCount(); i++) {
shutterSpeeds.add(this.spnBPShutterSpeed.getShutterSpeedAt(i));
}
return shutterSpeeds;
}
/**
* {@inheritDoc}
*/
@Override
protected Dialog onCreateDialog(int id) {
return DialogFactory.createDialog(id, this);
}
}

+ 83
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/1c/f04d027de24b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder gleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="BtnClose">Schliessen</string>
<string
name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string>
<string
name="text_GeneralPurpose">
Beim Erstellen einer Belichtungsreihe für ein späteres HDR-Bild, stellt sich oftmals das Problem,
dass der Kontrastumfang zu gross ist um von der typischen \"+2LW/0LW/-2LW\"-Vorgehensweise abgedeckt zu werden.\n
Hier kommt \"EasyBracketing\" zum Zug.\n\r
Ausgehend von gemessenen Werten für den hellsten Punkt resp. den dunkelsten Punkt
werden über definierbare Parameter alle notwendigen Belichtungen einer Belichtungsreihe berechnet. Diese können dann
an der Kamera sukzessive eingestellt und die Aufnahme ausgelöst werden.
</string>
<string
name="header_HowTo">2. Vorgehensweise</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 312
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/1d/001bf40b0d4b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,312 @@
package ch.spherIC;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemSelectedListener;
import ch.spherIC.components.ApertureSpinner;
import ch.spherIC.components.ShutterSpeedSpinner;
import ch.spherIC.components.XSpinner;
import ch.spherIC.resultlist.Exposure;
import ch.spherIC.resultlist.ExposureAdapter;
import ch.spherIC.resultlist.ExposureFactory;
import ch.spherIC.settings.SettingsDlg;
/**
* Main class EasyBracketing
*/
public class EasyBracketMain extends Activity {
public static final int ABOUT_DLG = 0;
public static final int SETTINGS_DLG = 1;
public static final int USERGUIDE_DLG = 2;
private static String DEF_SHUTTER_SPEED = "1/125";
private static String DEF_APERTURE = "f/8";
private static String DEF_EVSTEP = "2.0";
private ShutterSpeedSpinner spnDPShutterSpeed;
private ApertureSpinner spnDPAperture;
private ShutterSpeedSpinner spnBPShutterSpeed;
private ApertureSpinner spnBPAperture;
private TextView txtDPEVValue;
private TextView txtBPEVValue;
private TextView txtCalcPDeltaEV;
private ApertureSpinner spnCalcPAperture;
private XSpinner spnCalcPEVStep;
private Button resetBtn;
private Button calculateBtn;
private ListView resultList;
private LinearLayout resultsHeader;
private double bpCorrection;
private double dpCorrection;
private boolean fixBP;
private double dpEV;
private double bpEV;
public static final DecimalFormat DF = new DecimalFormat("0.##");
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
initComponents();
setDefaults();
loadSettings();
}
/**
* Loads and stores the settings
*/
public void loadSettings() {
// Load settings
SharedPreferences settings = getSharedPreferences(SettingsDlg.PREFS_NAME, Context.MODE_PRIVATE);
this.fixBP = settings.getBoolean("fixBrightPoint", true);
this.bpCorrection = settings.getFloat("brightPointCorrection", 0f);
this.dpCorrection = settings.getFloat("darkPointCorrection", 0f);
}
/**
* {@inheritDoc}
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.mainmenu, menu);
return true;
}
/**
* @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)
*/
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.itemAbout:
showDialog(ABOUT_DLG);
return true;
case R.id.itemSettings:
showDialog(SETTINGS_DLG);
return true;
case R.id.itemUserGuide:
showDialog(USERGUIDE_DLG);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
/**
* Initialization method
*/
private void initComponents() {
// initialize dropdowns
OnItemSelectedListener evRangeItemSelListener = new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
EasyBracketMain.this.dpEV = EVFormula.calcEV(EasyBracketMain.this.spnDPAperture.getSelectedAperture(),
EasyBracketMain.this.spnDPShutterSpeed
.getSelectedShutterSpeed());
EasyBracketMain.this.bpEV = EVFormula.calcEV(EasyBracketMain.this.spnBPAperture.getSelectedAperture(),
EasyBracketMain.this.spnBPShutterSpeed
.getSelectedShutterSpeed());
EasyBracketMain.this.txtDPEVValue.setText(EasyBracketMain.DF.format(EasyBracketMain.this.dpEV));
EasyBracketMain.this.txtBPEVValue.setText(EasyBracketMain.DF.format(EasyBracketMain.this.bpEV));
EasyBracketMain.this.txtCalcPDeltaEV.setText(EasyBracketMain.DF.format((EasyBracketMain.this.bpEV
+ EasyBracketMain.this.bpCorrection)
- (EasyBracketMain.this.dpEV
- EasyBracketMain.this.dpCorrection)));
EasyBracketMain.this.calculateBtn.setEnabled(EasyBracketMain.this.bpEV > EasyBracketMain.this.dpEV);
EasyBracketMain.this.resultsHeader.setVisibility(View.INVISIBLE);
findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.INVISIBLE);
EasyBracketMain.this.resultList.setAdapter(null);
if (EasyBracketMain.this.bpEV < EasyBracketMain.this.dpEV) {
Toast toast = Toast.makeText(EasyBracketMain.this, R.string.toastWarningDP_BP, Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL, 0, 0);
toast.show();
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
};
OnItemSelectedListener calcPItemSelListener = new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
toggleResultsList(false);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
};
this.spnDPShutterSpeed = (ShutterSpeedSpinner) findViewById(R.id.Spinner_DP_Shutter);
this.spnDPAperture = (ApertureSpinner) findViewById(R.id.Spinner_DP_Aperture);
this.spnBPShutterSpeed = (ShutterSpeedSpinner) findViewById(R.id.Spinner_BP_Shutter);
this.spnBPAperture = (ApertureSpinner) findViewById(R.id.Spinner_BP_Aperture);
this.spnCalcPAperture = (ApertureSpinner) findViewById(R.id.Spinner_calcP_Aperture);
this.spnCalcPEVStep = (XSpinner) findViewById(R.id.Spinner_calcP_EVStep);
this.txtDPEVValue = (TextView) findViewById(R.id.Text_EVVal_DP);
this.txtBPEVValue = (TextView) findViewById(R.id.Text_EVVal_BP);
this.txtCalcPDeltaEV = (TextView) findViewById(R.id.label_deltaEV_Val);
this.resultsHeader = (LinearLayout) ExposureAdapter.getHeaderView(this,
(LinearLayout)
findViewById(R.id.LinearLayout_ResultsHeader));
this.resultsHeader.setVisibility(View.INVISIBLE);
findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.INVISIBLE);
this.resultList = (ListView) findViewById(R.id.ListView_ExpResults);
this.resultList.setAdapter(null);
this.resetBtn = (Button) findViewById(R.id.Btn_Reset);
this.calculateBtn = (Button) findViewById(R.id.Btn_Calculate);
this.calculateBtn.setEnabled(false);
this.spnDPShutterSpeed.setOnItemSelectedListener(evRangeItemSelListener);
this.spnDPAperture.setOnItemSelectedListener(evRangeItemSelListener);
this.spnBPShutterSpeed.setOnItemSelectedListener(evRangeItemSelListener);
this.spnBPAperture.setOnItemSelectedListener(evRangeItemSelListener);
this.resetBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
setDefaults();
toggleResultsList(false);
}
});
this.calculateBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
toggleResultsList(true);
calculateExposures();
}
});
this.spnCalcPAperture.setOnItemSelectedListener(calcPItemSelListener);
this.spnCalcPEVStep.setOnItemSelectedListener(calcPItemSelListener);
}
/**
* Clears the results list.
*/
private void toggleResultsList(boolean visible) {
if (visible) {
EasyBracketMain.this.resultsHeader.setVisibility(View.VISIBLE);
findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.VISIBLE);
} else {
EasyBracketMain.this.resultsHeader.setVisibility(View.INVISIBLE);
findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.INVISIBLE);
EasyBracketMain.this.resultList.setAdapter(null);
}
}
/**
* Sets the default values.
*/
public void setDefaults() {
this.spnDPShutterSpeed.setSelectionByVal(DEF_SHUTTER_SPEED);
this.spnDPAperture.setSelectionByVal(DEF_APERTURE);
this.spnBPShutterSpeed.setSelectionByVal(DEF_SHUTTER_SPEED);
this.spnBPAperture.setSelectionByVal(DEF_APERTURE);
this.spnCalcPAperture.setSelectionByVal(DEF_APERTURE);
this.spnCalcPEVStep.setSelectionByVal(DEF_EVSTEP);
this.txtDPEVValue.setText(DF.format(EVFormula.calcEV(this.spnDPAperture.getSelectedAperture(),
this.spnDPShutterSpeed.getSelectedShutterSpeed())));
this.txtBPEVValue.setText(DF.format(EVFormula.calcEV(this.spnBPAperture.getSelectedAperture(),
this.spnBPShutterSpeed.getSelectedShutterSpeed())));
this.txtCalcPDeltaEV.setText(DF.format(this.bpEV + this.bpCorrection - (this.dpEV - this.dpCorrection)));
}
/**
* Initiates the calculation of the exposure values according to the input parameters.
*/
private void calculateExposures() {
List<Exposure> exposureList;
double calcPrmAperture = this.spnCalcPAperture.getSelectedAperture();
double calcPrmEvStep = Double.valueOf(this.spnCalcPEVStep.getSelectedItem().toString());
List<Double> allowedShutters = getShutterSpeeds();
exposureList = ExposureFactory.calculateExposures(this, this.dpEV - this.dpCorrection,
this.bpEV + this.bpCorrection, calcPrmAperture, calcPrmEvStep,
this.fixBP, allowedShutters);
this.resultList.setAdapter(new ExposureAdapter(this, exposureList));
}
/**
* Retrieves the list of all shutter speeds in drop down list as Double's.
*
* @return list of all shutter speeds in drop down list as Double's
*/
private List<Double> getShutterSpeeds() {
List<Double> shutterSpeeds = new ArrayList<Double>();
for (int i = 0; i < this.spnBPShutterSpeed.getCount(); i++) {
shutterSpeeds.add(this.spnBPShutterSpeed.getShutterSpeedAt(i));
}
return shutterSpeeds;
}
/**
* {@inheritDoc}
*/
@Override
protected Dialog onCreateDialog(int id) {
return DialogFactory.createDialog(id, this);
}
}

+ 66
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/1d/00fac612c74b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamic Range</string>
<string
name="shutter_speed">Shutter Speed</string>
<string
name="aperture">Aperture</string>
<string
name="ev">EV</string>
<string
name="dark_point">Dark Point Values</string>
<string
name="bright_point">Bright Point Values</string>
<string
name="calcParams">Calculation Parameters</string>
<string
name="delta_EV">Δ EV</string>
<string
name="expEVStep">EV Step</string>
<string
name="calculate">Calculate</string>
<string
name="reset">Reset</string>
<string
name="bracketingRes">Bracketing Exposures Values</string>
<string
name="expNbrLbl"># Exp.</string>
<string
name="toastWarningDP_BP">The delta between dark point EV and bright point EV is less or
equal to 0. Please correct the inputs.</string>
<string
name="menuUserGuide">User Guide</string>
<string
name="menuSettings">Settings...</string>
<string
name="menuAbout">About</string>
<string
name="about_Description">EasyBracketing allows you to easy calculate a serie of exposure
values according to initial dark and bright point values.</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Developed by spherIC (F. Smilari)\nMail to:
merlin868@hotmail.com\n\nTranslated by spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Gray Correction</string>
<string
name="Percent18CorrectionBP">Bright Pt. Value Correction (EV)</string>
<string
name="Percent18CorrectionDP">Dark Pt. Value Correction (EV)</string>
<string
name="FixRangePoint">Fixed EV Range Value</string>
<string
name="FixRangePointBP">Keep Bright Point Values fixed</string>
<string
name="FixRangePointDP">Keep Dark Point Value fixed</string>
<string
name="BtnSave">Save</string>
<string
name="BtnCancel">Cancel</string>
<string
name="userGuidePourpose">text alsdklsk lkds las laskd laskd laskd aksdl askd laksdlasklsakdlaskdlakdl alasdk laksdlaskd laskdlaskd lakdskkskdk las lskdlaskdls ldklas lsakdlakdlaskd alsdklaksd alksdlakd laskdlasdk.</string>
</resources>

+ 242
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/1d/4054a33d174b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,242 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
private static DisplayMetrics metrics;
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure) {
super(context);
this.setOrientation(HORIZONTAL);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private static DisplayMetrics metrics;
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure);
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
int width = getMetrics(context).widthPixels;
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(Math.round(0.20833f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics(Context context) {
if (metrics == null) {
metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
}
return metrics;
}
}

+ 243
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/1d/50a8eb4f174b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,243 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
private static DisplayMetrics metrics;
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure) {
super(context);
this.setOrientation(HORIZONTAL);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private static DisplayMetrics metrics;
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure);
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
int width = getMetrics(context).widthPixels;
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(Math.round(0.20833f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics(Context context) {
if (metrics == null) {
metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
}
return metrics;
}
}

+ 155
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/1e/e0fa0d20f64b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,155 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC;
import android.app.Activity;
import android.app.Dialog;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import ch.spherIC.settings.SettingsDlg;
/**
* Dialog factory class.
*/
public final class DialogFactory {
/**
* Static main method to initialize classes
*
* @param dlgCode Code of dialog to instantiate. See {@link EasyBracketMain}
* @param parent Parent {@link Activity}
*
* @return Instantiated dialog
*/
public static Dialog createDialog(int dlgCode, Activity parent) {
Dialog dlg;
switch (dlgCode) {
case EasyBracketMain.ABOUT_DLG:
dlg = createAboutDialog(parent);
break;
case EasyBracketMain.SETTINGS_DLG:
dlg = createSettingsDialog(parent);
break;
case EasyBracketMain.USERGUIDE_DLG:
dlg = createUserGuideDialog(parent);
break;
default:
dlg = null;
break;
}
return dlg;
}
/**
* Creates the About Dialog
*/
private static Dialog createAboutDialog(Activity parent) {
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.about_dialog);
parent.getResources().getText(R.string.menuAbout);
dialog.setTitle(parent.getResources().getText(R.string.menuAbout) + " EasyBracketing...");
ImageView image = (ImageView) dialog.findViewById(R.id.about_imageAppIcon);
image.setImageResource(R.drawable.icon);
TextView text = (TextView) dialog.findViewById(R.id.about_TextDescription);
text.setText(parent.getResources().getText(R.string.about_Description));
text = (TextView) dialog.findViewById(R.id.about_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getText(R.string.AppVersion).toString());
text = (TextView) dialog.findViewById(R.id.about_TextAutor);
text.setText(parent.getResources().getText(R.string.about_DevelopedBy).toString());
((Button) dialog.findViewById(R.id.btn_AboutClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
/**
* Creates the Settings Dialog
*/
private static Dialog createSettingsDialog(Activity parent) {
final Dialog dialog = new SettingsDlg(parent);
return dialog;
}
/**
* Creates the User Guide Dialog
*/
private static Dialog createUserGuideDialog(Activity parent) {
String versionName = "";
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.userguide_dialog);
parent.getResources().getText(R.string.menuUserGuide);
dialog.setTitle(parent.getResources().getText(R.string.menuUserGuide));
ImageView image = (ImageView) dialog.findViewById(R.id.ug_imageAppIcon);
image.setImageResource(R.drawable.icon);
try {
versionName = parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_CONFIGURATIONS)
.versionName;
} catch (NameNotFoundException e) {
versionName = "-";
}
TextView text = (TextView) dialog.findViewById(R.id.ug_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " "
+ parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_CONFIGURATIONS).versionName);
((Button) dialog.findViewById(R.id.btn_ugClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
}

+ 66
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/1f/c0d7d259c74b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamic Range</string>
<string
name="shutter_speed">Shutter Speed</string>
<string
name="aperture">Aperture</string>
<string
name="ev">EV</string>
<string
name="dark_point">Dark Point Values</string>
<string
name="bright_point">Bright Point Values</string>
<string
name="calcParams">Calculation Parameters</string>
<string
name="delta_EV">Δ EV</string>
<string
name="expEVStep">EV Step</string>
<string
name="calculate">Calculate</string>
<string
name="reset">Reset</string>
<string
name="bracketingRes">Bracketing Exposures Values</string>
<string
name="expNbrLbl"># Exp.</string>
<string
name="toastWarningDP_BP">The delta between dark point EV and bright point EV is less or
equal to 0. Please correct the inputs.</string>
<string
name="menuUserGuide">User Guide</string>
<string
name="menuSettings">Settings...</string>
<string
name="menuAbout">About</string>
<string
name="about_Description">EasyBracketing allows you to easy calculate a serie of exposure
values according to initial dark and bright point values.</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Developed by spherIC (F. Smilari)\nMail to:
merlin868@hotmail.com\n\nTranslated by spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Gray Correction</string>
<string
name="Percent18CorrectionBP">Bright Pt. Value Correction (EV)</string>
<string
name="Percent18CorrectionDP">Dark Pt. Value Correction (EV)</string>
<string
name="FixRangePoint">Fixed EV Range Value</string>
<string
name="FixRangePointBP">Keep Bright Point Values fixed</string>
<string
name="FixRangePointDP">Keep Dark Point Value fixed</string>
<string
name="BtnSave">Save</string>
<string
name="BtnCancel">Cancel</string>
<string
name="userGuidePourpose">text alsdklsk lkds las laskd laskd laskd. aksdl askd laksdlasklsakdlaskdlakdl alasdk laksdlaskd laskdlaskd lakdskkskdk las lskdlaskdls ldklas lsakdlakdlaskd alsdklaksd alksdlakd laskdlasdk. aksdl askd laksdlasklsakdlaskdlakdl alasdk laksdlaskd laskdlaskd lakdskkskdk las lskdlaskdls ldklas lsakdlakdlaskd alsdklaksd alksdlakd laskdlasdk. aksdl askd laksdlasklsakdlaskdlakdl alasdk laksdlaskd laskdlaskd lakdskkskdk las lskdlaskdls ldklas lsakdlakdlaskd alsdklaksd alksdlakd laskdlasdk.</string>
</resources>

+ 315
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/2/707102c50b4b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,315 @@
package ch.spherIC;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemSelectedListener;
import ch.spherIC.components.ApertureSpinner;
import ch.spherIC.components.ShutterSpeedSpinner;
import ch.spherIC.components.XSpinner;
import ch.spherIC.resultlist.Exposure;
import ch.spherIC.resultlist.ExposureAdapter;
import ch.spherIC.resultlist.ExposureFactory;
import ch.spherIC.settings.SettingsDlg;
/**
* Main class EasyBracketing
*/
public class EasyBracketMain extends Activity {
public static final int ABOUT_DLG = 0;
public static final int SETTINGS_DLG = 1;
public static final int USERGUIDE_DLG = 2;
private static String DEF_SHUTTER_SPEED = "1/125";
private static String DEF_APERTURE = "f/8";
private static String DEF_EVSTEP = "2.0";
private ShutterSpeedSpinner spnDPShutterSpeed;
private ApertureSpinner spnDPAperture;
private ShutterSpeedSpinner spnBPShutterSpeed;
private ApertureSpinner spnBPAperture;
private TextView txtDPEVValue;
private TextView txtBPEVValue;
private TextView txtCalcPDeltaEV;
private ApertureSpinner spnCalcPAperture;
private XSpinner spnCalcPEVStep;
private Button resetBtn;
private Button calculateBtn;
private ListView resultList;
private LinearLayout resultsHeader;
private double bpCorrection;
private double dpCorrection;
private boolean fixBP;
private double dpEV;
private double bpEV;
public static final DecimalFormat DF = new DecimalFormat("0.##");
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
initComponents();
setDefaults();
loadSettings();
}
/**
* Loads and stores the settings
*/
public void loadSettings() {
// Load settings
SharedPreferences settings = getSharedPreferences(SettingsDlg.PREFS_NAME, Context.MODE_PRIVATE);
this.fixBP = settings.getBoolean("fixBrightPoint", true);
this.bpCorrection = settings.getFloat("brightPointCorrection", 0f);
this.dpCorrection = settings.getFloat("darkPointCorrection", 0f);
}
/**
* {@inheritDoc}
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.mainmenu, menu);
return true;
}
/**
* @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)
*/
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.itemAbout:
showDialog(ABOUT_DLG);
return true;
case R.id.itemSettings:
showDialog(SETTINGS_DLG);
return true;
case R.id.itemUserGuide:
showDialog(USERGUIDE_DLG);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
/**
* Initialization method
*/
private void initComponents() {
// initialize dropdowns
OnItemSelectedListener evRangeItemSelListener = new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
EasyBracketMain.this.dpEV = EVFormula.calcEV(EasyBracketMain.this.spnDPAperture.getSelectedAperture(),
EasyBracketMain.this.spnDPShutterSpeed
.getSelectedShutterSpeed());
EasyBracketMain.this.bpEV = EVFormula.calcEV(EasyBracketMain.this.spnBPAperture.getSelectedAperture(),
EasyBracketMain.this.spnBPShutterSpeed
.getSelectedShutterSpeed());
EasyBracketMain.this.txtDPEVValue.setText(EasyBracketMain.DF.format(EasyBracketMain.this.dpEV));
EasyBracketMain.this.txtBPEVValue.setText(EasyBracketMain.DF.format(EasyBracketMain.this.bpEV));
EasyBracketMain.this.txtCalcPDeltaEV.setText(EasyBracketMain.DF.format((EasyBracketMain.this.bpEV
+ EasyBracketMain.this.bpCorrection)
- (EasyBracketMain.this.dpEV
- EasyBracketMain.this.dpCorrection)));
EasyBracketMain.this.calculateBtn.setEnabled(EasyBracketMain.this.bpEV > EasyBracketMain.this.dpEV);
EasyBracketMain.this.resultsHeader.setVisibility(View.INVISIBLE);
findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.INVISIBLE);
EasyBracketMain.this.resultList.setAdapter(null);
if (EasyBracketMain.this.bpEV < EasyBracketMain.this.dpEV) {
Toast toast = Toast.makeText(EasyBracketMain.this, R.string.toastWarningDP_BP, Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL, 0, 0);
toast.show();
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
};
OnItemSelectedListener calcPItemSelListener = new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
toggleResultsList(false);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
};
this.spnDPShutterSpeed = (ShutterSpeedSpinner) findViewById(R.id.Spinner_DP_Shutter);
this.spnDPAperture = (ApertureSpinner) findViewById(R.id.Spinner_DP_Aperture);
this.spnBPShutterSpeed = (ShutterSpeedSpinner) findViewById(R.id.Spinner_BP_Shutter);
this.spnBPAperture = (ApertureSpinner) findViewById(R.id.Spinner_BP_Aperture);
this.spnCalcPAperture = (ApertureSpinner) findViewById(R.id.Spinner_calcP_Aperture);
this.spnCalcPEVStep = (XSpinner) findViewById(R.id.Spinner_calcP_EVStep);
this.txtDPEVValue = (TextView) findViewById(R.id.Text_EVVal_DP);
this.txtBPEVValue = (TextView) findViewById(R.id.Text_EVVal_BP);
this.txtCalcPDeltaEV = (TextView) findViewById(R.id.label_deltaEV_Val);
this.resultsHeader = (LinearLayout) ExposureAdapter.getHeaderView(this,
(LinearLayout)
findViewById(R.id.LinearLayout_ResultsHeader));
this.resultsHeader.setVisibility(View.INVISIBLE);
findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.INVISIBLE);
this.resultList = (ListView) findViewById(R.id.ListView_ExpResults);
this.resultList.setAdapter(null);
this.resetBtn = (Button) findViewById(R.id.Btn_Reset);
this.calculateBtn = (Button) findViewById(R.id.Btn_Calculate);
this.calculateBtn.setEnabled(false);
this.spnDPShutterSpeed.setOnItemSelectedListener(evRangeItemSelListener);
this.spnDPAperture.setOnItemSelectedListener(evRangeItemSelListener);
this.spnBPShutterSpeed.setOnItemSelectedListener(evRangeItemSelListener);
this.spnBPAperture.setOnItemSelectedListener(evRangeItemSelListener);
this.resetBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
setDefaults();
toggleResultsList(false);
}
});
this.calculateBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
toggleResultsList(true);
calculateExposures();
}
});
this.spnCalcPAperture.setOnItemSelectedListener(calcPItemSelListener);
this.spnCalcPEVStep.setOnItemSelectedListener(calcPItemSelListener);
}
/**
* Clears the results list.
*/
private void toggleResultsList(boolean visible) {
if (visible) {
EasyBracketMain.this.resultsHeader.setVisibility(View.VISIBLE);
findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.VISIBLE);
} else {
EasyBracketMain.this.resultsHeader.setVisibility(View.INVISIBLE);
findViewById(R.id.View_ResHeader_Understroke).setVisibility(View.INVISIBLE);
EasyBracketMain.this.resultList.setAdapter(null);
}
}
/**
* Sets the default values.
*/
public void setDefaults() {
this.spnDPShutterSpeed.setSelectionByVal(DEF_SHUTTER_SPEED);
this.spnDPAperture.setSelectionByVal(DEF_APERTURE);
this.spnBPShutterSpeed.setSelectionByVal(DEF_SHUTTER_SPEED);
this.spnBPAperture.setSelectionByVal(DEF_APERTURE);
this.spnCalcPAperture.setSelectionByVal(DEF_APERTURE);
this.spnCalcPEVStep.setSelectionByVal(DEF_EVSTEP);
this.txtDPEVValue.setText(DF.format(EVFormula.calcEV(this.spnDPAperture.getSelectedAperture(),
this.spnDPShutterSpeed.getSelectedShutterSpeed())));
this.txtBPEVValue.setText(DF.format(EVFormula.calcEV(this.spnBPAperture.getSelectedAperture(),
this.spnBPShutterSpeed.getSelectedShutterSpeed())));
this.txtCalcPDeltaEV.setText(DF.format(this.bpEV + this.bpCorrection - (this.dpEV - this.dpCorrection)));
}
/**
* Initiates the calculation of the exposure values according to the input parameters.
*/
private void calculateExposures() {
List<Exposure> exposureList;
double calcPrmAperture = this.spnCalcPAperture.getSelectedAperture();
double calcPrmEvStep = Double.valueOf(this.spnCalcPEVStep.getSelectedItem().toString());
List<Double> allowedShutters = getShutterSpeeds();
exposureList = ExposureFactory.calculateExposures(this, this.dpEV - this.dpCorrection,
this.bpEV + this.bpCorrection, calcPrmAperture, calcPrmEvStep,
this.fixBP, allowedShutters);
this.resultList.setAdapter(new ExposureAdapter(this, exposureList));
DisplayMetrics metrics = new DisplayMetrics();
getApplicationContext().getDefaultDisplay().getMetrics(metrics);
}
/**
* Retrieves the list of all shutter speeds in drop down list as Double's.
*
* @return list of all shutter speeds in drop down list as Double's
*/
private List<Double> getShutterSpeeds() {
List<Double> shutterSpeeds = new ArrayList<Double>();
for (int i = 0; i < this.spnBPShutterSpeed.getCount(); i++) {
shutterSpeeds.add(this.spnBPShutterSpeed.getShutterSpeedAt(i));
}
return shutterSpeeds;
}
/**
* {@inheritDoc}
*/
@Override
protected Dialog onCreateDialog(int id) {
return DialogFactory.createDialog(id, this);
}
}

+ 20
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/2/e068e25b59f2001f1304a5e85d67cce9 Целия файл

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_window_focused="false"
android:drawable="@color/transparent" />
<item android:state_focused="true" android:state_enabled="false"
android:state_pressed="true"
android:drawable="@color/lightgrey" />
<item android:state_focused="true" android:state_enabled="false"
android:drawable="@color/lightgrey" />

<item android:state_focused="true" android:state_pressed="true"
android:drawable="@drawable/z_selector_background_transition" />
<item android:state_focused="false" android:state_pressed="true"
android:drawable="@drawable/z_selector_background_transition" />

<item android:state_focused="true"
android:drawable="@color/green" />

</selector>

+ 190
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/20/501acf630d4b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,190 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import android.util.DisplayMetrics;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
final int twentyPercentGray = Math.round(255f * 0.8f);
int deltaRGB = twentyPercentGray;
int iSize;
int iSize_r;
int iStart;
DisplayMetrics metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
switch (metrics.densityDpi) {
case DisplayMetrics.DENSITY_LOW:
iSize = 18;
iSize_r = 17;
iStart = 1;
break;
default:
break;
}
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
// The background
mIconBG = Bitmap.createBitmap(36, 36, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(2, 2, 33, 33, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 189
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/22/f05cca580d4b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,189 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import android.util.DisplayMetrics;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
final int twentyPercentGray = Math.round(255f * 0.8f);
int deltaRGB = twentyPercentGray;
int iSize;
int iSize_r;
int iStart;
DisplayMetrics metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
switch (metrics.density) {
case DisplayMetrics.DENSITY_LOW:
iSize = 18;
iSize_r = 17;
iStart = 1;
break;
default:
break;
}
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
// The background
mIconBG = Bitmap.createBitmap(36, 36, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(2, 2, 33, 33, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 168
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/23/40304ce0f44a001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,168 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
int deltaRGB = twentyPercentGray;
final int twentyPercentGray = Math.round(255f * 0.8f);
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
// The background
mIconBG = Bitmap.createBitmap(36, 36, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(2, 2, 33, 33, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 74
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/23/f0437f0cd14b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder glleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Developed by spherIC (F. Smilari)\nMail to:
merlin868@hotmail.com\n\nTranslated by spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Gray Correction</string>
<string
name="Percent18CorrectionBP">Bright Pt. Value Correction (EV)</string>
<string
name="Percent18CorrectionDP">Dark Pt. Value Correction (EV)</string>
<string
name="FixRangePoint">Fixed EV Range Value</string>
<string
name="FixRangePointBP">Keep Bright Point Values fixed</string>
<string
name="FixRangePointDP">Keep Dark Point Value fixed</string>
<string
name="BtnSave">Save</string>
<string
name="BtnCancel">Cancel</string>
<string
name="header_GeneralPurpose">1. General Purpose</string>
<string
name="text_GeneralPurpose">Text here</string>
<string
name="header_HowTo">2. How to use</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 242
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/24/70eae580164b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,242 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
private static DisplayMetrics metrics;
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure, int nbrExposures) {
super(context);
this.setOrientation(HORIZONTAL);
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private static DisplayMetrics metrics;
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure, this.exposureList.size());
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics() {
if (metrics == null) {
metrics = new DisplayMetrics();
}
return metrics;
}
}

+ 78
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/24/80bb78edf84b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamic Range</string>
<string
name="shutter_speed">Shutter Speed</string>
<string
name="aperture">Aperture</string>
<string
name="ev">EV</string>
<string
name="dark_point">Dark Point Values</string>
<string
name="bright_point">Bright Point Values</string>
<string
name="calcParams">Calculation Parameters</string>
<string
name="delta_EV">Δ EV</string>
<string
name="expEVStep">EV Step</string>
<string
name="calculate">Calculate</string>
<string
name="reset">Reset</string>
<string
name="bracketingRes">Bracketing Exposures Values</string>
<string
name="expNbrLbl"># Exp.</string>
<string
name="toastWarningDP_BP">The delta between dark point EV and bright point EV is less or
equal to 0. Please correct the inputs.</string>
<string
name="menuUserGuide">User Guide</string>
<string
name="menuSettings">Settings...</string>
<string
name="menuAbout">About</string>
<string
name="about_Description">EasyBracketing allows you to easy calculate a serie of exposure
values according to initial dark and bright point values.</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Developed by spherIC (F. Smilari)\nMail to:
merlin868@hotmail.com\n\nTranslated by spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Gray Correction</string>
<string
name="Percent18CorrectionBP">Bright Pt. Value Correction (EV)</string>
<string
name="Percent18CorrectionDP">Dark Pt. Value Correction (EV)</string>
<string
name="FixRangePoint">Fixed EV Range Value</string>
<string
name="FixRangePointBP">Keep Bright Point Values fixed</string>
<string
name="FixRangePointDP">Keep Dark Point Value fixed</string>
<string
name="BtnSave">Save</string>
<string
name="BtnCancel">Cancel</string>
<string
name="BtnClose">Close</string>
<string
name="header_GeneralPurpose">1. General Purpose</string>
<string
name="text_GeneralPurpose">When doing a bracketing for a later HDR image, often a problem araises. The dynamic range of the
composition is too large to fit the classic \"+2EV/0EVB/-2EV\" approach. This is the moment when \"EasyBracketing\" comes to its own.
Starting with camera-measured values for the brightest and darkest point and according to some configarable calculation parameters
you can calculate all the exposure values for the bracketing.
</string>
<string
name="header_HowTo">2. How to use</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 22
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/25/f0e9c563ba4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,22 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.userguide;
import android.app.Dialog;
public class UserGuideDialog extends Dialog {
}

+ 109
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/26/90a63fc79ded001f164fc7c9580306b8 Целия файл

@@ -0,0 +1,109 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.components;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.widget.TextView;
import ch.spherIC.R;
/**
* DOCUMENT ME!
*
* @author $author$
* @version $Revision$, $Date$
*/
public class XTextView extends TextView {
private boolean drawborder;
private int drawborderColor;
private int drawborderWidth;
/**
* Creates a new XTextView object.
*
* @param context DOCUMENT ME!
*/
public XTextView(Context context) {
super(context);
}
/**
* Creates a new $class.name$ object.
*
* @param context DOCUMENT ME!
* @param attrs DOCUMENT ME!
* @param defStyle DOCUMENT ME!
*/
public XTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(attrs);
}
/**
* Creates a new $class.name$ object.
*
* @param context DOCUMENT ME!
* @param attrs DOCUMENT ME!
*/
public XTextView(Context context, AttributeSet attrs) {
super(context, attrs);
init(attrs);
}
/**
* DOCUMENT ME!
*
* @param attrs DOCUMENT ME!
*/
private void init(AttributeSet attrs) {
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.XTextView);
this.drawborder = a.getBoolean(R.styleable.XTextView_drawBorder, false);
this.drawborderColor = a.getColor(R.styleable.XTextView_drawBorderColor, 0xffff0000);
this.drawborderWidth = a.getDimensionPixelSize(R.styleable.XTextView_drawBorderWidth, 1);
}
/**
* @see android.widget.TextView#onDraw(android.graphics.Canvas)
*/
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Rect rect = new Rect();
Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setColor(this.drawborderColor);
//paint.setStrokeWidth(this.drawborderWidth);
paint.setStrokeWidth(5);
getLocalVisibleRect(rect);
//rect.inset(this.drawborderWidth, this.drawborderWidth);
rect.inset(1, 1);
canvas.drawRect(rect, paint);
}
}

+ 74
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/27/c0ec7b5fd14b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder glleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Gray Correction</string>
<string
name="Percent18CorrectionBP">Bright Pt. Value Correction (EV)</string>
<string
name="Percent18CorrectionDP">Dark Pt. Value Correction (EV)</string>
<string
name="FixRangePoint">Fixed EV Range Value</string>
<string
name="FixRangePointBP">Keep Bright Point Values fixed</string>
<string
name="FixRangePointDP">Keep Dark Point Value fixed</string>
<string
name="BtnSave">Save</string>
<string
name="BtnCancel">Cancel</string>
<string
name="header_GeneralPurpose">1. General Purpose</string>
<string
name="text_GeneralPurpose">Text here</string>
<string
name="header_HowTo">2. How to use</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 106
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/2a/e060ae6c9ded001f164fc7c9580306b8 Целия файл

@@ -0,0 +1,106 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.components;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.widget.TextView;
import ch.spherIC.R;
/**
* DOCUMENT ME!
*
* @author $author$
* @version $Revision$, $Date$
*/
public class XTextView extends TextView {
private boolean drawborder;
private int drawborderColor;
private int drawborderWidth;
/**
* Creates a new XTextView object.
*
* @param context DOCUMENT ME!
*/
public XTextView(Context context) {
super(context);
}
/**
* Creates a new $class.name$ object.
*
* @param context DOCUMENT ME!
* @param attrs DOCUMENT ME!
* @param defStyle DOCUMENT ME!
*/
public XTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(attrs);
}
/**
* Creates a new $class.name$ object.
*
* @param context DOCUMENT ME!
* @param attrs DOCUMENT ME!
*/
public XTextView(Context context, AttributeSet attrs) {
super(context, attrs);
init(attrs);
}
/**
* DOCUMENT ME!
*
* @param attrs DOCUMENT ME!
*/
private void init(AttributeSet attrs) {
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.XTextView);
this.drawborder = a.getBoolean(R.styleable.XTextView_drawBorder, false);
this.drawborderColor = a.getColor(R.styleable.XTextView_drawBorderColor, 0xffff0000);
this.drawborderWidth = a.getDimensionPixelSize(R.styleable.XTextView_drawBorderWidth, 1);
}
/**
* @see android.widget.TextView#onDraw(android.graphics.Canvas)
*/
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Rect rect = new Rect();
Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setColor(this.drawborderColor);
paint.setStrokeWidth(this.drawborderWidth);
getLocalVisibleRect(rect);
//rect.inset(-this.drawborderWidth, -this.drawborderWidth);
canvas.drawRect(rect, paint);
}
}

+ 102
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/2b/90336782244c00101d0f80b0b7ec80cc Целия файл

@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder gleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="BtnClose">Schliessen</string>
<string
name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string>
<string
name="text_GeneralPurpose">
Beim Erstellen einer Belichtungsreihe für ein späteres HDR-Bild, stellt sich oftmals das Problem,
dass der Kontrastumfang zu gross ist um von der typischen \"+2LW/0LW/-2LW\"-Vorgehensweise abgedeckt zu werden.\nHier
kommt \"EasyBracketing\" zum Zug.\nAusgehend von gemessenen Werten für den hellsten Punkt resp. den dunkelsten Punkt
werden über definierbare Parameter alle notwendigen Belichtungen einer Belichtungsreihe berechnet. Diese können dann
an der Kamera sukzessive eingestellt und die Aufnahme ausgelöst werden.
</string>
<string
name="header_HowTo">2. Vorgehensweise</string>
<string
name="text_HowTo">
1. Stellen Sie die Kamera auf Spotbelichtungsmessung.
\n2. Wählen Sie eine geeignete Blende.
\n3. Messen Sie mit der Kamera die Belichtungswerte für den dunkelsten Punkt ihres Bildausschnitts.
\n4. Messen Sie mit der Kamera die Belichtungswerte für den hellsten Punkt ihres Bildausschnitts.
\n5. Stellen Sie die gemessenen Werte im Bereich \"Dynamikbereich\" von EasyBracketing ein.
\n6. Verändern Sie, falls gewünscht die Berechnungsparamter nach Ihren Vorstellungen.
\n7. Klicken Sie auf \"Berechnen\" um die Belichtungsreihe zu berechnen.
\n
\nEinstellungen:
\n
\n18-Grauwertkorrektur:
\nDie meisten Kameras versuchen bei der Belichtungsmessung auf ein sogenanntes 18%-Grau gleichmässig zu belichten.
Dies ist für Belichtungsreihen eher unerwünscht. Mit dieser Einstellung können Sie dem entgegenwirken. Den einzustellenden
Wert muss man über Belichtungsversuche empirisch ermitteln, da die Sensoren bei jedem Hersteller anders sind.
\n
\nAusgangspukt der Belichtungsreihe:
\nIn den meisten Fällen, wird der Dynamikumfang (Delta LW) einen gebrochenen Wert aufweisen, der in der Berechnung aufgerundet
wird. Dies führt dazu, dass der Dynamikumfang der Berechnung grösser ist als der Gemessene. Mit dieser Einstellung bestimmen Sie
von welchem Ende des Dynamikumfangs (Anker) die Berechnung der Belichtungsreihe starten soll.
</string>
</resources>

+ 169
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/2e/30cabde8f54a001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,169 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
final int twentyPercentGray = Math.round(255f * 0.8f);
int deltaRGB = twentyPercentGray;
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
// The background
mIconBG = Bitmap.createBitmap(36, 36, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(2, 2, 33, 33, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 157
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/2e/4064e51ff64b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,157 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC;
import android.app.Activity;
import android.app.Dialog;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import ch.spherIC.settings.SettingsDlg;
/**
* Dialog factory class.
*/
public final class DialogFactory {
/**
* Static main method to initialize classes
*
* @param dlgCode Code of dialog to instantiate. See {@link EasyBracketMain}
* @param parent Parent {@link Activity}
*
* @return Instantiated dialog
*/
public static Dialog createDialog(int dlgCode, Activity parent) {
Dialog dlg;
switch (dlgCode) {
case EasyBracketMain.ABOUT_DLG:
dlg = createAboutDialog(parent);
break;
case EasyBracketMain.SETTINGS_DLG:
dlg = createSettingsDialog(parent);
break;
case EasyBracketMain.USERGUIDE_DLG:
dlg = createUserGuideDialog(parent);
break;
default:
dlg = null;
break;
}
return dlg;
}
/**
* Creates the About Dialog
*/
private static Dialog createAboutDialog(Activity parent) {
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.about_dialog);
parent.getResources().getText(R.string.menuAbout);
dialog.setTitle(parent.getResources().getText(R.string.menuAbout) + " EasyBracketing...");
ImageView image = (ImageView) dialog.findViewById(R.id.about_imageAppIcon);
image.setImageResource(R.drawable.icon);
TextView text = (TextView) dialog.findViewById(R.id.about_TextDescription);
text.setText(parent.getResources().getText(R.string.about_Description));
text = (TextView) dialog.findViewById(R.id.about_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getText(R.string.AppVersion).toString());
text = (TextView) dialog.findViewById(R.id.about_TextAutor);
text.setText(parent.getResources().getText(R.string.about_DevelopedBy).toString());
((Button) dialog.findViewById(R.id.btn_AboutClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
/**
* Creates the Settings Dialog
*/
private static Dialog createSettingsDialog(Activity parent) {
final Dialog dialog = new SettingsDlg(parent);
return dialog;
}
/**
* Creates the User Guide Dialog
*/
private static Dialog createUserGuideDialog(Activity parent) {
String versionName = "";
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.userguide_dialog);
parent.getResources().getText(R.string.menuUserGuide);
dialog.setTitle(parent.getResources().getText(R.string.menuUserGuide));
ImageView image = (ImageView) dialog.findViewById(R.id.ug_imageAppIcon);
image.setImageResource(R.drawable.icon);
try {
PackageInfo ai = parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_CONFIGURATIONS);
System.out.println(ai.versionName);
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
TextView text = (TextView) dialog.findViewById(R.id.ug_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " "
+ parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_CONFIGURATIONS).versionName);
((Button) dialog.findViewById(R.id.btn_ugClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
}

+ 242
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/2f/30de9536164b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,242 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
private static DisplayMetrics metrics;
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure, int nbrExposures) {
super(context);
this.setOrientation(HORIZONTAL);
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private static Object metrics;
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure, this.exposureList.size());
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics() {
if (metrics == null) {
metrics = new DisplayMetrics();
}
return metrics;
}
}

+ 59
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/2f/50d1c04cdf4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:padding="10dp"
android:layout_height="fill_parent"
android:background="@drawable/bg_about"
android:orientation="vertical"
android:id="@+id/layout_AboutRoot">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_aboutVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/about_imageAppIcon" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/layout_aboutVersionText"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/about_TextDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/about_TextVersion"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<TextView
android:text="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/about_TextAutor"
android:textColor="@color/black"
android:paddingBottom="20dip"
android:paddingTop="20dip"></TextView>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_fs"
android:id="@+id/btn_AboutClose"
android:textColor="@color/white"
android:layout_gravity="center_horizontal"
android:text="@string/BtnClose"></Button>

</LinearLayout>

+ 247
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/2f/50de4b7d174b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,247 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
DisplayMetrics metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure) {
super(context);
this.setOrientation(HORIZONTAL);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private static DisplayMetrics metrics;
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure);
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
int width = getMetrics(context).widthPixels;
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(Math.round(0.20833f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(Math.round(0.35417f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics(Context context) {
if (metrics == null) {
metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
}
return metrics;
}
}

+ 89
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/2f/901348aae14b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>

<ScrollView
android:id="@+id/ug_ScrollView"
android:layout_width="wrap_content"
android:addStatesFromChildren="true"
android:layout_height="250dp">
<LinearLayout
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ug_hdr_GenPourpose"
android:textColor="@color/black"
android:textStyle="bold"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:text="@string/header_GeneralPurpose"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ug_txt_GenPourpose"
android:textColor="@color/black"
android:text="@string/text_GeneralPurpose">
</TextView>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ug_hdr_HowTo"
android:textColor="@color/black"
android:textStyle="bold"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:text="@string/header_HowTo"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ug_txt_HowTo"
android:textColor="@color/black"
android:text="@string/text_HowTo"></TextView>

</LinearLayout>
</ScrollView>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_fs"
android:id="@+id/btn_ugClose"
android:textColor="@color/white"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp" android:text="@string/BtnClose">
</Button>


</LinearLayout>

+ 147
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/3/00e5027df44b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,147 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC;
import android.app.Activity;
import android.app.Dialog;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import ch.spherIC.settings.SettingsDlg;
/**
* Dialog factory class.
*/
public final class DialogFactory {
/**
* Static main method to initialize classes
*
* @param dlgCode Code of dialog to instantiate. See {@link EasyBracketMain}
* @param parent Parent {@link Activity}
*
* @return Instantiated dialog
*/
public static Dialog createDialog(int dlgCode, Activity parent) {
Dialog dlg;
switch (dlgCode) {
case EasyBracketMain.ABOUT_DLG:
dlg = createAboutDialog(parent);
break;
case EasyBracketMain.SETTINGS_DLG:
dlg = createSettingsDialog(parent);
break;
case EasyBracketMain.USERGUIDE_DLG:
dlg = createUserGuideDialog(parent);
break;
default:
dlg = null;
break;
}
return dlg;
}
/**
* Creates the About Dialog
*/
private static Dialog createAboutDialog(Activity parent) {
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.about_dialog);
parent.getResources().getText(R.string.menuAbout);
dialog.setTitle(parent.getResources().getText(R.string.menuAbout) + " EasyBracketing...");
ImageView image = (ImageView) dialog.findViewById(R.id.about_imageAppIcon);
image.setImageResource(R.drawable.icon);
TextView text = (TextView) dialog.findViewById(R.id.about_TextDescription);
text.setText(parent.getResources().getText(R.string.about_Description));
text = (TextView) dialog.findViewById(R.id.about_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getText(R.string.AppVersion).toString());
text = (TextView) dialog.findViewById(R.id.about_TextAutor);
text.setText(parent.getResources().getText(R.string.about_DevelopedBy).toString());
((Button) dialog.findViewById(R.id.btn_AboutClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
/**
* Creates the Settings Dialog
*/
private static Dialog createSettingsDialog(Activity parent) {
final Dialog dialog = new SettingsDlg(parent);
return dialog;
}
/**
* Creates the User Guide Dialog
*/
private static Dialog createUserGuideDialog(Activity parent) {
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.userguide_dialog);
parent.getResources().getText(R.string.menuUserGuide);
dialog.setTitle(parent.getResources().getText(R.string.menuUserGuide));
ImageView image = (ImageView) dialog.findViewById(R.id.ug_imageAppIcon);
image.setImageResource(R.drawable.icon);
ApplicationInfo ai = parent.getPackageManager().getApplicationInfo("ch.spherIC", PackageManager.GET_META_DATA)
TextView text = (TextView) dialog.findViewById(R.id.ug_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getString(R.attr.).toString());
((Button) dialog.findViewById(R.id.btn_ugClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
}

+ 51
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/3/10e77274c64b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>

<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/ug_Text" android:ellipsize="none" android:text="@string/AppVersion">
</TextView>
</LinearLayout>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_fs"
android:id="@+id/btn_ugClose"
android:text="Close"
android:textColor="@color/white"
android:layout_gravity="center_horizontal">
</Button>


</LinearLayout>

+ 74
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/30/20d1d7fcde4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder glleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string>
<string
name="text_GeneralPurpose">Text here</string>
<string
name="header_HowTo">2. Vorgehensweise</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 155
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/30/30e425acf54b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,155 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC;
import android.app.Activity;
import android.app.Dialog;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import ch.spherIC.settings.SettingsDlg;
/**
* Dialog factory class.
*/
public final class DialogFactory {
/**
* Static main method to initialize classes
*
* @param dlgCode Code of dialog to instantiate. See {@link EasyBracketMain}
* @param parent Parent {@link Activity}
*
* @return Instantiated dialog
*/
public static Dialog createDialog(int dlgCode, Activity parent) {
Dialog dlg;
switch (dlgCode) {
case EasyBracketMain.ABOUT_DLG:
dlg = createAboutDialog(parent);
break;
case EasyBracketMain.SETTINGS_DLG:
dlg = createSettingsDialog(parent);
break;
case EasyBracketMain.USERGUIDE_DLG:
dlg = createUserGuideDialog(parent);
break;
default:
dlg = null;
break;
}
return dlg;
}
/**
* Creates the About Dialog
*/
private static Dialog createAboutDialog(Activity parent) {
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.about_dialog);
parent.getResources().getText(R.string.menuAbout);
dialog.setTitle(parent.getResources().getText(R.string.menuAbout) + " EasyBracketing...");
ImageView image = (ImageView) dialog.findViewById(R.id.about_imageAppIcon);
image.setImageResource(R.drawable.icon);
TextView text = (TextView) dialog.findViewById(R.id.about_TextDescription);
text.setText(parent.getResources().getText(R.string.about_Description));
text = (TextView) dialog.findViewById(R.id.about_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getText(R.string.AppVersion).toString());
text = (TextView) dialog.findViewById(R.id.about_TextAutor);
text.setText(parent.getResources().getText(R.string.about_DevelopedBy).toString());
((Button) dialog.findViewById(R.id.btn_AboutClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
/**
* Creates the Settings Dialog
*/
private static Dialog createSettingsDialog(Activity parent) {
final Dialog dialog = new SettingsDlg(parent);
return dialog;
}
/**
* Creates the User Guide Dialog
*/
private static Dialog createUserGuideDialog(Activity parent) {
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.userguide_dialog);
parent.getResources().getText(R.string.menuUserGuide);
dialog.setTitle(parent.getResources().getText(R.string.menuUserGuide));
ImageView image = (ImageView) dialog.findViewById(R.id.ug_imageAppIcon);
image.setImageResource(R.drawable.icon);
try {
PackageInfo ai = parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_META_DATA);
System.out.println(ai);
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
TextView text = (TextView) dialog.findViewById(R.id.ug_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getString(R.string.AppVersion).toString());
((Button) dialog.findViewById(R.id.btn_ugClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
}

+ 94
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/32/808984f1294c00101d5afee2c5ac3559 Целия файл

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamic Range</string>
<string
name="shutter_speed">Shutter Speed</string>
<string
name="aperture">Aperture</string>
<string
name="ev">EV</string>
<string
name="dark_point">Dark Point Values</string>
<string
name="bright_point">Bright Point Values</string>
<string
name="calcParams">Calculation Parameters</string>
<string
name="delta_EV">Δ EV</string>
<string
name="expEVStep">EV Step</string>
<string
name="calculate">Calculate</string>
<string
name="reset">Reset</string>
<string
name="bracketingRes">Bracketing Exposures Values</string>
<string
name="expNbrLbl"># Exp.</string>
<string
name="toastWarningDP_BP">The delta between dark point EV and bright point EV is less or
equal to 0. Please correct the inputs.</string>
<string
name="menuUserGuide">User Guide</string>
<string
name="menuSettings">Settings...</string>
<string
name="menuAbout">About</string>
<string name="about_Description">EasyBracketing allows you to easy calculate a serie of exposure
values according to initial dark and bright point values.</string>
<string
name="AppVersionLabel">Version:</string>
<string name="about_DevelopedBy">Developed by spherIC (F. Smilari)\nMail to:
merlin868@hotmail.com\n\nTranslated by spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Gray Correction</string>
<string
name="Percent18CorrectionBP">Bright Pt. Value Correction (EV)</string>
<string
name="Percent18CorrectionDP">Dark Pt. Value Correction (EV)</string>
<string
name="FixRangePoint">Fixed EV Range Value</string>
<string
name="FixRangePointBP">Keep Bright Point Values fixed</string>
<string
name="FixRangePointDP">Keep Dark Point Value fixed</string>
<string
name="BtnSave">Save</string>
<string
name="BtnCancel">Cancel</string>
<string
name="BtnClose">Close</string>
<string
name="header_GeneralPurpose">1. General Purpose</string>
<string
name="text_GeneralPurpose">When doing a bracketing for a later HDR image, often a problem araises: The dynamic range of the
composition is too large to fit the classic \"+2EV/0EV/-2EV\" approach.
\nThis is the moment when \"EasyBracketing\" comes to its own.
\nStarting with camera-measured values for the brightest and darkest point and according to some configurable calculation parameters
you can calculate all the exposure values for the bracketing and do the shots.
</string>
<string
name="header_HowTo">2. How to use</string>
<string name="text_HowTo">1. Set your camera to spot measuring.
\n2. Choose a suitable aperture.
\n3. With your camera measure the exposure values for the darkest point of your composition.
\n4. With your camera measure the exposure values for the brightest point of your composition.
\n5. Set these values in the area \"Dynamic Range\" of EasyBracketing.
\n6. Modify the calculation parameters to your needs if necessary.
\n7. Click on \"Calculate\" to start the computing of the exposure values of the bracketing.
\n
\nSettings:
\n
\n18%%-Gray Correction:
\nMost cameras try to achieve a so called 18%-Gray exposure value on measuring. This is not exactly what we want when doing bracketing.
This setting helps to counteract this behavior. Beacuse each sensor, depending on the manufacturer, has a little bit different behavior,
the exact values have to be determined by experimental trials.
\n
\nFixed EV Range Value:
\nIn most cases, the resulting delta EV from the measuring is a floating value which is rounded to the next integer value on calculation.
This means that the calculation value is always bigger than the measured. With this setting you can determine on which edge of the dynamic
range (anchor) the bracketing calculation should start.</string>
</resources>

+ 155
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/33/80bc1b0bf64b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,155 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC;
import android.app.Activity;
import android.app.Dialog;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import ch.spherIC.settings.SettingsDlg;
/**
* Dialog factory class.
*/
public final class DialogFactory {
/**
* Static main method to initialize classes
*
* @param dlgCode Code of dialog to instantiate. See {@link EasyBracketMain}
* @param parent Parent {@link Activity}
*
* @return Instantiated dialog
*/
public static Dialog createDialog(int dlgCode, Activity parent) {
Dialog dlg;
switch (dlgCode) {
case EasyBracketMain.ABOUT_DLG:
dlg = createAboutDialog(parent);
break;
case EasyBracketMain.SETTINGS_DLG:
dlg = createSettingsDialog(parent);
break;
case EasyBracketMain.USERGUIDE_DLG:
dlg = createUserGuideDialog(parent);
break;
default:
dlg = null;
break;
}
return dlg;
}
/**
* Creates the About Dialog
*/
private static Dialog createAboutDialog(Activity parent) {
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.about_dialog);
parent.getResources().getText(R.string.menuAbout);
dialog.setTitle(parent.getResources().getText(R.string.menuAbout) + " EasyBracketing...");
ImageView image = (ImageView) dialog.findViewById(R.id.about_imageAppIcon);
image.setImageResource(R.drawable.icon);
TextView text = (TextView) dialog.findViewById(R.id.about_TextDescription);
text.setText(parent.getResources().getText(R.string.about_Description));
text = (TextView) dialog.findViewById(R.id.about_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getText(R.string.AppVersion).toString());
text = (TextView) dialog.findViewById(R.id.about_TextAutor);
text.setText(parent.getResources().getText(R.string.about_DevelopedBy).toString());
((Button) dialog.findViewById(R.id.btn_AboutClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
/**
* Creates the Settings Dialog
*/
private static Dialog createSettingsDialog(Activity parent) {
final Dialog dialog = new SettingsDlg(parent);
return dialog;
}
/**
* Creates the User Guide Dialog
*/
private static Dialog createUserGuideDialog(Activity parent) {
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.userguide_dialog);
parent.getResources().getText(R.string.menuUserGuide);
dialog.setTitle(parent.getResources().getText(R.string.menuUserGuide));
ImageView image = (ImageView) dialog.findViewById(R.id.ug_imageAppIcon);
image.setImageResource(R.drawable.icon);
try {
PackageInfo ai = parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_CONFIGURATIONS);
System.out.println(ai);
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
TextView text = (TextView) dialog.findViewById(R.id.ug_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getString(R.string.AppVersion).toString());
((Button) dialog.findViewById(R.id.btn_ugClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
}

+ 68
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/33/90aed1b1ce4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamic Range</string>
<string
name="shutter_speed">Shutter Speed</string>
<string
name="aperture">Aperture</string>
<string
name="ev">EV</string>
<string
name="dark_point">Dark Point Values</string>
<string
name="bright_point">Bright Point Values</string>
<string
name="calcParams">Calculation Parameters</string>
<string
name="delta_EV">Δ EV</string>
<string
name="expEVStep">EV Step</string>
<string
name="calculate">Calculate</string>
<string
name="reset">Reset</string>
<string
name="bracketingRes">Bracketing Exposures Values</string>
<string
name="expNbrLbl"># Exp.</string>
<string
name="toastWarningDP_BP">The delta between dark point EV and bright point EV is less or
equal to 0. Please correct the inputs.</string>
<string
name="menuUserGuide">User Guide</string>
<string
name="menuSettings">Settings...</string>
<string
name="menuAbout">About</string>
<string
name="about_Description">EasyBracketing allows you to easy calculate a serie of exposure
values according to initial dark and bright point values.</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Developed by spherIC (F. Smilari)\nMail to:
merlin868@hotmail.com\n\nTranslated by spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Gray Correction</string>
<string
name="Percent18CorrectionBP">Bright Pt. Value Correction (EV)</string>
<string
name="Percent18CorrectionDP">Dark Pt. Value Correction (EV)</string>
<string
name="FixRangePoint">Fixed EV Range Value</string>
<string
name="FixRangePointBP">Keep Bright Point Values fixed</string>
<string
name="FixRangePointDP">Keep Dark Point Value fixed</string>
<string
name="BtnSave">Save</string>
<string
name="BtnCancel">Cancel</string>
<string
name="userGuidePourpose">Text
</string>
<string name="header_GeneralPurpose"></string>
</resources>

+ 41
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/34/706a1f8ecc4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>

<ScrollView android:id="@+id/ug_ScrollView" android:layout_width="wrap_content" android:addStatesFromChildren="true" android:layout_height="300dp"><LinearLayout android:orientation="vertical" android:layout_height="wrap_content" android:layout_width="wrap_content">
<TextView android:layout_width="wrap_content" android:id="@+id/ug_Text" android:text="@string/userGuidePourpose" android:textColor="@color/black" android:layout_height="wrap_content">
</TextView></LinearLayout></ScrollView><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/btn_fs" android:id="@+id/btn_ugClose" android:text="Close" android:textColor="@color/white" android:layout_gravity="center_horizontal" android:layout_marginTop="20dp">
</Button>


</LinearLayout>

+ 240
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/34/e07182d3164b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,240 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
private static DisplayMetrics metrics;
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure) {
super(context);
this.setOrientation(HORIZONTAL);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private static DisplayMetrics metrics;
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure, this.exposureList.size());
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics(Context context) {
if (metrics == null) {
metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
}
return metrics;
}
}

+ 43
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/36/f0eaf17ecc4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>


<ScrollView android:id="@+id/ug_ScrollView" android:layout_width="wrap_content" android:addStatesFromChildren="true" android:layout_height="300dp"><LinearLayout android:orientation="vertical" android:layout_height="wrap_content" android:layout_width="wrap_content">
<TextView android:layout_width="wrap_content" android:id="@+id/ug_Text" android:text="@string/userGuidePourpose" android:textColor="@color/black" android:layout_height="wrap_content">
</TextView></LinearLayout></ScrollView><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/btn_fs" android:id="@+id/btn_ugClose" android:text="Close" android:textColor="@color/white" android:layout_gravity="center_horizontal" android:layout_marginTop="20dp">
</Button>


</LinearLayout>

+ 72
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/38/10402915df4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamic Range</string>
<string
name="shutter_speed">Shutter Speed</string>
<string
name="aperture">Aperture</string>
<string
name="ev">EV</string>
<string
name="dark_point">Dark Point Values</string>
<string
name="bright_point">Bright Point Values</string>
<string
name="calcParams">Calculation Parameters</string>
<string
name="delta_EV">Δ EV</string>
<string
name="expEVStep">EV Step</string>
<string
name="calculate">Calculate</string>
<string
name="reset">Reset</string>
<string
name="bracketingRes">Bracketing Exposures Values</string>
<string
name="expNbrLbl"># Exp.</string>
<string
name="toastWarningDP_BP">The delta between dark point EV and bright point EV is less or
equal to 0. Please correct the inputs.</string>
<string
name="menuUserGuide">User Guide</string>
<string
name="menuSettings">Settings...</string>
<string
name="menuAbout">About</string>
<string
name="about_Description">EasyBracketing allows you to easy calculate a serie of exposure
values according to initial dark and bright point values.</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Developed by spherIC (F. Smilari)\nMail to:
merlin868@hotmail.com\n\nTranslated by spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Gray Correction</string>
<string
name="Percent18CorrectionBP">Bright Pt. Value Correction (EV)</string>
<string
name="Percent18CorrectionDP">Dark Pt. Value Correction (EV)</string>
<string
name="FixRangePoint">Fixed EV Range Value</string>
<string
name="FixRangePointBP">Keep Bright Point Values fixed</string>
<string
name="FixRangePointDP">Keep Dark Point Value fixed</string>
<string
name="BtnSave">Save</string>
<string
name="BtnCancel">Cancel</string>
<string
name="header_GeneralPurpose">1. General Purpose</string>
<string
name="text_GeneralPurpose">Text here</string>
<string
name="header_HowTo">2. How to use</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 168
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/38/808821f0f44a001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,168 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
final int twentyPercentGray = Math.round(255f * 0.8f);
int deltaRGB = twentyPercentGray;
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
// The background
mIconBG = Bitmap.createBitmap(36, 36, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(2, 2, 33, 33, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 83
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/3a/60b7ec8ae84b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder gleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="BtnClose">Schliessen</string>
<string
name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string>
<string
name="text_GeneralPurpose">
"Beim Erstellen einer Belichtungsreihe für ein späteres HDR-Bild, stellt sich oftmals das Problem,
dass der Kontrastumfang zu gross ist um von der typischen \"+2LW/0LW/-2LW\"-Vorgehensweise abgedeckt zu werden.\n
Hier kommt \"EasyBracketing\" zum Zug.\r
Ausgehend von gemessenen Werten für den hellsten Punkt resp. den dunkelsten Punkt
werden über definierbare Parameter alle notwendigen Belichtungen einer Belichtungsreihe berechnet. Diese können dann
an der Kamera sukzessive eingestellt und die Aufnahme ausgelöst werden."
</string>
<string
name="header_HowTo">2. Vorgehensweise</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 91
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/3c/300aedb0ea4b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder gleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="BtnClose">Schliessen</string>
<string
name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string>
<string
name="text_GeneralPurpose">
Beim Erstellen einer Belichtungsreihe für ein späteres HDR-Bild, stellt sich oftmals das Problem,
dass der Kontrastumfang zu gross ist um von der typischen \"+2LW/0LW/-2LW\"-Vorgehensweise abgedeckt zu werden.\nHier
kommt \"EasyBracketing\" zum Zug.\nAusgehend von gemessenen Werten für den hellsten Punkt resp. den dunkelsten Punkt
werden über definierbare Parameter alle notwendigen Belichtungen einer Belichtungsreihe berechnet. Diese können dann
an der Kamera sukzessive eingestellt und die Aufnahme ausgelöst werden.
</string>
<string
name="header_HowTo">2. Vorgehensweise</string>
<string
name="text_HowTo">
1. Stellen Sie die Kamera auf Spotbelichtungsmessung.
\n2. Wählen Sie eine geeignete Blende.\n
\n3. Messen Sie mit der Kamera die Belichtungswerte für den dunkelsten Punkt ihres Bildausschnitts.\n
\n4. Messen Sie mit der Kamera die Belichtungswerte für den hellsten Punkt ihres Bildausschnitts.\n
\n5. Stellen Sie die gemessenen Werte im Bereich \"Dynamikbereich\" von EasyBracketing ein.\n
\n6. Verändern Sie, falls gewünscht die Berechnungsparamter nach Ihren Vorstellungen.\n
\n7. Klicken Sie auf \"Berechnen\" um die Belichtungsreihe zu berechnen.\n
</string>
</resources>

+ 153
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/3c/d0476191f44b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,153 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC;
import android.app.Activity;
import android.app.Dialog;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import ch.spherIC.settings.SettingsDlg;
/**
* Dialog factory class.
*/
public final class DialogFactory {
/**
* Static main method to initialize classes
*
* @param dlgCode Code of dialog to instantiate. See {@link EasyBracketMain}
* @param parent Parent {@link Activity}
*
* @return Instantiated dialog
*/
public static Dialog createDialog(int dlgCode, Activity parent) {
Dialog dlg;
switch (dlgCode) {
case EasyBracketMain.ABOUT_DLG:
dlg = createAboutDialog(parent);
break;
case EasyBracketMain.SETTINGS_DLG:
dlg = createSettingsDialog(parent);
break;
case EasyBracketMain.USERGUIDE_DLG:
dlg = createUserGuideDialog(parent);
break;
default:
dlg = null;
break;
}
return dlg;
}
/**
* Creates the About Dialog
*/
private static Dialog createAboutDialog(Activity parent) {
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.about_dialog);
parent.getResources().getText(R.string.menuAbout);
dialog.setTitle(parent.getResources().getText(R.string.menuAbout) + " EasyBracketing...");
ImageView image = (ImageView) dialog.findViewById(R.id.about_imageAppIcon);
image.setImageResource(R.drawable.icon);
TextView text = (TextView) dialog.findViewById(R.id.about_TextDescription);
text.setText(parent.getResources().getText(R.string.about_Description));
text = (TextView) dialog.findViewById(R.id.about_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getText(R.string.AppVersion).toString());
text = (TextView) dialog.findViewById(R.id.about_TextAutor);
text.setText(parent.getResources().getText(R.string.about_DevelopedBy).toString());
((Button) dialog.findViewById(R.id.btn_AboutClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
/**
* Creates the Settings Dialog
*/
private static Dialog createSettingsDialog(Activity parent) {
final Dialog dialog = new SettingsDlg(parent);
return dialog;
}
/**
* Creates the User Guide Dialog
*/
private static Dialog createUserGuideDialog(Activity parent) {
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.userguide_dialog);
parent.getResources().getText(R.string.menuUserGuide);
dialog.setTitle(parent.getResources().getText(R.string.menuUserGuide));
ImageView image = (ImageView) dialog.findViewById(R.id.ug_imageAppIcon);
image.setImageResource(R.drawable.icon);
try {
ApplicationInfo ai = parent.getPackageManager().getApplicationInfo("ch.spherIC", PackageManager.GET_META_DATA);
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
TextView text = (TextView) dialog.findViewById(R.id.ug_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getString(R.string.AppVersion).toString());
((Button) dialog.findViewById(R.id.btn_ugClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
}

+ 178
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/3d/5089e6280d4b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,178 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import android.util.DisplayMetrics;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
final int twentyPercentGray = Math.round(255f * 0.8f);
int deltaRGB = twentyPercentGray;
int iSize;
int iSize_r;
int iStart;
DisplayMetrics metrics = new DisplayMetrics();
((Activity)context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
// The background
mIconBG = Bitmap.createBitmap(36, 36, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(2, 2, 33, 33, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 169
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/3d/c0ba09f0f44a001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,169 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
final int twentyPercentGray = Math.round(255f * 0.8f);
int deltaRGB = twentyPercentGray;
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
// The background
mIconBG = Bitmap.createBitmap(36, 36, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(2, 2, 33, 33, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 79
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/3f/503c4304f94b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamic Range</string>
<string
name="shutter_speed">Shutter Speed</string>
<string
name="aperture">Aperture</string>
<string
name="ev">EV</string>
<string
name="dark_point">Dark Point Values</string>
<string
name="bright_point">Bright Point Values</string>
<string
name="calcParams">Calculation Parameters</string>
<string
name="delta_EV">Δ EV</string>
<string
name="expEVStep">EV Step</string>
<string
name="calculate">Calculate</string>
<string
name="reset">Reset</string>
<string
name="bracketingRes">Bracketing Exposures Values</string>
<string
name="expNbrLbl"># Exp.</string>
<string
name="toastWarningDP_BP">The delta between dark point EV and bright point EV is less or
equal to 0. Please correct the inputs.</string>
<string
name="menuUserGuide">User Guide</string>
<string
name="menuSettings">Settings...</string>
<string
name="menuAbout">About</string>
<string
name="about_Description">EasyBracketing allows you to easy calculate a serie of exposure
values according to initial dark and bright point values.</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Developed by spherIC (F. Smilari)\nMail to:
merlin868@hotmail.com\n\nTranslated by spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Gray Correction</string>
<string
name="Percent18CorrectionBP">Bright Pt. Value Correction (EV)</string>
<string
name="Percent18CorrectionDP">Dark Pt. Value Correction (EV)</string>
<string
name="FixRangePoint">Fixed EV Range Value</string>
<string
name="FixRangePointBP">Keep Bright Point Values fixed</string>
<string
name="FixRangePointDP">Keep Dark Point Value fixed</string>
<string
name="BtnSave">Save</string>
<string
name="BtnCancel">Cancel</string>
<string
name="BtnClose">Close</string>
<string
name="header_GeneralPurpose">1. General Purpose</string>
<string
name="text_GeneralPurpose">When doing a bracketing for a later HDR image, often a problem araises. The dynamic range of the
composition is too large to fit the classic \"+2EV/0EVB/-2EV\" approach.
\nThis is the moment when \"EasyBracketing\" comes to its own.
\nStarting with camera-measured values for the brightest and darkest point and according to some configarable calculation parameters
you can calculate all the exposure values for the bracketing.
</string>
<string
name="header_HowTo">2. How to use</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 63
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/3f/80b14383cf4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>

<ScrollView
android:id="@+id/ug_ScrollView"
android:layout_width="wrap_content"
android:addStatesFromChildren="true" android:layout_height="250dp">
<LinearLayout
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/ug_hdr_GenPourpose" android:textColor="@color/black" android:textStyle="bold" android:layout_marginBottom="5dp" android:layout_marginTop="5dp" android:text="@string/header_GeneralPurpose"></TextView><TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/ug_txt_GenPourpose" android:textColor="@color/black" android:text="@string/text_GeneralPurpose">
</TextView>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/ug_hdr_HowTo" android:textColor="@color/black" android:textStyle="bold" android:layout_marginBottom="5dp" android:layout_marginTop="5dp" android:text="@string/header_HowTo"></TextView><TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/ug_txt_HowTo" android:textColor="@color/black" android:text="@string/text_HowTo"></TextView>

</LinearLayout>
</ScrollView>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_fs"
android:id="@+id/btn_ugClose"
android:text="Close"
android:textColor="@color/white"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp">
</Button>


</LinearLayout>

+ 99
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/3f/905dcd51fc4b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamic Range</string>
<string
name="shutter_speed">Shutter Speed</string>
<string
name="aperture">Aperture</string>
<string
name="ev">EV</string>
<string
name="dark_point">Dark Point Values</string>
<string
name="bright_point">Bright Point Values</string>
<string
name="calcParams">Calculation Parameters</string>
<string
name="delta_EV">Δ EV</string>
<string
name="expEVStep">EV Step</string>
<string
name="calculate">Calculate</string>
<string
name="reset">Reset</string>
<string
name="bracketingRes">Bracketing Exposures Values</string>
<string
name="expNbrLbl"># Exp.</string>
<string
name="toastWarningDP_BP">The delta between dark point EV and bright point EV is less or
equal to 0. Please correct the inputs.</string>
<string
name="menuUserGuide">User Guide</string>
<string
name="menuSettings">Settings...</string>
<string
name="menuAbout">About</string>
<string
name="about_Description">EasyBracketing allows you to easy calculate a serie of exposure
values according to initial dark and bright point values.</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Developed by spherIC (F. Smilari)\nMail to:
merlin868@hotmail.com\n\nTranslated by spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Gray Correction</string>
<string
name="Percent18CorrectionBP">Bright Pt. Value Correction (EV)</string>
<string
name="Percent18CorrectionDP">Dark Pt. Value Correction (EV)</string>
<string
name="FixRangePoint">Fixed EV Range Value</string>
<string
name="FixRangePointBP">Keep Bright Point Values fixed</string>
<string
name="FixRangePointDP">Keep Dark Point Value fixed</string>
<string
name="BtnSave">Save</string>
<string
name="BtnCancel">Cancel</string>
<string
name="BtnClose">Close</string>
<string
name="header_GeneralPurpose">1. General Purpose</string>
<string
name="text_GeneralPurpose">When doing a bracketing for a later HDR image, often a problem araises: The dynamic range of the
composition is too large to fit the classic \"+2EV/0EVB/-2EV\" approach.
\nThis is the moment when \"EasyBracketing\" comes to its own.
\nStarting with camera-measured values for the brightest and darkest point and according to some configurable calculation parameters
you can calculate all the exposure values for the bracketing and do the shots.
</string>
<string
name="header_HowTo">2. How to use</string>
<string
name="text_HowTo">
1. Set your camera to spot measuring.
\n2. Choose a suitable aperture.
\n3. With your camera measure the exposure values for the darkest point of your composition.
\n4. With your camera measure the exposure values for the brightest point of your composition.
\n5. Set these values in the area \"Dynamic Range\" of EasyBracketing.
\n6. Modify the calculation parameters to your needs if necessary.
\n7. Click on \"Calculate\" to start the computing of the exposure values of the bracketing.
\n
\nSettings:
\n
\n18%-Gray Correction:
\nMost cameras try to achieve a so called 18%-Gray exposure value on measuring. This is not exactly what we want when doing bracketing.
This setting helps to counteract this behavior. Beacuse each sensor, depending on the manufacturer, has a little bit different behavior,
the exact values have to be determined by experimental trials.
\n
\nFixed EV Range Value:
\nIn most cases, the resulting delta EV from the measuring is a floating value which is rounded to the next integer value on calculation.
This means that the calculation value is always bigger than the measured. With this setting you can determine on which edge of the dynamic
range (anchor) the bracketing calculation should start.
</string>
</resources>

+ 102
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/3f/e0510c38244c00101d0f80b0b7ec80cc Целия файл

@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder gleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="BtnClose">Schliessen</string>
<string
name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string>
<string
name="text_GeneralPurpose">
Beim Erstellen einer Belichtungsreihe für ein späteres HDR-Bild, stellt sich oftmals das Problem,
dass der Kontrastumfang zu gross ist um von der typischen \"+2LW/0LW/-2LW\"-Vorgehensweise abgedeckt zu werden.\nHier
kommt \"EasyBracketing\" zum Zug.\nAusgehend von gemessenen Werten für den hellsten Punkt resp. den dunkelsten Punkt
werden über definierbare Parameter alle notwendigen Belichtungen einer Belichtungsreihe berechnet. Diese können dann
an der Kamera sukzessive eingestellt und die Aufnahme ausgelöst werden.
</string>
<string
name="header_HowTo">2. Vorgehensweise</string>
<string
name="text_HowTo">
1. Stellen Sie die Kamera auf Spotbelichtungsmessung.
\n2. Wählen Sie eine geeignete Blende.
\n3. Messen Sie mit der Kamera die Belichtungswerte für den dunkelsten Punkt ihres Bildausschnitts.
\n4. Messen Sie mit der Kamera die Belichtungswerte für den hellsten Punkt ihres Bildausschnitts.
\n5. Stellen Sie die gemessenen Werte im Bereich \"Dynamikbereich\" von EasyBracketing ein.
\n6. Verändern Sie, falls gewünscht die Berechnungsparamter nach Ihren Vorstellungen.
\n7. Klicken Sie auf \"Berechnen\" um die Belichtungsreihe zu berechnen.
\n
\nEinstellungen:
\n
\n18%-Grauwertkorrektur:
\nDie meisten Kameras versuchen bei der Belichtungsmessung auf ein sogenanntes 18%-Grau gleichmässig zu belichten.
Dies ist für Belichtungsreihen eher unerwünscht. Mit dieser Einstellung können Sie dem entgegenwirken. Den einzustellenden
Wert muss man über Belichtungsversuche empirisch ermitteln, da die Sensoren bei jedem Hersteller anders sind.
\n
\nAusgangspukt der Belichtungsreihe:
\nIn den meisten Fällen, wird der Dynamikumfang (Delta LW) einen gebrochenen Wert aufweisen, der in der Berechnung aufgerundet
wird. Dies führt dazu, dass der Dynamikumfang der Berechnung grösser ist als der Gemessene. Mit dieser Einstellung bestimmen Sie
von welchem Ende des Dynamikumfangs (Anker) die Berechnung der Belichtungsreihe starten soll.
</string>
</resources>

+ 240
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/4/2010bb1c164b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,240 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
private static DisplayMetrics metrics;
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure, int nbrExposures) {
super(context);
this.setOrientation(HORIZONTAL);
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure, this.exposureList.size());
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics() {
if (metrics == null) {
metrics = new DisplayMetrics();
}
return metrics;
}
}

+ 248
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/4/90cab58c174b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,248 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure) {
super(context);
this.setOrientation(HORIZONTAL);
DisplayMetrics metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private static DisplayMetrics metrics;
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure);
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
int width = getMetrics(context).widthPixels;
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(Math.round(0.20833f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(Math.round(0.35417f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics(Context context) {
if (metrics == null) {
metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
}
return metrics;
}
}

+ 83
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/41/30dc6964e84b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder gleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="BtnClose">Schliessen</string>
<string
name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string>
<string
name="text_GeneralPurpose">
Beim Erstellen einer Belichtungsreihe für ein späteres HDR-Bild, stellt sich oftmals das Problem,
dass der Kontrastumfang zu gross ist um von der typischen \"+2LW/0LW/-2LW\"-Vorgehensweise abgedeckt zu werden.\n
Hier kommt \"EasyBracketing\" zum Zug.\n\r
Ausgehend von gemessenen Werten für den hellsten Punkt resp. den dunkelsten Punkt
werden über definierbare Parameter alle notwendigen Belichtungen einer Belichtungsreihe berechnet. Diese können dann
an der Kamera sukzessive eingestellt und die Aufnahme ausgelöst werden.
</string>
<string
name="header_HowTo">2. Vorgehensweise</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 136
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/42/70b2858cde4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,136 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.settings;
import android.app.Dialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.Spinner;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Settings / Preferences Dialog
*/
public class SettingsDlg extends Dialog {
public static final String PREFS_NAME = "SettingsFile";
private Context prnt;
/**
* Creates a new SettingsDlg object.
*/
public SettingsDlg(Context context) {
super(context, R.style.GlassThemeDialog);
this.prnt = context;
}
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings);
setTitle(prnt.getResources().getText(R.string.menuSettings));
((Button) findViewById(R.id.btn_Stg_Save)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
saveSettings();
SettingsDlg.this.dismiss();
((EasyBracketMain) SettingsDlg.this.prnt).loadSettings();
((EasyBracketMain) SettingsDlg.this.prnt).setDefaults();
}
});
((Button) findViewById(R.id.btn_Stg_Cancel)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SettingsDlg.this.dismiss();
}
});
}
/**
* {@inheritDoc}
*/
@Override
protected void onStart() {
super.onStart();
applySettings();
}
/**
* {@inheritDoc}
*/
@Override
protected void onStop() {
super.onStop();
}
/**
* Reads and applies the settings.
*/
private void applySettings() {
boolean fixBP;
float bpCorrection;
float dpCorrection;
// Restore settings
SharedPreferences settings = getContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
fixBP = settings.getBoolean("fixBrightPoint", true);
((RadioButton) findViewById(R.id.rdbtn_KeepBP)).setChecked(fixBP);
((RadioButton) findViewById(R.id.rdbtn_KeepDP)).setChecked(!fixBP);
bpCorrection = settings.getFloat("brightPointCorrection", 0f);
dpCorrection = settings.getFloat("darkPointCorrection", 0f);
((Spinner) findViewById(R.id.spn_BP_Corr)).setSelection((int) bpCorrection);
((Spinner) findViewById(R.id.spn_DP_Corr)).setSelection((int) dpCorrection);
}
/**
* Saves the settings
*/
private void saveSettings() {
// Save settings
SharedPreferences settings = getContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean("fixBrightPoint", ((RadioButton) findViewById(R.id.rdbtn_KeepBP)).isChecked());
editor.putFloat("brightPointCorrection", ((Spinner) findViewById(R.id.spn_BP_Corr)).getSelectedItemPosition());
editor.putFloat("darkPointCorrection", ((Spinner) findViewById(R.id.spn_DP_Corr)).getSelectedItemPosition());
// Commit the edits!
editor.commit();
}
}

+ 175
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/45/2085182d0b4b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,175 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import android.util.DisplayMetrics;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
final int twentyPercentGray = Math.round(255f * 0.8f);
int deltaRGB = twentyPercentGray;
int iSize;
int iSize_r;
int iStart;
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
// The background
mIconBG = Bitmap.createBitmap(36, 36, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(2, 2, 33, 33, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 102
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/47/204447012a4c00101d5afee2c5ac3559 Целия файл

@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder gleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="BtnClose">Schliessen</string>
<string
name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string>
<string
name="text_GeneralPurpose">
Beim Erstellen einer Belichtungsreihe für ein späteres HDR-Bild, stellt sich oftmals das Problem,
dass der Kontrastumfang zu gross ist um von der typischen \"+2LW/0LW/-2LW\"-Vorgehensweise abgedeckt zu werden.\nHier
kommt \"EasyBracketing\" zum Zug.\nAusgehend von gemessenen Werten für den hellsten Punkt resp. den dunkelsten Punkt
werden über definierbare Parameter alle notwendigen Belichtungen einer Belichtungsreihe berechnet. Diese können dann
an der Kamera sukzessive eingestellt und die Aufnahme ausgelöst werden.
</string>
<string
name="header_HowTo">2. Vorgehensweise</string>
<string
name="text_HowTo">
1. Stellen Sie die Kamera auf Spotbelichtungsmessung.
\n2. Wählen Sie eine geeignete Blende.
\n3. Messen Sie mit der Kamera die Belichtungswerte für den dunkelsten Punkt ihres Bildausschnitts.
\n4. Messen Sie mit der Kamera die Belichtungswerte für den hellsten Punkt ihres Bildausschnitts.
\n5. Stellen Sie die gemessenen Werte im Bereich \"Dynamikbereich\" von EasyBracketing ein.
\n6. Verändern Sie, falls gewünscht die Berechnungsparamter nach Ihren Vorstellungen.
\n7. Klicken Sie auf \"Berechnen\" um die Belichtungsreihe zu berechnen.
\n
\nEinstellungen:
\n
\n18%%-Grauwertkorrektur:
\nDie meisten Kameras versuchen bei der Belichtungsmessung auf ein sogenanntes 18%-Grau gleichmässig zu belichten.
Dies ist für Belichtungsreihen eher unerwünscht. Mit dieser Einstellung können Sie dem entgegenwirken. Den einzustellenden
Wert muss man über Belichtungsversuche empirisch ermitteln, da die Sensoren bei jedem Hersteller anders sind.
\n
\nAusgangspukt der Belichtungsreihe:
\nIn den meisten Fällen, wird der Dynamikumfang (Delta LW) einen gebrochenen Wert aufweisen, der in der Berechnung aufgerundet
wird. Dies führt dazu, dass der Dynamikumfang der Berechnung grösser ist als der Gemessene. Mit dieser Einstellung bestimmen Sie
von welchem Ende des Dynamikumfangs (Anker) die Berechnung der Belichtungsreihe starten soll.
</string>
</resources>

+ 51
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/47/7016194aca4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>

<LinearLayout
android:orientation="vertical" android:layout_height="fill_parent" android:layout_width="fill_parent">
<ScrollView android:layout_height="fill_parent" android:layout_width="fill_parent" android:fillViewport="true" android:id="@+id/ug_ScrollView"><TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/ug_Text" android:text="@string/userGuidePourpose" android:textColor="@color/black">
</TextView></ScrollView>
</LinearLayout>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_fs"
android:id="@+id/btn_ugClose"
android:text="Close"
android:textColor="@color/white"
android:layout_gravity="center_horizontal">
</Button>


</LinearLayout>

+ 82
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/47/9096bd13e94b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder gleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="BtnClose">Schliessen</string>
<string
name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string>
<string
name="text_GeneralPurpose">
Beim Erstellen einer Belichtungsreihe für ein späteres HDR-Bild, stellt sich oftmals das Problem,
dass der Kontrastumfang zu gross ist um von der typischen \"+2LW/0LW/-2LW\"-Vorgehensweise abgedeckt zu werden.\nHier kommt \"EasyBracketing\" zum Zug.\n
Ausgehend von gemessenen Werten für den hellsten Punkt resp. den dunkelsten Punkt
werden über definierbare Parameter alle notwendigen Belichtungen einer Belichtungsreihe berechnet. Diese können dann
an der Kamera sukzessive eingestellt und die Aufnahme ausgelöst werden.
</string>
<string
name="header_HowTo">2. Vorgehensweise</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 74
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/47/a0894573d14b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder glleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Fester LW Bereichswert</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="header_GeneralPurpose">1. General Purpose</string>
<string
name="text_GeneralPurpose">Text here</string>
<string
name="header_HowTo">2. How to use</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 247
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/47/c0ddf077174b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,247 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
DisplayMetrics metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure) {
super(context);
this.setOrientation(HORIZONTAL);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private static DisplayMetrics metrics;
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure);
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
int width = getMetrics(context).widthPixels;
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(Math.round(0.20833f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(Math.round(0.35417f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics(Context context) {
if (metrics == null) {
metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
}
return metrics;
}
}

+ 169
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/48/007cefeff44a001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,169 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
int deltaRGB = twentyPercentGray;
final int twentyPercentGray = Math.round(255f * 0.8f);
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
// The background
mIconBG = Bitmap.createBitmap(36, 36, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(2, 2, 33, 33, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 199
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/4a/e036179c0d4b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,199 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import android.util.DisplayMetrics;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
final int twentyPercentGray = Math.round(255f * 0.8f);
int deltaRGB = twentyPercentGray;
int iSize;
int iSize_r;
int iStart;
DisplayMetrics metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
switch (metrics.densityDpi) {
case DisplayMetrics.DENSITY_LOW:
iSize = 18;
iSize_r = 17;
iStart = 1;
break;
case DisplayMetrics.DENSITY_MEDIUM:
iSize = 24;
iSize_r = 22;
iStart = 2;
break;
default:
iSize = 36;
iSize_r = 33;
iStart = 2;
break;
}
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
// The background
mIconBG = Bitmap.createBitmap(iSize, iSize, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(iStart, iStart, iSize_r, iSize_r, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 156
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/4c/406c380bf64b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,156 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC;
import android.app.Activity;
import android.app.Dialog;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import ch.spherIC.settings.SettingsDlg;
/**
* Dialog factory class.
*/
public final class DialogFactory {
/**
* Static main method to initialize classes
*
* @param dlgCode Code of dialog to instantiate. See {@link EasyBracketMain}
* @param parent Parent {@link Activity}
*
* @return Instantiated dialog
*/
public static Dialog createDialog(int dlgCode, Activity parent) {
Dialog dlg;
switch (dlgCode) {
case EasyBracketMain.ABOUT_DLG:
dlg = createAboutDialog(parent);
break;
case EasyBracketMain.SETTINGS_DLG:
dlg = createSettingsDialog(parent);
break;
case EasyBracketMain.USERGUIDE_DLG:
dlg = createUserGuideDialog(parent);
break;
default:
dlg = null;
break;
}
return dlg;
}
/**
* Creates the About Dialog
*/
private static Dialog createAboutDialog(Activity parent) {
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.about_dialog);
parent.getResources().getText(R.string.menuAbout);
dialog.setTitle(parent.getResources().getText(R.string.menuAbout) + " EasyBracketing...");
ImageView image = (ImageView) dialog.findViewById(R.id.about_imageAppIcon);
image.setImageResource(R.drawable.icon);
TextView text = (TextView) dialog.findViewById(R.id.about_TextDescription);
text.setText(parent.getResources().getText(R.string.about_Description));
text = (TextView) dialog.findViewById(R.id.about_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getText(R.string.AppVersion).toString());
text = (TextView) dialog.findViewById(R.id.about_TextAutor);
text.setText(parent.getResources().getText(R.string.about_DevelopedBy).toString());
((Button) dialog.findViewById(R.id.btn_AboutClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
/**
* Creates the Settings Dialog
*/
private static Dialog createSettingsDialog(Activity parent) {
final Dialog dialog = new SettingsDlg(parent);
return dialog;
}
/**
* Creates the User Guide Dialog
*/
private static Dialog createUserGuideDialog(Activity parent) {
String versionName ="";
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.userguide_dialog);
parent.getResources().getText(R.string.menuUserGuide);
dialog.setTitle(parent.getResources().getText(R.string.menuUserGuide));
ImageView image = (ImageView) dialog.findViewById(R.id.ug_imageAppIcon);
image.setImageResource(R.drawable.icon);
try {
PackageInfo ai = parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_CONFIGURATIONS);
System.out.println(ai.versionName);
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
TextView text = (TextView) dialog.findViewById(R.id.ug_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_CONFIGURATIONS).versionName);
((Button) dialog.findViewById(R.id.btn_ugClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
}

+ 105
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/4c/80df6a559ded001f164fc7c9580306b8 Целия файл

@@ -0,0 +1,105 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.components;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.widget.TextView;
import ch.spherIC.R;
/**
* DOCUMENT ME!
*
* @author $author$
* @version $Revision$, $Date$
*/
public class XTextView extends TextView {
private boolean drawborder;
private int drawborderColor;
private int drawborderWidth;
/**
* Creates a new XTextView object.
*
* @param context DOCUMENT ME!
*/
public XTextView(Context context) {
super(context);
}
/**
* Creates a new $class.name$ object.
*
* @param context DOCUMENT ME!
* @param attrs DOCUMENT ME!
* @param defStyle DOCUMENT ME!
*/
public XTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(attrs);
}
/**
* Creates a new $class.name$ object.
*
* @param context DOCUMENT ME!
* @param attrs DOCUMENT ME!
*/
public XTextView(Context context, AttributeSet attrs) {
super(context, attrs);
init(attrs);
}
/**
* DOCUMENT ME!
*
* @param attrs DOCUMENT ME!
*/
private void init(AttributeSet attrs) {
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.XTextView);
this.drawborder = a.getBoolean(R.styleable.XTextView_drawBorder, false);
this.drawborderColor = a.getColor(R.styleable.XTextView_drawBorderColor, 0xffff0000);
this.drawborderWidth = a.getDimensionPixelSize(R.styleable.XTextView_drawBorderWidth, 1);
}
/**
* @see android.widget.TextView#onDraw(android.graphics.Canvas)
*/
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Rect rect = new Rect();
Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setColor(this.drawborderColor);
paint.setStrokeWidth(this.drawborderWidth);
getLocalVisibleRect(rect);
rect.inset(-this.drawborderWidth, -this.drawborderWidth);
canvas.drawRect(rect, paint);
}
}

+ 79
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/4d/2013e4f0ce4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamic Range</string>
<string
name="shutter_speed">Shutter Speed</string>
<string
name="aperture">Aperture</string>
<string
name="ev">EV</string>
<string
name="dark_point">Dark Point Values</string>
<string
name="bright_point">Bright Point Values</string>
<string
name="calcParams">Calculation Parameters</string>
<string
name="delta_EV">Δ EV</string>
<string
name="expEVStep">EV Step</string>
<string
name="calculate">Calculate</string>
<string
name="reset">Reset</string>
<string
name="bracketingRes">Bracketing Exposures Values</string>
<string
name="expNbrLbl"># Exp.</string>
<string
name="toastWarningDP_BP">The delta between dark point EV and bright point EV is less or
equal to 0. Please correct the inputs.</string>
<string
name="menuUserGuide">User Guide</string>
<string
name="menuSettings">Settings...</string>
<string
name="menuAbout">About</string>
<string
name="about_Description">EasyBracketing allows you to easy calculate a serie of exposure
values according to initial dark and bright point values.</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Developed by spherIC (F. Smilari)\nMail to:
merlin868@hotmail.com\n\nTranslated by spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Gray Correction</string>
<string
name="Percent18CorrectionBP">Bright Pt. Value Correction (EV)</string>
<string
name="Percent18CorrectionDP">Dark Pt. Value Correction (EV)</string>
<string
name="FixRangePoint">Fixed EV Range Value</string>
<string
name="FixRangePointBP">Keep Bright Point Values fixed</string>
<string
name="FixRangePointDP">Keep Dark Point Value fixed</string>
<string
name="BtnSave">Save</string>
<string
name="BtnCancel">Cancel</string>
<string
name="userGuidePourpose">Text
</string>
<string
name="header_GeneralPurpose">1. General Purpose
</string>
<string
name="text_GeneralPurpose">1. General Purpose
</string>
<string
name="header_HowTo">2. How to use
</string>
<string
name="header_GeneralPurpose">1. General Purpose
</string>
</resources>

+ 82
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/4d/400dd315e24b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder gleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="BtnClose">Schliessen</string>
<string
name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string>
<string
name="text_GeneralPurpose">
Beim Erstellen einer Belichtungsreihe für ein späteres HDR-Bild, stellt sich oftmals das Problem,
dass der Kontrastumfang zu gross ist um von der typischen "+2LW/0LW/-2LW"-Vorgehensweise abgedeckt zu werden.
Hier kommt EasyBracketing zum Zug. Ausgehend von gemessenen Werten für den hellsten Punkt resp. den dunkelsten Punkt
werden über definierbare Parameter alle notwendigen Belichtungen einer Belichtungsreihe berechnet. Diese können dann
an der Kamera sukzessive eingestellt und die Aufnahme ausgelöst werden.
</string>
<string
name="header_HowTo">2. Vorgehensweise</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 43
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/4e/706d8efaca4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>


<ScrollView android:id="@+id/ug_ScrollView" android:layout_height="wrap_content" android:layout_width="wrap_content"><LinearLayout android:orientation="vertical" android:layout_height="wrap_content" android:layout_width="wrap_content">
<TextView android:layout_width="wrap_content" android:id="@+id/ug_Text" android:text="@string/userGuidePourpose" android:textColor="@color/black" android:layout_height="wrap_content">
</TextView></LinearLayout></ScrollView><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/btn_fs" android:id="@+id/btn_ugClose" android:text="Close" android:textColor="@color/white" android:layout_gravity="center_horizontal">
</Button>


</LinearLayout>

+ 161
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/4e/e0bf825ef64b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,161 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC;
import android.app.Activity;
import android.app.Dialog;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import ch.spherIC.settings.SettingsDlg;
/**
* Dialog factory class.
*/
public final class DialogFactory {
/**
* Static main method to initialize classes
*
* @param dlgCode Code of dialog to instantiate. See {@link EasyBracketMain}
* @param parent Parent {@link Activity}
*
* @return Instantiated dialog
*/
public static Dialog createDialog(int dlgCode, Activity parent) {
Dialog dlg;
switch (dlgCode) {
case EasyBracketMain.ABOUT_DLG:
dlg = createAboutDialog(parent);
break;
case EasyBracketMain.SETTINGS_DLG:
dlg = createSettingsDialog(parent);
break;
case EasyBracketMain.USERGUIDE_DLG:
dlg = createUserGuideDialog(parent);
break;
default:
dlg = null;
break;
}
return dlg;
}
/**
* Creates the About Dialog
*/
private static Dialog createAboutDialog(Activity parent) {
String versionName = "";
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.about_dialog);
parent.getResources().getText(R.string.menuAbout);
dialog.setTitle(parent.getResources().getText(R.string.menuAbout) + " EasyBracketing...");
try {
versionName = parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_CONFIGURATIONS)
.versionName;
} catch (NameNotFoundException e) {
versionName = "-";
}
ImageView image = (ImageView) dialog.findViewById(R.id.about_imageAppIcon);
image.setImageResource(R.drawable.icon);
TextView text = (TextView) dialog.findViewById(R.id.about_TextDescription);
text.setText(parent.getResources().getText(R.string.about_Description));
text = (TextView) dialog.findViewById(R.id.about_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getText(R.string.AppVersion).toString());
text = (TextView) dialog.findViewById(R.id.about_TextAutor);
text.setText(parent.getResources().getText(R.string.about_DevelopedBy).toString());
((Button) dialog.findViewById(R.id.btn_AboutClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
/**
* Creates the Settings Dialog
*/
private static Dialog createSettingsDialog(Activity parent) {
final Dialog dialog = new SettingsDlg(parent);
return dialog;
}
/**
* Creates the User Guide Dialog
*/
private static Dialog createUserGuideDialog(Activity parent) {
String versionName = "";
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.userguide_dialog);
parent.getResources().getText(R.string.menuUserGuide);
dialog.setTitle(parent.getResources().getText(R.string.menuUserGuide));
try {
versionName = parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_CONFIGURATIONS)
.versionName;
} catch (NameNotFoundException e) {
versionName = "-";
}
ImageView image = (ImageView) dialog.findViewById(R.id.ug_imageAppIcon);
image.setImageResource(R.drawable.icon);
TextView text = (TextView) dialog.findViewById(R.id.ug_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString() + " " + versionName);
((Button) dialog.findViewById(R.id.btn_ugClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
}

+ 152
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/4f/8012242af64b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,152 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC;
import android.app.Activity;
import android.app.Dialog;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import ch.spherIC.settings.SettingsDlg;
/**
* Dialog factory class.
*/
public final class DialogFactory {
/**
* Static main method to initialize classes
*
* @param dlgCode Code of dialog to instantiate. See {@link EasyBracketMain}
* @param parent Parent {@link Activity}
*
* @return Instantiated dialog
*/
public static Dialog createDialog(int dlgCode, Activity parent) {
Dialog dlg;
switch (dlgCode) {
case EasyBracketMain.ABOUT_DLG:
dlg = createAboutDialog(parent);
break;
case EasyBracketMain.SETTINGS_DLG:
dlg = createSettingsDialog(parent);
break;
case EasyBracketMain.USERGUIDE_DLG:
dlg = createUserGuideDialog(parent);
break;
default:
dlg = null;
break;
}
return dlg;
}
/**
* Creates the About Dialog
*/
private static Dialog createAboutDialog(Activity parent) {
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.about_dialog);
parent.getResources().getText(R.string.menuAbout);
dialog.setTitle(parent.getResources().getText(R.string.menuAbout) + " EasyBracketing...");
ImageView image = (ImageView) dialog.findViewById(R.id.about_imageAppIcon);
image.setImageResource(R.drawable.icon);
TextView text = (TextView) dialog.findViewById(R.id.about_TextDescription);
text.setText(parent.getResources().getText(R.string.about_Description));
text = (TextView) dialog.findViewById(R.id.about_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getText(R.string.AppVersion).toString());
text = (TextView) dialog.findViewById(R.id.about_TextAutor);
text.setText(parent.getResources().getText(R.string.about_DevelopedBy).toString());
((Button) dialog.findViewById(R.id.btn_AboutClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
/**
* Creates the Settings Dialog
*/
private static Dialog createSettingsDialog(Activity parent) {
final Dialog dialog = new SettingsDlg(parent);
return dialog;
}
/**
* Creates the User Guide Dialog
*/
private static Dialog createUserGuideDialog(Activity parent) {
String versionName = "";
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.userguide_dialog);
parent.getResources().getText(R.string.menuUserGuide);
dialog.setTitle(parent.getResources().getText(R.string.menuUserGuide));
ImageView image = (ImageView) dialog.findViewById(R.id.ug_imageAppIcon);
image.setImageResource(R.drawable.icon);
try {
versionName = parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_CONFIGURATIONS)
.versionName;
} catch (NameNotFoundException e) {
versionName = "-";
}
TextView text = (TextView) dialog.findViewById(R.id.ug_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()+ " " + versionName);
((Button) dialog.findViewById(R.id.btn_ugClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
}

+ 82
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/50/00eccc8fcf4b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>

<ScrollView
android:id="@+id/ug_ScrollView"
android:layout_width="wrap_content"
android:addStatesFromChildren="true"
android:layout_height="250dp">
<LinearLayout
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ug_hdr_GenPourpose"
android:textColor="@color/black"
android:textStyle="bold"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:text="@string/header_GeneralPurpose"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ug_txt_GenPourpose"
android:textColor="@color/black"
android:text="@string/text_GeneralPurpose">
</TextView>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/ug_hdr_HowTo" android:textColor="@color/black" android:textStyle="bold" android:layout_marginBottom="5dp" android:layout_marginTop="5dp" android:text="@string/header_HowTo"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ug_txt_HowTo"
android:textColor="@color/black"
android:text="@string/text_HowTo"></TextView>

</LinearLayout>
</ScrollView>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_fs"
android:id="@+id/btn_ugClose"
android:text="Close"
android:textColor="@color/white"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp">
</Button>


</LinearLayout>

+ 247
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/51/f074747d174b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,247 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure) {
super(context);
this.setOrientation(HORIZONTAL);
DisplayMetrics metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private static DisplayMetrics metrics;
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure);
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
int width = getMetrics(context).widthPixels;
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(Math.round(0.20833f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(Math.round(0.35417f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(Math.round(0.14583f * width),
LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics(Context context) {
if (metrics == null) {
metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
}
return metrics;
}
}

+ 83
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/52/10e54343e24b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name="app_name">Easy Bracketing</string>
<string
name="dynamic_range">Dynamikbereich</string>
<string
name="shutter_speed">Belichtungszeit</string>
<string
name="aperture">Blende</string>
<string
name="ev">LW</string>
<string
name="dark_point">Werte Dunkelpunkt</string>
<string
name="bright_point">Werte Hellpunkt</string>
<string
name="calcParams">Berechnungsparameter</string>
<string
name="delta_EV">Δ LW</string>
<string
name="expEVStep">LW-Schritt</string>
<string
name="calculate">Berechnen</string>
<string
name="reset">Zurücksetzen</string>
<string
name="bracketingRes">Bracketing Belichtungswerte</string>
<string
name="expNbrLbl"># Bel.</string>
<string
name="toastWarningDP_BP">Das Delta zwischen dem LW des Dunkelpunkt und dem LW des Hellpunkt ist kleiner oder gleich 0.
\nBitte korrigieren Sie die Eingaben.</string>
<string
name="menuUserGuide">Benutzeranleitung</string>
<string
name="menuSettings">Einstellungen...</string>
<string
name="menuAbout">Info</string>
<string
name="about_Description">
EasyBracketing dient zur schnellen und einfachen Berechnung einer Belichtungsserie ausgehend
von den Belichtungswerten eines Dunkelpunktes und eines Hellpunktes.
</string>
<string
name="AppVersionLabel">Version:</string>
<string
name="about_DevelopedBy">Entwickelt von spherIC (F. Smilari)\nMail an:
merlin868@hotmail.com\n\nÜbersetzt von spherIC (F. Smilari)</string>
<string
name="Percent18Correction">18%-Grauwertkorrektur</string>
<string
name="Percent18CorrectionBP">Hellpunktkorrektur (LW)</string>
<string
name="Percent18CorrectionDP">Dunkelpunktkorrektur (LW)</string>
<string
name="FixRangePoint">Ausgangspunkt für Belichtungsserie</string>
<string
name="FixRangePointBP">Von Hellpunktwerten ausgehen</string>
<string
name="FixRangePointDP">Von Dunkelpunktwerten ausgehen</string>
<string
name="BtnSave">Speichern</string>
<string
name="BtnCancel">Abbrechen</string>
<string
name="BtnClose">Schliessen</string>
<string
name="header_GeneralPurpose">1. Allgm. Verwendungszweck</string>
<string
name="text_GeneralPurpose">
Beim Erstellen einer Belichtungsreihe für ein späteres HDR-Bild, stellt sich oftmals das Problem,
dass der Kontrastumfang zu gross ist um von der typischen \"+2LW/0LW/-2LW\"-Vorgehensweise abgedeckt zu werden.\n
Hier kommt EasyBracketing zum Zug.\n\r
Ausgehend von gemessenen Werten für den hellsten Punkt resp. den dunkelsten Punkt
werden über definierbare Parameter alle notwendigen Belichtungen einer Belichtungsreihe berechnet. Diese können dann
an der Kamera sukzessive eingestellt und die Aufnahme ausgelöst werden.
</string>
<string
name="header_HowTo">2. Vorgehensweise</string>
<string
name="text_HowTo">Text here</string>
</resources>

+ 240
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/52/50b3f680164b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,240 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
private static DisplayMetrics metrics;
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure, int nbrExposures) {
super(context);
this.setOrientation(HORIZONTAL);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private static DisplayMetrics metrics;
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure, this.exposureList.size());
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics() {
if (metrics == null) {
metrics = new DisplayMetrics();
}
return metrics;
}
}

+ 52
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/53/1063b957c64b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>

<LinearLayout>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/ug_Text" android:ellipsize="none" android:text="@string/AppVersion">
</TextView>
</LinearLayout>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_fs"
android:id="@+id/btn_ugClose"
android:text="Close"
android:textColor="@color/white"
android:layout_gravity="center_horizontal">
</Button>


</LinearLayout>

+ 152
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/53/507dec3af64b001014e4d4fb24de02af Целия файл

@@ -0,0 +1,152 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC;
import android.app.Activity;
import android.app.Dialog;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import ch.spherIC.settings.SettingsDlg;
/**
* Dialog factory class.
*/
public final class DialogFactory {
/**
* Static main method to initialize classes
*
* @param dlgCode Code of dialog to instantiate. See {@link EasyBracketMain}
* @param parent Parent {@link Activity}
*
* @return Instantiated dialog
*/
public static Dialog createDialog(int dlgCode, Activity parent) {
Dialog dlg;
switch (dlgCode) {
case EasyBracketMain.ABOUT_DLG:
dlg = createAboutDialog(parent);
break;
case EasyBracketMain.SETTINGS_DLG:
dlg = createSettingsDialog(parent);
break;
case EasyBracketMain.USERGUIDE_DLG:
dlg = createUserGuideDialog(parent);
break;
default:
dlg = null;
break;
}
return dlg;
}
/**
* Creates the About Dialog
*/
private static Dialog createAboutDialog(Activity parent) {
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.about_dialog);
parent.getResources().getText(R.string.menuAbout);
dialog.setTitle(parent.getResources().getText(R.string.menuAbout) + " EasyBracketing...");
ImageView image = (ImageView) dialog.findViewById(R.id.about_imageAppIcon);
image.setImageResource(R.drawable.icon);
TextView text = (TextView) dialog.findViewById(R.id.about_TextDescription);
text.setText(parent.getResources().getText(R.string.about_Description));
text = (TextView) dialog.findViewById(R.id.about_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString()
+ " " + parent.getResources().getText(R.string.AppVersion).toString());
text = (TextView) dialog.findViewById(R.id.about_TextAutor);
text.setText(parent.getResources().getText(R.string.about_DevelopedBy).toString());
((Button) dialog.findViewById(R.id.btn_AboutClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
/**
* Creates the Settings Dialog
*/
private static Dialog createSettingsDialog(Activity parent) {
final Dialog dialog = new SettingsDlg(parent);
return dialog;
}
/**
* Creates the User Guide Dialog
*/
private static Dialog createUserGuideDialog(Activity parent) {
String versionName = "";
final Dialog dialog = new Dialog(parent);
dialog.setContentView(R.layout.userguide_dialog);
parent.getResources().getText(R.string.menuUserGuide);
dialog.setTitle(parent.getResources().getText(R.string.menuUserGuide));
ImageView image = (ImageView) dialog.findViewById(R.id.ug_imageAppIcon);
image.setImageResource(R.drawable.icon);
try {
versionName = parent.getPackageManager().getPackageInfo("ch.spherIC", PackageManager.GET_CONFIGURATIONS)
.versionName;
} catch (NameNotFoundException e) {
versionName = "-";
}
TextView text = (TextView) dialog.findViewById(R.id.ug_TextVersion);
text.setText(parent.getResources().getText(R.string.AppVersionLabel).toString() + " " + versionName);
((Button) dialog.findViewById(R.id.btn_ugClose)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
}

+ 54
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/53/a0a054cdc94b001014c0b77f85c62fe3 Целия файл

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:padding="10dp"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/layout_ugVersion">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:id="@+id/ug_imageAppIcon"
android:layout_gravity="center_vertical" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="iii"
android:id="@+id/ug_TextVersion"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" />
</LinearLayout>

<LinearLayout
android:orientation="vertical" android:scrollbars="vertical" android:layout_height="fill_parent" android:layout_width="fill_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ug_Text"
android:text="@string/userGuidePourpose" android:textColor="@color/black" android:minLines="10" android:maxLines="20">
</TextView>
</LinearLayout>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_fs"
android:id="@+id/btn_ugClose"
android:text="Close"
android:textColor="@color/white"
android:layout_gravity="center_horizontal">
</Button>


</LinearLayout>

+ 241
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/54/60d1a01c164b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,241 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;
import ch.spherIC.R;
/**
* Exposure adapter view class.
*/
class ExposureAdapterView extends LinearLayout {
private static DisplayMetrics metrics;
/**
* Creates a new ExposureAdapterView object.
*
* @param context DOCUMENT ME!
* @param weather DOCUMENT ME!
*/
public ExposureAdapterView(Context context, Exposure exposure, int nbrExposures) {
super(context);
this.setOrientation(HORIZONTAL);
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextAppearance(context, R.style.ResultExposureText);
nbrControl.setText(Integer.toString(exposure.getNbr()));
addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextAppearance(context, R.style.ResultExposureText);
apertureControl.setText(exposure.getAperture());
addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextAppearance(context, R.style.ResultExposureTextSpecial);
shutterControl.setText(exposure.getShutterSpeed());
addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextAppearance(context, R.style.ResultExposureText);
evStepControl.setText(exposure.getEvStepAsString());
addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
expIconControl.setImageBitmap(exposure.getEvStepBtmp());
addView(expIconControl, expIconParams);
}
}
/**
* Exposure results adapter.
*/
public class ExposureAdapter extends BaseAdapter {
private Context context;
private List<Exposure> exposureList;
/**
* Creates a new ExposureAdapter object.
*/
public ExposureAdapter(Context context, List<Exposure> expList) {
this.context = context;
this.exposureList = expList;
}
/**
* Retrieves list size.
*
* @return list size
*/
@Override
public int getCount() {
return this.exposureList.size();
}
/**
* Retrieves the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return Exposure at index <code>position</code>
*/
@Override
public Object getItem(int position) {
return this.exposureList.get(position);
}
/**
* Retrieves the number of the exposure at index <code>position</code>.
*
* @param position Index in list
*
* @return the number of the exposure at index <code>position</code>
*/
@Override
public long getItemId(int position) {
//return this.exposureList.get(position).getNbr();
return position;
}
/**
* Retrieves a view representing a single result row.
*
* @param position Index in list
* @param convertView view
* @param parent parent
*
* @return {@link ExposureAdapterView}
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Exposure exposure = this.exposureList.get(position);
return new ExposureAdapterView(this.context, exposure, this.exposureList.size());
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
public static View getHeaderView(Context context, LinearLayout headerLL) {
int black = headerLL.getResources().getColor(R.color.black);
// Nbr
TextView nbrControl = new TextView(context);
LinearLayout.LayoutParams nbrParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
nbrParams.setMargins(3, 1, 1, 1);
nbrControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
nbrControl.setTextSize(13f);
nbrControl.setTextColor(black);
nbrControl.setText(R.string.expNbrLbl);
headerLL.addView(nbrControl, nbrParams);
// Aperture
TextView apertureControl = new TextView(context);
LinearLayout.LayoutParams apertureParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT, 0.2f);
apertureParams.setMargins(1, 1, 1, 1);
apertureControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
apertureControl.setTextSize(13f);
apertureControl.setTextColor(black);
apertureControl.setText(R.string.aperture);
headerLL.addView(apertureControl, apertureParams);
// Shutter speed
TextView shutterControl = new TextView(context);
LinearLayout.LayoutParams shutterParams = new LinearLayout.LayoutParams(170, LayoutParams.WRAP_CONTENT, 0.2f);
shutterParams.setMargins(1, 1, 1, 1);
shutterControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
shutterControl.setTextSize(13f);
shutterControl.setTextColor(black);
shutterControl.setText(R.string.shutter_speed);
headerLL.addView(shutterControl, shutterParams);
// EV Step
TextView evStepControl = new TextView(context);
LinearLayout.LayoutParams evStepParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
evStepParams.setMargins(1, 1, 1, 1);
evStepControl.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
evStepControl.setTextSize(13f);
evStepControl.setTextColor(black);
evStepControl.setText(R.string.expEVStep);
headerLL.addView(evStepControl, evStepParams);
// Icon
ImageView expIconControl = new ImageView(context);
LinearLayout.LayoutParams expIconParams = new LinearLayout.LayoutParams(70, LayoutParams.WRAP_CONTENT, 0.2f);
expIconParams.setMargins(1, 1, 1, 1);
headerLL.addView(expIconControl, expIconParams);
return headerLL;
}
/**
* Retrieves the value of
*
* @return DOCUMENT ME!
*/
private static DisplayMetrics getMetrics() {
if (metrics == null) {
metrics = new DisplayMetrics();
}
return metrics;
}
}

+ 189
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/54/c051e2580d4b001019f1c5d8b799da37 Целия файл

@@ -0,0 +1,189 @@
/*
* $URL$
* $Revision$
* $LastChangedBy$
* $LastChangedDate$
*
* Copyright (c) 2005 syseca AG, Switzerland
* All rights reserved.
*
* This software is the confidential and proprietary information
* of syseca AG. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you
* entered into with syseca AG.
*/
package ch.spherIC.resultlist;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Bitmap.Config;
import android.graphics.Paint.Style;
import android.util.DisplayMetrics;
import ch.spherIC.EVFormula;
import ch.spherIC.EasyBracketMain;
import ch.spherIC.R;
/**
* Factory that creates the exposure icons according to the EV range and values.
*/
public class ExposureFactory {
public static final DecimalFormat evDF = new DecimalFormat("0.######");
/**
* DOCUMENT ME!
*
* @param context DOCUMENT ME!
* @param dpEV DOCUMENT ME!
* @param bpEv DOCUMENT ME!
* @param calcPrmAperture DOCUMENT ME!
* @param calcPrmEvStep DOCUMENT ME!
* @param fixBP DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public static List<Exposure> calculateExposures(Context context, double dpEV, double bpEv, double calcPrmAperture,
double calcPrmEvStep, boolean fixBP, List<Double> allowedShutters) {
Exposure exp;
List<Exposure> exposures = new ArrayList<Exposure>();
double deltaEV = bpEv - dpEV;
long nbrExposures = Math.round(deltaEV / calcPrmEvStep) + 1;
// correct the deltaEV
deltaEV = calcPrmEvStep * (nbrExposures - 1);
double baseEVStep = -deltaEV / 2;
for (int i = 0; i < nbrExposures; i++) {
boolean found = false;
String shutterSpeed = "";
double shutter;
double evValue = 0;
double evStep = baseEVStep + i * calcPrmEvStep;
if (fixBP) {
evValue = bpEv - (nbrExposures - 1 - i) * calcPrmEvStep;
} else {
evValue = dpEV + i * calcPrmEvStep;
}
shutter = Double.valueOf(evDF.format((EVFormula.calcShutterSpeed(calcPrmAperture, evValue))));
for (int j = 1; j < allowedShutters.size(); j++) {
double v1 = allowedShutters.get(j - 1);
double v2 = allowedShutters.get(j);
if ((v1 <= shutter && shutter <= v2) || (v2 <= shutter && shutter <= v1)) {
if (Math.abs(shutter - v1) <= Math.abs(shutter - v2)) {
shutterSpeed = (v1 < 1) ? "1/" + evDF.format((1 / v1))
: "" + EasyBracketMain.DF.format(v1) + "''";
} else {
shutterSpeed = (v2 < 1) ? "1/" + evDF.format((1 / v2))
: "" + EasyBracketMain.DF.format(v2) + "''";
}
found = true;
break;
}
}
if (!found) {
shutterSpeed = (shutter < 1) ? "1/" + Math.round(1 / shutter)
: "" + EasyBracketMain.DF.format(shutter) + "''";
}
exp = new Exposure(i + 1, "f/" + EasyBracketMain.DF.format(calcPrmAperture), shutterSpeed, evStep, deltaEV,
getExpIcon(context, i + 1, (int) nbrExposures));
exposures.add(exp);
}
return exposures;
}
/**
* Retrieves Icon.
*
* @param context Context
* @param exp {@link Exposure} object
*
* @return Color stepped icon
*/
private static Bitmap getExpIcon(Context context, int expNbr, int nbrExposures) {
Bitmap mIcon;
Bitmap mIconBG;
Bitmap mIconSymbol;
Bitmap mIconSymbol_bl;
Canvas canvas;
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
final Resources res = context.getResources();
final int twentyPercentGray = Math.round(255f * 0.8f);
int deltaRGB = twentyPercentGray;
int iSize;
int iSize_r;
int iStart;
DisplayMetrics metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
switch (metrics.density) {
case DisplayMetrics.DENSITY_LOW:
iSize = 18;
iSize_r = 17;
iStart = 1;
break;
default:
break;
}
if (expNbr > 1 || nbrExposures > 1) {
deltaRGB = twentyPercentGray / (nbrExposures - 1) * (expNbr - 1);
}
// The background
mIconBG = Bitmap.createBitmap(36, 36, Config.ARGB_8888);
mIconBG.eraseColor(0x00000000);
canvas = new Canvas(mIconBG);
mPaint.setStyle(Style.FILL);
mPaint.setColor(Color.argb(255, deltaRGB, deltaRGB, deltaRGB));
canvas.drawRect(2, 2, 33, 33, mPaint);
// Let's retrieve all icon pieces as Bitmaps.
mIcon = BitmapFactory.decodeResource(res, R.drawable.exposureicon_frame);
mIconSymbol = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_white);
mIconSymbol_bl = BitmapFactory.decodeResource(res, R.drawable.exposureicon_symb_black);
// Prepares the paint that will be used to draw our icon mask. Using
// PorterDuff.Mode.SRC_OVER means the image that will be drawn will
// mask the already drawn image.
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
// We're now ready to drawn our Android-like icon :)
if (deltaRGB > twentyPercentGray / 2) {
canvas.drawBitmap(mIconSymbol_bl, 0, 0, mPaint);
} else {
canvas.drawBitmap(mIconSymbol, 0, 0, mPaint);
}
canvas.drawBitmap(mIcon, 0, 0, mPaint);
return mIconBG;
}
}

+ 0
- 0
.metadata/.plugins/org.eclipse.core.resources/.history/54/c0fbbae3f54a001019f1c5d8b799da37 Целия файл


Някои файлове не бяха показани, защото твърде много файлове са промени

Loading…
Отказ
Запис