]> rtime.felk.cvut.cz Git - orte.git/commitdiff
Simplified approach to write application.
authorjiri hubacek <jiri.hubacek@gmail.com>
Sat, 31 Jan 2015 19:51:17 +0000 (20:51 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 9 Feb 2015 16:56:15 +0000 (17:56 +0100)
- no need for fragments
- no need for complex approach to backward compatibility
- usable drawables choosen
- cs language added
- help added
- settings added

44 files changed:
orte/contrib/shape_android/.gitignore
orte/contrib/shape_android/AndroidManifest.xml
orte/contrib/shape_android/build.xml [deleted file]
orte/contrib/shape_android/lint.xml [deleted file]
orte/contrib/shape_android/project.properties
orte/contrib/shape_android/res/drawable-hdpi/ic_action_cast.png [deleted file]
orte/contrib/shape_android/res/drawable-hdpi/ic_action_download.png [deleted file]
orte/contrib/shape_android/res/drawable-hdpi/ic_action_refresh.png [new file with mode: 0644]
orte/contrib/shape_android/res/drawable-mdpi/ic_action_cast.png [deleted file]
orte/contrib/shape_android/res/drawable-mdpi/ic_action_download.png [deleted file]
orte/contrib/shape_android/res/drawable-mdpi/ic_action_refresh.png [new file with mode: 0644]
orte/contrib/shape_android/res/drawable-xhdpi/ic_action_cast.png [deleted file]
orte/contrib/shape_android/res/drawable-xhdpi/ic_action_download.png [deleted file]
orte/contrib/shape_android/res/drawable-xhdpi/ic_action_refresh.png [new file with mode: 0644]
orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_cast.png [deleted file]
orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_download.png [deleted file]
orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_refresh.png [new file with mode: 0644]
orte/contrib/shape_android/res/layout/activity_help.xml [new file with mode: 0644]
orte/contrib/shape_android/res/layout/activity_main.xml [deleted file]
orte/contrib/shape_android/res/layout/activity_publisher.xml [new file with mode: 0644]
orte/contrib/shape_android/res/layout/activity_settings.xml [new file with mode: 0644]
orte/contrib/shape_android/res/layout/fragment_main.xml [deleted file]
orte/contrib/shape_android/res/layout/fragment_publisher.xml [deleted file]
orte/contrib/shape_android/res/layout/fragment_subscriber.xml [deleted file]
orte/contrib/shape_android/res/menu/help.xml [new file with mode: 0644]
orte/contrib/shape_android/res/menu/main.xml [deleted file]
orte/contrib/shape_android/res/menu/publisher.xml
orte/contrib/shape_android/res/menu/subscriber.xml
orte/contrib/shape_android/res/values-cs/strings.xml [new file with mode: 0644]
orte/contrib/shape_android/res/values-v11/styles.xml
orte/contrib/shape_android/res/values-v14/styles.xml
orte/contrib/shape_android/res/values/strings.xml
orte/contrib/shape_android/res/values/styles.xml
orte/contrib/shape_android/src/org/ocera/orte/shape4a/MainActivity.java [deleted file]
orte/contrib/shape_android/src/org/ocera/orte/shape4a/PublisherFragment.java [deleted file]
orte/contrib/shape_android/src/org/ocera/orte/shape4a/SubscriberFragment.java [deleted file]
orte/contrib/shape_android/src/org/ocera/orte/shape_android/BoxType.java [moved from orte/contrib/shape_android/src/org/ocera/orte/shape4a/BoxType.java with 89% similarity]
orte/contrib/shape_android/src/org/ocera/orte/shape_android/HelpActivity.java [new file with mode: 0644]
orte/contrib/shape_android/src/org/ocera/orte/shape_android/PublisherActivity.java [new file with mode: 0644]
orte/contrib/shape_android/src/org/ocera/orte/shape_android/PublisherShape.java [moved from orte/contrib/shape_android/src/org/ocera/orte/shape4a/PublisherShape.java with 95% similarity]
orte/contrib/shape_android/src/org/ocera/orte/shape_android/PublisherView.java [moved from orte/contrib/shape_android/src/org/ocera/orte/shape4a/PublisherView.java with 93% similarity]
orte/contrib/shape_android/src/org/ocera/orte/shape_android/SettingsActivity.java [new file with mode: 0644]
orte/contrib/shape_android/src/org/ocera/orte/shape_android/SubscriberElement.java [moved from orte/contrib/shape_android/src/org/ocera/orte/shape4a/SubscriberElement.java with 89% similarity]
orte/contrib/shape_android/src/org/ocera/orte/shape_android/SubscriberView.java [moved from orte/contrib/shape_android/src/org/ocera/orte/shape4a/SubscriberView.java with 84% similarity]

index 943202ae48828821f641846138f185b6f29e68ba..5808629bb3651f214aab23e7dadb2906f3ef81c9 100644 (file)
@@ -14,6 +14,8 @@ gen/
 libs/
 obj/
 
+.settings/
+
 # Gradle files
 .gradle/
 build/
index 6b0fcf3868fb172034f64b851c40ec0b3d2aaff7..2aa7a53796eb32e4026f808a670cf129e0f78115 100644 (file)
@@ -1,32 +1,40 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="org.ocera.orte.shape4a"
+    package="org.ocera.orte.shape_android"
     android:versionCode="1"
-    android:versionName="1.1" >
+    android:versionName="1.2" >
 
     <uses-sdk
-        android:minSdkVersion="8"
+        android:minSdkVersion="10"
         android:targetSdkVersion="15" />
 
-     <uses-permission android:name="android.permission.INTERNET"/>
-     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
-     <uses-permission android:name="android.permission.WAKE_LOCK"/>
-    
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.WAKE_LOCK" />
+
     <application
         android:allowBackup="true"
         android:icon="@drawable/ic_launcher"
         android:label="@string/app_name"
         android:theme="@style/AppTheme" >
         <activity
-            android:name=".MainActivity"
-            android:label="@string/app_name"
-            android:configChanges="screenSize|orientation" >
-            <intent-filter>
+            android:name=".PublisherActivity"
+            android:configChanges="screenSize|orientation"
+            android:label="@string/title_activity_publisher" >
+            <intent-filter android:label="@string/app_name" >
                 <action android:name="android.intent.action.MAIN" />
 
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
+        <activity
+            android:name=".HelpActivity"
+            android:label="@string/title_activity_help" >
+        </activity>
+        <activity
+            android:name=".SettingsActivity"
+            android:label="@string/title_activity_settings" >
+        </activity>
     </application>
 
 </manifest>
diff --git a/orte/contrib/shape_android/build.xml b/orte/contrib/shape_android/build.xml
deleted file mode 100644 (file)
index a64a1ea..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="shape4a" default="help">
-
-    <!-- The local.properties file is created and updated by the 'android' tool.
-         It contains the path to the SDK. It should *NOT* be checked into
-         Version Control Systems. -->
-    <property file="local.properties" />
-
-    <!-- The ant.properties file can be created by you. It is only edited by the
-         'android' tool to add properties to it.
-         This is the place to change some Ant specific build properties.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         For other overridable properties, look at the beginning of the rules
-         files in the SDK, at tools/ant/build.xml
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
-    <property file="ant.properties" />
-
-    <!-- if sdk.dir was not set from one of the property file, then
-         get it from the ANDROID_HOME env var.
-         This must be done before we load project.properties since
-         the proguard config can use sdk.dir -->
-    <property environment="env" />
-    <condition property="sdk.dir" value="${env.ANDROID_HOME}">
-        <isset property="env.ANDROID_HOME" />
-    </condition>
-
-    <!-- The project.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-
-         This contains project specific properties such as project target, and library
-         dependencies. Lower level build properties are stored in ant.properties
-         (or in .classpath for Eclipse projects).
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
-    <loadproperties srcFile="project.properties" />
-
-    <!-- quick check on sdk.dir -->
-    <fail
-            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
-            unless="sdk.dir"
-    />
-
-    <!--
-        Import per project custom build rules if present at the root of the project.
-        This is the place to put custom intermediary targets such as:
-            -pre-build
-            -pre-compile
-            -post-compile (This is typically used for code obfuscation.
-                           Compiled code location: ${out.classes.absolute.dir}
-                           If this is not done in place, override ${out.dex.input.absolute.dir})
-            -post-package
-            -post-build
-            -pre-clean
-    -->
-    <import file="custom_rules.xml" optional="true" />
-
-    <!-- Import the actual build file.
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <import> task.
-             - customize it to your needs.
-         - Customize the whole content of build.xml
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, replacing the <import> task.
-             - customize to your needs.
-
-         ***********************
-         ****** IMPORTANT ******
-         ***********************
-         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
-         in order to avoid having your file be overridden by tools such as "android update project"
-    -->
-    <!-- version-tag: 1 -->
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
diff --git a/orte/contrib/shape_android/lint.xml b/orte/contrib/shape_android/lint.xml
deleted file mode 100644 (file)
index ee0eead..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<lint>
-</lint>
\ No newline at end of file
index f970a6c0d5a9823e5548839407abe7dc9661d76a..0675cec65d1ddeed01e1708201d35a607d7fd920 100644 (file)
@@ -12,5 +12,4 @@
 
 # Project target.
 target=android-15
-android.library.reference.1=../../../../../workspace/appcompat_v7
-android.library.reference.2=../../libaorte
+android.library.reference.1=../../dev/orte/orte/libaorte
diff --git a/orte/contrib/shape_android/res/drawable-hdpi/ic_action_cast.png b/orte/contrib/shape_android/res/drawable-hdpi/ic_action_cast.png
deleted file mode 100644 (file)
index 066ddd5..0000000
Binary files a/orte/contrib/shape_android/res/drawable-hdpi/ic_action_cast.png and /dev/null differ
diff --git a/orte/contrib/shape_android/res/drawable-hdpi/ic_action_download.png b/orte/contrib/shape_android/res/drawable-hdpi/ic_action_download.png
deleted file mode 100644 (file)
index 9fc6455..0000000
Binary files a/orte/contrib/shape_android/res/drawable-hdpi/ic_action_download.png and /dev/null differ
diff --git a/orte/contrib/shape_android/res/drawable-hdpi/ic_action_refresh.png b/orte/contrib/shape_android/res/drawable-hdpi/ic_action_refresh.png
new file mode 100644 (file)
index 0000000..dae2790
Binary files /dev/null and b/orte/contrib/shape_android/res/drawable-hdpi/ic_action_refresh.png differ
diff --git a/orte/contrib/shape_android/res/drawable-mdpi/ic_action_cast.png b/orte/contrib/shape_android/res/drawable-mdpi/ic_action_cast.png
deleted file mode 100644 (file)
index 49e214b..0000000
Binary files a/orte/contrib/shape_android/res/drawable-mdpi/ic_action_cast.png and /dev/null differ
diff --git a/orte/contrib/shape_android/res/drawable-mdpi/ic_action_download.png b/orte/contrib/shape_android/res/drawable-mdpi/ic_action_download.png
deleted file mode 100644 (file)
index 84b43d3..0000000
Binary files a/orte/contrib/shape_android/res/drawable-mdpi/ic_action_download.png and /dev/null differ
diff --git a/orte/contrib/shape_android/res/drawable-mdpi/ic_action_refresh.png b/orte/contrib/shape_android/res/drawable-mdpi/ic_action_refresh.png
new file mode 100644 (file)
index 0000000..94ab6f4
Binary files /dev/null and b/orte/contrib/shape_android/res/drawable-mdpi/ic_action_refresh.png differ
diff --git a/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_cast.png b/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_cast.png
deleted file mode 100644 (file)
index 7c4d657..0000000
Binary files a/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_cast.png and /dev/null differ
diff --git a/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_download.png b/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_download.png
deleted file mode 100644 (file)
index 702ad47..0000000
Binary files a/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_download.png and /dev/null differ
diff --git a/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_refresh.png b/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_refresh.png
new file mode 100644 (file)
index 0000000..ab4ab9d
Binary files /dev/null and b/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_refresh.png differ
diff --git a/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_cast.png b/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_cast.png
deleted file mode 100644 (file)
index f394a34..0000000
Binary files a/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_cast.png and /dev/null differ
diff --git a/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_download.png b/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_download.png
deleted file mode 100644 (file)
index 6bcd831..0000000
Binary files a/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_download.png and /dev/null differ
diff --git a/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_refresh.png b/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_refresh.png
new file mode 100644 (file)
index 0000000..44ee117
Binary files /dev/null and b/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_refresh.png differ
diff --git a/orte/contrib/shape_android/res/layout/activity_help.xml b/orte/contrib/shape_android/res/layout/activity_help.xml
new file mode 100644 (file)
index 0000000..28d11a2
--- /dev/null
@@ -0,0 +1,124 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:orientation="vertical"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    tools:context="org.ocera.orte.shape_android.HelpActivity" >
+
+    <ScrollView
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent">
+        
+           <LinearLayout
+               android:orientation="vertical"
+               android:layout_width="fill_parent"
+               android:layout_height="wrap_content"
+               android:padding="6dp">
+               
+                   <TextView
+                               android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_intro_ORTE_header"
+                           android:paddingBottom="4dp" />
+                       <TextView
+                               android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_intro_ORTE"
+                           android:paddingBottom="4dp" />
+                       <TextView
+                               android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_intro_shape_header"
+                           android:paddingBottom="4dp" />
+                       <TextView
+                               android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_intro_shape"
+                           android:paddingBottom="4dp" />
+                       
+                       <TextView
+                               android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_icons"
+                           android:paddingBottom="4dp"
+                           android:paddingTop="16dp" />
+                       <LinearLayout
+                       android:orientation="horizontal"
+                       android:layout_width="fill_parent"
+                       android:layout_height="wrap_content">
+                       <ImageView
+                           android:layout_width="wrap_content"
+                           android:layout_height="wrap_content"
+                           android:contentDescription="@string/help_refresh"
+                           android:src="@drawable/ic_action_refresh"
+                           android:background="@android:color/background_dark" />
+                       <TextView
+                           android:layout_width="wrap_content"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_refresh"
+                           android:paddingLeft="4dp" />
+                   </LinearLayout>
+                       <LinearLayout
+                       android:orientation="horizontal"
+                       android:layout_width="fill_parent"
+                       android:layout_height="wrap_content">
+                       <ImageView
+                           android:layout_width="wrap_content"
+                           android:layout_height="wrap_content"
+                           android:contentDescription="@string/help_new"
+                           android:src="@drawable/ic_action_new"
+                           android:background="@android:color/background_dark" />
+                       <TextView
+                           android:layout_width="wrap_content"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_new"
+                           android:paddingLeft="4dp" />
+                   </LinearLayout>
+                   
+                   <TextView
+                               android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_defaultMenu"
+                           android:paddingBottom="4dp"
+                           android:paddingTop="16dp" />
+                   <TextView
+                               android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_defaultMenu_element1"
+                           android:paddingBottom="4dp" />
+                   <TextView
+                               android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_defaultMenu_element2"
+                           android:paddingBottom="4dp" />
+                   
+                   <TextView
+                               android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_publishersMenu"
+                           android:paddingBottom="4dp"
+                           android:paddingTop="16dp" />
+                   <TextView
+                               android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_publishersMenu_element"
+                           android:paddingBottom="4dp" />
+                   
+                   <TextView
+                               android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_subscribersMenu"
+                           android:paddingBottom="4dp"
+                           android:paddingTop="16dp" />
+                   <TextView
+                               android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:text="@string/help_subscribersMenu_element"
+                           android:paddingBottom="4dp" />
+        </LinearLayout>
+    </ScrollView>
+</LinearLayout>
diff --git a/orte/contrib/shape_android/res/layout/activity_main.xml b/orte/contrib/shape_android/res/layout/activity_main.xml
deleted file mode 100644 (file)
index 57bafec..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/pager"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context="org.ocera.orte.shape4a.MainActivity" />
diff --git a/orte/contrib/shape_android/res/layout/activity_publisher.xml b/orte/contrib/shape_android/res/layout/activity_publisher.xml
new file mode 100644 (file)
index 0000000..df7af63
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ViewSwitcher xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/switcher"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent">
+    
+<RelativeLayout
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <org.ocera.orte.shape_android.PublisherView
+        android:id="@+id/publisher_view"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent" />
+
+</RelativeLayout>
+
+<RelativeLayout
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <org.ocera.orte.shape_android.SubscriberView
+        android:id="@+id/subscriber_view"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent" />
+
+</RelativeLayout>
+
+</ViewSwitcher>
\ No newline at end of file
diff --git a/orte/contrib/shape_android/res/layout/activity_settings.xml b/orte/contrib/shape_android/res/layout/activity_settings.xml
new file mode 100644 (file)
index 0000000..e367bb3
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+       <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    
+       <CheckBoxPreference
+           android:defaultValue="true"
+           android:key="prefScaling"
+           android:summary="@string/settings_scaling_description"
+           android:title="@string/settings_scaling" />
+
+       <EditTextPreference
+        android:title="@string/settings_managers"
+        android:summary="@string/settings_managers_description"
+        android:key="prefManagers"/>
+       
+</PreferenceScreen>
diff --git a/orte/contrib/shape_android/res/layout/fragment_main.xml b/orte/contrib/shape_android/res/layout/fragment_main.xml
deleted file mode 100644 (file)
index fcb917b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:paddingBottom="@dimen/activity_vertical_margin"
-    android:paddingLeft="@dimen/activity_horizontal_margin"
-    android:paddingRight="@dimen/activity_horizontal_margin"
-    android:paddingTop="@dimen/activity_vertical_margin"
-    tools:context="org.ocera.orte.shape4a.MainActivity$PlaceholderFragment" >
-
-    <TextView
-        android:id="@+id/section_label"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</RelativeLayout>
diff --git a/orte/contrib/shape_android/res/layout/fragment_publisher.xml b/orte/contrib/shape_android/res/layout/fragment_publisher.xml
deleted file mode 100644 (file)
index 83d4697..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:paddingBottom="@dimen/activity_vertical_margin"
-    android:paddingLeft="@dimen/activity_horizontal_margin"
-    android:paddingRight="@dimen/activity_horizontal_margin"
-    android:paddingTop="@dimen/activity_vertical_margin"
-    tools:context="org.ocera.orte.shape4a.MainActivity$PublisherFragment" >
-
-    <org.ocera.orte.shape4a.PublisherView
-        android:id="@+id/publisher_view"
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent" />
-    
-</RelativeLayout>
diff --git a/orte/contrib/shape_android/res/layout/fragment_subscriber.xml b/orte/contrib/shape_android/res/layout/fragment_subscriber.xml
deleted file mode 100644 (file)
index eff30d5..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:paddingBottom="@dimen/activity_vertical_margin"
-    android:paddingLeft="@dimen/activity_horizontal_margin"
-    android:paddingRight="@dimen/activity_horizontal_margin"
-    android:paddingTop="@dimen/activity_vertical_margin"
-    tools:context="org.ocera.orte.shape4a.MainActivity$SubscriberFragment" >
-
-    <org.ocera.orte.shape4a.SubscriberView
-        android:id="@+id/subscriber_view"
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent" />
-
-</RelativeLayout>
diff --git a/orte/contrib/shape_android/res/menu/help.xml b/orte/contrib/shape_android/res/menu/help.xml
new file mode 100644 (file)
index 0000000..30e85b8
--- /dev/null
@@ -0,0 +1,5 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:context="org.ocera.orte.shape_android.HelpActivity" >
+
+</menu>
diff --git a/orte/contrib/shape_android/res/menu/main.xml b/orte/contrib/shape_android/res/menu/main.xml
deleted file mode 100644 (file)
index 3671a87..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
-    tools:context="org.ocera.orte.shape4a.MainActivity" >
-
-    <item
-        android:id="@+id/action_settings"
-        android:orderInCategory="100"
-        android:title="@string/action_settings"
-        app:showAsAction="never" />
-    
-    <item 
-        android:id="@+id/action_help"  
-        android:orderInCategory="101"
-        android:title="@string/action_help"
-        app:showAsAction="never" />
-    
-
-</menu>
index 090b25de3cd83657c01cb2273e8e6adc63d4b56b..33cad24e082925ec6f5c54f54faceccc2d9836d1 100644 (file)
@@ -1,14 +1,30 @@
 <menu xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    tools:context="org.ocera.orte.shape4a.MainActivity" >
+    tools:context="org.ocera.orte.shape_android.PublisherActivity" >
+
+    <item
+        android:id="@+id/action_switch"
+        android:orderInCategory="5"
+        android:showAsAction="ifRoom"
+        android:title="@string/action_switch"
+        android:icon="@drawable/ic_action_refresh" />
     
     <item
         android:id="@+id/action_new"
         android:orderInCategory="10"
+        android:showAsAction="ifRoom"
         android:title="@string/action_new"
-        android:icon="@drawable/ic_action_new"
-        app:showAsAction="ifRoom" />
+        android:icon="@drawable/ic_action_new" />
     
+    <item
+        android:id="@+id/action_settings"
+        android:orderInCategory="100"
+        android:showAsAction="never"
+        android:title="@string/action_settings" />
+    <item
+        android:id="@+id/action_help"
+        android:orderInCategory="101"
+        android:showAsAction="never"
+        android:title="@string/action_help" />
 
 </menu>
index 1e0a5b08a57ca9cf9c4e7833590df757f4fdec68..3bcc9317c6a2cfda6ae7460bda84734ddaf2e0fc 100644 (file)
@@ -1,27 +1,43 @@
-<?xml version="1.0" encoding="utf-8"?>
 <menu xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    tools:context="org.ocera.orte.shape4a.MainActivity" >
+    tools:context="org.ocera.orte.shape_android.SubscriberActivity" >
+
+    <item
+        android:id="@+id/action_switch"
+        android:orderInCategory="5"
+        android:showAsAction="ifRoom"
+        android:title="@string/action_switch"
+        android:icon="@drawable/ic_action_refresh" />
     
     <item android:id="@+id/action_blue"
           android:title="@string/action_blue"
-          app:showAsAction="never" />
+          android:showAsAction="never" />
     
     <item android:id="@+id/action_green"
           android:title="@string/action_green"
-          app:showAsAction="never" />
+          android:showAsAction="never" />
     
     <item android:id="@+id/action_red"
           android:title="@string/action_red"
-          app:showAsAction="never" />
+          android:showAsAction="never" />
     
     <item android:id="@+id/action_black"
           android:title="@string/action_black"
-          app:showAsAction="never" />
+          android:showAsAction="never" />
     
     <item android:id="@+id/action_yellow"
           android:title="@string/action_yellow"
-          app:showAsAction="never" />
+          android:showAsAction="never" />
+    
+    <item
+        android:id="@+id/action_settings"
+        android:orderInCategory="100"
+        android:showAsAction="never"
+        android:title="@string/action_settings" />
+    <item
+        android:id="@+id/action_help"
+        android:orderInCategory="101"
+        android:showAsAction="never"
+        android:title="@string/action_help" />
 
 </menu>
diff --git a/orte/contrib/shape_android/res/values-cs/strings.xml b/orte/contrib/shape_android/res/values-cs/strings.xml
new file mode 100644 (file)
index 0000000..0fa5e2f
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <string name="app_name">ORTE demo aplikace</string>
+    
+    <string name="title_activity_subscriber">Subscribers</string>
+    <string name="title_activity_publisher">Publishers</string>
+    <string name="title_activity_help">Nápověda</string>
+    <string name="title_activity_settings">Nastavení</string>
+    
+    <string name="action_switch">Přepni</string>
+    <string name="action_new">Nový</string>
+    <string name="action_settings">Nastavení</string>
+    <string name="action_help">Nápověda</string>
+    
+    <string name="action_blue">Modrá</string>
+    <string name="action_green">Zelená</string>
+    <string name="action_red">Červená</string>
+    <string name="action_black">Černá</string>
+    <string name="action_yellow">Žlutá</string>
+    
+    <string name="dialog_OK">OK</string>
+    <string name="dialog_cancel">Zrušit</string>
+    <string name="dialog_delete">Smazat</string>
+    <string name="dialog_add">Přidat</string>
+    <string name="dialog_newPublisher">Barva pro nový Publisher?</string>
+    <string name="dialog_publisherSettings">Publisher #</string>
+    
+    <string name="help_intro_ORTE_header"><big>O projektu ORTE</big></string>
+    <string name="help_intro_ORTE">Open Real-Time Ethernet (ORTE) je open source implementace Real-Time Publish-Subscribe (RTPS) komunikačního protokolu. RTPS je nový protokol aplikační vrstvy cílící na oblast real-time komunikace, postavené na UDP protokolu. Protože existuje mnoho implementací TCP/IP v mnoha operačních systémech a RTPS protokol nemá žádné speciální HW/SW nároky, měl by být lehce portovatelný na mnoho cílových HW/SW platforem. Protože používá pouze UDP protokol, zachovává řízení časování a spolehlivosti. [<a href="http://orte.sourceforge.net/">zdroj</a>]</string>
+    <string name="help_intro_shape_header"><big>O programu Shape</big></string>
+    <string name="help_intro_shape">Shape je zkušební aplikace dodávaná se zdrojovým kódem ORTE.</string>
+    
+    <string name="help_icons"><big>Ikony</big></string>
+    <string name="help_refresh">Přepne z Publisherů na Subscribery a zpátky.</string>
+    <string name="help_new">Vytvoří nový Publisher.</string>
+    
+    <string name="help_defaultMenu"><big>Základní menu</big></string>
+    <string name="help_defaultMenu_element1"><b>Nastavení</b> - nastavení parametrů jako IP adresy Managerů, scaling, &#8230;</string>
+    <string name="help_defaultMenu_element2"><b>Nápověda</b> - zobrazí tuto nápovědu.</string>
+    
+    <string name="help_publishersMenu"><big>Publisher menu</big></string>
+    <string name="help_publishersMenu_element"><b>#n Color Shape</b> (např. #1 Red Circle) je označení Publisherů. #n je sekvenční číslo následované barvou a tvarem. Po kliknutí se objeví menu, kde se nastavuje síla (strength) Publishera. Pokud je přidáno dva a více Publisherů stejné barvy, je Subscribery preferován ten s největší silou.</string>
+    
+    <string name="help_subscribersMenu"><big>Subscriber menu</big></string>
+    <string name="help_subscribersMenu_element"><b>Modrá, Zelená, Červená, Černá, Žlutá</b> - ve výchozím nastavení je nastavené odebírání každé barvy. Nicméně odebírání určité barvy může být vymazáno (a znovu přidáno) a může být nastaven čas pro minimální zpoždění aktualizací Publisherů.</string>
+    
+    <string name="settings_scaling">Scaling</string>
+    <string name="settings_scaling_description">Povolí normování velikosti mezi implementací programu Shape pro Android a základní verzí.</string>
+    <string name="settings_managers">Managers</string>
+    <string name="settings_managers_description">IP adresy Managerů oddělené čárkou (,)</string>
+    
+
+</resources>
index a4a95bc46a1b0ffd0e785ae12c6e931ba8de504e..3c02242ad044be9b8c7c09e7c90c5d427763fe97 100644 (file)
@@ -4,7 +4,7 @@
         Base application theme for API 11+. This theme completely replaces
         AppBaseTheme from res/values/styles.xml on API 11+ devices.
     -->
-    <style name="AppBaseTheme" parent="Theme.AppCompat.Light">
+    <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
         <!-- API 11 theme customizations can go here. -->
     </style>
 
index 664f4f1622586572dae066c219ea0fc311df64c4..a91fd0372b20f85e284fc2fa2ce949176dfdf6e5 100644 (file)
@@ -5,7 +5,7 @@
         AppBaseTheme from BOTH res/values/styles.xml and
         res/values-v11/styles.xml on API 14+ devices.
     -->
-    <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+    <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
         <!-- API 14 theme customizations can go here. -->
     </style>
 
index 3a3b40b62bcfd3c6ce1a6f4fd3ea519ac9863091..1fc4ef72e6b27794c96ede3117bb0c3dcc0d8603 100644 (file)
@@ -1,20 +1,54 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
 
-    <string name="app_name">shape4a</string>
-    <string name="dialog_OK">OK</string>
-    <string name="dialog_cancel">Cancel</string>
-    <string name="dialog_newPublisher">Color for new Publisher?</string>
-    <string name="dialog_publisherSettings">Publisher #</string>
-    <string name="dialog_delete">Delete</string>
-    <string name="dialog_add">Add</string>
+    <string name="app_name">ORTE demo application</string>
+    
+    <string name="title_activity_subscriber">Subscribers</string>
+    <string name="title_activity_publisher">Publishers</string>
+    <string name="title_activity_help">Help</string>
+    <string name="title_activity_settings">Settings</string>
+    
+    <string name="action_switch">Switch</string>
+    <string name="action_new">New</string>
     <string name="action_settings">Settings</string>
     <string name="action_help">Help</string>
+    
     <string name="action_blue">Blue</string>
     <string name="action_green">Green</string>
     <string name="action_red">Red</string>
     <string name="action_black">Black</string>
     <string name="action_yellow">Yellow</string>
-    <string name="action_new">New</string>
+    
+    <string name="dialog_OK">OK</string>
+    <string name="dialog_cancel">Cancel</string>
+    <string name="dialog_delete">Delete</string>
+    <string name="dialog_add">Add</string>
+    <string name="dialog_newPublisher">Color for new Publisher?</string>
+    <string name="dialog_publisherSettings">Publisher #</string>
+    
+    <string name="help_intro_ORTE_header"><big>About ORTE</big></string>
+    <string name="help_intro_ORTE">The Open Real-Time Ethernet (ORTE) is an open source implementation of Real-Time Publish-Subscribe (RTPS) communication protocol. RTPS is new application layer protocol targeted to real-time communication area, which is build on the top of standard UDP stack. Since there are many TCP/IP stack implementations under many operating systems and RTPS protocol does not have any other special HW/SW requirements, it should be easily ported to many HW/SW target platforms. Because it uses only UDP protocol, it retains control of timing and reliability. [<a href="http://orte.sourceforge.net/">source</a>]</string>
+    <string name="help_intro_shape_header"><big>About Shape</big></string>
+    <string name="help_intro_shape">Shape is demo application delivered with ORTE source code.</string>
+    
+    <string name="help_icons"><big>Icons</big></string>
+    <string name="help_refresh">Goes from Publishers to Subscribers and back.</string>
+    <string name="help_new">Create new Publisher.</string>
+    
+    <string name="help_defaultMenu"><big>Generic menu</big></string>
+    <string name="help_defaultMenu_element1"><b>Settings</b> - set up parameters like IP addresses of Managers, scaling, &#8230;</string>
+    <string name="help_defaultMenu_element2"><b>Help</b> - shows this help.</string>
+    
+    <string name="help_publishersMenu"><big>Publisher menu</big></string>
+    <string name="help_publishersMenu_element"><b>#n Color Shape</b> (i.e. #1 Red Circle) is how Publishers are denoted. #n is sequence number followed by color and shape. When Publisher is clicked, settings menu appear, where strength of Publisher may be changed. If two and more Publishers of same color are added, the one with the greatest strength is preferred by Subscribers.</string>
+    
+    <string name="help_subscribersMenu"><big>Subscriber menu</big></string>
+    <string name="help_subscribersMenu_element"><b>Blue, Green, Red, Black, Yellow</b> - subscribing to each color is set to enabled by default. However, the subscription may be deleted (and added again) for certain color and minimum separation time may be set.</string>
+    
+    <string name="settings_scaling">Scaling</string>
+    <string name="settings_scaling_description">Allow scaling for shapes</string>
+    <string name="settings_managers">Managers</string>
+    <string name="settings_managers_description">Comma separated Manager\'s IP addresses</string>
+    
 
 </resources>
index 845fb572b9f0ebd686fd2172451876f88402c61f..6ce89c7ba4394d8cab27953d41456ce234ca37c3 100644 (file)
@@ -4,7 +4,7 @@
         Base application theme, dependent on API level. This theme is replaced
         by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
     -->
-    <style name="AppBaseTheme" parent="Theme.AppCompat.Light">
+    <style name="AppBaseTheme" parent="android:Theme.Light">
         <!--
             Theme customizations available in newer API levels can go in
             res/values-vXX/styles.xml, while customizations related to
diff --git a/orte/contrib/shape_android/src/org/ocera/orte/shape4a/MainActivity.java b/orte/contrib/shape_android/src/org/ocera/orte/shape4a/MainActivity.java
deleted file mode 100644 (file)
index 7de0d7b..0000000
+++ /dev/null
@@ -1,342 +0,0 @@
-/**
- * 
- *     This file is part of shape4a.
- *
- *  shape4a is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  shape4a is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with shape4a.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ocera.orte.shape4a;
-
-import java.util.regex.Pattern;
-
-import android.support.v7.app.ActionBarActivity;
-import android.support.v4.app.DialogFragment;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentPagerAdapter;
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.net.wifi.WifiManager;
-import android.net.wifi.WifiManager.WifiLock;
-import android.os.Bundle;
-import android.support.v4.view.ViewPager;
-import android.text.InputType;
-import android.text.format.Formatter;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.widget.EditText;
-import android.widget.LinearLayout;
-
-import org.ocera.orte.DomainApp;
-import org.ocera.orte.Manager;
-
-//TODO Better navigation (swipe sometimes miss drag).
-
-/**
- * Main application activity, when application
- * launch, this activity is choosen.
- * 
- * @author jiri hubacek <jiri.hubacek@gmail.com>
- * @version %I%, %G%
- * @since 1.0
- */
-public class MainActivity extends ActionBarActivity {
-       public final static Pattern IP_ADDRESS = Pattern.compile("((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))");
-       
-       /**
-        * The {@link android.support.v4.view.PagerAdapter} that will provide
-        * fragments for each of the sections. We use a {@link FragmentPagerAdapter}
-        * derivative, which will keep every loaded fragment in memory. If this
-        * becomes too memory intensive, it may be best to switch to a
-        * {@link android.support.v4.app.FragmentStatePagerAdapter}.
-        */
-       SectionsPagerAdapter mSectionsPagerAdapter;
-
-       /**
-        * The {@link ViewPager} that will host the section contents.
-        */
-       ViewPager mViewPager;
-
-       private WifiManager wifiManager;
-       private WifiLock wifiLock;
-       
-       private Manager orteManager;
-       private DomainApp appDomain;
-       
-       private SettingsDialogFragment settingsDialogFragment = new SettingsDialogFragment();
-       private HelpDialogFragment helpDialogFragment = new HelpDialogFragment();
-
-       /**
-        * Setting up workspace.
-        * 
-        * @param savedInstanceState
-        * @since 1.0
-        */
-       @Override
-       protected void onCreate(Bundle savedInstanceState) {
-               super.onCreate(savedInstanceState);
-               setContentView(R.layout.activity_main);
-
-               // Create the adapter that will return a fragment for each of the three
-               // primary sections of the activity.
-               mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
-
-               // Set up the ViewPager with the sections adapter.
-               mViewPager = (ViewPager) findViewById(R.id.pager);
-               mViewPager.setAdapter(mSectionsPagerAdapter);
-               
-               // From Robot_Demo project.
-               wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
-               wifiLock = (WifiLock) wifiManager.createWifiLock((
-                                       (android.os.Build.VERSION.SDK_INT >= 12)
-                                       ? WifiManager.WIFI_MODE_FULL_HIGH_PERF
-                                       : WifiManager.WIFI_MODE_FULL
-                               ), getClass().getName());
-               
-                               
-               // Start ORTE.
-               orteManager = new Manager("");
-               appDomain = new DomainApp();
-               
-       }
-
-       /**
-        * When pause activity, release WiFi lock.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public void onPause()
-       {
-               super.onPause();
-               
-               wifiLock.release();
-       }
-       
-       /**
-        * When resume activity, acquire WiFi lock.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public void onResume()
-       {
-               super.onResume();
-               
-               wifiLock.acquire();
-       }
-       
-       /**
-        * When switching application off.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public void onDestroy()
-       {
-               super.onDestroy();
-               
-               if (appDomain != null) {
-                       appDomain.destroy();
-                       appDomain = null;
-               }
-               if (orteManager != null) {
-                       orteManager.destroy();
-                       orteManager = null;
-               }
-       }
-       
-       /**
-        * Adding elements to menu.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public boolean onCreateOptionsMenu(Menu menu) {
-               // Inflate the menu; this adds items to the action bar if it is present.
-               getMenuInflater().inflate(R.menu.main, menu);
-               return true;
-       }
-
-       /**
-        * When Settings or Help button is selected.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public boolean onOptionsItemSelected(MenuItem item) {
-               // Handle action bar item clicks here. The action bar will
-               // automatically handle clicks on the Home/Up button, so long
-               // as you specify a parent activity in AndroidManifest.xml.
-               int id = item.getItemId();
-               switch (id) {
-               case R.id.action_settings:
-                       //TODO Menu Settings (prefer own activity)
-                       // Ideas about settings:
-                       // - input for manager's ip adresses
-                       // - enable/disable scaling, destination screen size
-                       
-                       settingsDialogFragment.show(getSupportFragmentManager(), "dialog");
-                       return true;
-               case R.id.action_help:
-                       //TODO Menu Help (prefer own activity)
-                       
-                       helpDialogFragment.show(getSupportFragmentManager(), "dialog");
-                       return true;
-               default:
-                       // Nothing...
-               }
-               return super.onOptionsItemSelected(item);
-       }
-
-       /**
-        * A {@link FragmentPagerAdapter} that returns a fragment corresponding to
-        * one of the sections/tabs/pages.
-        */
-       public class SectionsPagerAdapter extends FragmentPagerAdapter {
-
-               public SectionsPagerAdapter(FragmentManager fm) {
-                       super(fm);
-               }
-
-               @Override
-               public Fragment getItem(int position) {
-                       // getItem is called to instantiate the fragment for the given page.
-                       // Return a PlaceholderFragment (defined as a static inner class
-                       // below).
-                       if (position == 0) {
-                               PublisherFragment fragment = new PublisherFragment(appDomain);
-                               fragment.setHasOptionsMenu(true);
-                               return fragment;
-                       } else {
-                               SubscriberFragment fragment = new SubscriberFragment(appDomain);
-                               fragment.setHasOptionsMenu(true);
-                               return fragment;
-                       }
-               }
-
-               @Override
-               public int getCount() {
-                       // Show 2 total pages - Publisher and Subscriber
-                       return 2;
-               }
-       }
-       
-       /**
-        * Very easy help/about.
-        * 
-        * @since 1.0
-        */
-       public class HelpDialogFragment extends DialogFragment
-       {
-               /**
-                * Create dialog window.
-                * 
-                * @since 1.0
-                */
-               @Override
-               public Dialog onCreateDialog(Bundle savedInstanceState)
-               {
-                       AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
-                       builder.setTitle("Help/About")
-                               .setMessage("Under construction\n" +
-                                               "\n" +
-                                               "written by jiri hubacek\n")
-                               .setPositiveButton(R.string.dialog_OK, new DialogInterface.OnClickListener() {
-                                       @Override
-                                       public void onClick(DialogInterface dialog, int which)
-                                       {}
-                               });
-                       
-                       return builder.create();
-               }
-       }
-       
-       /**
-        * Set up IP addresses of other managers.
-        * 
-        * @since 1.0
-        */
-       public class SettingsDialogFragment extends DialogFragment
-       {
-               private EditText om;
-               
-               /**
-                * Create dialog window.
-                * 
-                * @since 1.0
-                */
-               @Override
-               public Dialog onCreateDialog(Bundle savedInstanceState)
-               {
-                       // Strings should be done better way, like
-                       // centralized in strings.xml
-                       
-                       AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
-                       builder.setTitle("Your IP is " + Formatter.formatIpAddress(wifiManager.getConnectionInfo().getIpAddress()) + ",\nadd other managers:")
-                               .setView(text())
-                               .setPositiveButton(R.string.dialog_OK, new DialogInterface.OnClickListener() {
-                                       
-                                       /**
-                                        * When IP addresses of managers changes,
-                                        * destroy manager and create new one.
-                                        * 
-                                        * @since 1.0
-                                        */
-                                       @Override
-                                       public void onClick(DialogInterface dialog, int which)
-                                       {
-                                               if (IP_ADDRESS.matcher(om.getText()).matches()) {
-                                                       if (orteManager != null) orteManager.destroy();
-                                                       
-                                                       String managers[] = new String[1];
-                                                       managers[0] = om.getText().toString();
-                                                       
-                                                       orteManager = new Manager(managers);
-                                               }
-                                       }
-                               })
-                               .setNegativeButton(R.string.dialog_cancel, new DialogInterface.OnClickListener() {
-                                       
-                                       @Override
-                                       public void onClick(DialogInterface dialog, int which) {
-                                       }
-                               });
-                       
-                       return builder.create();
-               }
-               
-               /**
-                * SeekBar for setting-up strength of publishers.
-                * 
-                * @return Layout of SeekBar.
-                * @since 1.0
-                */
-               private View text(){
-                       LinearLayout l = new LinearLayout(getActivity());
-                       l.setOrientation(LinearLayout.VERTICAL);
-                       
-                       om = new EditText(getActivity());
-                       om.setInputType(InputType.TYPE_CLASS_PHONE);
-                       om.setText("192.168.1.108");
-                       
-                       l.addView(om);
-                       return l;
-               }
-       }
-       
-}
diff --git a/orte/contrib/shape_android/src/org/ocera/orte/shape4a/PublisherFragment.java b/orte/contrib/shape_android/src/org/ocera/orte/shape4a/PublisherFragment.java
deleted file mode 100644 (file)
index 21faf03..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-/**
- * 
- *     This file is part of shape4a.
- *
- *  shape4a is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  shape4a is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with shape4a.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ocera.orte.shape4a;
-
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.content.DialogInterface;
-import android.content.res.Configuration;
-import android.os.Bundle;
-import android.os.Handler;
-import android.support.v4.app.DialogFragment;
-import android.support.v4.app.Fragment;
-import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.LinearLayout;
-import android.widget.SeekBar;
-
-import org.ocera.orte.DomainApp;
-
-/**
- * Fragment containing publishing workspace.
- * 
- * @author jiri hubacek <jiri.hubacek@gmail.com>
- * @version %I%, %G%
- * @since 1.0
- */
-public class PublisherFragment extends Fragment {
-       private static final int REDRAW_INTERVAL = 50;
-       private static final int STRENGTH_MAX = 5;
-       
-       private View rootView;
-       private PublisherView publisherView;
-       
-       private Handler handler = new Handler();
-       private Runnable redraw = new Runnable()
-       {
-               @Override
-               public void run()
-               {
-                       publisherView.countShapes();
-                       publisherView.invalidate();
-                       handler.postDelayed(this, REDRAW_INTERVAL);
-               }
-       };
-       
-       NewDialogFragment newDialogFragment = new NewDialogFragment();
-       PublisherSettingsDialogFragment publisherSettingsDialogFragment = new PublisherSettingsDialogFragment();
-       
-       private DomainApp appDomain;
-       
-       /**
-        * Constructor just stores appDomain variable.
-        * 
-        * @param appDomain
-        * @since 1.0
-        */
-       public PublisherFragment(DomainApp appDomain)
-       {
-               this.appDomain = appDomain;
-       }
-
-       /**
-        * When screen orientation is changed,
-        * scale recalculation is needed.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public void onConfigurationChanged(Configuration newConfig)
-       {
-               for (PublisherShape s : this.publisherView.shapes) {
-                       s.setScale(getActivity().getWindowManager().getDefaultDisplay().getWidth(), getActivity().getWindowManager().getDefaultDisplay().getHeight());
-               }
-       }
-       
-       /**
-        * Setting up workspace, adding publisherView
-        * and timer (handler) for drawing objects.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
-       {
-               this.rootView = inflater.inflate(R.layout.fragment_publisher, container, false);
-               this.publisherView = (PublisherView) this.rootView.findViewById(R.id.publisher_view);
-               this.handler.postDelayed(redraw, REDRAW_INTERVAL);
-               
-               return this.rootView;
-       }
-       
-       /**
-        * Creating menu.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
-       {
-               inflater.inflate(R.menu.publisher, menu);
-       }
-       
-       /**
-        * All created publishers are in menu.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public void onPrepareOptionsMenu(Menu  menu)
-       {
-               for (PublisherShape shape : publisherView.shapes) {
-                       menu.add(0, publisherView.shapes.indexOf(shape), 20 + publisherView.shapes.indexOf(shape), "#" + publisherView.shapes.indexOf(shape) + " " + shape.getColorName() + " " + shape.getShapeName());
-               }
-       }
-       
-       /**
-        * Select settings of publishers
-        * or add new publisher.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public boolean onOptionsItemSelected(MenuItem item)
-       {
-               // Handle action bar item clicks here. The action bar will
-               // automatically handle clicks on the Home/Up button, so long
-               // as you specify a parent activity in AndroidManifest.xml.
-               int id = item.getItemId();
-               
-               if (id >= 0 && id < publisherView.shapes.size()) {
-                       publisherSettingsDialogFragment.setId(id);
-                       publisherSettingsDialogFragment.show(getFragmentManager(), "dialog");
-               } else {
-                       switch (id) {
-                       case R.id.action_new:
-                               newDialogFragment.show(getFragmentManager(), "dialog");
-                               break;
-                       }
-               }
-               return super.onOptionsItemSelected(item);
-       }
-       
-       /**
-        * Dialog for adding new publisher
-        * throw action bar button +.
-        * 
-        * @since 1.0
-        */
-       public class NewDialogFragment extends DialogFragment
-       {
-               /*
-                * Selection of colors is badly solved,
-                * it should be altered..
-                * 
-                */
-               private String[] colors = new String[5];
-               
-               /**
-                * In constructor, make array
-                * of colors.
-                * 
-                * @since 1.0
-                */
-               public NewDialogFragment()
-               {
-                       // Texts should be done better way,
-                       // like centralized in strings.xml
-                       
-                       colors[0] = "Blue";
-                       colors[1] = "Green";
-                       colors[2] = "Red";
-                       colors[3] = "Black";
-                       colors[4] = "Yellow";
-               }
-               
-               /**
-                * Creating dialog for new publisher.
-                * 
-                * @since 1.0
-                */
-               @Override
-               public Dialog onCreateDialog(Bundle savedInstanceState)
-               {
-                       AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
-                       builder.setTitle(R.string.dialog_newPublisher)
-                               .setItems(colors, new DialogInterface.OnClickListener()
-                               {
-                                       @Override
-                                       public void onClick(DialogInterface dialog, int which)
-                                       {
-                                               // new publisher
-                                               
-                                               publisherView.addShape(which, appDomain);
-
-                                               for (PublisherShape s : publisherView.shapes) {
-                                                       s.setScale(getActivity().getWindowManager().getDefaultDisplay().getWidth(), getActivity().getWindowManager().getDefaultDisplay().getHeight());
-                                               }
-                                               
-                                               getActivity().supportInvalidateOptionsMenu();
-                                       }
-                               })
-                               .setNegativeButton(R.string.dialog_cancel, new DialogInterface.OnClickListener()
-                               {
-                                       @Override
-                                       public void onClick(DialogInterface dialog, int which)
-                                       {       
-                                       }
-                               });
-                       return builder.create();
-                       
-               }
-       }
-       
-       /**
-        * When click on shape in Action Bar menu.
-        * 
-        * @since 1.0
-        */
-       public class PublisherSettingsDialogFragment extends DialogFragment
-       {
-               private int shapeId;
-               private int shapeStrength;
-               private SeekBar seekStrength;
-               
-               /**
-                * No constructor needed.
-                * 
-                * @since 1.0
-                */
-               public PublisherSettingsDialogFragment()
-               {}
-               
-               /**
-                * Set wanted publisher's dialog.
-                * 
-                * @param i Index of publisher.
-                * @since 1.0
-                */
-               public void setId(int i)
-               {
-                       this.shapeId = i;
-                       this.shapeStrength = publisherView.shapes.get(this.shapeId).getStrength();
-               }
-               
-               /**
-                * Creating dialog for publisher's settings.
-                * 
-                * @since 1.0
-                */
-               @Override
-               public Dialog onCreateDialog(Bundle savedInstanceState)
-               {
-                       AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
-                       builder.setTitle("#" + this.shapeId + " " + publisherView.shapes.get(this.shapeId).getColorName() + " " + publisherView.shapes.get(this.shapeId).getShapeName() + " strength:")
-                               .setView(seekBar())
-                               .setPositiveButton(R.string.dialog_OK, new DialogInterface.OnClickListener()
-                               {
-                                       @Override
-                                       public void onClick(DialogInterface dialog, int which)
-                                       {
-                                               publisherView.shapes.get(shapeId).setStrength(shapeStrength);
-                                       }
-                               })
-                               .setNeutralButton(R.string.dialog_delete, new DialogInterface.OnClickListener()
-                               {       
-                                       @Override
-                                       public void onClick(DialogInterface dialog, int which) {
-                                               publisherView.shapes.get(shapeId).killMe();
-                                               publisherView.shapes.remove(shapeId);
-                                               getActivity().supportInvalidateOptionsMenu();
-                                       }
-                               })
-                               .setNegativeButton(R.string.dialog_cancel, new DialogInterface.OnClickListener()
-                               {
-                                       @Override
-                                       public void onClick(DialogInterface dialog, int which)
-                                       {       
-                                       }
-                               });
-                       return builder.create();
-               }
-               
-               /**
-                * SeekBar for setting-up strength of publishers.
-                * 
-                * @return Layout of SeekBar.
-                * @since 1.0
-                */
-               private View seekBar(){
-                       LinearLayout l = new LinearLayout(getActivity());
-                       l.setOrientation(LinearLayout.VERTICAL);
-                       
-                       seekStrength = new SeekBar(getActivity());
-                       seekStrength.setMax(STRENGTH_MAX);
-                       seekStrength.setProgress(shapeStrength);
-                       seekStrength.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
-                       {
-                               @Override
-                               public void onStopTrackingTouch(SeekBar seekBar) {
-                               }
-                               
-                               @Override
-                               public void onStartTrackingTouch(SeekBar seekBar) {
-                               }
-                               
-                               @Override
-                               public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
-                               {
-                                       shapeStrength = progress;
-                               }
-                       });
-                       
-                       l.addView(seekStrength);
-                       return l;
-               }
-       }
-}
diff --git a/orte/contrib/shape_android/src/org/ocera/orte/shape4a/SubscriberFragment.java b/orte/contrib/shape_android/src/org/ocera/orte/shape4a/SubscriberFragment.java
deleted file mode 100644 (file)
index 5818e6d..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/**
- * 
- *     This file is part of shape4a.
- *
- *  shape4a is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  shape4a is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with shape4a.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ocera.orte.shape4a;
-
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.content.DialogInterface;
-import android.content.res.Configuration;
-import android.os.Bundle;
-import android.support.v4.app.DialogFragment;
-import android.support.v4.app.Fragment;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.LinearLayout;
-import android.widget.SeekBar;
-
-import org.ocera.orte.DomainApp;
-import org.ocera.orte.types.NtpTime;
-
-/**
- * Fragment containing subscribing workspace.
- * 
- * @author jiri hubacek <jiri.hubacek@gmail.com>
- * @version %I%, %G%
- * @since 1.0
- */
-public class SubscriberFragment extends Fragment {
-       private static final int MINSEPARATION_MAX = 5;
-       
-       private View rootView;
-       private SubscriberView subscriberView;
-       private DomainApp appDomain;
-       
-       private SubscriberSettingsDialogFragment subscriberSettingsDialogFragment = new SubscriberSettingsDialogFragment();
-       
-       /**
-        * Constructor just stores appDomain variable.
-        * 
-        * @param appDomain
-        * @since 1.0
-        */
-       public SubscriberFragment(DomainApp appDomain)
-       {
-               this.appDomain = appDomain;
-       }
-       
-       /**
-        * When screen orientation is changed,
-        * scale recalculation is needed.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public void onConfigurationChanged(Configuration newConfig)
-       {
-               for (SubscriberElement e : this.subscriberView.elements) {
-                       e.setScale(getActivity().getWindowManager().getDefaultDisplay().getWidth(), getActivity().getWindowManager().getDefaultDisplay().getHeight());
-               }
-       }
-       
-       /**
-        * Setting up workspace, adding publisherView
-        * and timer (handler) for drawing objects.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-               
-               this.rootView = inflater.inflate(R.layout.fragment_subscriber, container, false);
-               this.subscriberView = (SubscriberView) this.rootView.findViewById(R.id.subscriber_view);
-               this.subscriberView.addElements(this.appDomain);
-               for (SubscriberElement e : this.subscriberView.elements) {
-                       e.setScale(getActivity().getWindowManager().getDefaultDisplay().getWidth(), getActivity().getWindowManager().getDefaultDisplay().getHeight());
-               }
-               return this.rootView;
-       }
-       
-       /**
-        * Creating menu.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
-       {
-               inflater.inflate(R.menu.subscriber, menu);
-       }
-       
-       /**
-        * Setting up subscriber objects.
-        * 
-        * @since 1.0
-        */
-       @Override
-       public boolean onOptionsItemSelected(MenuItem item)
-       {
-               int id = 0;
-               switch (item.getItemId()) {
-               case R.id.action_blue:
-                       id = 0;
-                       break;
-               case R.id.action_green:
-                       id = 1;
-                       break;
-               case R.id.action_red:
-                       id = 2;
-                       break;
-               case R.id.action_black:
-                       id = 3;
-                       break;
-               case R.id.action_yellow:
-                       id = 4;
-                       break;
-               default:
-               }
-               
-               subscriberSettingsDialogFragment.setId(id);
-               subscriberSettingsDialogFragment.show(getFragmentManager(), "dialog");
-               
-               return super.onOptionsItemSelected(item);
-       }
-       
-       /**
-        * When click on shape in Action Bar menu.
-        * 
-        * @since 1.0
-        */
-       public class SubscriberSettingsDialogFragment extends DialogFragment
-       {
-               private int eId, ms;
-               private NtpTime minSeparation;
-               private SeekBar seekMinSeparation;
-               
-               /**
-                * Set wanted publisher's dialog.
-                * 
-                * @param i Index of publisher.
-                * @since 1.0
-                */
-               public void setId(int i)
-               {
-                       this.eId = i;
-                       this.minSeparation = subscriberView.elements.get(this.eId).getMinSeparation();
-                       this.ms = 0;
-               }
-               
-               /**
-                * Creating dialog for subscriber's settings.
-                * 
-                * @since 1.0
-                */
-               @Override
-               public Dialog onCreateDialog(Bundle savedInstanceState)
-               {
-                       AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
-                       builder.setTitle(PublisherShape.getColorName(this.eId) + " settings")
-                               .setView(seekBar())
-                               .setPositiveButton(R.string.dialog_OK, new DialogInterface.OnClickListener()
-                               {
-                                       @Override
-                                       public void onClick(DialogInterface dialog, int which)
-                                       {
-                                               minSeparation = new NtpTime(ms);
-                                               subscriberView.elements.get(eId).setMinSeparation(minSeparation);
-                                               subscriberView.elements.get(eId).setEnabled(true);
-                                       }
-                               })
-                               .setNeutralButton(subscriberView.elements.get(eId).getEnabled()?R.string.dialog_delete:R.string.dialog_add, new DialogInterface.OnClickListener()
-                               {       
-                                       @Override
-                                       public void onClick(DialogInterface dialog, int which) {
-                                               if (subscriberView.elements.get(eId).getEnabled()) {
-                                                       subscriberView.elements.get(eId).setEnabled(false);
-                                               } else {
-                                                       minSeparation = new NtpTime(ms);
-                                                       subscriberView.elements.get(eId).setMinSeparation(minSeparation);
-                                                       subscriberView.elements.get(eId).setEnabled(true);
-                                               }
-                                       }
-                               })
-                               .setNegativeButton(R.string.dialog_cancel, new DialogInterface.OnClickListener()
-                               {
-                                       @Override
-                                       public void onClick(DialogInterface dialog, int which)
-                                       {}
-                               });
-                       return builder.create();
-               }
-               
-               /**
-                * SeekBar for setting-up min. separation of subscribers.
-                * 
-                * @return Layout of SeekBar.
-                * @since 1.0
-                */
-               private View seekBar(){
-                       LinearLayout l = new LinearLayout(getActivity());
-                       l.setOrientation(LinearLayout.VERTICAL);
-                       
-                       seekMinSeparation = new SeekBar(getActivity());
-                       seekMinSeparation.setMax(MINSEPARATION_MAX);
-                       seekMinSeparation.setProgress(0);
-                       seekMinSeparation.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
-                       {
-                               @Override
-                               public void onStopTrackingTouch(SeekBar seekBar) {
-                               }
-                               
-                               @Override
-                               public void onStartTrackingTouch(SeekBar seekBar) {
-                               }
-                               
-                               @Override
-                               public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
-                               {
-                                       ms = progress;
-                               }
-                       });
-                       
-                       l.addView(seekMinSeparation);
-                       return l;
-               }
-       }
-}
similarity index 89%
rename from orte/contrib/shape_android/src/org/ocera/orte/shape4a/BoxType.java
rename to orte/contrib/shape_android/src/org/ocera/orte/shape_android/BoxType.java
index c8482a5a668d4fc084540640e7f969cac23b04e6..651536d514b5715a4bdec997d95cf63d54bfdeda 100644 (file)
@@ -1,27 +1,29 @@
 /**
  * 
- *     This file is part of shape4a.
+ *     This file is part of shape_android.
  *
- *  shape4a is free software: you can redistribute it and/or modify
+ *  shape_android is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
- *  shape4a is distributed in the hope that it will be useful,
+ *  shape_android is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with shape4a.  If not, see <http://www.gnu.org/licenses/>.
+ *  along with shape_android.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-package org.ocera.orte.shape4a;
+package org.ocera.orte.shape_android;
 
 import org.ocera.orte.DomainApp;
 import org.ocera.orte.types.MessageData;
 import org.ocera.orte.types.ORTEConstant;
 
+import android.content.SharedPreferences;
+import android.preference.PreferenceManager;
 import android.util.Log;
 
 /**
@@ -34,8 +36,8 @@ import android.util.Log;
 public class BoxType extends MessageData
 {
        private static final byte FUZZY = 0;
-       private static final double DESTINATION_WIDTH = 389.0;
-       private static final double DESTINATION_HEIGHT = 331.0;
+       private static final double DESTINATION_WIDTH = 367.0; //389.0;
+       private static final double DESTINATION_HEIGHT = 261.0; //331.0;
        
        public byte color;
        public byte shape;
diff --git a/orte/contrib/shape_android/src/org/ocera/orte/shape_android/HelpActivity.java b/orte/contrib/shape_android/src/org/ocera/orte/shape_android/HelpActivity.java
new file mode 100644 (file)
index 0000000..24018e2
--- /dev/null
@@ -0,0 +1,75 @@
+/**
+ * 
+ *     This file is part of shape_android.
+ *
+ *  shape_android is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  shape_android is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with shape_android.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ocera.orte.shape_android;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.Menu;
+import android.view.MenuItem;
+
+/**
+ * This activity shows help.
+ * 
+ * @author jiri hubacek <jiri.hubacek@gmail.com>
+ * @version %I, %G
+ * @since 1.2
+ */
+public class HelpActivity extends Activity
+{
+       /**
+        * Setting up workspace.
+        * 
+        * @since 1.2
+        */
+       @Override
+       protected void onCreate(Bundle savedInstanceState) {
+               super.onCreate(savedInstanceState);
+               setContentView(R.layout.activity_help);
+       }
+
+
+       /**
+        * There is nothing in the menu now.
+        * 
+        * @since 1.2
+        */
+       @Override
+       public boolean onCreateOptionsMenu(Menu menu) {
+               // Inflate the menu; this adds items to the action bar if it is present.
+               getMenuInflater().inflate(R.menu.help, menu);
+               return true;
+       }
+
+       /**
+        * Nothing happens now when menu is selected.
+        * 
+        * @since 1.2
+        */
+       @Override
+       public boolean onOptionsItemSelected(MenuItem item) {
+               // Handle action bar item clicks here. The action bar will
+               // automatically handle clicks on the Home/Up button, so long
+               // as you specify a parent activity in AndroidManifest.xml.
+               int id = item.getItemId();
+               if (id == R.id.action_settings) {
+                       return true;
+               }
+               return super.onOptionsItemSelected(item);
+       }
+}
diff --git a/orte/contrib/shape_android/src/org/ocera/orte/shape_android/PublisherActivity.java b/orte/contrib/shape_android/src/org/ocera/orte/shape_android/PublisherActivity.java
new file mode 100644 (file)
index 0000000..7725783
--- /dev/null
@@ -0,0 +1,494 @@
+/**
+ * 
+ *     This file is part of shape_android.
+ *
+ *  shape_android is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  shape_android is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with shape_android.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ocera.orte.shape_android;
+
+import java.util.regex.Pattern;
+
+import org.ocera.orte.DomainApp;
+import org.ocera.orte.Manager;
+import org.ocera.orte.types.NtpTime;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.res.Configuration;
+import android.net.wifi.WifiManager;
+import android.net.wifi.WifiManager.WifiLock;
+import android.os.Bundle;
+import android.os.Handler;
+import android.preference.PreferenceManager;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.widget.LinearLayout;
+import android.widget.SeekBar;
+import android.widget.ViewSwitcher;
+
+/**
+ * Class for object sent and received throw the ORTE middleware.
+ * 
+ * @author jiri hubacek <jiri.hubacek@gmail.com>
+ * @version %I, %G
+ * @since 1.2
+ */
+public class PublisherActivity extends Activity {
+       //public final static Pattern IP_ADDRESS = Pattern.compile("((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))");
+
+       private static final int REDRAW_INTERVAL = 50;
+       private static final int STRENGTH_MAX = 5;
+       private static final int MINSEPARATION_MAX = 5;
+       private static final int RESULT_SETTINGS = 1;
+       
+       private WifiManager wifiManager;
+       private WifiLock wifiLock;
+       
+       private Manager orteManager;
+       private DomainApp appDomain;
+       
+       private PublisherView publisherView;
+       private SubscriberView subscriberView;
+       
+       private ViewSwitcher switcher;
+       private boolean actualIsPublisher;
+       private SharedPreferences sp;
+       
+       private Handler handler = new Handler();
+       private Runnable redraw = new Runnable()
+       {
+               @Override
+               public void run()
+               {
+                       publisherView.countShapes();
+                       publisherView.invalidate();
+                       handler.postDelayed(this, REDRAW_INTERVAL);
+               }
+       };
+       
+       /**
+        * Setting up main workspace.
+        * 
+        * @since 1.2
+        */
+       @Override
+       protected void onCreate(Bundle savedInstanceState) {
+               super.onCreate(savedInstanceState);
+               setContentView(R.layout.activity_publisher);
+               
+               // From Robot_Demo project.
+               wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
+               wifiLock = (WifiLock) wifiManager.createWifiLock((
+                                       (android.os.Build.VERSION.SDK_INT >= 12)
+                                       ? WifiManager.WIFI_MODE_FULL_HIGH_PERF
+                                       : WifiManager.WIFI_MODE_FULL
+                               ), getClass().getName());
+
+               sp = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
+               
+               // Start ORTE.
+               orteManager = new Manager(sp.getString("prefManagers", ""));
+               appDomain = new DomainApp();
+               
+               this.switcher = (ViewSwitcher) findViewById(R.id.switcher);
+               this.actualIsPublisher = true;
+               
+               this.publisherView = (PublisherView) findViewById(R.id.publisher_view);
+               this.subscriberView = (SubscriberView) findViewById(R.id.subscriber_view);
+               
+               this.redraw.run();
+               this.subscriberView.addElements(this.appDomain);
+               for (SubscriberElement e : this.subscriberView.elements) {
+                       e.setScale(this.getWindowManager().getDefaultDisplay().getWidth(), this.getWindowManager().getDefaultDisplay().getHeight());
+                       e.setAllowScaling(sp.getBoolean("prefScaling", true));
+               }
+       }
+
+       /**
+        * When pause activity, release WiFi lock.
+        * 
+        * @since 1.0
+        */
+       @Override
+       public void onPause()
+       {
+               super.onPause();
+               
+               wifiLock.release();
+       }
+       
+       /**
+        * When resume activity, acquire WiFi lock.
+        * 
+        * @since 1.0
+        */
+       @Override
+       public void onResume()
+       {
+               super.onResume();
+               
+               wifiLock.acquire();
+       }
+       
+       /**
+        * When switching application off.
+        * 
+        * @since 1.0
+        */
+       @Override
+       public void onDestroy()
+       {
+               super.onDestroy();
+               
+               if (appDomain != null) {
+                       appDomain.destroy();
+                       appDomain = null;
+               }
+               if (orteManager != null) {
+                       orteManager.destroy();
+                       orteManager = null;
+               }
+       }
+       
+       /**
+        * When screen orientation is changed,
+        * scale recalculation is needed.
+        * 
+        * @since 1.0
+        */
+       @Override
+       public void onConfigurationChanged(Configuration newConfig)
+       {
+               super.onConfigurationChanged(newConfig);
+               
+               for (PublisherShape s : this.publisherView.shapes) {
+                       s.setScale(this.getWindowManager().getDefaultDisplay().getWidth(), this.getWindowManager().getDefaultDisplay().getHeight());
+               }
+               for (SubscriberElement e : this.subscriberView.elements) {
+                       e.setScale(this.getWindowManager().getDefaultDisplay().getWidth(), this.getWindowManager().getDefaultDisplay().getHeight());
+               }
+               
+               //TODO  When change rotation in Subscriber view,
+               //              there is no change in Publisher view, which
+               //              leads to misbehavior. For example, there
+               //              is Publisher of Black color in Publisher view,
+               //              and we are looking at it in Subscriber view,
+               //              when rotation is changed, Publisher view remains
+               //              in old rotation while Subscriber view is in new
+               //              rotation. Therefore Black Publisher thinks that
+               //              it's still in old rotation and the problem with
+               //              leaving screen is here.
+       }
+
+       /**
+        * When returning from SettingsActivity, apply settings.
+        * 
+        * @since 1.2
+        */
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data)
+    {
+           super.onActivityResult(requestCode, resultCode, data);
+       
+           switch(requestCode) {
+           case RESULT_SETTINGS:
+               boolean allowScaling = sp.getBoolean("prefScaling", true);
+
+                       for (PublisherShape s : this.publisherView.shapes) {
+                               s.box.allowScaling = allowScaling;
+                       }
+               for (SubscriberElement e : this.subscriberView.elements) {
+                               e.setAllowScaling(allowScaling);
+                       }
+               
+               if (orteManager != null) orteManager.destroy();
+                       orteManager = new Manager(sp.getString("prefManagers", ""));
+                       
+               break;
+           }
+
+    }
+    
+    /**
+     * Creating menu.
+     * 
+     * @since 1.2
+     */
+       @Override
+       public boolean onCreateOptionsMenu(Menu menu) {
+               // Inflate the menu; this adds items to the action bar if it is present.
+               getMenuInflater().inflate(R.menu.publisher, menu);
+               return true;
+       }
+       
+       /**
+        * All created publishers are in menu.
+        * @return 
+        * 
+        * @since 1.0
+        */
+       @Override
+       public boolean onPrepareOptionsMenu(Menu menu)
+       {
+               menu.clear();
+               
+               if (this.actualIsPublisher) {
+                       getMenuInflater().inflate(R.menu.publisher, menu);
+                       for (PublisherShape shape : this.publisherView.shapes) {
+                               menu.add(0, this.publisherView.shapes.indexOf(shape), 20 + this.publisherView.shapes.indexOf(shape), "#" + this.publisherView.shapes.indexOf(shape) + " " + shape.getColorName() + " " + shape.getShapeName());
+                       }
+               } else {
+                       getMenuInflater().inflate(R.menu.subscriber, menu);
+               }
+               
+               return super.onPrepareOptionsMenu(menu);
+       }
+       
+       /**
+        * Logic for menu selecting.
+        * 
+        * Contains switching between Publishers and Subscribers, adding
+        * new Publisher, setting Publishers, setting Subscribers, moving
+        * to SettingsActivity and HelpActivity.
+        * 
+        * @since 1.2
+        */
+       @SuppressLint("NewApi")
+       @Override
+       public boolean onOptionsItemSelected(MenuItem item) {
+               // Handle action bar item clicks here. The action bar will
+               // automatically handle clicks on the Home/Up button, so long
+               // as you specify a parent activity in AndroidManifest.xml.
+               final int id = item.getItemId();
+               final Activity me = this;
+               Intent intent;
+               
+               switch(id) {
+               case R.id.action_switch:
+                       if (this.actualIsPublisher) {
+                               this.switcher.showNext();
+                               this.setTitle(R.string.title_activity_subscriber);
+                       } else {
+                               this.switcher.showPrevious();
+                               this.setTitle(R.string.title_activity_publisher);
+                       }
+                       this.actualIsPublisher = !this.actualIsPublisher;
+                       
+                       if (android.os.Build.VERSION.SDK_INT >= 11) this.invalidateOptionsMenu();
+                       
+                       return true;
+               case R.id.action_new:
+                       String[] colors = new String[5];
+                       
+                       colors[0] = "Blue";
+                       colors[1] = "Green";
+                       colors[2] = "Red";
+                       colors[3] = "Black";
+                       colors[4] = "Yellow";
+                       
+                       AlertDialog.Builder builderNew = new AlertDialog.Builder(me);
+                       builderNew.setTitle(R.string.dialog_newPublisher)
+                       .setItems(colors, new DialogInterface.OnClickListener()
+                       {
+                               @Override
+                               public void onClick(DialogInterface dialog, int which)
+                               {
+                                       // new publisher
+                                       
+                                       publisherView.addShape(which, appDomain);
+
+                                       for (PublisherShape s : publisherView.shapes) {
+                                               s.setScale(me.getWindowManager().getDefaultDisplay().getWidth(), me.getWindowManager().getDefaultDisplay().getHeight());
+                                               s.box.allowScaling = sp.getBoolean("prefScaling", true);
+                                       }
+                                       
+                                       if (android.os.Build.VERSION.SDK_INT >= 11) me.invalidateOptionsMenu();
+                               }
+                       })
+                       .setNegativeButton(R.string.dialog_cancel, new DialogInterface.OnClickListener()
+                       {
+                               @Override
+                               public void onClick(DialogInterface dialog, int which)
+                               {       
+                               }
+                       });
+                       
+                       AlertDialog dialogNew = builderNew.create();
+                       dialogNew.show();
+                       
+                       return true;
+               case R.id.action_settings:
+                       intent = new Intent(this, SettingsActivity.class);
+                       startActivityForResult(intent, RESULT_SETTINGS);
+                       return true;
+               case R.id.action_help:
+                       intent = new Intent(this, HelpActivity.class);
+                       startActivity(intent);
+                       return true;
+               default:
+                       // For settings of Publisher/Subscriber elements.
+                       LinearLayout l = new LinearLayout(me);
+                       l.setOrientation(LinearLayout.VERTICAL);
+                       AlertDialog.Builder builderSettings = new AlertDialog.Builder(me);
+                       
+                       if (this.actualIsPublisher) {
+                               /*
+                                * Parameters of Publisher shapes.
+                                */
+                               final int shapeStrength = publisherView.shapes.get(id).getStrength();
+                               SeekBar seekStrength;
+                               
+                               /* seekBar */
+                               seekStrength = new SeekBar(me);
+                               seekStrength.setMax(STRENGTH_MAX);
+                               seekStrength.setProgress(shapeStrength);
+                               
+                               seekStrength.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
+                               {
+                                       @Override
+                                       public void onStopTrackingTouch(SeekBar seekBar) {
+                                       }
+                                       
+                                       @Override
+                                       public void onStartTrackingTouch(SeekBar seekBar) {
+                                       }
+                                       
+                                       @Override
+                                       public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
+                                       {
+                                               publisherView.shapes.get(id).setStrength(progress);
+                                       }
+                               });
+                               
+                               l.addView(seekStrength);
+                               /* seekBar - end */
+                               
+                               builderSettings.setTitle("#" + id + " " + publisherView.shapes.get(id).getColorName() + " " + publisherView.shapes.get(id).getShapeName() + " strength:")
+                               .setView(l)
+                               .setPositiveButton(R.string.dialog_OK, new DialogInterface.OnClickListener()
+                               {
+                                       @Override
+                                       public void onClick(DialogInterface dialog, int which)
+                                       {}
+                               })
+                               .setNeutralButton(R.string.dialog_delete, new DialogInterface.OnClickListener()
+                               {       
+                                       @Override
+                                       public void onClick(DialogInterface dialog, int which) {
+                                               publisherView.shapes.get(id).killMe();
+                                               publisherView.shapes.remove(id);
+                                               
+                                               if (android.os.Build.VERSION.SDK_INT >= 11) me.invalidateOptionsMenu();
+                                       }
+                               })
+                               .setNegativeButton(R.string.dialog_cancel, new DialogInterface.OnClickListener()
+                               {
+                                       @Override
+                                       public void onClick(DialogInterface dialog, int which)
+                                       {
+                                               publisherView.shapes.get(id).setStrength(shapeStrength);
+                                       }
+                               });
+                       
+                               AlertDialog dialogSettings = builderSettings.create();
+                               dialogSettings.show();
+                       } else {
+                               /*
+                                * Parameters of Subscriber shapes.
+                                */
+                               final int eId;
+                               SeekBar seekMinSeparation;
+                               
+                               switch (id) {
+                               case R.id.action_blue:
+                                       eId = 0;
+                                       break;
+                               case R.id.action_green:
+                                       eId = 1;
+                                       break;
+                               case R.id.action_red:
+                                       eId = 2;
+                                       break;
+                               case R.id.action_black:
+                                       eId = 3;
+                                       break;
+                               case R.id.action_yellow:
+                                       eId = 4;
+                                       break;
+                               default:
+                                       eId = 0;
+                               }
+                               
+                               /* seekBar */
+                               seekMinSeparation = new SeekBar(me);
+                               seekMinSeparation.setMax(MINSEPARATION_MAX);
+                               seekMinSeparation.setProgress(0);
+                               subscriberView.elements.get(eId).setMinSeparation(new NtpTime(0));
+                               
+                               seekMinSeparation.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
+                               {
+                                       @Override
+                                       public void onStopTrackingTouch(SeekBar seekBar) {
+                                       }
+                                       
+                                       @Override
+                                       public void onStartTrackingTouch(SeekBar seekBar) {
+                                       }
+                                       
+                                       @Override
+                                       public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
+                                       {
+                                               subscriberView.elements.get(eId).setMinSeparation(new NtpTime(progress));
+                                               subscriberView.elements.get(eId).setEnabled(true);
+                                       }
+                               });
+                               
+                               l.addView(seekMinSeparation);
+                               /* seekBar - end */
+                               
+                               builderSettings.setTitle(PublisherShape.getColorName(eId) + " settings")
+                               .setView(l)
+                               .setPositiveButton(R.string.dialog_OK, new DialogInterface.OnClickListener()
+                               {
+                                       @Override
+                                       public void onClick(DialogInterface dialog, int which)
+                                       {}
+                               })
+                               .setNeutralButton(subscriberView.elements.get(eId).getEnabled()?R.string.dialog_delete:R.string.dialog_add, new DialogInterface.OnClickListener()
+                               {       
+                                       @Override
+                                       public void onClick(DialogInterface dialog, int which) {
+                                               if (subscriberView.elements.get(eId).getEnabled()) {
+                                                       subscriberView.elements.get(eId).setEnabled(false);
+                                               } else {
+                                                       subscriberView.elements.get(eId).setMinSeparation(new NtpTime(0));
+                                                       subscriberView.elements.get(eId).setEnabled(true);
+                                               }
+                                       }
+                               });
+                       
+                               AlertDialog dialogSettings = builderSettings.create();
+                               dialogSettings.show();
+                       }
+               }
+               
+               return super.onOptionsItemSelected(item);
+       }
+}
similarity index 95%
rename from orte/contrib/shape_android/src/org/ocera/orte/shape4a/PublisherShape.java
rename to orte/contrib/shape_android/src/org/ocera/orte/shape_android/PublisherShape.java
index d1dde687353aec179fd9f95736870b49678e6136..9d74bc3ec4958aa5dcd38d84663d5f5cefa26ded 100644 (file)
@@ -1,22 +1,22 @@
 /**
  * 
- *     This file is part of shape4a.
+ *     This file is part of shape_android.
  *
- *  shape4a is free software: you can redistribute it and/or modify
+ *  shape_android is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
- *  shape4a is distributed in the hope that it will be useful,
+ *  shape_android is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with shape4a.  If not, see <http://www.gnu.org/licenses/>.
+ *  along with shape_android.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-package org.ocera.orte.shape4a;
+package org.ocera.orte.shape_android;
 
 import org.ocera.orte.DomainApp;
 import org.ocera.orte.Publication;
similarity index 93%
rename from orte/contrib/shape_android/src/org/ocera/orte/shape4a/PublisherView.java
rename to orte/contrib/shape_android/src/org/ocera/orte/shape_android/PublisherView.java
index d079a9358098626a92715bf217a60668dbb87428..b07f49bb3b823880d9c117e816ef01e0d084c5b0 100644 (file)
@@ -1,22 +1,22 @@
 /**
  * 
- *     This file is part of shape4a.
+ *     This file is part of shape_android.
  *
- *  shape4a is free software: you can redistribute it and/or modify
+ *  shape_android is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
- *  shape4a is distributed in the hope that it will be useful,
+ *  shape_android is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with shape4a.  If not, see <http://www.gnu.org/licenses/>.
+ *  along with shape_android.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-package org.ocera.orte.shape4a;
+package org.ocera.orte.shape_android;
 
 import java.util.ArrayList;
 import java.util.Random;
diff --git a/orte/contrib/shape_android/src/org/ocera/orte/shape_android/SettingsActivity.java b/orte/contrib/shape_android/src/org/ocera/orte/shape_android/SettingsActivity.java
new file mode 100644 (file)
index 0000000..0478f4d
--- /dev/null
@@ -0,0 +1,54 @@
+/**
+ * 
+ *     This file is part of shape_android.
+ *
+ *  shape_android is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  shape_android is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with shape_android.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ocera.orte.shape_android;
+
+import android.content.Context;
+import android.net.wifi.WifiManager;
+import android.os.Bundle;
+import android.preference.PreferenceActivity;
+import android.preference.EditTextPreference;
+import android.text.format.Formatter;
+
+/**
+ * This activity show settings.
+ * 
+ * @author jiri hubacek <jiri.hubacek@gmail.com>
+ * @version %I, %G
+ * @since 1.2
+ */
+public class SettingsActivity extends PreferenceActivity
+{
+       /**
+        * Setting up workspace.
+        * 
+        * @since 1.2
+        */
+       @Override
+       protected void onCreate(Bundle savedInstanceState)
+       {
+               super.onCreate(savedInstanceState);
+               addPreferencesFromResource(R.layout.activity_settings);
+               
+               WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
+               EditTextPreference pref = (EditTextPreference) findPreference("prefManagers");
+
+               //TODO should be done in respect to @strings
+               pref.setSummary("Comma separated manager\'s IP addresses" + " (actual IP: "+Formatter.formatIpAddress(wifiManager.getConnectionInfo().getIpAddress())+")");
+       }
+}
similarity index 89%
rename from orte/contrib/shape_android/src/org/ocera/orte/shape4a/SubscriberElement.java
rename to orte/contrib/shape_android/src/org/ocera/orte/shape_android/SubscriberElement.java
index 8dcaec1b477507cb115ba76268375bec8b918878..f88f3280d10921d728bbc46f4180d801270cfcce 100644 (file)
@@ -1,22 +1,22 @@
 /**
  * 
- *     This file is part of shape4a.
+ *     This file is part of shape_android.
  *
- *  shape4a is free software: you can redistribute it and/or modify
+ *  shape_android is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
- *  shape4a is distributed in the hope that it will be useful,
+ *  shape_android is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with shape4a.  If not, see <http://www.gnu.org/licenses/>.
+ *  along with shape_android.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-package org.ocera.orte.shape4a;
+package org.ocera.orte.shape_android;
 
 import android.graphics.Canvas;
 import android.graphics.drawable.ShapeDrawable;
@@ -150,7 +150,7 @@ public class SubscriberElement extends SubscriptionCallback
                        this.shape.setShape(new RectShape());
                }
        }
-       
+
        /**
         * Getter for enabled value. Should be object
         * drawn or not?
@@ -169,6 +169,24 @@ public class SubscriberElement extends SubscriptionCallback
         */
        public void setEnabled(boolean b) { this.enabled = b; }
 
+       /**
+        * Getter for enabled value. Should be object
+        * drawn or not?
+        * 
+        * @return Enabled?
+        * @since 1.0
+        */
+       public boolean getAllowScaling()        { return this.box.allowScaling; }
+       
+       /**
+        * Set value enabled. Should be object
+        * drawn or not?
+        * 
+        * @param b Enable?
+        * @since 1.0
+        */
+       public void setAllowScaling(boolean b) { this.box.allowScaling = b; }
+
        /**
         * Getter for receiving value. Should be object
         * drawn or not?
similarity index 84%
rename from orte/contrib/shape_android/src/org/ocera/orte/shape4a/SubscriberView.java
rename to orte/contrib/shape_android/src/org/ocera/orte/shape_android/SubscriberView.java
index 3d8de08edab5c4808f23ec01d8b69b50b57ae2f4..31f84d66c757f467878a0d843226ee0b8bc14c04 100644 (file)
@@ -1,22 +1,22 @@
 /**
  * 
- *     This file is part of shape4a.
+ *     This file is part of shape_android.
  *
- *  shape4a is free software: you can redistribute it and/or modify
+ *  shape_android is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
- *  shape4a is distributed in the hope that it will be useful,
+ *  shape_android is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with shape4a.  If not, see <http://www.gnu.org/licenses/>.
+ *  along with shape_android.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-package org.ocera.orte.shape4a;
+package org.ocera.orte.shape_android;
 
 import java.util.ArrayList;