MCPcopy Create free account
hub / github.com/Card-Forge/forge / LayoutMenu

Class LayoutMenu

forge-gui-desktop/src/main/java/forge/menus/LayoutMenu.java:50–548  ·  view source on GitHub ↗

Returns a JMenu containing options associated with screen layout, theming, and panel/window options. Some entries are only shown on the match screen.

Source from the content-addressed store, hash-verified

48 * and panel/window options. Some entries are only shown on the match screen.
49 */
50public final class LayoutMenu {
51 public LayoutMenu() {
52 }
53
54 private static final ForgePreferences prefs = FModel.getPreferences();
55 private static final Localizer localizer = Localizer.getInstance();
56
57 public JMenu getMenu() {
58 final FScreen currentScreen = Singletons.getControl().getCurrentScreen();
59 final boolean isMatch = currentScreen != null && currentScreen.isMatchScreen();
60 final boolean isHome = currentScreen == FScreen.HOME_SCREEN;
61
62 final JMenu menu = new JMenu(localizer.getMessage("lblLayout"));
63 menu.setMnemonic(KeyEvent.VK_L);
64
65 if (!isHome) {
66 menu.add(getMenu_FileOptions());
67 menu.add(getMenuItem_RevertLayout());
68 menu.add(getMenuItem_ResetMatchLayout());
69 }
70 if (!isHome) {
71 menu.addSeparator();
72 }
73 menu.add(getMenu_ThemeOptions());
74 if (isMatch) {
75 menu.add(getMenuItem_ShowBackgroundImage());
76 }
77
78 if (menu.getItemCount() > 0) {
79 menu.addSeparator();
80 }
81 menu.add(getMenuItem_FullScreen());
82 menu.add(getMenuItem_SetWindowSize());
83
84 menu.addSeparator();
85 if (isMatch) {
86 menu.add(getMenu_HandOptions());
87 menu.add(getMenu_LogPane());
88 }
89 menu.add(getMenuItem_ShowTabs());
90 menu.add(getMenuItem_NewCardCountInTab());
91
92 if (isMatch) {
93 menu.addSeparator();
94 menu.add(getMenu_SortMultiplayerFields());
95 }
96 return menu;
97 }
98
99 private JMenu getMenu_FileOptions() {
100 final JMenu menu = new JMenu(localizer.getMessage("lblFile"));
101 menu.add(getMenuItem_OpenLayout());
102 menu.add(getMenuItem_SaveLayout());
103 return menu;
104 }
105
106 private static JMenu getMenu_ThemeOptions() {
107 final JMenu menu = new JMenu(localizer.getMessage("lblTheme"));

Callers

nothing calls this directly

Calls 5

getPreferencesMethod · 0.95
getInstanceMethod · 0.95
setCursorMethod · 0.95
changeSkinMethod · 0.95
resetCursorMethod · 0.95

Tested by

no test coverage detected