Exemplo n.º 1
0
 public void actionPerformed(ActionEvent param1ActionEvent)
 {
     SwingUtilities.invokeLater(() =>
     {
         CostOSRibbonUI.null.this.this$0.scrollAndRevealTaskToggleButton(taskToggleButton);
         CostOSRibbonUI.null.this.this$0.ribbon.SelectedTask = task;
         if (CostOSRibbonUI.null.this.this$0.ribbon.Minimized)
         {
             if (true.Equals(CostOSRibbonUI.null.this.this$0.ribbon.getClientProperty("ribbon.internal.justMinimized")))
             {
                 CostOSRibbonUI.null.this.this$0.ribbon.putClientProperty("ribbon.internal.justMinimized", null);
                 return;
             }
             System.Collections.IList list = PopupPanelManager.defaultManager().ShownPath;
             if (list.size() > 0)
             {
                 foreach (PopupPanelManager.PopupInfo popupInfo in list)
                 {
                     if (popupInfo.PopupOriginator == taskToggleButton)
                     {
                         PopupPanelManager.defaultManager().hidePopups(null);
                         return;
                     }
                 }
             }
             PopupPanelManager.defaultManager().hidePopups(null);
             CostOSRibbonUI.null.this.this$0.ribbon.remove(CostOSRibbonUI.null.this.this$0.bandScrollablePanel);
             int i         = (((BasicRibbonUI.BandHostPanel) this.this$1.this$0.bandScrollablePanel.View).PreferredSize).height;
             Insets insets = CostOSRibbonUI.null.this.this$0.ribbon.Insets;
             i            += insets.top + insets.bottom;
             AbstractRibbonBand abstractRibbonBand = (CostOSRibbonUI.null.this.this$0.ribbon.SelectedTask.BandCount > 0) ? CostOSRibbonUI.null.this.this$0.ribbon.SelectedTask.getBand(0) : null;
             if (abstractRibbonBand != null)
             {
                 Insets insets1 = abstractRibbonBand.Insets;
                 i += insets1.top + insets1.bottom;
             }
             CostOSRibbonUI.OfficeBandHostPopupPanel officeBandHostPopupPanel = new CostOSRibbonUI.OfficeBandHostPopupPanel(CostOSRibbonUI.null.this.this$0.bandScrollablePanel, new Dimension(CostOSRibbonUI.null.this.this$0.ribbon.Width, i));
             int j = (this.this$1.this$0.ribbon.LocationOnScreen).x;
             int k = (this.this$1.this$0.ribbon.LocationOnScreen).y + CostOSRibbonUI.null.this.this$0.ribbon.Height;
             Rectangle rectangle = CostOSRibbonUI.null.this.this$0.ribbon.GraphicsConfiguration.Bounds;
             int m = (officeBandHostPopupPanel.PreferredSize).width;
             if (j + m > rectangle.x + rectangle.width)
             {
                 j = rectangle.x + rectangle.width - m;
             }
             int n = (officeBandHostPopupPanel.PreferredSize).height;
             if (k + n > rectangle.y + rectangle.height)
             {
                 k = rectangle.y + rectangle.height - n;
             }
             officeBandHostPopupPanel.PreferredSize = new Dimension(CostOSRibbonUI.null.this.this$0.ribbon.Width, i);
             Popup popup = PopupFactory.SharedInstance.getPopup(taskToggleButton, officeBandHostPopupPanel, j, k);
             PopupPanelManager.PopupListener popupListener = new PopupListenerAnonymousInnerClass(this);
             PopupPanelManager.defaultManager().addPopupListener(popupListener);
             PopupPanelManager.defaultManager().addPopup(taskToggleButton, popup, officeBandHostPopupPanel);
         }
     });
 }
Exemplo n.º 2
0
 public PopupPanelCallbackAnonymousInnerClass(RibbonBandLayout outerInstance, AbstractRibbonBand popupBand, Dimension size)
 {
     this.outerInstance = outerInstance;
     this.popupBand     = popupBand;
     this.size          = size;
 }
Exemplo n.º 3
0
            public virtual void layoutContainer(Container param1Container)
            {
                if (!param1Container.Visible)
                {
                    return;
                }
                Insets insets = param1Container.Insets;
                int    i      = param1Container.Height - insets.top - insets.bottom;
                RibbonBandResizePolicy ribbonBandResizePolicy = ((AbstractRibbonBand)param1Container).CurrentResizePolicy;

                if (ribbonBandResizePolicy is org.pushingpixels.flamingo.api.ribbon.resize.IconRibbonBandResizePolicy)
                {
                    outerInstance.collapsedButton.Visible = true;
                    int j = (this.this$0.collapsedButton.PreferredSize).width;
                    outerInstance.collapsedButton.setBounds(0, 0, param1Container.Width, param1Container.Height);
                    if (outerInstance.collapsedButton.PopupCallback == null)
                    {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.pushingpixels.flamingo.api.ribbon.AbstractRibbonBand popupBand = CostOSRibbonBandUI.this.ribbonBand.cloneBand();
                        AbstractRibbonBand popupBand = outerInstance.ribbonBand.cloneBand();
                        abstractRibbonBand.ControlPanel = outerInstance.ribbonBand.ControlPanel;
                        System.Collections.IList list = outerInstance.ribbonBand.ResizePolicies;
                        abstractRibbonBand.ResizePolicies = list;
                        RibbonBandResizePolicy ribbonBandResizePolicy1 = (RibbonBandResizePolicy)list[0];
                        abstractRibbonBand.CurrentResizePolicy = ribbonBandResizePolicy1;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.awt.Dimension size = new java.awt.Dimension(4 + ribbonBandResizePolicy1.getPreferredWidth(i, 4), insets.top + insets.bottom + Math.max(param1Container.getHeight(), (this.this$0.ribbonBand.getControlPanel().getPreferredSize()).height + CostOSRibbonBandUI.this.getBandTitleHeight()));
                        Dimension size = new Dimension(4 + ribbonBandResizePolicy1.getPreferredWidth(i, 4), insets.top + insets.bottom + Math.Max(param1Container.Height, (this.this$0.ribbonBand.ControlPanel.PreferredSize).height + outerInstance.BandTitleHeight));
                        outerInstance.collapsedButton.PopupCallback = new PopupPanelCallbackAnonymousInnerClass(this, popupBand, size);
                        outerInstance.ribbonBand.ControlPanel       = null;
                        outerInstance.ribbonBand.PopupRibbonBand    = abstractRibbonBand;
                    }
                    if (outerInstance.expandButton != null)
                    {
                        outerInstance.expandButton.setBounds(0, 0, 0, 0);
                    }
                    return;
                }
                if (outerInstance.collapsedButton.Visible)
                {
                    BasicRibbonBandUI.CollapsedButtonPopupPanel collapsedButtonPopupPanel = (outerInstance.collapsedButton.PopupCallback != null) ? (BasicRibbonBandUI.CollapsedButtonPopupPanel)outerInstance.collapsedButton.PopupCallback.getPopupPanel(outerInstance.collapsedButton) : null;
                    if (collapsedButtonPopupPanel != null)
                    {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.pushingpixels.flamingo.api.ribbon.AbstractRibbonBand popupBand = (org.pushingpixels.flamingo.api.ribbon.AbstractRibbonBand)collapsedButtonPopupPanel.removeComponent();
                        AbstractRibbonBand popupBand = (AbstractRibbonBand)collapsedButtonPopupPanel.removeComponent();
                        outerInstance.ribbonBand.ControlPanel       = abstractRibbonBand.ControlPanel;
                        outerInstance.ribbonBand.PopupRibbonBand    = null;
                        outerInstance.collapsedButton.PopupCallback = null;
                    }
                }
                outerInstance.collapsedButton.Visible = false;
                AbstractBandControlPanel abstractBandControlPanel = outerInstance.ribbonBand.ControlPanel;

                abstractBandControlPanel.Visible = true;
                abstractBandControlPanel.setBounds(insets.left, insets.top, param1Container.Width - insets.left - insets.right, param1Container.Height - outerInstance.BandTitleHeight - insets.top - insets.bottom);
                abstractBandControlPanel.doLayout();
                if (outerInstance.expandButton != null)
                {
                    int j = (this.this$0.expandButton.PreferredSize).width;
                    int k = (this.this$0.expandButton.PreferredSize).height;
                    int m = outerInstance.BandTitleHeight - 4;
                    if (k > m)
                    {
                        k = m;
                    }
                    int n = param1Container.Height - (outerInstance.BandTitleHeight - k) / 2;
                    outerInstance.expandButton.setBounds(param1Container.Width - insets.right - j, n - k, j, k);
                }
            }