Change main client window MagePanes from JInternalFrames to JLayeredPanes

* This change's purpose is to get rid of the extra borders shown around the window border. These arise from using JInternalFrames in a JDestopPane and are impossible to remove in a forwards compatible way when using JInternalFrames. The solution it to move to have MagePane inherit from a plain old JLayeredPane instead of JInternalFrame. All of the MagePanes are always maximized anyways, so this doesn't lose any functionality.
This commit is contained in:
Mark Langen 2017-04-07 22:04:00 -06:00
parent fee7e4a4e6
commit 321f5597b7
9 changed files with 131 additions and 186 deletions

View file

@ -35,7 +35,8 @@ package mage.client.game;
import java.awt.AWTEvent;
import java.util.UUID;
import javax.swing.SwingUtilities;
import javax.swing.*;
import mage.client.MagePane;
/**
@ -48,10 +49,9 @@ public class GamePane extends MagePane {
* Creates new form GamePane
*/
public GamePane() {
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
initComponents();
SwingUtilities.invokeLater(() -> {
gamePanel.setJLayeredPane(getLayeredPane());
gamePanel.setJLayeredPane(this);
gamePanel.installComponents();
});
@ -96,12 +96,13 @@ public class GamePane extends MagePane {
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jScrollPane1.setBorder(BorderFactory.createEmptyBorder());
gamePanel = new mage.client.game.GamePanel();
jScrollPane1.setViewportView(gamePanel);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 600, Short.MAX_VALUE)
@ -113,7 +114,6 @@ public class GamePane extends MagePane {
.addGap(0, 400, Short.MAX_VALUE)
);
pack();
}
public UUID getGameId() {