reformatted chat panel and game message - you can now see both areas at the same time

This commit is contained in:
BetaSteward 2011-09-25 21:53:27 -04:00
parent 40ff3f2a0e
commit 835879fe78
3 changed files with 43 additions and 47 deletions

View file

@ -16,14 +16,14 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="txtMessage" alignment="1" pref="168" max="32767" attributes="0"/> <Component id="txtMessage" alignment="0" pref="183" max="32767" attributes="0"/>
<Component id="jTabbedPane1" alignment="1" pref="168" max="32767" attributes="0"/> <Component id="jSplitPane1" alignment="0" pref="183" 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">
<Group type="102" alignment="1" attributes="0"> <Group type="102" alignment="1" attributes="0">
<Component id="jTabbedPane1" pref="294" max="32767" attributes="0"/> <Component id="jSplitPane1" pref="288" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="txtMessage" min="-2" pref="25" max="-2" attributes="0"/> <Component id="txtMessage" min="-2" pref="25" max="-2" attributes="0"/>
</Group> </Group>
@ -36,25 +36,21 @@
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtMessageKeyTyped"/> <EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtMessageKeyTyped"/>
</Events> </Events>
</Component> </Component>
<Container class="javax.swing.JTabbedPane" name="jTabbedPane1"> <Container class="javax.swing.JSplitPane" name="jSplitPane1">
<Properties> <Properties>
<Property name="tabPlacement" type="int" value="3"/> <Property name="orientation" type="int" value="0"/>
<Property name="resizeWeight" type="double" value="0.8"/>
</Properties> </Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="chat"/>
</AccessibilityProperties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/> <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">
<AuxValues> <AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues> </AuxValues>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="chat"> <JSplitPaneConstraints position="left"/>
<Property name="tabTitle" type="java.lang.String" value="chat"/>
</JTabbedPaneConstraints>
</Constraint> </Constraint>
</Constraints> </Constraints>
@ -79,10 +75,8 @@
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues> </AuxValues>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="players"> <JSplitPaneConstraints position="bottom"/>
<Property name="tabTitle" type="java.lang.String" value="players"/>
</JTabbedPaneConstraints>
</Constraint> </Constraint>
</Constraints> </Constraints>

View file

@ -257,11 +257,9 @@ class TableModel extends AbstractTableModel {
private void initComponents() { private void initComponents() {
txtMessage = new javax.swing.JTextField(); txtMessage = new javax.swing.JTextField();
jTabbedPane1 = new javax.swing.JTabbedPane(); jSplitPane1 = new javax.swing.JSplitPane();
jScrollPane1 = new javax.swing.JScrollPane(); jScrollPane1 = new javax.swing.JScrollPane();
//txtConversation = new JTextArea();
txtConversation = new ColorPane(); txtConversation = new ColorPane();
//txtConversation = new JTextPane();
jScrollPane2 = new javax.swing.JScrollPane(); jScrollPane2 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable(); jTable1 = new javax.swing.JTable();
@ -271,45 +269,43 @@ class TableModel extends AbstractTableModel {
} }
}); });
jTabbedPane1.setTabPlacement(javax.swing.JTabbedPane.BOTTOM); jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
jSplitPane1.setResizeWeight(0.25);
//txtConversation.setColumns(20); // txtConversation.setColumns(20);
txtConversation.setOpaque(false); txtConversation.setOpaque(false);
//txtConversation.setEditable(false); // txtConversation.setEditable(false);
txtConversation.setFont(new java.awt.Font("Arial", 0, 14)); txtConversation.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
//txtConversation.enableInputMethods(false); // txtConversation.setLineWrap(true);
//txtConversation.setLineWrap(true); // txtConversation.setRows(5);
//txtConversation.setRows(5); // txtConversation.setWrapStyleWord(true);
//txtConversation.setWrapStyleWord(true);
jScrollPane1.setViewportView(txtConversation); jScrollPane1.setViewportView(txtConversation);
jScrollPane1.setBorder(new EmptyBorder(0,0,0,0)); jScrollPane1.setBorder(new EmptyBorder(0,0,0,0));
jTabbedPane1.addTab("chat", jScrollPane1); jSplitPane1.setLeftComponent(jScrollPane2);
jTable1.setModel(this.tableModel); jTable1.setModel(this.tableModel);
jTable1.setToolTipText("Connected players"); jTable1.setToolTipText("Connected players");
jTable1.setGridColor(new java.awt.Color(255, 255, 255)); jTable1.setGridColor(new java.awt.Color(255, 255, 255));
jScrollPane2.setViewportView(jTable1); jScrollPane2.setViewportView(jTable1);
jTabbedPane1.addTab("players", jScrollPane2); jSplitPane1.setBottomComponent(jScrollPane1);
jSplitPane1.setDividerLocation(150 + jSplitPane1.getInsets().bottom);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtMessage, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE) .addComponent(txtMessage, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
.addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE) .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
); );
layout.setVerticalGroup( layout.setVerticalGroup(
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(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE) .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 288, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(txtMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
); );
jTabbedPane1.getAccessibleContext().setAccessibleName("chat");
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
private void simplifyComponents() { private void simplifyComponents() {
@ -327,7 +323,7 @@ class TableModel extends AbstractTableModel {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(txtMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
); );
jTabbedPane1 = null;
jTable1 = null; jTable1 = null;
jScrollPane2 = null; jScrollPane2 = null;
} }
@ -376,10 +372,9 @@ class TableModel extends AbstractTableModel {
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTabbedPane jTabbedPane1; private javax.swing.JSplitPane jSplitPane1;
private javax.swing.JTable jTable1; private javax.swing.JTable jTable1;
//private javax.swing.JTextArea txtConversation; private ColorPane txtConversation;
private ColorPane txtConversation;
private javax.swing.JTextField txtMessage; private javax.swing.JTextField txtMessage;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables

View file

@ -590,7 +590,8 @@ public class GamePanel extends javax.swing.JPanel {
userChatPanel.useExtendedView(ChatPanel.VIEW_MODE.CHAT); userChatPanel.useExtendedView(ChatPanel.VIEW_MODE.CHAT);
gameChatPanel.setConnectedChat(userChatPanel); gameChatPanel.setConnectedChat(userChatPanel);
gameChatPanel.disableInput(); gameChatPanel.disableInput();
jTabbedPane1 = new JTabbedPane(); // jTabbedPane1 = new JTabbedPane();
jSplitPane2 = new javax.swing.JSplitPane();
hand.setCardDimension(getHandCardDimension()); hand.setCardDimension(getHandCardDimension());
handCards = new HashMap<String, SimpleCardsView>(); handCards = new HashMap<String, SimpleCardsView>();
@ -859,10 +860,15 @@ public class GamePanel extends javax.swing.JPanel {
hand.setZone(Constants.Zone.HAND.toString()); hand.setZone(Constants.Zone.HAND.toString());
HandContainer handContainer = new HandContainer(hand); HandContainer handContainer = new HandContainer(hand);
jTabbedPane1.setTabPlacement(javax.swing.JTabbedPane.BOTTOM); jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
jTabbedPane1.addTab("Game", gameChatPanel); jSplitPane2.setResizeWeight(0.5);
jTabbedPane1.addTab("Chat", userChatPanel); jSplitPane2.setLeftComponent(userChatPanel);
jTabbedPane1.setSelectedIndex(1); jSplitPane2.setBottomComponent(gameChatPanel);
// jTabbedPane1.setTabPlacement(javax.swing.JTabbedPane.BOTTOM);
// jTabbedPane1.addTab("Game", gameChatPanel);
// jTabbedPane1.addTab("Chat", userChatPanel);
// jTabbedPane1.setSelectedIndex(1);
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout); jPanel3.setLayout(jPanel3Layout);
@ -891,7 +897,7 @@ public class GamePanel extends javax.swing.JPanel {
jSplitPane1.setLeftComponent(jPanel3); jSplitPane1.setLeftComponent(jPanel3);
gameChatPanel.setMinimumSize(new java.awt.Dimension(100, 48)); gameChatPanel.setMinimumSize(new java.awt.Dimension(100, 48));
jSplitPane1.setRightComponent(jTabbedPane1); jSplitPane1.setRightComponent(jSplitPane2);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout); this.setLayout(layout);
@ -1070,7 +1076,8 @@ public class GamePanel extends javax.swing.JPanel {
private Map<String, SimpleCardsView> handCards; private Map<String, SimpleCardsView> handCards;
private mage.client.cards.Cards stack; private mage.client.cards.Cards stack;
private JTabbedPane jTabbedPane1; // private JTabbedPane jTabbedPane1;
private javax.swing.JSplitPane jSplitPane2;
private Border emptyBorder = new EmptyBorder(0,0,0,0); private Border emptyBorder = new EmptyBorder(0,0,0,0);
private Color prevBGColor; private Color prevBGColor;
private final static Color DEFAULT_FOREGROUND_COLOR = Color.BLACK; private final static Color DEFAULT_FOREGROUND_COLOR = Color.BLACK;