/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package grafikchat.view;
/**
*
* @author marian
*/
public class ChatView extends javax.swing.JFrame {
/**
* @return the rbClient
*/
public javax.swing.JRadioButton getRbClient() {
return rbClient;
}
/**
* @return the rbServer
*/
public javax.swing.JRadioButton getRbServer() {
return rbServer;
}
/**
* @return the btConnect
*/
public javax.swing.JButton getBtConnect() {
return btConnect;
}
/**
* @return the lbIP
*/
public javax.swing.JLabel getLbIP() {
return lbIP;
}
/**
* @return the lbPort
*/
public javax.swing.JLabel getLbPort() {
return lbPort;
}
/**
* @return the tfIP
*/
public javax.swing.JTextField getTfIP() {
return tfIP;
}
/**
* @return the tfPort
*/
public javax.swing.JTextField getTfPort() {
return tfPort;
}
/**
* Creates new form ChatView
*/
public ChatView() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// //GEN-BEGIN:initComponents
private void initComponents() {
bgSelect = new javax.swing.ButtonGroup();
tfPort = new javax.swing.JTextField();
lbPort = new javax.swing.JLabel();
lbIP = new javax.swing.JLabel();
tfIP = new javax.swing.JTextField();
btConnect = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
rbClient = new javax.swing.JRadioButton();
rbServer = new javax.swing.JRadioButton();
gvDrawPane = new grafikchat.view.GrafikView();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
tfPort.setText("3210");
tfPort.setToolTipText("");
lbPort.setText("Port:");
lbPort.setToolTipText("");
lbIP.setText("IP:");
tfIP.setText("127.0.0.1");
btConnect.setText("connect");
btConnect.setToolTipText("");
bgSelect.add(rbClient);
rbClient.setSelected(true);
rbClient.setText("Client");
bgSelect.add(rbServer);
rbServer.setText("Server");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(gvDrawPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(rbClient, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(215, 215, 215))
.addComponent(jSeparator1)
.addGroup(layout.createSequentialGroup()
.addComponent(lbPort)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tfPort, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbIP)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tfIP, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btConnect))
.addGroup(layout.createSequentialGroup()
.addComponent(rbServer)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(rbClient)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(rbServer)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lbPort)
.addComponent(tfPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(tfIP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lbIP)
.addComponent(btConnect))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(gvDrawPane, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// //GEN-END:initComponents
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ChatView().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup bgSelect;
private javax.swing.JButton btConnect;
private grafikchat.view.GrafikView gvDrawPane;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JLabel lbIP;
private javax.swing.JLabel lbPort;
private javax.swing.JRadioButton rbClient;
private javax.swing.JRadioButton rbServer;
private javax.swing.JTextField tfIP;
private javax.swing.JTextField tfPort;
// End of variables declaration//GEN-END:variables
/**
* @return the gvDrawPane
*/
public grafikchat.view.GrafikView getGvDrawPane() {
return gvDrawPane;
}
}