mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
* Some more support for GUI resizing.
This commit is contained in:
parent
c6f8d09229
commit
0c242bce5f
2 changed files with 69 additions and 94 deletions
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<Form version="1.2" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
|
@ -11,7 +11,7 @@
|
|||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,-14,0,0,6,17"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,3,20,0,0,6,17"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
|
@ -464,7 +464,7 @@
|
|||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jSplitPaneTables" alignment="0" pref="643" max="32767" attributes="0"/>
|
||||
<Component id="jSplitPaneTables" alignment="0" pref="672" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
|
@ -566,7 +566,7 @@
|
|||
</Border>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[664, 39]"/>
|
||||
<Dimension value="[516, 37]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
|
@ -575,64 +575,37 @@
|
|||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jButtonNext" min="-2" pref="65" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" pref="1350" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jButtonNext" alignment="3" min="-2" pref="17" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout">
|
||||
<Property name="alignment" type="int" value="0"/>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Component class="javax.swing.JButton" name="jButtonFooterNext">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Next"/>
|
||||
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
||||
<Property name="opaque" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonFooterNextActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabelFooterLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Tahoma" size="11" style="1"/>
|
||||
</Property>
|
||||
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||
<Property name="text" type="java.lang.String" value="Message of the Day:"/>
|
||||
<Property name="alignmentY" type="float" value="0.3"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Component class="javax.swing.JLabel" name="jLabelFooterText">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||
<Property name="text" type="java.lang.String" value="You are playing Mage version 0.7.5. Welcome! -- Mage dev team --"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="jButtonNext">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Next"/>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[55, 25]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[55, 25]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[55, 25]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonNextActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
|
|
|
@ -36,6 +36,7 @@ package mage.client.table;
|
|||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.HeadlessException;
|
||||
import java.awt.Image;
|
||||
import java.awt.Point;
|
||||
|
@ -323,9 +324,26 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
newimg = img.getScaledInstance(GUISizeHelper.menuFont.getSize(), GUISizeHelper.menuFont.getSize(), java.awt.Image.SCALE_SMOOTH);
|
||||
btnStateFinished.setIcon(new ImageIcon(newimg));
|
||||
|
||||
int iconSize = 48 + GUISizeHelper.menuFont.getSize() * 2 - 15;
|
||||
icon = new javax.swing.ImageIcon(getClass().getResource("/buttons/match_new.png"));
|
||||
img = icon.getImage();
|
||||
newimg = img.getScaledInstance(iconSize, iconSize, java.awt.Image.SCALE_SMOOTH);
|
||||
btnNewTable.setIcon(new ImageIcon(newimg));
|
||||
|
||||
icon = new javax.swing.ImageIcon(getClass().getResource("/buttons/tourney_new.png"));
|
||||
img = icon.getImage();
|
||||
newimg = img.getScaledInstance(iconSize, iconSize, java.awt.Image.SCALE_SMOOTH);
|
||||
btnNewTournament.setIcon(new ImageIcon(newimg));
|
||||
|
||||
for (JToggleButton component : filterButtons) {
|
||||
component.setFont(GUISizeHelper.menuFont);
|
||||
}
|
||||
Dimension newDimension = new Dimension((int) jPanelBottom.getPreferredSize().getWidth(), GUISizeHelper.menuFont.getSize() + 28);
|
||||
jPanelBottom.setMinimumSize(newDimension);
|
||||
jPanelBottom.setPreferredSize(newDimension);
|
||||
jButtonFooterNext.setFont(GUISizeHelper.menuFont);
|
||||
jLabelFooterLabel.setFont(new Font(GUISizeHelper.menuFont.getName(), Font.BOLD, GUISizeHelper.menuFont.getSize()));
|
||||
jLabelFooterText.setFont(GUISizeHelper.menuFont);
|
||||
}
|
||||
|
||||
private void saveDividerLocations() {
|
||||
|
@ -509,8 +527,8 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
this.jPanelBottom.setVisible(false);
|
||||
} else {
|
||||
this.jPanelBottom.setVisible(true);
|
||||
this.jLabel2.setText(serverMessages.get(0));
|
||||
this.jButtonNext.setVisible(serverMessages.size() > 1);
|
||||
this.jLabelFooterText.setText(serverMessages.get(0));
|
||||
this.jButtonFooterNext.setVisible(serverMessages.size() > 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -684,9 +702,9 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
tableCompleted = new javax.swing.JTable();
|
||||
chatPanelMain = new mage.client.table.PlayersChatPanel();
|
||||
jPanelBottom = new javax.swing.JPanel();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
jButtonNext = new javax.swing.JButton();
|
||||
jButtonFooterNext = new javax.swing.JButton();
|
||||
jLabelFooterLabel = new javax.swing.JLabel();
|
||||
jLabelFooterText = new javax.swing.JLabel();
|
||||
|
||||
setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
|
@ -1092,7 +1110,7 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
);
|
||||
jPanelTablesLayout.setVerticalGroup(
|
||||
jPanelTablesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jSplitPaneTables, javax.swing.GroupLayout.DEFAULT_SIZE, 643, Short.MAX_VALUE)
|
||||
.addComponent(jSplitPaneTables, javax.swing.GroupLayout.DEFAULT_SIZE, 672, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
jSplitPane1.setLeftComponent(jPanelTables);
|
||||
|
@ -1107,45 +1125,29 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
add(jSplitPane1, gridBagConstraints);
|
||||
|
||||
jPanelBottom.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
|
||||
jPanelBottom.setPreferredSize(new java.awt.Dimension(664, 39));
|
||||
jPanelBottom.setPreferredSize(new java.awt.Dimension(516, 37));
|
||||
jPanelBottom.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
|
||||
|
||||
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
|
||||
jLabel1.setText("Message of the Day:");
|
||||
jLabel1.setAlignmentY(0.3F);
|
||||
|
||||
jLabel2.setText("You are playing Mage version 0.7.5. Welcome! -- Mage dev team --");
|
||||
|
||||
jButtonNext.setText("Next");
|
||||
jButtonNext.setMaximumSize(new java.awt.Dimension(55, 25));
|
||||
jButtonNext.setMinimumSize(new java.awt.Dimension(55, 25));
|
||||
jButtonNext.setPreferredSize(new java.awt.Dimension(55, 25));
|
||||
jButtonNext.addActionListener(new java.awt.event.ActionListener() {
|
||||
jButtonFooterNext.setText("Next");
|
||||
jButtonFooterNext.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
jButtonFooterNext.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||
jButtonFooterNext.setOpaque(false);
|
||||
jButtonFooterNext.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jButtonNextActionPerformed(evt);
|
||||
jButtonFooterNextActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
jPanelBottom.add(jButtonFooterNext);
|
||||
|
||||
javax.swing.GroupLayout jPanelBottomLayout = new javax.swing.GroupLayout(jPanelBottom);
|
||||
jPanelBottom.setLayout(jPanelBottomLayout);
|
||||
jPanelBottomLayout.setHorizontalGroup(
|
||||
jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanelBottomLayout.createSequentialGroup()
|
||||
.addComponent(jButtonNext, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 1350, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
jPanelBottomLayout.setVerticalGroup(
|
||||
jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanelBottomLayout.createSequentialGroup()
|
||||
.addGroup(jPanelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jButtonNext, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(jLabel1))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
jLabelFooterLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
|
||||
jLabelFooterLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
jLabelFooterLabel.setText("Message of the Day:");
|
||||
jLabelFooterLabel.setAlignmentY(0.3F);
|
||||
jPanelBottom.add(jLabelFooterLabel);
|
||||
|
||||
jLabelFooterText.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
jLabelFooterText.setText("You are playing Mage version 0.7.5. Welcome! -- Mage dev team --");
|
||||
jPanelBottom.add(jLabelFooterText);
|
||||
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridy = 2;
|
||||
|
@ -1193,17 +1195,17 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
newTableDialog.showDialog(roomId);
|
||||
}//GEN-LAST:event_btnNewTableActionPerformed
|
||||
|
||||
private void jButtonNextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNextActionPerformed
|
||||
private void jButtonFooterNextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonFooterNextActionPerformed
|
||||
synchronized (this) {
|
||||
if (messages != null && !messages.isEmpty()) {
|
||||
currentMessage++;
|
||||
if (currentMessage >= messages.size()) {
|
||||
currentMessage = 0;
|
||||
}
|
||||
this.jLabel2.setText(messages.get(currentMessage));
|
||||
this.jLabelFooterText.setText(messages.get(currentMessage));
|
||||
}
|
||||
}
|
||||
}//GEN-LAST:event_jButtonNextActionPerformed
|
||||
}//GEN-LAST:event_jButtonFooterNextActionPerformed
|
||||
|
||||
private void btnFilterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFilterActionPerformed
|
||||
setTableFilter();
|
||||
|
@ -1248,9 +1250,9 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
private mage.client.table.PlayersChatPanel chatPanelMain;
|
||||
private javax.swing.JToolBar filterBar1;
|
||||
private javax.swing.JToolBar filterBar2;
|
||||
private javax.swing.JButton jButtonNext;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JButton jButtonFooterNext;
|
||||
private javax.swing.JLabel jLabelFooterLabel;
|
||||
private javax.swing.JLabel jLabelFooterText;
|
||||
private javax.swing.JPanel jPanelBottom;
|
||||
private javax.swing.JPanel jPanelTables;
|
||||
private javax.swing.JPanel jPanelTop;
|
||||
|
|
Loading…
Reference in a new issue