@Override
 public void onDestroy() {
   if (!NetworkView.Instance().isInitialized() && NetworkInitializer.Instance != null) {
     NetworkInitializer.Instance.setActivity(null);
   }
   super.onDestroy();
 }
Exemplo n.º 2
0
 public void setup() {
   size(1400, 800);
   previous_w = width;
   previous_h = height;
   frame.setResizable(true);
   bounds = new Rect(0, 0, width, height / 3);
   nv = new NetworkView(new DerLeser("data_aggregate.csv").readIn(), bounds);
   nv.setBounds(bounds);
 }
 @Override
 public void onResume() {
   super.onResume();
   if (!NetworkView.Instance().isInitialized()) {
     if (NetworkInitializer.Instance == null) {
       new NetworkInitializer(this);
       NetworkInitializer.Instance.start();
     } else {
       NetworkInitializer.Instance.setActivity(this);
     }
   } else {
     prepareView();
     if (myIntent != null) {
       processIntent(myIntent);
       myIntent = null;
     }
   }
 }
  private void refreshCatalogsList() {
    final NetworkView view = NetworkView.Instance();

    final Handler handler =
        new Handler() {
          @Override
          public void handleMessage(Message msg) {
            if (msg.obj == null) {
              view.finishBackgroundUpdate();
            } else {
              final ZLResource dialogResource = ZLResource.resource("dialog");
              final ZLResource boxResource = dialogResource.getResource("networkError");
              final ZLResource buttonResource = dialogResource.getResource("button");
              new AlertDialog.Builder(NetworkLibraryActivity.this)
                  .setTitle(boxResource.getResource("title").getValue())
                  .setMessage((String) msg.obj)
                  .setIcon(0)
                  .setPositiveButton(buttonResource.getResource("ok").getValue(), null)
                  .create()
                  .show();
            }
          }
        };

    UIUtil.wait(
        "updatingCatalogsList",
        new Runnable() {
          public void run() {
            String error = null;
            try {
              view.runBackgroundUpdate(true);
            } catch (ZLNetworkException e) {
              error = e.getMessage();
            }
            handler.sendMessage(handler.obtainMessage(0, error));
          }
        },
        this);
  }
 public final int getCount() {
   if (!NetworkView.Instance().isInitialized()) {
     return 0;
   }
   return myTree.subTrees().size();
 }
Exemplo n.º 6
0
 public void draw() {
   nv.render();
   nv.getHoveredDatums();
 }