Some more changes to GUI to better support high screen resolutions.

This commit is contained in:
LevelX2 2016-02-10 08:31:21 +01:00
parent 2e574ab19e
commit a0ff08b0b9
13 changed files with 388 additions and 273 deletions

View file

@ -26,12 +26,11 @@
* or implied, of BetaSteward_at_googlemail.com.
*/
/*
/*
* TournamentPane.java
*
* Created on 22-Jan-2011, 11:41:47 PM
*/
package mage.client.tournament;
import java.util.UUID;
@ -43,7 +42,9 @@ import mage.client.MagePane;
*/
public class TournamentPane extends MagePane {
/** Creates new form TournamentPane */
/**
* Creates new form TournamentPane
*/
public TournamentPane() {
initComponents();
}
@ -59,6 +60,10 @@ public class TournamentPane extends MagePane {
removeFrame();
}
public void changeGUISize() {
tournamentPanel.changeGUISize();
}
public UUID getTournamentId() {
if (this.tournamentPanel == null) {
return null;
@ -66,10 +71,10 @@ public class TournamentPane extends MagePane {
return tournamentPanel.getTournamentId();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
@ -91,7 +96,6 @@ public class TournamentPane extends MagePane {
pack();
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private mage.client.tournament.TournamentPanel tournamentPanel;
// End of variables declaration//GEN-END:variables

View file

@ -34,6 +34,8 @@
package mage.client.tournament;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.text.DateFormat;
@ -56,6 +58,7 @@ import static mage.client.dialog.PreferencesDialog.KEY_TOURNAMENT_MATCH_COLUMNS_
import static mage.client.dialog.PreferencesDialog.KEY_TOURNAMENT_PLAYER_COLUMNS_ORDER;
import static mage.client.dialog.PreferencesDialog.KEY_TOURNAMENT_PLAYER_COLUMNS_WIDTH;
import mage.client.util.ButtonColumn;
import mage.client.util.FontSizeHelper;
import mage.client.util.Format;
import mage.client.util.gui.TableUtil;
import mage.client.util.gui.countryBox.CountryCellRenderer;
@ -105,6 +108,8 @@ public class TournamentPanel extends javax.swing.JPanel {
tableMatches.createDefaultColumnsFromModel();
TableUtil.setColumnWidthAndOrder(tableMatches, DEFAULT_COLUMNS_WIDTH_MATCHES, KEY_TOURNAMENT_MATCH_COLUMNS_WIDTH, KEY_TOURNAMENT_MATCH_COLUMNS_ORDER);
setGUISize();
chatPanel1.useExtendedView(ChatPanelBasic.VIEW_MODE.NONE);
chatPanel1.setChatType(ChatPanelBasic.ChatType.TOURNAMENT);
@ -142,6 +147,18 @@ public class TournamentPanel extends javax.swing.JPanel {
}
public void changeGUISize() {
setGUISize();
}
private void setGUISize() {
Font font = FontSizeHelper.getTableFont();
tablePlayers.getTableHeader().setFont(font);
tablePlayers.getTableHeader().setPreferredSize(new Dimension(FontSizeHelper.tableHeaderHeight, FontSizeHelper.tableHeaderHeight));
tableMatches.getTableHeader().setFont(font);
tableMatches.getTableHeader().setPreferredSize(new Dimension(FontSizeHelper.tableHeaderHeight, FontSizeHelper.tableHeaderHeight));
}
private void saveDividerLocations() {
// save panel sizes and divider locations.
Rectangle rec = MageFrame.getDesktop().getBounds();