flamingo
  1. flamingo
  2. FLAMINGO-27

Must have at least ONE taskbar component

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: milestone 1
    • Component/s: ribbon
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: PC

    • Issuezilla Id:
      27

      Description

      In integrating the ribbon into my own application, I discovered that there must
      always be at least taskbar component, otherwise the internal taskbar panel will
      be zero width resulting in a IllegalArgumentException in LinearGradientPaint.

      Example code:

      private static class RibbonTest extends JRibbonFrame
      {
      public RibbonTest(String title) throws HeadlessException

      { super(title); JRibbonBand band = new JRibbonBand("TestBand", new EmptyResizableIcon(16)); band.addCommandButton(new JCommandButton("Test Command", new EmptyResizableIcon(16)), RibbonElementPriority.TOP); band.setTitle("Band Title"); RibbonTask rt = new RibbonTask("TestTask", band); getRibbon().addTask(rt); // Required. Comment next line to see IllegalArgumentException getRibbon().addTaskbarComponent(new JButton("Test Taskbar")); }

      Stack trace:
      Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Start
      point cannot equalendpoint
      at java.awt.LinearGradientPaint.<init>(LinearGradientPaint.java:271)
      at java.awt.LinearGradientPaint.<init>(LinearGradientPaint.java:221)
      at java.awt.LinearGradientPaint.<init>(LinearGradientPaint.java:157)
      at
      org.jvnet.substance.painter.gradient.StandardGradientPainter.paintContourBackground(StandardGradientPainter.java:99)
      at
      org.jvnet.substance.flamingo.ribbon.ui.SubstanceRibbonFrameTitlePane.paintTaskBarPanelOutline(SubstanceRibbonFrameTitlePane.java:567)
      at
      org.jvnet.substance.flamingo.ribbon.ui.SubstanceRibbonFrameTitlePane.paintComponent(SubstanceRibbonFrameTitlePane.java:524)
      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.JLayeredPane.paint(JLayeredPane.java:564)
      at javax.swing.JComponent.paintChildren(JComponent.java:864)
      at javax.swing.JComponent.paint(JComponent.java:1036)
      at javax.swing.JComponent.paintToOffscreen(JComponent.java:5122)
      at
      javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:277)
      at javax.swing.RepaintManager.paint(RepaintManager.java:1217)
      at javax.swing.JComponent._paintImmediately(JComponent.java:5070)
      at javax.swing.JComponent.paintImmediately(JComponent.java:4880)
      at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:803)
      at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
      at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:694)
      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:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at
      java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

        Activity

        Hide
        cicavey added a comment -

        I did not post the complete example, Here is the entire code example:

        package epi.resourcestream;

        import java.awt.HeadlessException;

        import javax.swing.JButton;
        import javax.swing.JFrame;
        import javax.swing.SwingUtilities;
        import javax.swing.UIManager;

        import org.jvnet.flamingo.common.JCommandButton;
        import org.jvnet.flamingo.common.icon.EmptyResizableIcon;
        import org.jvnet.flamingo.ribbon.JRibbonBand;
        import org.jvnet.flamingo.ribbon.JRibbonFrame;
        import org.jvnet.flamingo.ribbon.RibbonElementPriority;
        import org.jvnet.flamingo.ribbon.RibbonTask;
        import org.jvnet.substance.skin.SubstanceBusinessBlackSteelLookAndFeel;

        public class Init
        {
        private static class RibbonTest extends JRibbonFrame
        {

        public RibbonTest(String title) throws HeadlessException

        { super(title); JRibbonBand band = new JRibbonBand("TestBand", new EmptyResizableIcon(16)); band.addCommandButton(new JCommandButton("Test Command", new EmptyResizableIcon(16)), RibbonElementPriority.TOP); band.setTitle("Band Title"); RibbonTask rt = new RibbonTask("TestTask", band); getRibbon().addTask(rt); // Required ! getRibbon().addTaskbarComponent(new JButton("Test Taskbarcomponent")); }

        }

        public static void main(String[] args)
        {
        JFrame.setDefaultLookAndFeelDecorated(true);
        try

        { UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel()); }

        catch(Exception e)

        { System.out.println("Substance Raven Graphite failed to initialize"); }

        SwingUtilities.invokeLater(new Runnable()
        {
        public void run()

        { JFrame frame = new RibbonTest("Test"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(500, 500); frame.setLocation(0, 0); frame.setVisible(true); }

        });
        }
        }

        Show
        cicavey added a comment - I did not post the complete example, Here is the entire code example: package epi.resourcestream; import java.awt.HeadlessException; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.SwingUtilities; import javax.swing.UIManager; import org.jvnet.flamingo.common.JCommandButton; import org.jvnet.flamingo.common.icon.EmptyResizableIcon; import org.jvnet.flamingo.ribbon.JRibbonBand; import org.jvnet.flamingo.ribbon.JRibbonFrame; import org.jvnet.flamingo.ribbon.RibbonElementPriority; import org.jvnet.flamingo.ribbon.RibbonTask; import org.jvnet.substance.skin.SubstanceBusinessBlackSteelLookAndFeel; public class Init { private static class RibbonTest extends JRibbonFrame { public RibbonTest(String title) throws HeadlessException { super(title); JRibbonBand band = new JRibbonBand("TestBand", new EmptyResizableIcon(16)); band.addCommandButton(new JCommandButton("Test Command", new EmptyResizableIcon(16)), RibbonElementPriority.TOP); band.setTitle("Band Title"); RibbonTask rt = new RibbonTask("TestTask", band); getRibbon().addTask(rt); // Required ! getRibbon().addTaskbarComponent(new JButton("Test Taskbarcomponent")); } } public static void main(String[] args) { JFrame.setDefaultLookAndFeelDecorated(true); try { UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel()); } catch(Exception e) { System.out.println("Substance Raven Graphite failed to initialize"); } SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new RibbonTest("Test"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(500, 500); frame.setLocation(0, 0); frame.setVisible(true); } }); } }
        Hide
        kirillcool added a comment -

        Needs to be fixed in both the core Flamingo (paints incorrect outlines) and
        Substance Flamingo plugin (exception).

        Thanks
        Kirill

        Show
        kirillcool added a comment - Needs to be fixed in both the core Flamingo (paints incorrect outlines) and Substance Flamingo plugin (exception). Thanks Kirill
        Hide
        kirillcool added a comment -

        This should be fixed in the latest 4.0dev of core Flamingo and 5.1dev of
        Substance Flamingo plugin.

        Thanks
        Kirill

        Show
        kirillcool added a comment - This should be fixed in the latest 4.0dev of core Flamingo and 5.1dev of Substance Flamingo plugin. Thanks Kirill

          People

          • Assignee:
            kirillcool
            Reporter:
            cicavey
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: