From 09669baedc5d41827e8956e12b1d392b74f0fe18 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 29 May 2014 18:22:32 +0200 Subject: [PATCH] * Table / Games list - Selecting watch game for an already watched game brings the panel of the watched game to front. --- .../src/main/java/mage/client/MageFrame.java | 7 +++++++ .../main/java/mage/client/chat/ChatPanel.form | 20 +++++++++++++++++- .../main/java/mage/client/chat/ChatPanel.java | 10 ++++++++- .../java/mage/client/table/TablesPanel.form | 21 ++++++++++++++++--- .../java/mage/client/table/TablesPanel.java | 16 +++++++++----- 5 files changed, 64 insertions(+), 10 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/MageFrame.java b/Mage.Client/src/main/java/mage/client/MageFrame.java index 3cbd271546..d3268cad74 100644 --- a/Mage.Client/src/main/java/mage/client/MageFrame.java +++ b/Mage.Client/src/main/java/mage/client/MageFrame.java @@ -585,6 +585,13 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { public void watchGame(UUID gameId) { try { + for(Component component :desktopPane.getComponents()) { + if (component instanceof GamePane + && ((GamePane) component).getGameId().equals(gameId)) { + setActive((GamePane) component); + return; + } + } GamePane gamePane = new GamePane(); desktopPane.add(gamePane, JLayeredPane.DEFAULT_LAYER); gamePane.setMaximum(true); diff --git a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form index fbbda4c256..7bc34fdbb7 100644 --- a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form +++ b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form @@ -24,7 +24,7 @@ - + @@ -33,6 +33,10 @@ + + + + @@ -40,6 +44,11 @@ + + + + + @@ -68,6 +77,11 @@ + + + + + @@ -86,10 +100,14 @@ + + + + diff --git a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java index 3d4eb3e67c..b055535cad 100644 --- a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java +++ b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java @@ -377,9 +377,13 @@ public class ChatPanel extends javax.swing.JPanel { jTablePlayers = new javax.swing.JTable(); txtMessage = new javax.swing.JTextField(); + jSplitPane1.setBorder(null); + jSplitPane1.setDividerSize(10); jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); jSplitPane1.setResizeWeight(0.25); + jScrollPaneTxt.setBorder(null); + txtConversation.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); txtConversation.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N txtConversation.setFocusCycleRoot(false); @@ -389,11 +393,15 @@ public class ChatPanel extends javax.swing.JPanel { jSplitPane1.setRightComponent(jScrollPaneTxt); + jScrollPanePlayers.setBorder(null); + jTablePlayers.setModel(this.tableModel); jTablePlayers.setToolTipText("Connected players"); jTablePlayers.setAutoscrolls(false); + jTablePlayers.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jTablePlayers.setFocusable(false); jTablePlayers.setGridColor(new java.awt.Color(255, 255, 255)); + jTablePlayers.setOpaque(false); jTablePlayers.setRequestFocusEnabled(false); jTablePlayers.setRowSelectionAllowed(false); jTablePlayers.setUpdateSelectionOnSort(false); @@ -419,7 +427,7 @@ public class ChatPanel extends javax.swing.JPanel { layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 288, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGap(0, 0, 0) .addComponent(txtMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) ); }// //GEN-END:initComponents diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.form b/Mage.Client/src/main/java/mage/client/table/TablesPanel.form index 2b595ba00c..6826884077 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.form +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.form @@ -182,7 +182,10 @@ - + + + + @@ -213,18 +216,22 @@ - + - + + + + + @@ -232,6 +239,11 @@ + + + + + @@ -257,6 +269,9 @@ + + + diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java index 4ec38cf5f3..7d9f337394 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java @@ -535,20 +535,26 @@ public class TablesPanel extends javax.swing.JPanel { .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); - jSplitPane1.setDividerSize(3); + jSplitPane1.setBorder(null); + jSplitPane1.setDividerSize(10); jSplitPane1.setResizeWeight(1.0); chatPanel.setMinimumSize(new java.awt.Dimension(100, 43)); jSplitPane1.setRightComponent(chatPanel); + jSplitPane2.setBorder(null); + jSplitPane2.setDividerSize(10); jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); jSplitPane2.setResizeWeight(0.5); + jScrollPane1.setBorder(null); + tableTables.setModel(this.tableModel); jScrollPane1.setViewportView(tableTables); jSplitPane2.setLeftComponent(jScrollPane1); + jScrollPane2.setBorder(null); jScrollPane2.setMinimumSize(new java.awt.Dimension(23, 0)); tableCompleted.setModel(this.matchesModel); @@ -560,11 +566,11 @@ public class TablesPanel extends javax.swing.JPanel { jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 803, Short.MAX_VALUE) + .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 805, Short.MAX_VALUE) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 499, Short.MAX_VALUE) + .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 505, Short.MAX_VALUE) ); jSplitPane1.setLeftComponent(jPanel3); @@ -574,7 +580,7 @@ public class TablesPanel extends javax.swing.JPanel { layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 848, Short.MAX_VALUE) + .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 908, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 908, Short.MAX_VALUE)) ); @@ -587,7 +593,7 @@ public class TablesPanel extends javax.swing.JPanel { .addGap(0, 0, 0) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 580, Short.MAX_VALUE)) + .addGap(0, 584, Short.MAX_VALUE)) ); }// //GEN-END:initComponents