Hi
> agreed on the "weird" functionality. but i guess that's rooted in OJ's 
> inability to set categories invisible as such. while imperfect i still think 
> users grasp it's functionality and will find use for it, or put differently - 
> better to have it than not.
>
> disagreed on your big rework. granted i oversaw another NPE in the check 
> hook, but still the code works as probably intended, so would touch it only 
> for speed or fixing. it e.g. introduces a new NPE in PluginContext when 
> reordering categories.
Sorry, I've looked for a solution which is more readable (made it java-5 
friendly) and working without throwing exception, but I may also have 
introduced new bugs.
The main point : it seems to me that the initialize method was never 
called and that it was the
root cause of the exceptions...
I checked where initialization method usually happened (in 
JumpConfiguration) and followed the way...
I may have missed a better solution.

> wrt. check hook,
> on context menu activation it set's the checkbox value to the saved state of 
> the rightclicked category. this was formerly done via a a selectionlistener, 
> which is waste as it only need to be done on activation.
>
> wrt. no layer selected condition you added
> that disables the plugin if also layers are disabled.
I don't understand : the plugin availability does not depend on layers 
ability but on layer selection (or what do you mean by disabled) .
Anyhow, current situation is not satisfying, because if you have some 
layers selected, a right click on a category unselect the layers.
On the other hand, if you have layers + category selected, right click 
on category does not unselect layers.
>   but i already opened the category context menu, so clearly i want to switch 
> /category/ visibility. i feel it obstructs usability.
>
> wrt. initialization and standard
> that is cosmetic. unfortunately the plugin is written to need a reference to 
> it's menu item. easiest way to get it is the way i wrote it. no need for 
> loops to find it later (waste of cpu cycles). this needs the feature install 
> call to be within the plugin, like in so many others, e.g. 
> OpenJUMPConfiguration's plugins.
> in the future i want to reworks this whole mess to be defined within the xml 
> files, with neat atributes that can define icons, enablechecks, positions 
> within the menu and all. but until then, let's simply see that it works.
>
> any strong objection to restore 3558 and let me fix the NPE in the check hook?
No objection, go ahead,
If you could keep "cosmetic" changes (java-5 upgrade, replacement of 
deprecate methods, standardization of method naming), I would appreciate

Michaël
>
> ..ede
>
>
> On 22.05.2013 00:09, Michaël Michaud wrote:
>> Hi,
>>
>> r3558 includes a new fix to bug 3613603 (3613660).
>> Ede, I tried to make the initialization phase more standard.
>> I removed the "hook" in the createEnableCheck, but maybe
>> I misunderstood what it was for.
>>
>> I tried to keep the original way this plugins work, but it is quite
>> difficult to understand.
>> One must consider that turning category visibility off does not change
>> layer visibility, but
>> hide it until the category visibility is turned on again.
>>
>> Michaël
>>
>>
>>> Bugs item #3613660, was opened at 2013-05-21 06:28
>>> Message generated for change (Comment added) made by edso
>>> You can respond by visiting:
>>> https://sourceforge.net/tracker/?func=detail&atid=679906&aid=3613660&group_id=118054
>>>
>>> Please note that this message will contain a full copy of the comment 
>>> thread,
>>> including the initial issue submission, for this request,
>>> not just the latest update.
>>> Category: General / Other
>>> Group: Linux / Unix
>>>> Status: Closed
>>>> Resolution: Duplicate
>>> Priority: 7
>>> Private: No
>>> Submitted By: G. Aruta (ma15569)
>>> Assigned to: Nobody/Anonymous (nobody)
>>> Summary: NPE on right-click a category
>>>
>>> Initial Comment:
>>> Create a new layer
>>> Click on category to access to context menu (right-click)
>>> A NPE appears:
>>> java.lang.NullPointerException
>>>     at 
>>> org.openjump.core.ui.plugin.mousemenu.category.SetCategoryVisibilityPlugIn.layerSelectionChanged(SetCategoryVisibilityPlugIn.java:254)
>>>     at 
>>> org.openjump.core.ui.plugin.mousemenu.category.SetCategoryVisibilityPlugIn$1.check(SetCategoryVisibilityPlugIn.java:128)
>>>     at 
>>> com.vividsolutions.jump.workbench.plugin.MultiEnableCheck.check(MultiEnableCheck.java:60)
>>>     at 
>>> org.openjump.core.ui.swing.listener.EnableCheckMenuItemShownListener.menuItemShown(EnableCheckMenuItemShownListener.java:60)
>>>     at 
>>> com.vividsolutions.jump.workbench.ui.plugin.FeatureInstaller$2.popupMenuWillBecomeVisible(FeatureInstaller.java:903)
>>>     at 
>>> javax.swing.JPopupMenu.firePopupMenuWillBecomeVisible(JPopupMenu.java:640)
>>>     at javax.swing.JPopupMenu.setVisible(JPopupMenu.java:747)
>>>     at javax.swing.JPopupMenu.show(JPopupMenu.java:921)
>>>     at 
>>> com.vividsolutions.jump.workbench.ui.TreeLayerNamePanel.tree_mouseReleased(TreeLayerNamePanel.java:524)
>>>     at 
>>> com.vividsolutions.jump.workbench.ui.TreeLayerNamePanel$9.mousePressed(TreeLayerNamePanel.java:472)
>>>     at 
>>> java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:280)
>>>     at 
>>> java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:279)
>>>     at 
>>> java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:279)
>>>     at 
>>> java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:279)
>>>     at java.awt.Component.processMouseEvent(Component.java:6285)
>>>     at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
>>>     at java.awt.Component.processEvent(Component.java:6053)
>>>     at java.awt.Container.processEvent(Container.java:2045)
>>>     at java.awt.Component.dispatchEventImpl(Component.java:4649)
>>>     at java.awt.Container.dispatchEventImpl(Container.java:2103)
>>>     at java.awt.Component.dispatchEvent(Component.java:4475)
>>>     at 
>>> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4633)
>>>     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4294)
>>>     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4227)
>>>     at java.awt.Container.dispatchEventImpl(Container.java:2089)
>>>     at java.awt.Window.dispatchEventImpl(Window.java:2587)
>>>     at java.awt.Component.dispatchEvent(Component.java:4475)
>>>     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:675)
>>>     at java.awt.EventQueue.access$300(EventQueue.java:96)
>>>     at java.awt.EventQueue$2.run(EventQueue.java:634)
>>>     at java.awt.EventQueue$2.run(EventQueue.java:632)
>>>     at java.security.AccessController.doPrivileged(Native Method)
>>>     at 
>>> java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
>>>     at 
>>> java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:116)
>>>     at java.awt.EventQueue$3.run(EventQueue.java:648)
>>>     at java.awt.EventQueue$3.run(EventQueue.java:646)
>>>     at java.security.AccessController.doPrivileged(Native Method)
>>>     at 
>>> java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
>>>     at java.awt.EventQueue.dispatchEvent(EventQueue.java:645)
>>>     at 
>>> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
>>>     at 
>>> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
>>>     at 
>>> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
>>>     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
>>>     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
>>>     at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
>>>
>>>
>>> ----------------------------------------------------------------------
>>>
>>>> Comment By: ede (edso)
>>> Date: 2013-05-21 06:36
>>>
>>> Message:
>>> duplicate of
>>> https://sourceforge.net/tracker/?func=detail&atid=679906&aid=3613603&group_id=118054
>>>
>>> please use search function before posting ;).. ede
>>>
>>> ----------------------------------------------------------------------
>>>
>>> You can respond by visiting:
>>> https://sourceforge.net/tracker/?func=detail&atid=679906&aid=3613660&group_id=118054
>>>
>>> ------------------------------------------------------------------------------
>>> Try New Relic Now & We'll Send You this Cool Shirt
>>> New Relic is the only SaaS-based application performance monitoring service
>>> that delivers powerful full stack analytics. Optimize and monitor your
>>> browser, app, & servers with just a few lines of code. Try New Relic
>>> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
>>> _______________________________________________
>>> Jump-pilot-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> Try New Relic Now & We'll Send You this Cool Shirt
>> New Relic is the only SaaS-based application performance monitoring service
>> that delivers powerful full stack analytics. Optimize and monitor your
>> browser, app, & servers with just a few lines of code. Try New Relic
>> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
>> _______________________________________________
>> Jump-pilot-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> Jump-pilot-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to