[FLAMINGO-8] ClassCastException when pressing space on JCommandButton Created: 24/Jul/08  Updated: 31/Jul/08  Resolved: 31/Jul/08

Status: Closed
Project: flamingo
Component/s: common components
Affects Version/s: 3.1
Fix Version/s: milestone 1

Type: Bug Priority: Blocker
Reporter: flynnk Assignee: kirillcool
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 8

 Description   

Anytime the spacebar is pressed on any JCommandButton, the exception below is
thrown. Looks like the key bindings where not updated when JCommandButton no
longer descended from AbstractButton (this did not happen until after that change).

Set as P1 since it means that pressing the space bar in the app effectively
crashes it.

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:
org.jvnet.flamingo.common.JCommandButton cannot be cast to
javax.swing.AbstractButton
at
javax.swing.plaf.basic.BasicButtonListener$Actions.actionPerformed(BasicButtonListener.java:275)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1636)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2849)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2884)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2812)
at java.awt.Component.processEvent(Component.java:5818)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at
java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848)
at
java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:697)
at
java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:962)
at
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:834)
at
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:661)
at java.awt.Component.dispatchEventImpl(Component.java:4285)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)



 Comments   
Comment by kirillcool [ 24/Jul/08 ]

This should be fixed in the latest 3.1dev drop. The new
utest.common.CommandButtonTestCase is the first version of unit testing the UI
interaction aspects of command button component.

Thanks
Kirill

Comment by flynnk [ 31/Jul/08 ]

Working now. Marking as closed.





[FLAMINGO-11] JCommandToggleButton groups not working for single selection Created: 02/Aug/08  Updated: 02/Aug/08  Resolved: 02/Aug/08

Status: Closed
Project: flamingo
Component/s: common components
Affects Version/s: 3.1
Fix Version/s: milestone 1

Type: Bug Priority: Major
Reporter: flynnk Assignee: kirillcool
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 11

 Description   

The easiest way to reproduce this bug is to run the Flamingo Ribbon
demonstration application and select the various items in the quick styles task
band; more than one can be selected. This behavior is inconsistent with the
documentation and what one would expect from toggle buttons.

The CommandButtonGroup class does not call setGroup() on the action model from
the JCommandToggleButton, so the underlying model never makes the callback to
the group to cause the group to then deselect the other buttons and enforce the
single selection.

From my examination of the code, it looks like to get this functionality and
continue to use the JToggleButton.ToggleButtonModel as the underlying model for
the JCommandToggleButton, CommandButtonGroup would have to extend ButtonGroup,
but button group requires the buttons to extend AbstractButton. I think you are
going to have to reimplement the ToggleButtonModel as well since you no longer
want the CommandButtons to extend AbstractButton.

Workaround:

There is a good workaround to this issue, which lowers the priority a bit. In
the action listener for the toggle button, you can call the underlying button
group directly to set the selected button. For example, in a JRibbonBand, you
can call:

ribbonBand.setSelectedRibbonGalleryButton("GALLERY_NAME", button);

Might be a good idea to add this workaround to the example applications until
the primary issue is fixed (I checked there to see if this was called to see if
I was screwing up; others might as well...)



 Comments   
Comment by kirillcool [ 02/Aug/08 ]

Should be fixed in the latest 3.1dev drop.

Thanks
Kirill

Comment by flynnk [ 02/Aug/08 ]

Confirm fix in latest dev drop.





[FLAMINGO-12] Tooltips in popup gallery appear behing popup Created: 02/Aug/08  Updated: 02/Aug/08  Resolved: 02/Aug/08

Status: Closed
Project: flamingo
Component/s: ribbon
Affects Version/s: 3.1
Fix Version/s: milestone 1

Type: Bug Priority: Minor
Reporter: flynnk Assignee: kirillcool
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: JPEG File tooltipbug.jpg    
Issuezilla Id: 12

 Description   

In a ribbon, with a popup gallery displayed, tooltips for the
JCommandToggleButtons appear behind the popup in the part of the popup that
extends below the ribbon. In the part of the popup on top of the ribbon, the
tooltips appear in the right place.

This is much easier explained in the screenshot I'm about to attach.



 Comments   
Comment by flynnk [ 02/Aug/08 ]

Created an attachment (id=3)
Image of screen with tooltip bug

Comment by kirillcool [ 02/Aug/08 ]

At the present moment, the solution would be to force heavyweight tooltips with
ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false). I do have
long term plans to add "super tooltips" [1] to command buttons. Marking as
WONTFIX since the setToolTipText on AbstractCommandButton will eventually be
deprecated and forwarded to using rich tooltips.

Thanks
Kirill

[1] http://blogs.msdn.com/jensenh/archive/2005/12/02/499371.aspx

Comment by flynnk [ 02/Aug/08 ]

I've reworked my GUI to use a JCommandButton with a drop down menu; the zone
names (what would appear on the tooltip) are mainly text anyway so I suspect
this will be clearer to my users. So I'll live.

Super tooltips would be really cool; I'm all for that. I read the linked
article and took a look at the implementation in Word, and I think that's a much
better approach to online help than others I've seen. Just my $0.02.

Do you have a timetable for implementing super tooltips (3.1 or 3.2?)? This is
probably a better question for your blog than the issue tracker...





[FLAMINGO-10] StringIndexOutOfBoundsException with empty JRibbonBand Created: 31/Jul/08  Updated: 03/Aug/08  Resolved: 03/Aug/08

Status: Closed
Project: flamingo
Component/s: ribbon
Affects Version/s: 3.1
Fix Version/s: milestone 1

Type: Bug Priority: Trivial
Reporter: flynnk Assignee: kirillcool
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 10

 Description   

The following exception occurs when using an empty JRibbonBand. While empty
JRibbonBands aren't particularly useful (hence P5), this is likely to occur
during development (using them as placeholders for work to come shortly).

Exception in thread "AWT-EventQueue-0"
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1938)
at
org.jvnet.flamingo.ribbon.ui.BasicRibbonBandUI.paintBandTitle(BasicRibbonBandUI.java:644)
at
org.jvnet.flamingo.ribbon.ui.BasicRibbonBandUI.paint(BasicRibbonBandUI.java:613)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:143)
at
org.jvnet.flamingo.ribbon.ui.BasicRibbonBandUI.update(BasicRibbonBandUI.java:583)
at javax.swing.JComponent.paintComponent(JComponent.java:763)
at javax.swing.JComponent.paint(JComponent.java:1027)
at javax.swing.JComponent.paintChildren(JComponent.java:864)
at javax.swing.JComponent.paint(JComponent.java:1036)
at javax.swing.JComponent.paintChildren(JComponent.java:864)
at javax.swing.JComponent.paint(JComponent.java:1036)
at javax.swing.JComponent.paintChildren(JComponent.java:864)
at javax.swing.JComponent.paint(JComponent.java:1036)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:564)
at javax.swing.JComponent.paintChildren(JComponent.java:864)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5129)
at
javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)
at javax.swing.RepaintManager.paint(RepaintManager.java:1128)
at javax.swing.JComponent.paint(JComponent.java:1013)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
at java.awt.Container.paint(Container.java:1797)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:734)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:679)
at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:659)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)



 Comments   
Comment by kirillcool [ 31/Jul/08 ]

Should be fixed in the latest 3.1dev drop.

Thanks
Kirill

Comment by flynnk [ 02/Aug/08 ]

The exception no longer occurs under the default (Metal) L&F, but still occurs
when using Substance-Flamingo. (I could file a bug in that project, but
probably easier to just note it here--let me know if you prefer different.)

Furthermore, the ribbon band now shows up as two pixels wide. It might be nicer
for it to show up as having the width of the specified title and be empty.
Principle of least surprise, pretty much.

Comment by kirillcool [ 02/Aug/08 ]

Reopening to fix for Substance-Flamingo and provide enough width to show the title.

Comment by kirillcool [ 03/Aug/08 ]

Should be addressed in the latest 3.1dev drop of the core Flamingo library -
respecting the title string of an empty ribbon band. This also fixes the
exception under Substance.

Thanks
Kirill

Comment by flynnk [ 03/Aug/08 ]

Do I need to update to the latest Substance-Flamingo dev drop?

Comment by flynnk [ 03/Aug/08 ]

Never mind the previous comment.

Closing, as I confirm it is fixed. I appreciate this one--I know it's not a big
deal, but this exception drove me crazy for about 20 minutes as I tried to
figure out exactly what I was doing wrong...





Generated at Mon Aug 03 09:12:12 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.