Package org.sf.feeling.swt.win32.extension.graphics

Examples of org.sf.feeling.swt.win32.extension.graphics.GraphicsUtil


  private static int hJournalPlaybackHook = 0;
  private static boolean isInstall = false;

  static int JournalPlaybackHookProc(int nCode, int wParam, int lParam) {
    if (interceptor != null) {
      InterceptorFlag flag = interceptor.intercept(nCode, wParam, lParam);
      if (InterceptorFlag.FALSE.equals(flag))
        return -1;
      else if (flag.isCustom())
        return flag.getValue();
    }
    return Extension.CallNextHookEx(hJournalPlaybackHook, nCode, wParam,
        lParam);
  }
View Full Code Here


    /**
     * Notifies listeners about a hook event.
     */
    private void notifyListeners(HookData data) {
      for (int i = 0; i < listeners.size() && messageThreadAlive; i++) {
        HookEventListener listener = (HookEventListener) listeners
            .get(i);
        listener.acceptHookData(data);
      }
    }
View Full Code Here

  {
    if (listeners != null)
    {
      for (int i = 0; i < listeners.size(); i++)
      {
        final CDDriveChangeListener listener = (CDDriveChangeListener) listeners
            .get(i);
        Display.getDefault().asyncExec(new Runnable()
        {
          public void run()
          {
            if (event.type == CDDrive.DEVICE_LOADED) listener.driveLoaded(event);
            else if (event.type == CDDrive.DEVICE_EJECTED) listener
                .driveEjected(event);
          }
        });
      }
    }
View Full Code Here

      oleControlSite = new OleControlSite(oleFrame, SWT.NONE,
          "ShockwaveFlash.ShockwaveFlash");
      OleAutomation oleAutomation = new OleAutomation(oleControlSite);
      flashObject = new OleObject(oleAutomation);
      created = true;
      final OleMsgHook hook = new OleMsgHook(this);
      oleControlSite.addDisposeListener(new DisposeListener() {

        public void widgetDisposed(DisposeEvent e) {
          hook.unInstallHook();
        }

      });
      hook.installHook();
      activate();
    } catch (SWTException ex) {
      if (oleFrame != null && !oleFrame.isDisposed())
        oleFrame.dispose();
      errorLabel = new CLabel(this, SWT.CENTER);
View Full Code Here

    try {
      // Create an Automation object for access to extended capabilities
      oleControlSite = new OleControlSite(oleFrame, SWT.NONE,
          "ShockwaveFlash.ShockwaveFlash");
      OleAutomation oleAutomation = new OleAutomation(oleControlSite);
      flashObject = new OleObject(oleAutomation);
      created = true;
      final OleMsgHook hook = new OleMsgHook(this);
      oleControlSite.addDisposeListener(new DisposeListener() {

        public void widgetDisposed(DisposeEvent e) {
View Full Code Here

  public OleHookInterceptor getHookInterceptor() {
    return interceptor;
  }

  public static boolean canCreate() {
    RegistryKey key = new RegistryKey(RootKey.HKEY_CLASSES_ROOT,
        "ShockwaveFlash.ShockwaveFlash");
    if (!key.exists())
      return false;
    if (key.hasSubkey("CurVer"))
      return true;
    else
      return false;
  }
View Full Code Here

    Windows.hideTitleBar(shell.handle);
    Windows.setBorderThick(shell.handle, false);
    Windows.setWindowAsDialogModel(shell.handle, false);
    if (resizeHook == null) resizeHook = new WindowResizeHook(this);
    resizeHook.installHook();
    if (menuManager == null) menuManager = new SystemMenuManager(shell);
  }
View Full Code Here

      getBorder(IContainer.BORDER_SW).addListener(SWT.MouseMove, mouseResizeListener);
      getBorder(IContainer.BORDER_SW).addListener(SWT.MouseExit, mouseResizeListener);
    }

    {
      final WindowMoveListener mouseMoveListener = new WindowMoveListener(shell, true);
      titleArea.addListener(SWT.MouseDown, mouseMoveListener);
      titleArea.addListener(SWT.MouseMove, mouseMoveListener);
      titleArea.addListener(SWT.MouseUp, mouseMoveListener);

      Composite windowTitle = (Composite) titleArea.getData("title");
View Full Code Here

  private static MixerMsgHook hook;

  public static boolean openControl(Shell shell)
  {
    boolean result = Mixer.mixerOpen(shell.handle, deviceId);
    hook = new MixerMsgHook(shell);
    hook.installHook();
    shell.addDisposeListener(new DisposeListener()
    {
      public void widgetDisposed(DisposeEvent e)
      {
View Full Code Here


    Object treeMenu ;
    if(XPWidgetTheme.isPlatform()) { 
      PopupMenu popupMenu = new PopupMenu(tree, XPWidgetTheme.THEME);
      treeMenu = new CMenu();
      popupMenu.setMenu((CMenu)treeMenu);
    } else {
      treeMenu = new Menu(getShell(), SWT.POP_UP);
      tree.setMenu((Menu)treeMenu);
    }

    factory.createStyleMenuItem( treeMenu, "itemAdd", "+.gif", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        try {
          traverseTree(TreeHandler.SELECT, addItems());
        } catch (Exception e) {
          ClientLog.getInstance().setMessage(tree.getShell(), e);
        }
      }  
    })

    factory.createStyleMenuItem(treeMenu, "itemRemove", "-.gif", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        try {
          traverseTree(TreeHandler.REMOVE, new String[]{});
          removeItem();
          traverseTree(TreeHandler.SELECT, lstPath.getItems());
        } catch (Exception e) {
          ClientLog.getInstance().setMessage(tree.getShell(), e);
        }
      }  
    });  

    factory.createStyleMenuItem(treeMenu, SWT.SEPARATOR);

    factory.createStyleMenuItem(treeMenu, "itemExpand", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        expand(true);
      }  
    });

    factory.createStyleMenuItem(treeMenu, "itemCollapse", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        expand(false);
      }  
    });

    factory.createStyleMenuItem(treeMenu, SWT.SEPARATOR);

    factory.createStyleMenuItem(treeMenu, "itemExpandDataNode", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        expandDataNode();
      }  
    });

    factory.createStyleMenuItem(treeMenu, "itemCollapseTree", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        TreeItem [] items = tree.getItems();
        if(items == null) return;
        for(TreeItem item : items) {
          expand(item, false);
        }
      }  
    });

    factory.createStyleMenuItem(treeMenu, SWT.SEPARATOR);

    factory.createStyleMenuItem( treeMenu, "itemView", "view.gif", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        viewItem();
      }  
    });  

    sash0.setWeights( new int[]{500, 300});    
    handler = new TreeHandler();       

    Composite bottom = new Composite(this, SWT.NONE);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    bottom.setLayoutData(gridData);
    factory.setComposite(bottom);

    gridLayout = new GridLayout(1, false);
    gridLayout.marginHeight = 2;
    gridLayout.horizontalSpacing = 5;
    gridLayout.verticalSpacing = 0;
    gridLayout.marginWidth = 2;
    bottom.setLayout(gridLayout);

    txtPath = new NodeEditor2(bottom, this);
    txtPath.setFont(UIDATA.FONT_10B);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.heightHint = 70;
    if(UIDATA.isMacOS) {
      //      gridData.heightHint = 30;
      txtPath.setFont(UIDATA.FONT_11B);
    }

    txtPath.setLayoutData(gridData);
    /*txtPath.addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent event) {
        if(event.keyCode == SWT.CR) {
          addEditItem();
          event.doit = false;
        }
      }
    });*/

    /*txtPath.text.setDoubleClickEnabled(false);
    txtPath.text.addMouseListener(new MouseAdapter() {

      public void mouseDown(MouseEvent e) {
        if(e.count == 3) {
          txtPath.setText("");         
          return;
        }

        if(e.button == 2) {
          if(txtPath.getText().trim().isEmpty()) return;
          addEditItem();
        }
      }


      @SuppressWarnings("unused")
      public void mouseDoubleClick(MouseEvent e) {
        new TemplateHandlerAction(new char[]{'[', ']'}).handle(txtPath.text);
      }
    });*/


    lstPath = factory.createList(bottom, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL);
    lstPath.setFont(UIDATA.FONT_10B);
    lstPath.addSelectionListener(new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent e){
        int selectedIndex = lstPath.getSelectionIndex();
        if(selectedIndex < 0) return;
        String path  = lstPath.getItem(selectedIndex);
        txtPath.setText(path);
        List<String> removes = null;
        try {
          removes = traverseTree(TreeHandler.SELECT, new String[]{path});
        } catch (Exception exp) {
          ClientLog.getInstance().setMessage(tree.getShell(), exp);
        }
        if(removes == null) return ;
        for(String ele : removes) lstPath.remove(ele);
        if(removes.size() > 0 && lstPath.getItemCount() > 0) lstPath.select(0);
      }
    });

    Object menu;

    if(XPWidgetTheme.isPlatform()) { 
      PopupMenu popupMenu = new PopupMenu(lstPath, XPWidgetTheme.THEME);
      menu = new CMenu();
      popupMenu.setMenu((CMenu)menu);
    } else {
      menu = new Menu(getShell(), SWT.POP_UP);
      lstPath.setMenu((Menu)menu);
    }
View Full Code Here

TOP

Related Classes of org.sf.feeling.swt.win32.extension.graphics.GraphicsUtil

Copyright © 2018 www.massapicom. 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.