přidano nastaveni pro zobrazeni maximalizovaneho okna
parent
ef3008969f
commit
3e7af1977c
|
|
@ -2,6 +2,7 @@ package jnet.client;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.swing.JFrame;
|
||||
import jnet.client.client.NettyClientManager;
|
||||
import jnet.client.gui.Tray;
|
||||
import jnet.client.gui.Window;
|
||||
|
|
@ -96,8 +97,12 @@ public class Client {
|
|||
///
|
||||
/// okno
|
||||
///
|
||||
okno.setSize(1024, 800);
|
||||
okno.setLocationRelativeTo(null);
|
||||
if (config.getBoolean("open_maximalized")) {
|
||||
okno.setExtendedState(JFrame.MAXIMIZED_BOTH);
|
||||
} else {
|
||||
okno.setSize(1024, 800);
|
||||
okno.setLocationRelativeTo(null);
|
||||
}
|
||||
|
||||
///
|
||||
/// spustit minimalozovane ?
|
||||
|
|
|
|||
|
|
@ -36,9 +36,14 @@ public class SettingsPanel extends JPanel {
|
|||
runMinimalized.setBounds(30, getNextY(nadpisLabel) + 20, 400, 25);
|
||||
runMinimalized.setSelected(Client.config.getBoolean("start_minimalized"));
|
||||
this.add(runMinimalized);
|
||||
|
||||
JCheckBox openMaxWindow = new JCheckBox("Otevírat maximalizované okno");
|
||||
openMaxWindow.setBounds(30, getNextY(runMinimalized), 400, 25);
|
||||
openMaxWindow.setSelected(Client.config.getBoolean("open_maximalized"));
|
||||
this.add(openMaxWindow);
|
||||
|
||||
JCheckBox enableDebug = new JCheckBox("Debug režim");
|
||||
enableDebug.setBounds(30, getNextY(runMinimalized), 400, 25);
|
||||
enableDebug.setBounds(30, getNextY(openMaxWindow), 400, 25);
|
||||
enableDebug.setSelected(Client.config.getBoolean("debug"));
|
||||
this.add(enableDebug);
|
||||
|
||||
|
|
@ -182,6 +187,7 @@ public class SettingsPanel extends JPanel {
|
|||
// Uložíme všechny hodnoty z komponent do konfigurace
|
||||
Client.config.setProperty("debug", enableDebug.isSelected());
|
||||
Client.config.setProperty("start_minimalized", runMinimalized.isSelected());
|
||||
Client.config.setProperty("open_maximalized", openMaxWindow.isSelected());
|
||||
Client.config.setProperty("sound", enableSounds.isSelected());
|
||||
Client.config.setProperty("sound.volume", volumeSlider.getValue() / 100.0);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ public class Window extends JFrame {
|
|||
|
||||
private static Window instance;
|
||||
|
||||
|
||||
private JSplitPane splitPane;
|
||||
private StatusBar statusBar;
|
||||
private MapTree mapTree;
|
||||
|
|
@ -49,8 +48,8 @@ public class Window extends JFrame {
|
|||
|
||||
initComponents();
|
||||
|
||||
pack();
|
||||
setLocationRelativeTo(null);
|
||||
// pack();
|
||||
// setLocationRelativeTo(null);
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
|
@ -141,6 +140,19 @@ public class Window extends JFrame {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean b) {
|
||||
super.setVisible(b);
|
||||
if (b) {
|
||||
// Pro jistotu zpozdíme maximalizaci, aby se provedla až po dokončení layoutu
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
setExtendedState(JFrame.MAXIMIZED_BOTH);
|
||||
toFront();
|
||||
requestFocus();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Statické přístupové metody pro ostatní komponenty
|
||||
// ------------------------------------------------------------------------
|
||||
|
|
@ -219,10 +231,10 @@ public class Window extends JFrame {
|
|||
currentMapView.refreshFromServer(site);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Obnoví aktuální zobrazení mapy podle dat ze serveru.
|
||||
* Pokud není žádná mapa otevřena, nic neprovede.
|
||||
* Obnoví aktuální zobrazení mapy podle dat ze serveru. Pokud není žádná
|
||||
* mapa otevřena, nic neprovede.
|
||||
*/
|
||||
public static void refreshCurrentMapView() {
|
||||
if (currentMapView == null) {
|
||||
|
|
@ -298,10 +310,10 @@ public class Window extends JFrame {
|
|||
}
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
// if (currentServerSettingsPanel == null) {
|
||||
currentServerSettingsPanel = new ServerSettingsPanel();
|
||||
//JScrollPane scroll = new JScrollPane(currentServerSettingsPanel);
|
||||
instance.splitPane.add(currentServerSettingsPanel, JSplitPane.RIGHT);
|
||||
instance.splitPane.revalidate();
|
||||
currentServerSettingsPanel = new ServerSettingsPanel();
|
||||
//JScrollPane scroll = new JScrollPane(currentServerSettingsPanel);
|
||||
instance.splitPane.add(currentServerSettingsPanel, JSplitPane.RIGHT);
|
||||
instance.splitPane.revalidate();
|
||||
// }
|
||||
currentServerSettingsPanel.setTable(tab);
|
||||
switch (tab) {
|
||||
|
|
@ -325,7 +337,7 @@ public class Window extends JFrame {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public static void putServerLog(String[] log) {
|
||||
if (currentServerSettingsPanel != null) {
|
||||
currentServerSettingsPanel.putLog(log);
|
||||
|
|
@ -343,13 +355,13 @@ public class Window extends JFrame {
|
|||
currentServerSettingsPanel.refreshUsers();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void refreshSnmpProfiles() {
|
||||
if (currentServerSettingsPanel != null) {
|
||||
currentServerSettingsPanel.refreshSnmpProfiles();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void refreshSnmpTemplates() {
|
||||
if (currentServerSettingsPanel != null) {
|
||||
currentServerSettingsPanel.refreshSnmpTemplates();
|
||||
|
|
|
|||
Loading…
Reference in New Issue