org.arakhne.neteditor.android.activity
G - is the type of the graph supported by this editor.public abstract class AbstractEditorActivity<G extends Graph<?,?,?,?>> extends android.app.Activity
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractEditorActivity.DifferedActionType
Type of differed action that may be run by
the function
runDifferedActionAfterSaving(DifferedActionType). |
| Modifier and Type | Field and Description |
|---|---|
protected static String |
TAG
Tag for logs.
|
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OKACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_WAIVE_PRIORITY, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_ROUTER_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, STORAGE_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, UI_MODE_SERVICE, USB_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE| Constructor and Description |
|---|
AbstractEditorActivity() |
| Modifier and Type | Method and Description |
|---|---|
protected static NetEditorContentType |
decode(File file)
Detect the type of the given file.
|
File |
getCurrentDocument()
Replies the filename of the current document.
|
NetEditorContentType |
getCurrentDocumentType()
Replies the encoding type of the current document.
|
FigureView<G> |
getFigureView()
Replies the viewer of figures.
|
protected abstract Class<? extends FigureFactory<G>> |
getPreferredFigureFactory()
Replies the type of the figure factory supported by this editor.
|
protected abstract Class<? extends FileFilter> |
getPreferredFileFilter()
Replies the type of the preferred file filter for this activity.
|
protected abstract Class<G> |
getPreferredGraphType()
Replies the type of the graph supported by this editor.
|
boolean |
hasChanged()
Replies if the current document has been changed since
its last loading.
|
boolean |
isSelectionEnabled()
Replies if the selection manager is enabled.
|
boolean |
isSelectionMode()
Replies if the activity is in selection mode.
|
protected void |
killApplication()
Kill the application.
|
protected void |
onActionPerformed(boolean isEditionEnabled,
Point2D hitPoint,
Figure... figures)
Invoked when the user want to perform the standard action
on the given figures.
|
protected void |
onActivityResult(int requestCode,
int resultCode,
android.content.Intent data) |
void |
onBackPressed() |
void |
onCreate(android.os.Bundle savedInstanceState) |
boolean |
onCreateThumbnail(android.graphics.Bitmap outBitmap,
android.graphics.Canvas canvas) |
protected void |
onDestroy() |
protected void |
onRegisterPropertyEditors()
Invoked to register the property editors that are known by the activity.
|
protected void |
onRestoreInstanceState(android.os.Bundle savedInstanceState) |
protected void |
onSaveInstanceState(android.os.Bundle outState) |
protected void |
onSecondaryActionPerformed(boolean isEditionEnabled,
Figure... figures)
Invoked when the user want to perform the standard secondary action
on the given figures.
|
protected void |
runDifferedActionAfterSaving(AbstractEditorActivity.DifferedActionType action)
Ask the user if he wants to save its document and run the
specified action if a positive answer if given.
|
protected void |
runLoadAction(boolean askToSave)
Run the loading action.
|
protected void |
runNewDocumentAction(boolean askToSave)
Run the new action.
|
protected void |
runSaveAction()
Run the saving action.
|
protected void |
runSaveAsAction()
Run the save-as action.
|
(package private) void |
setFileSelectionCallback(ActionModeOwner.Callback callback)
Set the callback that may be invoked by the mode's file selector.
|
void |
setSelectionEnabled(boolean enable)
Set if the selection manager is enabled.
|
protected void |
showError(Throwable e)
Show an error dialog box.
|
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, dump, findViewById, finish, finishActivity, finishActivityFromChild, finishAffinity, finishFromChild, getActionBar, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getCurrentFocus, getFragmentManager, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLoaderManager, getLocalClassName, getMenuInflater, getParent, getParentActivityIntent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, invalidateOptionsMenu, isChangingConfigurations, isChild, isFinishing, isTaskRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onChildTitleChanged, onConfigurationChanged, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onCreateView, onCreateView, onDetachedFromWindow, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNavigateUp, onNavigateUpFromChild, onNewIntent, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPause, onPostCreate, onPostResume, onPrepareDialog, onPrepareDialog, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onPreparePanel, onRestart, onResume, onRetainNonConfigurationInstance, onSearchRequested, onStart, onStop, onTitleChanged, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, openOptionsMenu, overridePendingTransition, recreate, registerForContextMenu, removeDialog, requestWindowFeature, runOnUiThread, setContentView, setContentView, setContentView, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setIntent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, shouldUpRecreateTask, showDialog, showDialog, startActionMode, startActivities, startActivities, startActivity, startActivity, startActivityForResult, startActivityForResult, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderForResult, startIntentSenderForResult, startIntentSenderFromChild, startIntentSenderFromChild, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenubindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalFilesDir, getFilesDir, getFileStreamPath, getMainLooper, getObbDir, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, sendStickyOrderedBroadcast, setWallpaper, setWallpaper, startInstrumentation, startService, stopService, unbindService, unregisterReceiverprotected static final String TAG
protected static NetEditorContentType decode(File file)
file - null if it is a NGR file.void setFileSelectionCallback(ActionModeOwner.Callback callback)
callback - protected void runDifferedActionAfterSaving(AbstractEditorActivity.DifferedActionType action)
The user may answer in following ways:
action - is the action to run.protected void onRegisterPropertyEditors()
public boolean isSelectionEnabled()
true if the selection manager is enabled.public void setSelectionEnabled(boolean enable)
enable - is true if the selection manager is enabled.public File getCurrentDocument()
public NetEditorContentType getCurrentDocumentType()
public boolean hasChanged()
true if the document has changed since
the last loading; false if the document remains
the same.protected void showError(Throwable e)
e - public void onCreate(android.os.Bundle savedInstanceState)
onCreate in class android.app.Activityprotected void onSaveInstanceState(android.os.Bundle outState)
onSaveInstanceState in class android.app.Activityprotected void onRestoreInstanceState(android.os.Bundle savedInstanceState)
onRestoreInstanceState in class android.app.Activitypublic FigureView<G> getFigureView()
public boolean onCreateThumbnail(android.graphics.Bitmap outBitmap,
android.graphics.Canvas canvas)
onCreateThumbnail in class android.app.Activitypublic void onBackPressed()
onBackPressed in class android.app.Activityprotected void killApplication()
protected void onDestroy()
onDestroy in class android.app.Activityprotected void onActionPerformed(boolean isEditionEnabled,
Point2D hitPoint,
Figure... figures)
By default this function does nothing.
isEditionEnabled - indicates if the figures can be edited.hitPoint - is the point where the action is performed. It may be null if
the position is unknown.figures - are the figures on which the action must be performedprotected void onSecondaryActionPerformed(boolean isEditionEnabled,
Figure... figures)
By default this function open the property editor for the figures.
isEditionEnabled - indicates if the figures can be edited.figures - public boolean isSelectionMode()
true if in selection mode.protected void onActivityResult(int requestCode,
int resultCode,
android.content.Intent data)
onActivityResult in class android.app.Activityprotected void runNewDocumentAction(boolean askToSave)
askToSave - is true if the user must answer
to "Want to save?".protected void runLoadAction(boolean askToSave)
askToSave - is true if the user must answer
to "Want to save?".protected abstract Class<? extends FileFilter> getPreferredFileFilter()
null for the default type.OpenableDocumentFileFilterprotected abstract Class<G> getPreferredGraphType()
protected abstract Class<? extends FigureFactory<G>> getPreferredFigureFactory()
protected void runSaveAction()
protected void runSaveAsAction()
Copyright © 2001-2013 NetEditor Developers. 
NetEditor API Documentation by NetEditor Developers is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Based on a work at www.arakhne.org/neteditor