示例#1
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);
                }
            }