Examples of IView


Examples of org.gudy.azureus2.ui.swt.views.IView

      writer.println("# of SubViews: " + tabViews.size());
      writer.indent();
      try {
        for (Iterator<IView> iter = tabViews.iterator(); iter.hasNext();) {
          IView view = iter.next();
          view.generateDiagnostics(writer);
        }
      } finally {
        writer.exdent();
      }
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.views.IView

        //UIDebugGenerator.offusticateArea(image, columnBounds);
      }
    }

    IView view = getActiveSubView();
    if (view instanceof ObfusticateImage) {
      try {
        ((ObfusticateImage) view).obfusticatedImage(image);
      } catch (Exception e) {
        Debug.out("Obfusticating " + view, e);
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.views.IView

    if (isVisible != wasVisible) {
      visibleRowsChanged();
      if (isVisible) {
        loopFactor = 0;

        IView view = getActiveSubView();
        if (view instanceof IViewExtension) {
          ((IViewExtension)view).viewActivated();
        }
      } else {
        IView view = getActiveSubView();
        if (view instanceof IViewExtension) {
          ((IViewExtension)view).viewDeactivated();
        }
      }
    }
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.views.IView

          MdiEntry new_entry,
          MdiEntry old_entry )
        {
          if ( new_entry == old_entry && (new_entry instanceof MdiEntrySWT) ){
           
            IView view = ((MdiEntrySWT)new_entry).getIView();
           
            if ( view instanceof SubscriptionView ){
             
              try{
               
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.views.IView

  protected void refreshView() {
    if (!(mdiEntry instanceof MdiEntrySWT)) {
      return;
    }
    IView iView = ((MdiEntrySWT)mdiEntry).getIView();
    if (iView instanceof SubscriptionView) {
      SubscriptionView subsView = (SubscriptionView) iView;
      subsView.refreshView();
    }
  }
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.views.IView

          close(true);
        }

      } else if (iviewClass != null) {
        try {
          IView view = null;
          if (iviewClassArgs == null) {
            view = (IView) iviewClass.newInstance();
          } else {
            Constructor<?> constructor = iviewClass.getConstructor(iviewClassArgs);
            view = (IView) constructor.newInstance(iviewClassVals);
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.views.IView

    mdi.removeItem(SideBarEntrySWT.this);

    triggerCloseListeners(!SWTThread.getInstance().isTerminated());

    IView iview = getIView();
    if (iview != null) {
      iview.delete();
      setIView(null);
    }
    SWTSkinObject so = getSkinObject();
    if (so != null) {
      setSkinObject(null, null);
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.views.IView

      final UIUpdatable updatable = new UIUpdatable() {
        public void updateUI() {
          Object[] views = topbarViews.toArray();
          for (int i = 0; i < views.length; i++) {
            try {
              IView view = (IView) views[i];
              if (view.getComposite().isVisible()) {
                view.refresh();
              }
            } catch (Exception e) {
              Debug.out(e);
            }
          }
        }

        public String getUpdateUIName() {
          return "TopBar";
        }
      };
      try {
        UIFunctionsManager.getUIFunctions().getUIUpdater().addUpdater(updatable);
      } catch (Exception e) {
        Debug.out(e);
      }

      skinObject.getControl().addDisposeListener(new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
          try {
            UIFunctionsManager.getUIFunctions().getUIUpdater().removeUpdater(
                updatable);
          } catch (Exception ex) {
            Debug.out(ex);
          }
          Object[] views = topbarViews.toArray();
          topbarViews.clear();
          for (int i = 0; i < views.length; i++) {
            IView view = (IView) views[i];
            view.delete();
          }
        }
      });

      SWTSkinObject soPrev = skin.getSkinObject("topbar-plugin-prev");
      if (soPrev != null) {
        SWTSkinButtonUtility btnPrev = new SWTSkinButtonUtility(soPrev);
        btnPrev.addSelectionListener(new ButtonListenerAdapter() {
          public void pressed(SWTSkinButtonUtility buttonUtility,
              SWTSkinObject skinObject, int stateMask) {
            //System.out.println("prev click " + activeTopBar + " ; "
            //    + topbarViews.size());
            if (activeTopBar == null || topbarViews.size() <= 1) {
              return;
            }
            int i = topbarViews.indexOf(activeTopBar) - 1;
            if (i < 0) {
              i = topbarViews.size() - 1;
            }
            activateTopBar((IView) topbarViews.get(i));
          }
        });
      }

      SWTSkinObject soNext = skin.getSkinObject("topbar-plugin-next");
      if (soNext != null) {
        SWTSkinButtonUtility btnNext = new SWTSkinButtonUtility(soNext);
        btnNext.addSelectionListener(new ButtonListenerAdapter() {
          public void pressed(SWTSkinButtonUtility buttonUtility,
              SWTSkinObject skinObject, int stateMask) {
            //System.out.println("next click");
            if (activeTopBar == null || topbarViews.size() <= 1) {
              return;
            }
            int i = topbarViews.indexOf(activeTopBar) + 1;
            if (i >= topbarViews.size()) {
              i = 0;
            }
            activateTopBar((IView) topbarViews.get(i));
          }
        });
      }

      SWTSkinObject soTitle = skin.getSkinObject("topbar-plugin-title");
      if (soTitle != null) {
        final Composite cTitle = (Composite) soTitle.getControl();
        cTitle.addPaintListener(new PaintListener() {
          public void paintControl(PaintEvent e) {
            e.gc.setAdvanced(true);
            //Font font = new Font(e.gc.getDevice(), "Sans", 8, SWT.NORMAL);
            //e.gc.setFont(font);
            if (e.gc.getAdvanced() && activeTopBar != null) {
              try {
                e.gc.setTextAntialias(SWT.ON);
              } catch (Exception ex) {
                // Ignore ERROR_NO_GRAPHICS_LIBRARY error or any others
              }

              try {
                Transform transform = new Transform(e.gc.getDevice());
                transform.rotate(270);
                e.gc.setTransform(transform);

                String s = activeTopBar.getShortTitle();
                Point size = e.gc.textExtent(s);
                e.gc.drawText(s, -size.x, 0, true);
                //e.gc.drawText(s, 0,0, true);
                transform.dispose();
              } catch (Exception ex) {
                // setTransform can trhow a ERROR_NO_GRAPHICS_LIBRARY error
                // no use trying to draw.. it would look weird
              }
              //font.dispose();
            }
          }
        });
      }

      SWTSkinObject soList = skin.getSkinObject("topbar-plugin-list");
      if (soList != null) {
        final Composite cList = (Composite) soList.getControl();
        listPlugins = new org.eclipse.swt.widgets.List(cList, SWT.None);
        listPlugins.setLayoutData(Utils.getFilledFormData());
        listPlugins.setBackground(cList.getBackground());
        listPlugins.setForeground(cList.getForeground());
        listPlugins.addSelectionListener(new SelectionListener() {
          public void widgetSelected(SelectionEvent e) {
            int i = listPlugins.getSelectionIndex();
            if (i >= 0 && i < topbarViews.size()) {
              activateTopBar((IView) topbarViews.get(i));
              COConfigurationManager.setParameter("topbar.viewindex", i);
            }
          }

          public void widgetDefaultSelected(SelectionEvent e) {
          }
        });
      }

      skinObject = skin.getSkinObject(SkinConstants.VIEWID_PLUGINBAR);
      if (skinObject != null) {
        Listener l = new Listener() {
          private int mouseDownAt = 0;

          public void handleEvent(Event event) {
            Composite c = (Composite) event.widget;
            if (event.type == SWT.MouseDown) {
              Rectangle clientArea = c.getClientArea();
              if (event.y > clientArea.height - 10) {
                mouseDownAt = event.y;
              }
            } else if (event.type == SWT.MouseUp && mouseDownAt > 0) {
              int diff = event.y - mouseDownAt;
              mouseDownAt = 0;
              FormData formData = (FormData) c.getLayoutData();
              formData.height += diff;
              if (formData.height < 50) {
                formData.height = 50;
              } else {
                Rectangle clientArea = c.getShell().getClientArea();
                int max = clientArea.height - 350;
                if (formData.height > max) {
                  formData.height = max;
                }
              }
              COConfigurationManager.setParameter("v3.topbar.height",
                  formData.height);
              Utils.relayout(c);
            } else if (event.type == SWT.MouseMove) {
              Rectangle clientArea = c.getClientArea();
              boolean draggable = (event.y > clientArea.height - 10);
              c.setCursor(draggable ? c.getDisplay().getSystemCursor(
                  SWT.CURSOR_SIZENS) : null);
            } else if (event.type == SWT.MouseExit) {
              c.setCursor(null);
            }
          }
        };
        Control control = skinObject.getControl();
        control.addListener(SWT.MouseDown, l);
        control.addListener(SWT.MouseUp, l);
        control.addListener(SWT.MouseMove, l);
        control.addListener(SWT.MouseExit, l);

        skinObject.addListener(new SWTSkinObjectListener() {
          public Object eventOccured(SWTSkinObject skinObject, int eventType,
              Object params) {
            if (eventType == EVENT_SHOW) {
              int h = COConfigurationManager.getIntParameter("v3.topbar.height");
              Control control = skinObject.getControl();
              FormData formData = (FormData) control.getLayoutData();
              formData.height = h;
              control.setLayoutData(formData);
              Utils.relayout(control);
            }
            return null;
          }
        });
      }

      int toActiveView = COConfigurationManager.getIntParameter(
          "topbar.viewindex", 0);
      int viewIndex = toActiveView;
      for (int i = 0; i < coreTopBarViews.length; i++) {
        IView view = coreTopBarViews[i];
        addTopBarView(view, cPluginArea);
        if (toActiveView-- == 0) {
          activateTopBar(view);
          if (listPlugins != null) {
            listPlugins.setSelection(viewIndex);
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.views.IView

      if (i > 0) {
        id = id.substring(i + 1);
      }
    }

    IView viewFromID = mdi.getIViewFromID(id);
    if (viewFromID != null) {
      mdi.showEntryByID(id);
    }

    final String _id = id;
View Full Code Here

Examples of srsim.ui.IView

    simulator.listenForClients(5222);
    simulator.startSimulation();
    ready = true;

    // Show user interface
    IView view = nogui ? new ConsoleView(simulator) : new SwingView(
        simulator);
    view.init();
    view.display();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.