Quantcast

Hotkeys for shortcuts problem

classic Classic list List threaded Threaded
35 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Hotkeys for shortcuts problem

Gryphon
Dear all,
I would like to use as a hotkey for shortcut to beanshell script not a single-letter call (i.e. A), but a ctrl+A, shift+A, or alt+A. How that can be done?

Thanks in advance,
Sergey
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Arthur D. Edelstein
Hi Sergey,

At the moment I believe this option doesn't exist.

Best regards,
Arthur


On Wed, Sep 26, 2012 at 10:39 AM, Gryphon <[hidden email]> wrote:

> Dear all,
> I would like to use as a hotkey for shortcut to beanshell script not a
> single-letter call (i.e. A), but a ctrl+A, shift+A, or alt+A. How that can
> be done?
>
> Thanks in advance,
> Sergey
>
>
>
> --
> View this message in context: http://micro-manager.3463995.n2.nabble.com/Hotkeys-for-shortcuts-problem-tp7578749.html
> Sent from the Micro-Manager mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> How fast is your code?
> 3 out of 4 devs don\\\'t know how their code performs in production.
> Find out how slow your code is with AppDynamics Lite.
> http://ad.doubleclick.net/clk;262219672;13503038;z?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general

------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

John Hayes
In reply to this post by Gryphon
Hi Sergey,  

Check out my terminal response to this thread: http://micro-manager.3463995.n2.nabble.com/Starting-Beanshell-scripts-from-an-ImageJ-macro-ActionBar-td7578188.html

In particular, I think you could use the BeanShellRunner_ from a macro and bind that to a shortcut through ImageJ’s normal route or use an ActionBar as I am doing.

Best regards,

John

On 26 sept. 2012, at 19:39, Gryphon wrote:

> Dear all,
> I would like to use as a hotkey for shortcut to beanshell script not a
> single-letter call (i.e. A), but a ctrl+A, shift+A, or alt+A. How that can
> be done?
>
> Thanks in advance,
> Sergey
>
>
>
> --
> View this message in context: http://micro-manager.3463995.n2.nabble.com/Hotkeys-for-shortcuts-problem-tp7578749.html
> Sent from the Micro-Manager mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> How fast is your code?
> 3 out of 4 devs don\\\'t know how their code performs in production.
> Find out how slow your code is with AppDynamics Lite.
> http://ad.doubleclick.net/clk;262219672;13503038;z?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

GrantHarris
In reply to this post by Gryphon
Sergey--
I'm working on a plugin that will provide this sort of functionality.  If you would like to try it out 'pre-release', send me your email and I can provide a copy to you.
-- Grant Harris   gharris at mbl.edu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Arthur D. Edelstein
In reply to this post by Gryphon
Hi Sergey and Grant,

I've added a request ticket here:

https://valelab.ucsf.edu/trac/micromanager/ticket/641

Arthur


On Wed, Sep 26, 2012 at 10:39 AM, Gryphon <[hidden email]> wrote:

> Dear all,
> I would like to use as a hotkey for shortcut to beanshell script not a
> single-letter call (i.e. A), but a ctrl+A, shift+A, or alt+A. How that can
> be done?
>
> Thanks in advance,
> Sergey
>
>
>
> --
> View this message in context: http://micro-manager.3463995.n2.nabble.com/Hotkeys-for-shortcuts-problem-tp7578749.html
> Sent from the Micro-Manager mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> How fast is your code?
> 3 out of 4 devs don\\\'t know how their code performs in production.
> Find out how slow your code is with AppDynamics Lite.
> http://ad.doubleclick.net/clk;262219672;13503038;z?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general

------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Gryphon
Grant, thank you form writing the fix.
Arthur, thanks for creating the ticket.

I am not sure that Grant's script can solve my problem completely, because it seems that use of hotkeys now is a mistake. What I wanted to do: I would like to control microscope motorized parts using Logitech f710 gamepad, since it is not comfortable to do it using groups or simple hotkeys. As a result I created 33 simple scripts of 1-5 strings (open/close shutter, change filter wheel position, move stage, etc.), assigned each of them a hotkey, and wrote a script in Autohotkey to translate gamepad Axes/POV translation and buttons press into keyboard hotkeys. In fact everything really works, but I feel really strange. Is there any less idiotic way to handle the task, smth like java code to listen to gamepad?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Arthur D. Edelstein
Hi Sergey,

It sounds like you might want to write a java plugin for Micro-Manager
instead. You would need to find a way for Java to talk to your gamepad
-- please let us know how you get on!

Best regards,
Arthur


On Tue, Oct 2, 2012 at 11:49 AM, Gryphon <[hidden email]> wrote:

> Grant, thank you form writing the fix.
> Arthur, thanks for creating the ticket.
>
> I am not sure that Grant's script can solve my problem completely, because
> it seems that use of hotkeys now is a mistake. What I wanted to do: I would
> like to control microscope motorized parts using Logitech f710 gamepad,
> since it is not comfortable to do it using groups or simple hotkeys. As a
> result I created 33 simple scripts of 1-5 strings (open/close shutter,
> change filter wheel position, move stage, etc.), assigned each of them a
> hotkey, and wrote a script in Autohotkey to translate gamepad Axes/POV
> translation and buttons press into keyboard hotkeys. In fact everything
> really works, but I feel really strange. Is there any less idiotic way to
> handle the task, smth like java code to listen to gamepad?
>
>
>
> --
> View this message in context: http://micro-manager.3463995.n2.nabble.com/Hotkeys-for-shortcuts-problem-tp7578749p7578771.html
> Sent from the Micro-Manager mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Nico Stuurman
Administrator
>> What I wanted to do: I would like to control microscope motorized parts using Logitech f710 gamepad,


> It sounds like you might want to write a java plugin for Micro-Manager instead. You would need to find a way for Java to talk to your gamepad

Looks like lwjgl (http://lwjgl.org/) can do the trick.

Best,

Nico



------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Edwardf
In reply to this post by Arthur D. Edelstein
Hi Sergey

I had to write a plugin not so long ago that would control micromanger aquisition using a usb foot pad I came across a very useful java library that allows the shortcut to overide the jave window focussing problem it can be found here

http://code.google.com/p/jintellitype/

Hope this helps.

Best regards
Edward

On 03/10/2012 01:16, Arthur D. Edelstein wrote:
Hi Sergey,

It sounds like you might want to write a java plugin for Micro-Manager
instead. You would need to find a way for Java to talk to your gamepad
-- please let us know how you get on!

Best regards,
Arthur


On Tue, Oct 2, 2012 at 11:49 AM, Gryphon [hidden email] wrote:
Grant, thank you form writing the fix.
Arthur, thanks for creating the ticket.

I am not sure that Grant's script can solve my problem completely, because
it seems that use of hotkeys now is a mistake. What I wanted to do: I would
like to control microscope motorized parts using Logitech f710 gamepad,
since it is not comfortable to do it using groups or simple hotkeys. As a
result I created 33 simple scripts of 1-5 strings (open/close shutter,
change filter wheel position, move stage, etc.), assigned each of them a
hotkey, and wrote a script in Autohotkey to translate gamepad Axes/POV
translation and buttons press into keyboard hotkeys. In fact everything
really works, but I feel really strange. Is there any less idiotic way to
handle the task, smth like java code to listen to gamepad?



--
View this message in context: http://micro-manager.3463995.n2.nabble.com/Hotkeys-for-shortcuts-problem-tp7578749p7578771.html
Sent from the Micro-Manager mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


--

Edward Finucane

Software Specialist
Cairn Research Ltd
Graveney Road
Faversham
Kent, ME13 8UP
UK

www.cairn-research.co.uk
[hidden email]

Tel: + 44 (0)1795 594515
Fax: + 44 (0)1795 594510




------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Gryphon
Thanks, Edward, I never heard about the library. I'll try it.

Nico, thanks for lwjgl link. Yes, writing a plugin would be a good think in my case. Could you please advice me a book or smth that shows how to use the library Controller class? I am newbie to Java, so I don't understand the very basics from time to time.

Best regards,
Sergey
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

GrantHarris
Another option for supporting the gamepad is this library JInput.  Here are a couple of articles about it: Joystick in Java with JInput and Chapter 11. Building a Game Pad Controller with JInput.
I have used this in the past to support a joystick in one of my applications.
-- Grant
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Gryphon
Thanks, Grant. The JInput with Controller class already implemented is the exact thing I was looking for.

I tried to implement the JoystickTest program with no modification as a MicroManager plugin as decribed in "Writing plugins for Micro-Manager" guide. But I got such problems:
1. while run using conventional MM run, my plugin is not listed in Plugin tab.
2. while run using "Debug" option from NetBeans, there is the plugin in the list, but it cannot be run.
Here are the log a the project:
Project:
https://rapidshare.com/files/988139992/joy_ij_plugin.zip
Error log from NetBeans
Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: Not supported yet.
        at joystick.JoystickTest.setApp(JoystickTest.java:303)
        at org.micromanager.MMStudioMainFrame$PluginItem.instantiate(MMStudioMainFrame.java:751)
        at org.micromanager.MMStudioMainFrame$47.actionPerformed(MMStudioMainFrame.java:3033)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
        at java.awt.Component.processMouseEvent(Component.java:6505)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
        at java.awt.Component.processEvent(Component.java:6270)
        at java.awt.Container.processEvent(Container.java:2229)
        at java.awt.Component.dispatchEventImpl(Component.java:4861)
        at java.awt.Container.dispatchEventImpl(Container.java:2287)
        at java.awt.Component.dispatchEvent(Component.java:4687)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
        at java.awt.Container.dispatchEventImpl(Container.java:2273)
        at java.awt.Window.dispatchEventImpl(Window.java:2719)
        at java.awt.Component.dispatchEvent(Component.java:4687)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
        at java.awt.EventQueue.access$200(EventQueue.java:103)
        at java.awt.EventQueue$3.run(EventQueue.java:682)
        at java.awt.EventQueue$3.run(EventQueue.java:680)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
        at java.awt.EventQueue$4.run(EventQueue.java:696)
        at java.awt.EventQueue$4.run(EventQueue.java:694)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
LOG(2012-10-18T21:27:46.359375, 2424, 0011ADE8:): > Plugin command: JoystickTest

Can you please consult me what I am doing wrong? As I am new to Java and NetBeans it could have been something obvious.

Yours sincerely,
Sergey
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Arthur D. Edelstein
Hi Sergey,

It looks like you are on the right track. The error indicates that you
have not yet implemented the setApp method of your plugin. This method
receives a reference to the ScriptInterface instance (same as the gui
object in the Beanshell scripting pane).

Best regards,
Arthur


On Thu, Oct 18, 2012 at 10:43 AM, Gryphon <[hidden email]> wrote:

> Thanks, Grant. The JInput with Controller class already implemented is the
> exact thing I was looking for.
>
> I tried to implement the JoystickTest program with no modification as a
> MicroManager plugin as decribed in "Writing plugins for Micro-Manager"
> guide. But I got such problems:
> 1. while run using conventional MM run, my plugin is not listed in Plugin
> tab.
> 2. while run using "Debug" option from NetBeans, there is the plugin in the
> list, but it cannot be run.
> Here are the log a the project:
> Project:
> https://rapidshare.com/files/988139992/joy_ij_plugin.zip
> Error log from NetBeans
> Exception in thread "AWT-EventQueue-0"
> java.lang.UnsupportedOperationException: Not supported yet.
>         at joystick.JoystickTest.setApp(JoystickTest.java:303)
>         at
> org.micromanager.MMStudioMainFrame$PluginItem.instantiate(MMStudioMainFrame.java:751)
>         at
> org.micromanager.MMStudioMainFrame$47.actionPerformed(MMStudioMainFrame.java:3033)
>         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
>         at
> javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
>         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
>         at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
>         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
>         at
> javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
>         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
>         at java.awt.Component.processMouseEvent(Component.java:6505)
>         at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
>         at java.awt.Component.processEvent(Component.java:6270)
>         at java.awt.Container.processEvent(Container.java:2229)
>         at java.awt.Component.dispatchEventImpl(Component.java:4861)
>         at java.awt.Container.dispatchEventImpl(Container.java:2287)
>         at java.awt.Component.dispatchEvent(Component.java:4687)
>         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
>         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
>         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
>         at java.awt.Container.dispatchEventImpl(Container.java:2273)
>         at java.awt.Window.dispatchEventImpl(Window.java:2719)
>         at java.awt.Component.dispatchEvent(Component.java:4687)
>         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
>         at java.awt.EventQueue.access$200(EventQueue.java:103)
>         at java.awt.EventQueue$3.run(EventQueue.java:682)
>         at java.awt.EventQueue$3.run(EventQueue.java:680)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
>         at
> java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
>         at java.awt.EventQueue$4.run(EventQueue.java:696)
>         at java.awt.EventQueue$4.run(EventQueue.java:694)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
>         at
> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
>         at
> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
>         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
>         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
>         at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
> LOG(2012-10-18T21:27:46.359375, 2424, 0011ADE8:): > Plugin command:
> JoystickTest
>
> Can you please consult me what I am doing wrong? As I am new to Java and
> NetBeans it could have been something obvious.
>
> Yours sincerely,
> Sergey
>
>
>
> --
> View this message in context: http://micro-manager.3463995.n2.nabble.com/Hotkeys-for-shortcuts-problem-tp7578749p7578825.html
> Sent from the Micro-Manager mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Gryphon
Thanks, Arthur.

I added these lines (+necessary import)

public void setApp(ScriptInterface si) {
        app_ = si;
        //throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void show() {
        JFrameWindow window = new JFrameWindow();
        stickOrGamepadTypeJoystick_Test_Better(window);

and re-compiled with correct JDK, 6 instead of 7. Now plugin is fully functional.
joy_ij_plugin2.zip

Another problem is that now I cannot close the plugin window. And when plugin is running I cannot use any other MicroManager options. What's the best way to fix it?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Arthur D. Edelstein
Hi Sergey,

> Another problem is that now I cannot close the plugin window. And when
> plugin is running I cannot use any other MicroManager options. What's the
> best way to fix it?

It sounds like it could be an EDT issue (graphical rendering and
callbacks should run on the EDT, other things on background threads).
See
http://docs.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html

Best regards,
Arthur

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

GrantHarris
In reply to this post by Gryphon
I agree with Arthur that you a running into an EDT issue.  You have a loop that is polling the joystick controller and then making calls from that thread that update the GUI ... Not good!  You might use the SwingUtilities.invokeLater(Runnable) trick like this:

  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      // safely update whatever in the GUI...
    }
  });
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Gryphon
Dear all,

I acquired some knowledge in java, now my plugin is thread-safe and seems fuctional. The problem i get now is that I cannot acquire MMcore instance, so, while I use smth like core_.getFocusDevice(); I get NullPointerException.
 Could you please tell me, how to link MM core to my plugin?
https://rapidshare.com/files/187647404/Joystick2.zip (sorry, the file is a bit too large to upload to the site directly)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Arthur D. Edelstein
Hi Gryphon,

You should have a reference to the Micro-Manager application instance
through the plugin's setApp method. So you can then call
app.getMMCore(); .

Best regards
Arthur


On Thu, Nov 1, 2012 at 10:04 AM, Gryphon <[hidden email]> wrote:

> Dear all,
>
> I acquired some knowledge in java, now my plugin is thread-safe and seems
> fuctional. The problem i get now is that I cannot acquire MMcore instance,
> so, while I use smth like core_.getFocusDevice(); I get
> NullPointerException.
>  Could you please tell me, how to link MM core to my plugin?
> https://rapidshare.com/files/187647404/Joystick2.zip (sorry, the file is a
> bit too large to upload to the site directly)
>
>
>
> --
> View this message in context: http://micro-manager.3463995.n2.nabble.com/Hotkeys-for-shortcuts-problem-tp7578749p7578875.html
> Sent from the Micro-Manager mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Gryphon
I do have:

    @Override
    public void setApp(ScriptInterface app) {
           //app_ = si;
      app_ = (MMStudioMainFrame) app;
      core_ = app.getMMCore();
    }

And, in the class

public class JoystickTest extends JPanel
                             implements MMPlugin {
    public static String menuName = "PlayMicro";
    private ScriptInterface app;
    private MMStudioMainFrame app_;
    private CMMCore core_;

But when I call in the code

                if (core_ == null) {
                    flipTask.cancel(true);
                    System.out.println("Core was not connected!");
                   
                } else {
                System.out.println(""+core_);
                }

I get "Core was not connected!" in NetBeans Debug. Could you please tell me, what can be wrong?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hotkeys for shortcuts problem

Arthur D. Edelstein
Hi Sergey,

> I do have:
>
>     @Override
>     public void setApp(ScriptInterface app) {
>            //app_ = si;
>       app_ = (MMStudioMainFrame) app;
>       core_ = app.getMMCore();
>     }
>
> And, in the class
>
> public class JoystickTest extends JPanel
>                              implements MMPlugin {
>     public static String menuName = "PlayMicro";
>     private ScriptInterface app;
>     private MMStudioMainFrame app_;
>     private CMMCore core_;

Is this a different class from the setApp method? If so, you may need
to assign core_ and app_ for this new class as well.

Best regards,
Arthur

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
12
Loading...