mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
* Try to fix URL handling.
This commit is contained in:
parent
16dc022018
commit
d743864bbd
2 changed files with 13 additions and 12 deletions
|
@ -60,7 +60,6 @@ import static mage.client.dialog.PreferencesDialog.KEY_TABLES_FILTER_SETTINGS;
|
|||
import static mage.client.dialog.PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_1;
|
||||
import static mage.client.dialog.PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_2;
|
||||
import static mage.client.dialog.PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_3;
|
||||
import static mage.client.dialog.PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE;
|
||||
import mage.client.util.ButtonColumn;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.IgnoreList;
|
||||
|
@ -427,15 +426,15 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
private void restoreDividers() {
|
||||
Rectangle currentBounds = MageFrame.getDesktop().getBounds();
|
||||
if (currentBounds != null) {
|
||||
String firstDivider = PreferencesDialog.getCachedValue(KEY_TABLES_DIVIDER_LOCATION_1, null);
|
||||
String tableDivider = PreferencesDialog.getCachedValue(KEY_TABLES_DIVIDER_LOCATION_2, null);
|
||||
String chatDivider = PreferencesDialog.getCachedValue(KEY_TABLES_DIVIDER_LOCATION_3, null);
|
||||
GuiDisplayUtil.restoreDividerLocations(currentBounds, firstDivider, jSplitPane1);
|
||||
GuiDisplayUtil.restoreDividerLocations(currentBounds, tableDivider, jSplitPaneTables);
|
||||
GuiDisplayUtil.restoreDividerLocations(currentBounds, chatDivider, chatPanelMain);
|
||||
}
|
||||
Rectangle currentBounds = MageFrame.getDesktop().getBounds();
|
||||
if (currentBounds != null) {
|
||||
String firstDivider = PreferencesDialog.getCachedValue(KEY_TABLES_DIVIDER_LOCATION_1, null);
|
||||
String tableDivider = PreferencesDialog.getCachedValue(KEY_TABLES_DIVIDER_LOCATION_2, null);
|
||||
String chatDivider = PreferencesDialog.getCachedValue(KEY_TABLES_DIVIDER_LOCATION_3, null);
|
||||
GuiDisplayUtil.restoreDividerLocations(currentBounds, firstDivider, jSplitPane1);
|
||||
GuiDisplayUtil.restoreDividerLocations(currentBounds, tableDivider, jSplitPaneTables);
|
||||
GuiDisplayUtil.restoreDividerLocations(currentBounds, chatDivider, chatPanelMain);
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, JComponent> getUIComponents() {
|
||||
|
@ -550,6 +549,7 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
this.jPanelBottom.setVisible(false);
|
||||
} else {
|
||||
this.jPanelBottom.setVisible(true);
|
||||
URLHandler.RemoveMouseAdapter(jLabelFooterText);
|
||||
URLHandler.handleMessage(serverMessages.get(0), this.jLabelFooterText);
|
||||
this.jButtonFooterNext.setVisible(serverMessages.size() > 1);
|
||||
}
|
||||
|
|
|
@ -9,10 +9,10 @@ import java.awt.Desktop;
|
|||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import javax.swing.JLabel;
|
||||
|
||||
/**
|
||||
|
@ -47,6 +47,7 @@ public class URLHandler {
|
|||
|
||||
private static MouseAdapter createMouseAdapter(String url) {
|
||||
currentMouseAdapter = new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if (e.getClickCount() > 0) {
|
||||
if (Desktop.isDesktopSupported()) {
|
||||
|
@ -57,7 +58,7 @@ public class URLHandler {
|
|||
} catch (IOException | URISyntaxException ex) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue