Skip to content

Commit

Permalink
test chems
Browse files Browse the repository at this point in the history
  • Loading branch information
ElyesKhama committed Dec 22, 2017
1 parent 15264c8 commit 3222e3b
Show file tree
Hide file tree
Showing 11 changed files with 252 additions and 235 deletions.
48 changes: 32 additions & 16 deletions src/GraphiquePackage/FichCom.form
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,26 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" pref="120" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="msgWrote" min="-2" pref="175" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" pref="120" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="21" max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace pref="93" max="32767" attributes="0"/>
<EmptySpace pref="37" max="32767" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="89" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand All @@ -45,12 +51,14 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="83" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="48" max="32767" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" pref="148" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" pref="148" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="39" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="msgWrote" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="82" max="-2" attributes="0"/>
<EmptySpace pref="40" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand Down Expand Up @@ -84,5 +92,13 @@
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JTextField" name="msgWrote">
<Properties>
<Property name="text" type="java.lang.String" value="Ecrire message..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="msgWroteActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
60 changes: 43 additions & 17 deletions src/GraphiquePackage/FichCom.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
package GraphiquePackage;

import SourcePackage.Main;

/**
*
* @author elyes
Expand All @@ -14,9 +16,13 @@ public class FichCom extends javax.swing.JDialog {
/**
* Creates new form FichCom
*/
public FichCom(java.awt.Dialog parent, boolean modal) {

private static int portDest;

public FichCom(java.awt.Dialog parent, boolean modal, int port ) {
super(parent, modal);
initComponents();
portDest = port ;
}

/**
Expand All @@ -32,6 +38,7 @@ private void initComponents() {
jButton1 = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
listMsg = new javax.swing.JTextArea();
msgWrote = new javax.swing.JTextField();

setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

Expand All @@ -48,42 +55,60 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
listMsg.setRows(5);
jScrollPane1.setViewportView(listMsg);

msgWrote.setText("Ecrire message...");
msgWrote.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
msgWroteActionPerformed(evt);
}
});

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(32, 32, 32)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addGap(24, 24, 24)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(30, 30, 30)
.addComponent(jButton1)))
.addContainerGap(93, Short.MAX_VALUE))
.addContainerGap()
.addComponent(msgWrote, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(32, 32, 32)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE)
.addComponent(jButton1)
.addGap(89, 89, 89))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(83, 83, 83)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 48, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGap(26, 26, 26)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(39, 39, 39)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(82, 82, 82))
.addComponent(msgWrote, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(40, Short.MAX_VALUE))
);

pack();
}// </editor-fold>//GEN-END:initComponents

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed



Main.user.sendMessageTCP(msgWrote.getText(),"", portDest,false);
this.listMsg.setText(listMsg.getText().concat("\n \t "+ msgWrote.getText()));
}//GEN-LAST:event_jButton1ActionPerformed

private void msgWroteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_msgWroteActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_msgWroteActionPerformed

/**
* @param args the command line arguments
*/
Expand Down Expand Up @@ -115,7 +140,7 @@ public static void main(String args[]) {
/* Create and display the dialog */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
FichCom dialog = new FichCom(new javax.swing.JDialog(), true);
FichCom dialog = new FichCom(new javax.swing.JDialog(), true, 0);
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent e) {
Expand All @@ -138,5 +163,6 @@ public void setListMsg(String msg){
private javax.swing.JLabel jLabel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea listMsg;
private javax.swing.JTextField msgWrote;
// End of variables declaration//GEN-END:variables
}
53 changes: 28 additions & 25 deletions src/GraphiquePackage/FichMenu.form
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,35 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="MonPseudo" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="670" max="32767" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="listUser" max="32767" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="44" pref="44" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="MonPseudo" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="658" max="32767" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="listUser" max="32767" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="44" pref="44" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="jTextField1" min="-2" pref="223" max="-2" attributes="0"/>
<Component id="pseudoEntry" min="-2" pref="223" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
</Group>
</Group>
Expand All @@ -71,13 +72,15 @@
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" pref="26" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="36" max="-2" attributes="0"/>
<Component id="jTextField1" min="-2" pref="55" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="pseudoEntry" min="-2" pref="55" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="listUser" min="-2" pref="263" max="-2" attributes="0"/>
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="130" max="32767" attributes="0"/>
<EmptySpace pref="198" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand Down Expand Up @@ -125,12 +128,12 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="jTextField1">
<Component class="javax.swing.JTextField" name="pseudoEntry">
<Properties>
<Property name="text" type="java.lang.String" value="A qui parler ? entrer pseudo"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField1ActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pseudoEntryActionPerformed"/>
</Events>
</Component>
</SubComponents>
Expand Down
Loading

0 comments on commit 3222e3b

Please sign in to comment.