TableWaitingDialog is not closeable and stays on top

This commit is contained in:
BetaSteward 2011-05-19 21:34:31 -04:00
parent 71a1b5dbef
commit e841ed0cf8
5 changed files with 10 additions and 8 deletions

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.1" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JInternalFrameFormInfo">
<SyntheticProperties>
@ -24,7 +24,7 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="306" max="32767" attributes="0"/>
<EmptySpace min="0" pref="310" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>

View file

@ -65,7 +65,8 @@ public class MageDialog extends javax.swing.JInternalFrame {
public void show() {
super.show();
this.toFront();
this.setClosable(!modal);
if (modal)
this.setClosable(false);
if (this.modal) {
startModal();
}
@ -75,8 +76,8 @@ public class MageDialog extends javax.swing.JInternalFrame {
public void setVisible(boolean value) {
super.setVisible(value);
this.toFront();
this.setClosable(!modal);
if (modal) {
this.setClosable(false);
if (value) {
startModal();
} else {

View file

@ -2,6 +2,7 @@
<Form version="1.6" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JInternalFrameFormInfo">
<Properties>
<Property name="closable" type="boolean" value="false"/>
<Property name="resizable" type="boolean" value="true"/>
<Property name="title" type="java.lang.String" value="Waiting for players"/>
</Properties>
@ -40,7 +41,7 @@
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jSplitPane1" pref="263" max="32767" attributes="0"/>
<Component id="jSplitPane1" pref="267" max="32767" attributes="0"/>
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnMoveDown" alignment="3" min="-2" max="-2" attributes="0"/>

View file

@ -72,7 +72,6 @@ public class TableWaitingDialog extends MageDialog {
session.getUI().addButton(MageComponents.TABLE_WAITING_START_BUTTON, btnStart);
}
// @Override
public void update(TableView table) {
try {
if (table != null) {
@ -158,6 +157,7 @@ public class TableWaitingDialog extends MageDialog {
tableSeats = new javax.swing.JTable();
chatPanel = new mage.client.chat.ChatPanel(false);
setClosable(false);
setResizable(true);
setTitle("Waiting for players");
@ -222,7 +222,7 @@ public class TableWaitingDialog extends MageDialog {
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
.addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 267, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnMoveDown)

View file

@ -330,7 +330,7 @@ public class TablesPanel extends javax.swing.JPanel {
newTableDialog.showDialog(roomId);
if (newTableDialog.getTable() != null) {
tableWaitingDialog = new TableWaitingDialog();
MageFrame.getDesktop().add(tableWaitingDialog);
MageFrame.getDesktop().add(tableWaitingDialog, JLayeredPane.MODAL_LAYER);
tableWaitingDialog.showDialog(roomId, newTableDialog.getTable().getTableId(), false);
}
}//GEN-LAST:event_btnNewTableActionPerformed