From 41c25d0c90a2461c3e34bf9659dcf1da5e1e8580 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 22 Aug 2013 08:18:56 -0400 Subject: [PATCH] [Android] General cleanup. Add more documentation. Remove some accidental changes that slipped through. Don't want to have input settings in the settings menu just yet. --- .../dolphinemu/dolphinemu/AboutFragment.java | 9 ---- .../dolphinemu/NativeGLSurfaceView.java | 8 ++++ .../folderbrowser/FolderBrowser.java | 17 ++++++- .../folderbrowser/FolderBrowserAdapter.java | 7 +++ .../dolphinemu/gamelist/GameListActivity.java | 44 ++++++++++++----- .../dolphinemu/gamelist/GameListAdapter.java | 12 +++++ .../dolphinemu/gamelist/GameListFragment.java | 33 ++++++++----- .../dolphinemu/gamelist/GameListItem.java | 47 ++++++++++++++++++- .../inputconfig/InputConfigAdapter.java | 13 +++-- .../inputconfig/InputConfigFragment.java | 26 ++++++++-- .../dolphinemu/settings/PrefsActivity.java | 18 ++----- .../settings/VideoSettingsFragment.java | 40 ++++++++++++---- .../dolphinemu/sidemenu/SideMenuAdapter.java | 12 +++++ .../dolphinemu/sidemenu/SideMenuItem.java | 16 +++---- 14 files changed, 232 insertions(+), 70 deletions(-) diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java index 40e78fc4bf..41e347a697 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java @@ -23,17 +23,8 @@ import org.dolphinemu.dolphinemu.settings.VideoSettingsFragment; public final class AboutFragment extends Fragment { private static Activity m_activity; - private ListView mMainList; - private FolderBrowserAdapter adapter; - boolean Configuring = false; - boolean firstEvent = true; - - public AboutFragment() - { - // Empty constructor required for fragment subclasses - } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java b/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java index 816f4afb34..2e38d98fef 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java @@ -4,12 +4,20 @@ import android.content.Context; import android.view.SurfaceHolder; import android.view.SurfaceView; +/** + * The surface that rendering is done to. + */ public final class NativeGLSurfaceView extends SurfaceView { private static Thread myRun; private static boolean Running = false; private static boolean Created = false; + /** + * Constructor. + * + * @param context The current {@link Context}. + */ public NativeGLSurfaceView(Context context) { super(context); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java index 4dc4b7b62c..2895196ff7 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java @@ -19,6 +19,19 @@ import org.dolphinemu.dolphinemu.NativeLibrary; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.gamelist.GameListActivity; +/** + * A basic folder browser {@link Fragment} that allows + * the user to select ISOs/ROMs for playing within the + * emulator. + *

+ * Any valid ISO/ROM selected in this will be added to + * the game list for easy browsing the next time the + * application is used. + *

+ * Note that invalid items will be shown in the color red.
+ * Also note that this file browser does not display files + * or directories that are hidden + */ public final class FolderBrowser extends Fragment { private Activity m_activity; @@ -69,7 +82,7 @@ public final class FolderBrowser extends Fragment } catch (Exception ex) { - Log.d("EXCEPTION", ex.toString()); + Log.e("Exception-FolderBrowser", ex.toString()); } } @@ -136,6 +149,8 @@ public final class FolderBrowser extends Fragment + " must implement OnGameListZeroListener"); } } + + private void FolderSelected() { String Directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPathes", "0"); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserAdapter.java index 46effa4f70..e77205b527 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserAdapter.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserAdapter.java @@ -12,6 +12,12 @@ import android.widget.TextView; import org.dolphinemu.dolphinemu.R; +/** + * The {@link ArrayAdapter} that backs the file browser. + *

+ * This is responsible for correctly handling the display + * of the items for the UI. + */ public final class FolderBrowserAdapter extends ArrayAdapter { private final Context c; @@ -26,6 +32,7 @@ public final class FolderBrowserAdapter extends ArrayAdapter items = objects; } + @Override public FolderBrowserItem getItem(int i) { return items.get(i); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListActivity.java index c03971a2b6..62a9f34189 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListActivity.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListActivity.java @@ -1,3 +1,9 @@ +/** + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu.gamelist; import android.app.Activity; @@ -26,9 +32,8 @@ import org.dolphinemu.dolphinemu.sidemenu.SideMenuAdapter; import org.dolphinemu.dolphinemu.sidemenu.SideMenuItem; /** - * Copyright 2013 Dolphin Emulator Project - * Licensed under GPLv2 - * Refer to the license.txt file included. + * The activity that implements all of the functions + * for the game list. */ public final class GameListActivity extends Activity implements GameListFragment.OnGameListZeroListener @@ -40,8 +45,24 @@ public final class GameListActivity extends Activity private DrawerLayout mDrawerLayout; private SideMenuAdapter mDrawerAdapter; private ListView mDrawerList; + + /** + * Interface defining methods which handle + * the binding of specific key presses within + * the input mapping settings. + */ + public interface OnGameConfigListener + { + boolean onMotionEvent(MotionEvent event); + boolean onKeyEvent(KeyEvent event); + } - // Called from the game list fragment + /** + * Called from the {@link GameListFragment}. + *

+ * This is called when there are no games + * currently present within the game list. + */ public void onZeroFiles() { mDrawerLayout.openDrawer(mDrawerList); @@ -100,6 +121,12 @@ public final class GameListActivity extends Activity fragmentManager.beginTransaction().replace(R.id.content_frame, mCurFragment).commit(); } + /** + * Switches to the {@link Fragment} represented + * by the given ID number. + * + * @param toPage the number representing the {@link Fragment} to switch to.l + */ public void SwitchPage(int toPage) { if (mCurFragmentNum == toPage) @@ -194,11 +221,11 @@ public final class GameListActivity extends Activity SwitchPage(o.getID()); } }; + /** * When using the ActionBarDrawerToggle, you must call it during * onPostCreate() and onConfigurationChanged()... */ - @Override protected void onPostCreate(Bundle savedInstanceState) { @@ -235,17 +262,12 @@ public final class GameListActivity extends Activity return super.onOptionsItemSelected(item); } + @Override public void onBackPressed() { SwitchPage(0); } - public interface OnGameConfigListener - { - public boolean onMotionEvent(MotionEvent event); - public boolean onKeyEvent(KeyEvent event); - } - // Gets move(triggers, joystick) events @Override public boolean dispatchGenericMotionEvent(MotionEvent event) diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java index 9f2d727b2a..1bc88e1255 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java @@ -1,3 +1,9 @@ +/** + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu.gamelist; import android.content.Context; @@ -12,6 +18,11 @@ import java.util.List; import org.dolphinemu.dolphinemu.R; +/** + * The adapter backing the game list. + *

+ * Responsible for handling each game list item individually. + */ public final class GameListAdapter extends ArrayAdapter { private final Context c; @@ -26,6 +37,7 @@ public final class GameListAdapter extends ArrayAdapter items = objects; } + @Override public GameListItem getItem(int i) { return items.get(i); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListFragment.java index 302c618b06..d77741016b 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListFragment.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListFragment.java @@ -1,3 +1,9 @@ +/** + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu.gamelist; import android.app.Activity; @@ -22,26 +28,28 @@ import java.util.Set; import org.dolphinemu.dolphinemu.NativeLibrary; import org.dolphinemu.dolphinemu.R; + /** - * Copyright 2013 Dolphin Emulator Project - * Licensed under GPLv2 - * Refer to the license.txt file included. + * The {@link Fragment} responsible for displaying the game list. */ public final class GameListFragment extends Fragment { private ListView mMainList; private GameListAdapter mGameAdapter; private static GameListActivity mMe; - OnGameListZeroListener mCallback; + private OnGameListZeroListener mCallback; + /** + * Interface that defines how to handle the case + * when there are zero game. + */ public interface OnGameListZeroListener { - public void onZeroFiles(); - } - - public GameListFragment() - { - // Empty constructor required for fragment subclasses + /** + * This is called when there are no games + * currently present within the game list. + */ + void onZeroFiles(); } private void Fill() @@ -97,8 +105,11 @@ public final class GameListFragment extends Fragment mGameAdapter = new GameListAdapter(mMe, R.layout.gamelist_layout, fls); mMainList.setAdapter(mGameAdapter); - if (fls.size() == 0) + + if (fls.isEmpty()) + { mCallback.onZeroFiles(); + } } @Override diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListItem.java b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListItem.java index e79112bc99..16ba06a65a 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListItem.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListItem.java @@ -1,8 +1,15 @@ +/** + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu.gamelist; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; +import android.util.Log; import java.io.File; import java.io.IOException; @@ -10,6 +17,9 @@ import java.io.InputStream; import org.dolphinemu.dolphinemu.NativeLibrary; +/** + * Represents an item in the game list. + */ public final class GameListItem implements Comparable { private String name; @@ -18,6 +28,15 @@ public final class GameListItem implements Comparable private final boolean isValid; private Bitmap image; + /** + * Constructor. + * + * @param ctx The current {@link Context} + * @param name The name of this GameListItem. + * @param data The subtitle for this GameListItem + * @param path The file path for the game represented by this GameListItem. + * @param isValid Whether or not the emulator can handle this file. + */ public GameListItem(Context ctx, String name, String data, String path, boolean isValid) { this.name = name; @@ -44,8 +63,7 @@ public final class GameListItem implements Comparable } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + Log.e("Exception-GameListItem", e.toString()); } } else @@ -57,26 +75,51 @@ public final class GameListItem implements Comparable } } + /** + * Gets the name of this GameListItem. + * + * @return the name of this GameListItem. + */ public String getName() { return name; } + /** + * Gets the subtitle of this GameListItem. + * + * @return the subtitle of this GameListItem. + */ public String getData() { return data; } + /** + * Gets the file path of the game represented by this GameListItem. + * + * @return the file path of the game represented by this GameListItem. + */ public String getPath() { return path; } + /** + * Gets the image data for this game as a {@link Bitmap}. + * + * @return the image data for this game as a {@link Bitmap}. + */ public Bitmap getImage() { return image; } + /** + * Gets whether or not the emulator can handle this GameListItem. + * + * @return true, if this GameListItem can be handled by the emulator; false, otherwise. + */ public boolean isValid() { return isValid; diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/inputconfig/InputConfigAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/inputconfig/InputConfigAdapter.java index 99b689c4bf..318075ec40 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/inputconfig/InputConfigAdapter.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/inputconfig/InputConfigAdapter.java @@ -1,3 +1,9 @@ +/** + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu.inputconfig; import android.content.Context; @@ -12,9 +18,9 @@ import java.util.List; import org.dolphinemu.dolphinemu.R; /** - * Copyright 2013 Dolphin Emulator Project - * Licensed under GPLv2 - * Refer to the license.txt file included. + * The adapter backing the input mapping configuration. + *

+ * Responsible for handling the list items. */ public final class InputConfigAdapter extends ArrayAdapter { @@ -30,6 +36,7 @@ public final class InputConfigAdapter extends ArrayAdapter items = objects; } + @Override public InputConfigItem getItem(int i) { return items.get(i); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/inputconfig/InputConfigFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/inputconfig/InputConfigFragment.java index beae49a88a..dd91b952c7 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/inputconfig/InputConfigFragment.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/inputconfig/InputConfigFragment.java @@ -1,3 +1,9 @@ +/** + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu.inputconfig; import android.app.Activity; @@ -17,9 +23,8 @@ import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.gamelist.GameListActivity; /** - * Copyright 2013 Dolphin Emulator Project - * Licensed under GPLv2 - * Refer to the license.txt file included. + * The {@link Fragment} responsible for implementing the functionality + * within the input control mapping config. */ public final class InputConfigFragment extends Fragment implements GameListActivity.OnGameConfigListener @@ -31,7 +36,14 @@ public final class InputConfigFragment extends Fragment private boolean Configuring = false; private boolean firstEvent = true; - static public String getInputDesc(InputDevice input) + /** + * Gets the descriptor for the given {@link InputDevice}. + * + * @param input The {@link InputDevice} to get the descriptor of. + * + * @return the descriptor for the given {@link InputDevice}. + */ + public static String getInputDesc(InputDevice input) { if (input == null) return "null"; // Happens when the inputdevice is from an unknown source @@ -109,6 +121,11 @@ public final class InputConfigFragment extends Fragment adapter.insert(o, configPosition); } + /** + * Gets the current {@link InputConfigAdapter} + * + * @return the current {@link InputConfigAdapter}. + */ public InputConfigAdapter getAdapter() { return adapter; @@ -157,6 +174,7 @@ public final class InputConfigFragment extends Fragment return true; } + // Called from GameListActivity public boolean onKeyEvent(KeyEvent event) { Log.w("InputConfigFragment", "Got Event " + event.getAction()); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/settings/PrefsActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/settings/PrefsActivity.java index 5a1aeabf60..08685fa008 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/settings/PrefsActivity.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/settings/PrefsActivity.java @@ -7,7 +7,6 @@ package org.dolphinemu.dolphinemu.settings; import org.dolphinemu.dolphinemu.R; -import org.dolphinemu.dolphinemu.inputconfig.InputConfigFragment; import android.app.ActionBar; import android.app.ActionBar.Tab; @@ -31,12 +30,12 @@ public final class PrefsActivity extends Activity implements ActionBar.TabListen * 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; + private SectionsPagerAdapter mSectionsPagerAdapter; /** * The {@link ViewPager} that will host the section contents. */ - ViewPager mViewPager; + private ViewPager mViewPager; @Override protected void onCreate(Bundle savedInstanceState) @@ -73,7 +72,6 @@ public final class PrefsActivity extends Activity implements ActionBar.TabListen // the TabListener interface, as the callback (listener) for when // this tab is selected. actionBar.addTab(actionBar.newTab().setText(R.string.cpu_settings).setTabListener(this)); - actionBar.addTab(actionBar.newTab().setText("Input Settings").setTabListener(this)); actionBar.addTab(actionBar.newTab().setText(R.string.video_settings).setTabListener(this)); } @@ -94,8 +92,8 @@ public final class PrefsActivity extends Activity implements ActionBar.TabListen } /** - * A {@link FragmentPagerAdapter} that returns a fragment corresponding to one of the - * sections/tabs/pages. + * A {@link FragmentPagerAdapter} that returns a fragment + * corresponding to one of the sections/tabs/pages. */ public final class SectionsPagerAdapter extends FragmentPagerAdapter { @@ -113,9 +111,6 @@ public final class PrefsActivity extends Activity implements ActionBar.TabListen return new CPUSettingsFragment(); case 1: - return new InputConfigFragment(); - - case 2: return new VideoSettingsFragment(); default: // Should never happen. @@ -127,7 +122,7 @@ public final class PrefsActivity extends Activity implements ActionBar.TabListen public int getCount() { // Show total pages. - return 3; + return 2; } @Override @@ -139,9 +134,6 @@ public final class PrefsActivity extends Activity implements ActionBar.TabListen return getString(R.string.cpu_settings).toUpperCase(); case 1: - return "Input Settings";//getString(R.string) - - case 2: return getString(R.string.video_settings).toUpperCase(); default: // Should never happen. diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/settings/VideoSettingsFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/settings/VideoSettingsFragment.java index ae2b41e987..3d97f2cbca 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/settings/VideoSettingsFragment.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/settings/VideoSettingsFragment.java @@ -27,15 +27,19 @@ public final class VideoSettingsFragment extends PreferenceFragment { private Activity m_activity; - public static class VersionCheck + /** + * Class which provides a means to check various + * info about the OpenGL ES support for a device. + */ + public static final class VersionCheck { - EGL10 mEGL; - EGLDisplay mEGLDisplay; - EGLConfig[] mEGLConfigs; - EGLConfig mEGLConfig; - EGLContext mEGLContext; - EGLSurface mEGLSurface; - GL10 mGL; + private EGL10 mEGL; + private EGLDisplay mEGLDisplay; + private EGLConfig[] mEGLConfigs; + private EGLConfig mEGLConfig; + private EGLContext mEGLContext; + private EGLSurface mEGLSurface; + private GL10 mGL; String mThreadOwner; @@ -68,16 +72,31 @@ public final class VideoSettingsFragment extends PreferenceFragment mThreadOwner = Thread.currentThread().getName(); } + /** + * Gets the OpenGL ES version string. + * + * @return the OpenGL ES version string. + */ public String getVersion() { return mGL.glGetString(GL10.GL_VERSION); } + /** + * Gets the OpenGL ES vendor string. + * + * @return the OpenGL ES vendor string. + */ public String getVendor() { return mGL.glGetString(GL10.GL_VENDOR); } + /** + * Gets the name of the OpenGL ES renderer. + * + * @return the name of the OpenGL ES renderer. + */ public String getRenderer() { return mGL.glGetString(GL10.GL_RENDERER); @@ -107,6 +126,11 @@ public final class VideoSettingsFragment extends PreferenceFragment } } + /** + * Checks if this device supports OpenGL ES 3. + * + * @return true if this device supports OpenGL ES 3; false otherwise. + */ public static boolean SupportsGLES3() { VersionCheck mbuffer = new VersionCheck(); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/sidemenu/SideMenuAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/sidemenu/SideMenuAdapter.java index 63439d5ad3..0e84009071 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/sidemenu/SideMenuAdapter.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/sidemenu/SideMenuAdapter.java @@ -1,3 +1,9 @@ +/** + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu.sidemenu; import android.content.Context; @@ -11,6 +17,11 @@ import java.util.List; import org.dolphinemu.dolphinemu.R; +/** + * Adapter that backs the sidebar menu. + *

+ * Responsible for handling the elements of each sidebar item. + */ public final class SideMenuAdapter extends ArrayAdapter { private final Context c; @@ -25,6 +36,7 @@ public final class SideMenuAdapter extends ArrayAdapter items = objects; } + @Override public SideMenuItem getItem(int i) { return items.get(i); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/sidemenu/SideMenuItem.java b/Source/Android/src/org/dolphinemu/dolphinemu/sidemenu/SideMenuItem.java index 51c41f04c4..a3393ef211 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/sidemenu/SideMenuItem.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/sidemenu/SideMenuItem.java @@ -12,8 +12,8 @@ package org.dolphinemu.dolphinemu.sidemenu; */ public final class SideMenuItem implements Comparable { - private final String m_name; - private final int m_id; + private final String name; + private final int id; /** * Constructor @@ -23,8 +23,8 @@ public final class SideMenuItem implements Comparable */ public SideMenuItem(String name, int id) { - m_name = name; - m_id = id; + this.name = name; + this.id = id; } /** @@ -34,7 +34,7 @@ public final class SideMenuItem implements Comparable */ public String getName() { - return m_name; + return name; } /** @@ -44,13 +44,13 @@ public final class SideMenuItem implements Comparable */ public int getID() { - return m_id; + return id; } public int compareTo(SideMenuItem o) { - if (this.m_name != null) - return this.m_name.toLowerCase().compareTo(o.getName().toLowerCase()); + if (name != null) + return this.name.toLowerCase().compareTo(o.getName().toLowerCase()); else throw new IllegalArgumentException(); }