Android Open Source - Visu Channel Options Dialog






From Project

Back to project page Visu.

License

The source code is released under:

Apache License

If you think the Android project Visu listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ufavaloro.android.visu.UI;
//from   w ww .j a  va 2s  .  c  om
import org.apache.http.auth.MalformedChallengeException;

import com.ufavaloro.android.visu.draw.channel.Channel;
import com.ufavaloro.android.visu.study.Study;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;

public class ChannelOptionsDialog extends AlertDialog {

  private MainActivity mMainActivity;
  private Study mStudy;
  private int mChannelNumber;
  private final CharSequence[] mOnlineChannelOptions = {"Configurar", "Ocultar"};
  private final CharSequence[] mOfflineChannelOptions = {"Propiedades", "Ocultar"};
  
  public ChannelOptionsDialog(Context context, int theme, int channelNumber) {
    super(context, theme);
    mChannelNumber = channelNumber;
  }

  public void setup() {
    AlertDialog.Builder builder = new AlertDialog.Builder(mMainActivity);
    Channel channel = mStudy.draw.getChannels().getChannelAtIndex(mChannelNumber);
    //builder.setTitle("Canal " + (mChannel.getChannelNumber() + 1));
  
    // The channel is an on-line channel (connected to an ADC)
    if(channel.isOnline()) {
      builder.setItems(mOnlineChannelOptions, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int item) {
          switch(item) {
          // Configurar
          case 0:
            mMainActivity.onlineChannelPropertiesDialog(mChannelNumber);
            break;
            
          // Ocultar canal
            case 1: 
              mStudy.hideChannel(mChannelNumber);
              break;
              
            // Remover canal
            case 2:
              mStudy.removeChannel(mChannelNumber);
              
            default:
              break;
          }
            }
          });
    // The channel is an offline channel (loaded from local storage or google drive)
    } else {
      builder.setItems(mOnlineChannelOptions, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int item) {
          switch(item) {
          // Properties
          case 0:
            mMainActivity.offlineChannelPropertiesDialog(mChannelNumber);
            break;
            
          // Ocultar canal
            case 1: 
              mStudy.hideChannel(mChannelNumber);
              break;
              
            // Remover canal
            case 2:
              mStudy.removeChannel(mChannelNumber);
              
            default:
              break;
          }
            }
          });
    }
  
    builder.create().show();
  }
    
  public void setMainActivity(MainActivity mainActivity) {
    mMainActivity = mainActivity;
  }

  public void setStudy(Study study) {
    mStudy = study;
  }
}




Java Source Code List

com.samsung.sprc.fileselector.FileData.java
com.samsung.sprc.fileselector.FileListAdapter.java
com.samsung.sprc.fileselector.FileOperation.java
com.samsung.sprc.fileselector.FileSelector.java
com.samsung.sprc.fileselector.FileUtils.java
com.samsung.sprc.fileselector.OnHandleFileListener.java
com.samsung.sprc.fileselector.SaveLoadClickListener.java
com.samsung.sprc.fileselector.TextViewWithImage.java
com.ufavaloro.android.visu.UI.ChannelOptionsDialog.java
com.ufavaloro.android.visu.UI.LoadFileFromGoogleDriveDialog.java
com.ufavaloro.android.visu.UI.LoadFileFromLocalStorageDialog.java
com.ufavaloro.android.visu.UI.MainActivity.java
com.ufavaloro.android.visu.UI.MainMenuDialog.java
com.ufavaloro.android.visu.UI.NewStudyDialog.java
com.ufavaloro.android.visu.UI.OfflineChannelPropertiesDialog.java
com.ufavaloro.android.visu.UI.OnlineChannelPropertiesDialog.java
com.ufavaloro.android.visu.UI.StopStudyDialog.java
com.ufavaloro.android.visu.bluetooth.BluetoothProtocolMessage.java
com.ufavaloro.android.visu.bluetooth.BluetoothProtocol.java
com.ufavaloro.android.visu.bluetooth.BluetoothServiceMessage.java
com.ufavaloro.android.visu.bluetooth.BluetoothService.java
com.ufavaloro.android.visu.draw.BitmapManager.java
com.ufavaloro.android.visu.draw.DrawHelper.java
com.ufavaloro.android.visu.draw.RGB.java
com.ufavaloro.android.visu.draw.ReferenceMatrix.java
com.ufavaloro.android.visu.draw.TouchPointer.java
com.ufavaloro.android.visu.draw.channel.ChannelList.java
com.ufavaloro.android.visu.draw.channel.Channel.java
com.ufavaloro.android.visu.draw.channel.DrawBuffer.java
com.ufavaloro.android.visu.draw.channel.InfoBox.java
com.ufavaloro.android.visu.draw.channel.Label.java
com.ufavaloro.android.visu.draw.channel.ScreenElement.java
com.ufavaloro.android.visu.draw.channel.SignalBox.java
com.ufavaloro.android.visu.storage.DataConversion.java
com.ufavaloro.android.visu.storage.SamplesBuffer.java
com.ufavaloro.android.visu.storage.StorageHelperMessage.java
com.ufavaloro.android.visu.storage.StorageHelper.java
com.ufavaloro.android.visu.storage.StudyDataParser.java
com.ufavaloro.android.visu.storage.datatypes.AcquisitionData.java
com.ufavaloro.android.visu.storage.datatypes.AdcData.java
com.ufavaloro.android.visu.storage.datatypes.PatientData.java
com.ufavaloro.android.visu.storage.datatypes.StorageData.java
com.ufavaloro.android.visu.storage.datatypes.StudyData.java
com.ufavaloro.android.visu.storage.googledrive.GoogleDriveClientMessage.java
com.ufavaloro.android.visu.storage.googledrive.GoogleDriveClient.java
com.ufavaloro.android.visu.storage.googledrive.GoogleDriveManagerMessage.java
com.ufavaloro.android.visu.storage.googledrive.GoogleDriveManager.java
com.ufavaloro.android.visu.storage.local.LocalStorageManager.java
com.ufavaloro.android.visu.study.StudyMessage.java
com.ufavaloro.android.visu.study.StudyType.java
com.ufavaloro.android.visu.study.Study.java