public CostOSRibbonApplicationMenuPopupPanel(JRibbonApplicationMenuButton paramJRibbonApplicationMenuButton, RibbonApplicationMenu paramRibbonApplicationMenu) { Layout = new BorderLayout(); Border = BorderFactory.createEmptyBorder(); if (paramRibbonApplicationMenu.DefaultCallback == null) { this.defaultPrimaryCallback = new PrimaryRolloverCallbackAnonymousInnerClass(this); } else { this.defaultPrimaryCallback = paramRibbonApplicationMenu.DefaultCallback; } CostOSApplicationMenuContainerPanel costOSApplicationMenuContainerPanel = new CostOSApplicationMenuContainerPanel(new BorderLayout()); costOSApplicationMenuContainerPanel.Background = SECONDARY_MENU_COLOR; JFrame jFrame = CostOSRootPaneUI.Resolver.MainFrame; costOSApplicationMenuContainerPanel.MinimumSize = new Dimension(jFrame.Width - 2, jFrame.Height - 55); costOSApplicationMenuContainerPanel.PreferredSize = new Dimension(jFrame.Width - 2, jFrame.Height - 55); costOSApplicationMenuContainerPanel.MaximumSize = new Dimension(jFrame.Width - 2, jFrame.Height - 55); this.panelLevel1 = new JPanel(); this.panelLevel1.Layout = new LayoutManagerAnonymousInnerClass(this); this.panelLevel1.Background = PRIMARY_MENU_COLOR; this.panelLevel1.Border = BorderFactory.createEmptyBorder(); if (paramRibbonApplicationMenu != null) { System.Collections.IList list = paramRibbonApplicationMenu.PrimaryEntries; if (list != null && list.Count > 0) { EmptyResizableIcon emptyResizableIcon = new EmptyResizableIcon(16); for (sbyte b = 0; b < list.Count; b++) { System.Collections.IList list1 = (System.Collections.IList)list[b]; foreach (RibbonApplicationMenuEntryPrimary ribbonApplicationMenuEntryPrimary in list1) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final JCommandAppMenuButton commandButton = new JCommandAppMenuButton(ribbonApplicationMenuEntryPrimary.getText(), emptyResizableIcon); JCommandAppMenuButton commandButton = new JCommandAppMenuButton(ribbonApplicationMenuEntryPrimary.Text, emptyResizableIcon); jCommandAppMenuButton.CommandButtonKind = ribbonApplicationMenuEntryPrimary.EntryKind; jCommandAppMenuButton.addActionListener(ribbonApplicationMenuEntryPrimary.MainActionListener); if (ribbonApplicationMenuEntryPrimary.RolloverCallback != null) { jCommandAppMenuButton.addRolloverActionListener(new RolloverActionListenerAnonymousInnerClass(this)); } else if (ribbonApplicationMenuEntryPrimary.SecondaryGroupCount == 0) { jCommandAppMenuButton.addRolloverActionListener(new RolloverActionListenerAnonymousInnerClass2(this)); } else { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryPrimary.PrimaryRolloverCallback coreCallback = new org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryPrimary.PrimaryRolloverCallback() RibbonApplicationMenuEntryPrimary.PrimaryRolloverCallback coreCallback = new PrimaryRolloverCallbackAnonymousInnerClass2(this, commandButton); jCommandAppMenuButton.addRolloverActionListener(new RolloverActionListenerAnonymousInnerClass3(this, commandButton, coreCallback)); } jCommandAppMenuButton.DisplayState = MENU_TILE_LEVEL_1; jCommandAppMenuButton.HorizontalAlignment = 10; jCommandAppMenuButton.PopupOrientationKind = JCommandButton.CommandButtonPopupOrientationKind.SIDEWARD; jCommandAppMenuButton.Enabled = ribbonApplicationMenuEntryPrimary.Enabled; jCommandAppMenuButton.Foreground = CostOSWindowsLookAndFeel.ribbonAppMenuButtonForegroundColor; this.panelLevel1.add(jCommandAppMenuButton); } if (b < list.Count - 1) { JPopupMenu.Separator separator = new SeparatorAnonymousInnerClass(this); this.panelLevel1.add(separator); } } } } costOSApplicationMenuContainerPanel.add(this.panelLevel1, "West"); this.panelLevel2 = new JPanel(); this.panelLevel2.Background = SECONDARY_MENU_COLOR; this.panelLevel2.Border = new BorderAnonymousInnerClass(this); this.panelLevel2.PreferredSize = new Dimension(30 * FlamingoUtilities.getFont(this.panelLevel1, new string[] { "Ribbon.font", "Button.font", "Panel.font" }).Size - 30, 10); this.defaultPrimaryCallback.menuEntryActivated(this.panelLevel2); costOSApplicationMenuContainerPanel.add(this.panelLevel2, "Center"); add(costOSApplicationMenuContainerPanel, "Center"); this.panelLevel1.doLayout(); firstLevelMenuWidth = (int)this.panelLevel1.PreferredSize.Width; }
public RolloverActionListenerAnonymousInnerClass3(CostOSRibbonApplicationMenuPopupPanel outerInstance, Desktop.common.nomitech.common.laf.CostOSRibbonApplicationMenuPopupPanel.JCommandAppMenuButton commandButton, RibbonApplicationMenuEntryPrimary.PrimaryRolloverCallback coreCallback) { this.outerInstance = outerInstance; this.commandButton = commandButton; this.coreCallback = coreCallback; }