mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
* 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:
parent
3a5dd428e6
commit
09669baedc
5 changed files with 64 additions and 10 deletions
|
@ -585,6 +585,13 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
|
|
||||||
public void watchGame(UUID gameId) {
|
public void watchGame(UUID gameId) {
|
||||||
try {
|
try {
|
||||||
|
for(Component component :desktopPane.getComponents()) {
|
||||||
|
if (component instanceof GamePane
|
||||||
|
&& ((GamePane) component).getGameId().equals(gameId)) {
|
||||||
|
setActive((GamePane) component);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
GamePane gamePane = new GamePane();
|
GamePane gamePane = new GamePane();
|
||||||
desktopPane.add(gamePane, JLayeredPane.DEFAULT_LAYER);
|
desktopPane.add(gamePane, JLayeredPane.DEFAULT_LAYER);
|
||||||
gamePane.setMaximum(true);
|
gamePane.setMaximum(true);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="1" attributes="0">
|
||||||
<Component id="jSplitPane1" pref="288" max="32767" 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"/>
|
<Component id="txtMessage" min="-2" pref="30" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
|
@ -33,6 +33,10 @@
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
|
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
|
||||||
<Properties>
|
<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="orientation" type="int" value="0"/>
|
||||||
<Property name="resizeWeight" type="double" value="0.25"/>
|
<Property name="resizeWeight" type="double" value="0.25"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
@ -40,6 +44,11 @@
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Container class="javax.swing.JScrollPane" name="jScrollPaneTxt">
|
<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>
|
<Constraints>
|
||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||||
<JSplitPaneConstraints position="right"/>
|
<JSplitPaneConstraints position="right"/>
|
||||||
|
@ -68,6 +77,11 @@
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
<Container class="javax.swing.JScrollPane" name="jScrollPanePlayers">
|
<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>
|
<AuxValues>
|
||||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
</AuxValues>
|
</AuxValues>
|
||||||
|
@ -86,10 +100,14 @@
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="toolTipText" type="java.lang.String" value="Connected players"/>
|
<Property name="toolTipText" type="java.lang.String" value="Connected players"/>
|
||||||
<Property name="autoscrolls" type="boolean" value="false"/>
|
<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="focusable" type="boolean" value="false"/>
|
||||||
<Property name="gridColor" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
<Property name="gridColor" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||||
</Property>
|
</Property>
|
||||||
|
<Property name="opaque" type="boolean" value="false"/>
|
||||||
<Property name="requestFocusEnabled" type="boolean" value="false"/>
|
<Property name="requestFocusEnabled" type="boolean" value="false"/>
|
||||||
<Property name="rowSelectionAllowed" 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">
|
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
|
||||||
|
|
|
@ -377,9 +377,13 @@ public class ChatPanel extends javax.swing.JPanel {
|
||||||
jTablePlayers = new javax.swing.JTable();
|
jTablePlayers = new javax.swing.JTable();
|
||||||
txtMessage = new javax.swing.JTextField();
|
txtMessage = new javax.swing.JTextField();
|
||||||
|
|
||||||
|
jSplitPane1.setBorder(null);
|
||||||
|
jSplitPane1.setDividerSize(10);
|
||||||
jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
||||||
jSplitPane1.setResizeWeight(0.25);
|
jSplitPane1.setResizeWeight(0.25);
|
||||||
|
|
||||||
|
jScrollPaneTxt.setBorder(null);
|
||||||
|
|
||||||
txtConversation.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
|
txtConversation.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
|
||||||
txtConversation.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
|
txtConversation.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
|
||||||
txtConversation.setFocusCycleRoot(false);
|
txtConversation.setFocusCycleRoot(false);
|
||||||
|
@ -389,11 +393,15 @@ public class ChatPanel extends javax.swing.JPanel {
|
||||||
|
|
||||||
jSplitPane1.setRightComponent(jScrollPaneTxt);
|
jSplitPane1.setRightComponent(jScrollPaneTxt);
|
||||||
|
|
||||||
|
jScrollPanePlayers.setBorder(null);
|
||||||
|
|
||||||
jTablePlayers.setModel(this.tableModel);
|
jTablePlayers.setModel(this.tableModel);
|
||||||
jTablePlayers.setToolTipText("Connected players");
|
jTablePlayers.setToolTipText("Connected players");
|
||||||
jTablePlayers.setAutoscrolls(false);
|
jTablePlayers.setAutoscrolls(false);
|
||||||
|
jTablePlayers.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
|
||||||
jTablePlayers.setFocusable(false);
|
jTablePlayers.setFocusable(false);
|
||||||
jTablePlayers.setGridColor(new java.awt.Color(255, 255, 255));
|
jTablePlayers.setGridColor(new java.awt.Color(255, 255, 255));
|
||||||
|
jTablePlayers.setOpaque(false);
|
||||||
jTablePlayers.setRequestFocusEnabled(false);
|
jTablePlayers.setRequestFocusEnabled(false);
|
||||||
jTablePlayers.setRowSelectionAllowed(false);
|
jTablePlayers.setRowSelectionAllowed(false);
|
||||||
jTablePlayers.setUpdateSelectionOnSort(false);
|
jTablePlayers.setUpdateSelectionOnSort(false);
|
||||||
|
@ -419,7 +427,7 @@ public class ChatPanel extends javax.swing.JPanel {
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
.addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 288, Short.MAX_VALUE)
|
.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))
|
.addComponent(txtMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
|
@ -182,7 +182,10 @@
|
||||||
</Container>
|
</Container>
|
||||||
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
|
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
|
||||||
<Properties>
|
<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"/>
|
<Property name="resizeWeight" type="double" value="1.0"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
|
||||||
|
@ -213,18 +216,22 @@
|
||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="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>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<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>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Container class="javax.swing.JSplitPane" name="jSplitPane2">
|
<Container class="javax.swing.JSplitPane" name="jSplitPane2">
|
||||||
<Properties>
|
<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="orientation" type="int" value="0"/>
|
||||||
<Property name="resizeWeight" type="double" value="0.5"/>
|
<Property name="resizeWeight" type="double" value="0.5"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
@ -232,6 +239,11 @@
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
<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>
|
<AuxValues>
|
||||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
</AuxValues>
|
</AuxValues>
|
||||||
|
@ -257,6 +269,9 @@
|
||||||
</Container>
|
</Container>
|
||||||
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
|
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
|
||||||
<Properties>
|
<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">
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
<Dimension value="[23, 0]"/>
|
<Dimension value="[23, 0]"/>
|
||||||
</Property>
|
</Property>
|
||||||
|
|
|
@ -535,20 +535,26 @@ public class TablesPanel extends javax.swing.JPanel {
|
||||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
);
|
);
|
||||||
|
|
||||||
jSplitPane1.setDividerSize(3);
|
jSplitPane1.setBorder(null);
|
||||||
|
jSplitPane1.setDividerSize(10);
|
||||||
jSplitPane1.setResizeWeight(1.0);
|
jSplitPane1.setResizeWeight(1.0);
|
||||||
|
|
||||||
chatPanel.setMinimumSize(new java.awt.Dimension(100, 43));
|
chatPanel.setMinimumSize(new java.awt.Dimension(100, 43));
|
||||||
jSplitPane1.setRightComponent(chatPanel);
|
jSplitPane1.setRightComponent(chatPanel);
|
||||||
|
|
||||||
|
jSplitPane2.setBorder(null);
|
||||||
|
jSplitPane2.setDividerSize(10);
|
||||||
jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
||||||
jSplitPane2.setResizeWeight(0.5);
|
jSplitPane2.setResizeWeight(0.5);
|
||||||
|
|
||||||
|
jScrollPane1.setBorder(null);
|
||||||
|
|
||||||
tableTables.setModel(this.tableModel);
|
tableTables.setModel(this.tableModel);
|
||||||
jScrollPane1.setViewportView(tableTables);
|
jScrollPane1.setViewportView(tableTables);
|
||||||
|
|
||||||
jSplitPane2.setLeftComponent(jScrollPane1);
|
jSplitPane2.setLeftComponent(jScrollPane1);
|
||||||
|
|
||||||
|
jScrollPane2.setBorder(null);
|
||||||
jScrollPane2.setMinimumSize(new java.awt.Dimension(23, 0));
|
jScrollPane2.setMinimumSize(new java.awt.Dimension(23, 0));
|
||||||
|
|
||||||
tableCompleted.setModel(this.matchesModel);
|
tableCompleted.setModel(this.matchesModel);
|
||||||
|
@ -560,11 +566,11 @@ public class TablesPanel extends javax.swing.JPanel {
|
||||||
jPanel3.setLayout(jPanel3Layout);
|
jPanel3.setLayout(jPanel3Layout);
|
||||||
jPanel3Layout.setHorizontalGroup(
|
jPanel3Layout.setHorizontalGroup(
|
||||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
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.setVerticalGroup(
|
||||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
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);
|
jSplitPane1.setLeftComponent(jPanel3);
|
||||||
|
@ -574,7 +580,7 @@ public class TablesPanel extends javax.swing.JPanel {
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
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(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)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 908, Short.MAX_VALUE))
|
.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)
|
.addGap(0, 0, 0)
|
||||||
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
|
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.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
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue