* Table / Games list - Selecting watch game for an already watched game brings the panel of the watched game to front.

This commit is contained in:
LevelX2 2014-05-29 18:22:32 +02:00
parent 3a5dd428e6
commit 09669baedc
5 changed files with 64 additions and 10 deletions

View file

@ -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);

View file

@ -24,7 +24,7 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jSplitPane1" pref="288" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="txtMessage" min="-2" pref="30" max="-2" attributes="0"/>
</Group>
</Group>
@ -33,6 +33,10 @@
<SubComponents>
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
<Property name="dividerSize" type="int" value="10"/>
<Property name="orientation" type="int" value="0"/>
<Property name="resizeWeight" type="double" value="0.25"/>
</Properties>
@ -40,6 +44,11 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPaneTxt">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="right"/>
@ -68,6 +77,11 @@
</SubComponents>
</Container>
<Container class="javax.swing.JScrollPane" name="jScrollPanePlayers">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
@ -86,10 +100,14 @@
</Property>
<Property name="toolTipText" type="java.lang.String" value="Connected players"/>
<Property name="autoscrolls" type="boolean" value="false"/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Standardcursor"/>
</Property>
<Property name="focusable" type="boolean" value="false"/>
<Property name="gridColor" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="opaque" type="boolean" value="false"/>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
<Property name="rowSelectionAllowed" type="boolean" value="false"/>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">

View file

@ -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))
);
}// </editor-fold>//GEN-END:initComponents

View file

@ -182,7 +182,10 @@
</Container>
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
<Properties>
<Property name="dividerSize" type="int" value="3"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
<Property name="dividerSize" type="int" value="10"/>
<Property name="resizeWeight" type="double" value="1.0"/>
</Properties>
@ -213,18 +216,22 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jSplitPane2" alignment="0" pref="803" max="32767" attributes="0"/>
<Component id="jSplitPane2" alignment="0" pref="805" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jSplitPane2" alignment="0" pref="503" max="32767" attributes="0"/>
<Component id="jSplitPane2" alignment="0" pref="505" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JSplitPane" name="jSplitPane2">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
<Property name="dividerSize" type="int" value="10"/>
<Property name="orientation" type="int" value="0"/>
<Property name="resizeWeight" type="double" value="0.5"/>
</Properties>
@ -232,6 +239,11 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
@ -257,6 +269,9 @@
</Container>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[23, 0]"/>
</Property>

View file

@ -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))
);
}// </editor-fold>//GEN-END:initComponents