Скачиваний:
16
Добавлен:
01.05.2014
Размер:
110.26 Кб
Скачать
package ic.gui;

import javax.swing.*;
import ic.core.*;
import java.util.*;
import javax.swing.JTabbedPane;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JComponent;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.KeyEvent;

import java.awt.Image;
/*
* MainFrame.java
*
* Created on April 19, 2007, 11:38 PM
*/

/**
*
* @author adm
*/
public class HumanBeings extends javax.swing.JFrame {
//HumanBeings hb = null;
Human h = null;
String []model = null;
String []fmodel = null;
IProvider []providers = null;

String []iPModel = null;
String []iCTypeModel = null;
String []iCSpeedModel = null;


IProvider currProv = null;
IConnection.ConnectionType currConnectionType = null;
float currCSpeed = 0;
IConnection currConnection = null;
boolean readyToConnect = false;

float specPrice =0;
//ButtonGroup buttonGroupSoftPackages = null;
//JButton jButton7, jButton8;
/** Creates new form MainFrame */
protected static ImageIcon createImageIcon(String path) {
java.net.URL imgURL = HumanBeings.class.getResource(path);
if (imgURL != null) {
return new ImageIcon(imgURL);
} else {
System.err.println("Couldn't find file: " + path);
return null;
}
}

public HumanBeings() {
initComponents();
//ImageIcon icon = createImageIcon("images\\yo.gif");

setIconImage(java.awt.Toolkit.getDefaultToolkit().getImage("images\\yo.gif"));

buttonGroupCash.add(jRadioButton500);
buttonGroupCash.add(jRadioButton1000);
buttonGroupCash.add(jRadioButton5000);

buttonGroupSoftPackages.add(jRadioButtonS20);
buttonGroupSoftPackages.add(jRadioButtonS100);
buttonGroupSoftPackages.add(jRadioButtonS500);

/*jButtonSInstallSoftware.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonSInstallSoftwareMouseClicked(evt);
}
});
*/


jRadioButtonS20.setSelected(true);
jRadioButton500.setSelected(true);
updateAllInfo();
createComputersCombo();
createFurnitureCombo();
generateProviders();
}

public void updateAllInfo() {
updateComputerInfo();
updateHumanInfo();
updateFurnitureInfo();
updateSoftwareInfo();
updateInternetInfo();
updateStatusInfo();
}

public void updateStatusInfo() {
int count =0;
if(h==null) {
jLabelSStatus.setText("INCOMPLETE");

jLabelSComputer.setText("---");
jLabelSSoftware.setText("---");
jLabelSSoftwareInstalled.setText("---");
jLabelSFurniture.setText("---");
jLabelSInetConnection.setText("---");
return;
}
if(h.getPC()!=null) {
jLabelSComputer.setText(h.getPC().getName());
count++;
if(h.getPC().getSoftwarePackage() != null) {
jLabelSSoftware.setText(h.getPC().getSoftwarePackage().getOSName()+
" + "+h.getPC().getSoftwarePackage().getOfficeName());
count ++;
if(h.getPC().getSoftwarePackage().getInstalled().equalsIgnoreCase("YES")) {
jLabelSSoftwareInstalled.setText(h.getPC().getSoftwarePackage().getInstalledBy());
count++;
if(h.getIConnection()!=null || h.getIConnection() != null) {
jLabelSInetConnection.setText(h.getIConnection().getConnectionType() +
" / " +h.getIConnection().getSpeed()+" K");
count++;
}
else jLabelSInetConnection.setText("---");
}
else {
jLabelSInetConnection.setText("---");
jLabelSSoftwareInstalled.setText("---");
}
}
else {
jLabelSSoftware.setText("---");
jLabelSSoftwareInstalled.setText("---");
jLabelSInetConnection.setText("---");
}
}
else {
jLabelSComputer.setText("---");
jLabelSSoftware.setText("---");
jLabelSSoftwareInstalled.setText("---");
jLabelSInetConnection.setText("---");
}
if(h.getFurniture()!=null) {
jLabelSFurniture.setText(h.getFurniture().getName());
count++;
}
else
jLabelSFurniture.setText("---");

if(count >=5)
jLabelSStatus.setText("COMPLETE");
else
jLabelSStatus.setText("INCOMPLETE");
}

public void generateProviders() {
String []pnames = {"Web ", "Info ", "Alfa ", "Tele"};
String []plnames = {" Plus", " Tel", " Super", " Plus"};
providers = new IProvider[(int)(Math.random()*100)];
for (int i =0; i<providers.length; i++) {
providers[i] = new IProvider(
pnames[(int)(Math.random()*100%4)]+plnames[(int)(Math.random()*100%4)]
);
}

IConnection.ConnectionType []ctypes= new IConnection.ConnectionType[4];
ctypes[0] = IConnection.ConnectionType.ADSL;
ctypes[1] = IConnection.ConnectionType.dialup;
ctypes[2] = IConnection.ConnectionType.network;
ctypes[3] = IConnection.ConnectionType.sattelite;

float [] cspeeds = {1024, 512, 256,128,64};
float [] coeffs = {200, 100, 50, 30, 20};

for(int i =0; i<providers.length; i++ ) {
for(int j=0; j<ctypes.length; j++) {
for(int k =0; k<cspeeds.length; k++) {

IConnection icc= new IConnection(
cspeeds[k],
(float)(coeffs[k]*(1+Math.random()) ),
ctypes[j]);
providers[i].addPricePosition(icc);
}
}
}
}

public void generateICCombos() {
iPModel = new String [providers.length];
U.log("-----------------------------------------");
for(int i =0; i< providers.length; i++) {
iPModel[i] = providers[i].getName();
U.log(providers[i].getName());
}

//String []iCTypeModel = null;
//String []iCSpeedModel = null;
jComboBoxICProvider.setModel(new DefaultComboBoxModel(iPModel));
jComboBoxICType.setEnabled(false);
jComboBoxICSpeed.setEnabled(false);
}
public void generateIConnTypes() {
String prov= (String)jComboBoxICProvider.getSelectedItem();
IProvider iprov = null;
for(int i=0; i<providers.length; i++) {
if(providers[i].getName().equalsIgnoreCase(prov)) {
iprov = providers[i];
break;
}
}
if(iprov == null) {
JOptionPane.showMessageDialog(this, "CANNOT FIND PROVIDER with such name: "+prov, "Provider not found!",
JOptionPane.ERROR_MESSAGE);
return;
}
currProv = iprov;

iCTypeModel = new String[]{"sattelite", "ADSL", "dialup", "network"};

jComboBoxICProvider.setEnabled(false);
jComboBoxICType.setModel(new DefaultComboBoxModel(iCTypeModel));
jComboBoxICType.setEnabled(true);
}

public void generateIConnSpeeds() {
String type= (String)jComboBoxICType.getSelectedItem();
IConnection.ConnectionType cont;
if(type.equalsIgnoreCase("sattelite")) {
cont = IConnection.ConnectionType.sattelite;
}else
if(type.equalsIgnoreCase("ADSL")) {
cont = IConnection.ConnectionType.ADSL;
}else
if(type.equalsIgnoreCase("dialup")) {
cont = IConnection.ConnectionType.dialup;
}else
if(type.equalsIgnoreCase("network")) {
cont = IConnection.ConnectionType.network;
}else {
cont = IConnection.ConnectionType.ADSL;
JOptionPane.showMessageDialog(this, "CANNOT FIND CONNECTION TYPE with such name: "+type,
"Connection type not found!",
JOptionPane.ERROR_MESSAGE);
}
//1024, 512, 256,128,64
iCSpeedModel = new String[] {"1024", "512", "256","128","64"};
jComboBoxICType.setEnabled(false);
jComboBoxICSpeed.setModel(new DefaultComboBoxModel(iCSpeedModel));
jComboBoxICSpeed.setEnabled(true);
currConnectionType = cont;
}
public void generateIMonthFee() {
String speed= (String)jComboBoxICSpeed.getSelectedItem();
this.currCSpeed = (new Float(speed)).floatValue();
jComboBoxICSpeed.setEnabled(false);

HashMap hm = currProv.getPriceList();
Iterator it = hm.keySet().iterator();


float monthFee=0;
U.log("+++++++++++++++++++++++++++++++++++++++++++++++++++++");
while(it.hasNext()) {

IConnection ico = (IConnection)hm.get(it.next());
U.log("ico: type"+ico.getConnectionType().toString()+" fee"+ico.getMonthFee()+"speed"+ico.getSpeed());
if( ico.getConnectionType().toString().equalsIgnoreCase(currConnectionType.toString()) ) {
if( Math.abs(ico.getSpeed()-currCSpeed) < 0.1) {
monthFee = ico.getMonthFee();
currConnection=ico;
break;
}
}
}

//currConnection = (IConnection)hm.get(jComboBoxICProvider.)
jTextFieldMonthFee.setText(""+monthFee+"$");
jComboBoxICSpeed.setEnabled(false);
readyToConnect = true;
jButtonDialogBuyConnection.setEnabled(true);
}
public void createFurnitureCombo() {
if(fmodel != null)
return;
FurnitureSalesCompany []comps = new FurnitureSalesCompany[(int)(Math.random()*100)];
String [] cnames = {"Rim Mebel", "Ultramebel", "Euromebel", "Avalon", "Mebel City",
"Mebelko", "Furni", "iFurniture", "Funiture", "Doors", "Rooms", "Great Mebel",
"Smart Furniture", "Furniture Hell"};
String [] hipcs = {"H Galant", "H Elite", "H Ultra" };
String [] midpcs = {"M Avalant", "M Dub", "M Kiparis", "M Elite Lite" };
String [] lowpcs = {"L Prestige", "L Econom", "L Interier", "L Moda" };

for(int i = 0; i< comps.length; i++) {
comps[i] = new FurnitureSalesCompany(cnames[(int)(Math.random()*100)%14]);
comps[i].addPriceValue(hipcs[(int)(Math.random()*100)%3], (float)(Math.random())*1000);
comps[i].addPriceValue(midpcs[(int)(Math.random()*100)%4], (float)(Math.random())*750);
comps[i].addPriceValue(lowpcs[(int)(Math.random()*100)%4], (float)(Math.random())*500);
}


for(int i =0; i<comps.length; i++) {
//U.log(comps[i].getName()+"");
}

fmodel = new String[comps.length*3];
for(int i =0; i<comps.length; i++) {
HashMap hm = comps[i].getPrice();
Set<String> keys = hm.keySet();
Iterator it = keys.iterator();
String s = (String)it.next();
fmodel[i*3]= s+" = "+((Float)hm.get(s)).floatValue()+" - "+comps[i].getName();
s = (String)it.next();
fmodel[i*3+1]= s+" = "+((Float)hm.get(s)).floatValue()+" - "+comps[i].getName();
s = (String)it.next();
fmodel[i*3+2]= s+" = "+((Float)hm.get(s)).floatValue()+" - "+comps[i].getName();
}

jComboBoxFurniture.setModel(new DefaultComboBoxModel(fmodel));

//for(int i =0; i<model.length; i++) { U.log(model[i]); }
}

public void createComputersCombo() {
if(model != null)
return;
ComputerSalesCompany []comps = new ComputerSalesCompany[(int)(Math.random()*100)];
String [] cnames = {"RIC inc.", "Ultracomp", "Euroset", "Key", "Computer World",
"MC-Art", "Svyaznoi", "Mobile things", "SVEGA", "INSEL", "RIM", "320-8080",
"Digits", "PC Hell"};
String [] hipcs = {"H Core2Quad", "H AMD X4", "H Mac G7" };
String [] midpcs = {"M AMD X2", "M AMD 64", "M Core2Duo", "M Centrino" };
String [] lowpcs = {"L AMD 64", "L AMD Sempron", "L IP4", "L Celeron D" };

for(int i = 0; i< comps.length; i++) {
comps[i] = new ComputerSalesCompany(cnames[(int)(Math.random()*100)%14]);
comps[i].addPriceValue(hipcs[(int)(Math.random()*100)%3], (float)(Math.random())*10000);
comps[i].addPriceValue(midpcs[(int)(Math.random()*100)%4], (float)(Math.random())*5000);
comps[i].addPriceValue(lowpcs[(int)(Math.random()*100)%4], (float)(Math.random())*1000);
}
double dd = Math.random()*100;

for(int i =0; i<comps.length; i++) {
//U.log(comps[i].getName()+"");
}
model = new String[comps.length*3];
for(int i =0; i<comps.length; i++) {
HashMap hm = comps[i].getPrice();
Set<String> keys = hm.keySet();
Iterator it = keys.iterator();
String s = (String)it.next();
model[i*3]= s+" = "+((Float)hm.get(s)).floatValue()+" - "+comps[i].getName();
s = (String)it.next();
model[i*3+1]= s+" = "+((Float)hm.get(s)).floatValue()+" - "+comps[i].getName();
s = (String)it.next();
model[i*3+2]= s+" = "+((Float)hm.get(s)).floatValue()+" - "+comps[i].getName();
}

jComboBoxComputers.setModel(new DefaultComboBoxModel(model));

//for(int i =0; i<model.length; i++) { U.log(model[i]); }
}

public void updateInternetInfo() {
if(h==null || h.getPC() ==null || h.getPC().getSoftwarePackage() == null
|| h.getIProvider() == null || h.getIConnection() ==null) {
jLabelIConnected.setText("NO");
jLabelIConnectionSpeed.setText("0");
jLabelIConnectionType.setText("---");
jLabelIMonthFee.setText("0");
jLabelIProviderName.setText("---");

}
else {
jLabelIConnected.setText("YES");
jLabelIConnectionSpeed.setText(h.getIConnection().getSpeed()+" Kb/ps");
jLabelIConnectionType.setText(h.getIConnection().getConnectionType()+"");
jLabelIMonthFee.setText(h.getIConnection().getMonthFee()+"");
jLabelIProviderName.setText(h.getIProvider().getName());
}

}
public void updateSoftwareInfo() {
if(h==null || h.getPC() ==null || h.getPC().getSoftwarePackage() == null) {
jLabelSPackage.setText("---");
jLabelSInstalled.setText("---");
jLabelSInstalledBy.setText("---");
jLabelSOffice.setText("---");
jLabelSOperationSystem.setText("---");
jLabelSPrice.setText("---");
}
else {
SoftwarePackage sp = h.getPC().getSoftwarePackage();
jLabelSPackage.setText(sp.getName());
jLabelSInstalled.setText(sp.getInstalled());
jLabelSInstalledBy.setText(sp.getInstalledBy());
jLabelSOffice.setText(sp.getOfficeName());
jLabelSOperationSystem.setText(sp.getOSName());
jLabelSPrice.setText(sp.getPrice()+"");
}
}

public void updateComputerInfo() {
if(h==null || h.getPC() ==null) {
jLabelCComputer.setText("---");
jLabelCCost.setText("---");
jLabelCProductivity.setText("---");
jLabelCSeller.setText("---");
}
else {
jLabelCComputer.setText(h.getPC().getName());
jLabelCCost.setText(""+h.getPC().getPrice());
jLabelCProductivity.setText(""+h.getPC().getProductivity());
jLabelCSeller.setText(h.getPC().getSeller());
}


}

public void updateFurnitureInfo() {
if(h==null || h.getFurniture() ==null) {
jLabelFName.setText("---");
jLabelFComfort.setText("---");
jLabelFPrice.setText("---");
jLabelFSeller.setText("---");
}
else {
jLabelFName.setText(h.getFurniture().getName());
jLabelFComfort.setText(""+h.getFurniture().getBeauty());
jLabelFPrice.setText(""+h.getFurniture().getPrice());
jLabelFSeller.setText(h.getFurniture().getSeller());
}
}
/** 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.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
jDialogNewHuman = new javax.swing.JDialog();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jTextFieldName = new javax.swing.JTextField();
jRadioButton500 = new javax.swing.JRadioButton();
jRadioButton1000 = new javax.swing.JRadioButton();
jRadioButton5000 = new javax.swing.JRadioButton();
jLabel4 = new javax.swing.JLabel();
buttonGroupCash = new javax.swing.ButtonGroup();
jLabel8 = new javax.swing.JLabel();
jDialogBuySoftware = new javax.swing.JDialog();
jRadioButtonS20 = new javax.swing.JRadioButton();
jRadioButtonS100 = new javax.swing.JRadioButton();
jRadioButtonS500 = new javax.swing.JRadioButton();
jLabel35 = new javax.swing.JLabel();
jLabel36 = new javax.swing.JLabel();
jButtonSoftHouseBuy = new javax.swing.JButton();
jButtonSoftHouseCancel = new javax.swing.JButton();
buttonGroupSoftPackages = new javax.swing.ButtonGroup();
jDialogInstallSoftware = new javax.swing.JDialog();
jButtonSIBySpecialist = new javax.swing.JButton();
jButtonSICancel = new javax.swing.JButton();
jLabel38 = new javax.swing.JLabel();
jLabel39 = new javax.swing.JLabel();
jLabelSoftInfoOnDialog = new javax.swing.JLabel();
jLabel40 = new javax.swing.JLabel();
jButtonSIByMyself = new javax.swing.JButton();
jLabel41 = new javax.swing.JLabel();
jLabel42 = new javax.swing.JLabel();
jLabelSISpecPrice = new javax.swing.JLabel();
buttonGroup1 = new javax.swing.ButtonGroup();
jDialogIConnection = new javax.swing.JDialog();
jButtonDialogBuyConnection = new javax.swing.JButton();
jButton7 = new javax.swing.JButton();
jComboBoxICType = new javax.swing.JComboBox();
jLabel37 = new javax.swing.JLabel();
jComboBoxICSpeed = new javax.swing.JComboBox();
jComboBoxICProvider = new javax.swing.JComboBox();
jLabel49 = new javax.swing.JLabel();
jLabel50 = new javax.swing.JLabel();
jLabel51 = new javax.swing.JLabel();
jLabel52 = new javax.swing.JLabel();
jTextFieldMonthFee = new javax.swing.JTextField();
jTabbedPane = new javax.swing.JTabbedPane();
jPanelHuman = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
jLabelHumanCreated = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabelHumanName = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabelHumanCashFlow = new javax.swing.JLabel();
jLabel53 = new javax.swing.JLabel();
jLabel54 = new javax.swing.JLabel();
jLabelSComputer = new javax.swing.JLabel();
jLabel56 = new javax.swing.JLabel();
jLabelSSoftware = new javax.swing.JLabel();
jLabelSFurniture = new javax.swing.JLabel();
jLabel59 = new javax.swing.JLabel();
jLabel60 = new javax.swing.JLabel();
jLabelSInetConnection = new javax.swing.JLabel();
jLabelSStatus = new javax.swing.JLabel();
jLabel55 = new javax.swing.JLabel();
jLabelSSoftwareInstalled = new javax.swing.JLabel();
jSeparator6 = new javax.swing.JSeparator();
jPanelComputer = new javax.swing.JPanel();
jLabel6 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel20 = new javax.swing.JLabel();
jLabelCCost = new javax.swing.JLabel();
jLabelCProductivity = new javax.swing.JLabel();
jLabelCComputer = new javax.swing.JLabel();
jLabel21 = new javax.swing.JLabel();
jLabelCSeller = new javax.swing.JLabel();
jPanelSoftware = new javax.swing.JPanel();
jLabel12 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
jLabel25 = new javax.swing.JLabel();
jLabel27 = new javax.swing.JLabel();
jLabel29 = new javax.swing.JLabel();
jLabel31 = new javax.swing.JLabel();
jLabelSPackage = new javax.swing.JLabel();
jLabelSOperationSystem = new javax.swing.JLabel();
jLabelSOffice = new javax.swing.JLabel();
jLabelSPrice = new javax.swing.JLabel();
jLabelSInstalled = new javax.swing.JLabel();
jLabelSInstalledBy = new javax.swing.JLabel();
jButtonInstallSoftware = new javax.swing.JButton();
jPanelFurniture = new javax.swing.JPanel();
jLabel24 = new javax.swing.JLabel();
jLabelFName = new javax.swing.JLabel();
jLabel26 = new javax.swing.JLabel();
jLabelFComfort = new javax.swing.JLabel();
jLabel28 = new javax.swing.JLabel();
jLabelFPrice = new javax.swing.JLabel();
jLabel30 = new javax.swing.JLabel();
jLabelFSeller = new javax.swing.JLabel();
jPanelInternet = new javax.swing.JPanel();
jLabel43 = new javax.swing.JLabel();
jLabel44 = new javax.swing.JLabel();
jLabel45 = new javax.swing.JLabel();
jLabel46 = new javax.swing.JLabel();
jLabel47 = new javax.swing.JLabel();
jLabelIConnected = new javax.swing.JLabel();
jLabelIConnectionSpeed = new javax.swing.JLabel();
jLabelIMonthFee = new javax.swing.JLabel();
jLabelIProviderName = new javax.swing.JLabel();
jLabel48 = new javax.swing.JLabel();
jLabelIConnectionType = new javax.swing.JLabel();
jButtonIConnect = new javax.swing.JButton();
jPanelSHOP = new javax.swing.JPanel();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButtonSBuySoftwareFrame = new javax.swing.JButton();
jComboBoxComputers = new javax.swing.JComboBox();
jComboBoxFurniture = new javax.swing.JComboBox();
jLabel32 = new javax.swing.JLabel();
jLabel33 = new javax.swing.JLabel();
jLabel34 = new javax.swing.JLabel();
jSeparator5 = new javax.swing.JSeparator();
jPanelAbout = new javax.swing.JPanel();
jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
jLabel18 = new javax.swing.JLabel();
jLabel19 = new javax.swing.JLabel();
jLabel22 = new javax.swing.JLabel();
jLabel23 = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jSeparator2 = new javax.swing.JSeparator();
jSeparator3 = new javax.swing.JSeparator();
jSeparator4 = new javax.swing.JSeparator();
jLabel16 = new javax.swing.JLabel();
jLabel57 = new javax.swing.JLabel();
jLabel58 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();

jDialogNewHuman.setTitle("Creating a human");
jButton2.setText("Create!");
jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton2MouseClicked(evt);
}
});

jButton3.setText("Cancel");
jButton3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton3MouseClicked(evt);
}
});

jLabel2.setText("Human's name:");

jLabel3.setText("Human's budget for worspace creation and internet connection:");

jRadioButton500.setText("500 $");
jRadioButton500.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jRadioButton500.setMargin(new java.awt.Insets(0, 0, 0, 0));

jRadioButton1000.setText("1000 $");
jRadioButton1000.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jRadioButton1000.setMargin(new java.awt.Insets(0, 0, 0, 0));

jRadioButton5000.setText("5000 $");
jRadioButton5000.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jRadioButton5000.setMargin(new java.awt.Insets(0, 0, 0, 0));

jLabel4.setText("NEW Human Creation");

org.jdesktop.layout.GroupLayout jDialogNewHumanLayout = new org.jdesktop.layout.GroupLayout(jDialogNewHuman.getContentPane());
jDialogNewHuman.getContentPane().setLayout(jDialogNewHumanLayout);
jDialogNewHumanLayout.setHorizontalGroup(
jDialogNewHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogNewHumanLayout.createSequentialGroup()
.add(jDialogNewHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogNewHumanLayout.createSequentialGroup()
.addContainerGap()
.add(jDialogNewHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel2)
.add(jLabel3)))
.add(jDialogNewHumanLayout.createSequentialGroup()
.add(114, 114, 114)
.add(jLabel4))
.add(jDialogNewHumanLayout.createSequentialGroup()
.add(87, 87, 87)
.add(jDialogNewHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(jRadioButton5000)
.add(org.jdesktop.layout.GroupLayout.LEADING, jRadioButton1000)
.add(org.jdesktop.layout.GroupLayout.LEADING, jRadioButton500)))
.add(jDialogNewHumanLayout.createSequentialGroup()
.add(93, 93, 93)
.add(jTextFieldName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 160, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(47, Short.MAX_VALUE))
.add(org.jdesktop.layout.GroupLayout.TRAILING, jDialogNewHumanLayout.createSequentialGroup()
.addContainerGap(109, Short.MAX_VALUE)
.add(jButton2)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton3)
.add(110, 110, 110))
);
jDialogNewHumanLayout.setVerticalGroup(
jDialogNewHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jDialogNewHumanLayout.createSequentialGroup()
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jLabel4)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel2)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextFieldName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel3)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jRadioButton500)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jRadioButton1000)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jRadioButton5000)
.add(22, 22, 22)
.add(jDialogNewHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jButton3)
.add(jButton2))
.addContainerGap())
);
jLabel8.setText("jLabel8");
jDialogBuySoftware.setTitle("Software House");
jRadioButtonS20.setText("Linux + Open Office - 20$");
jRadioButtonS20.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jRadioButtonS20.setMargin(new java.awt.Insets(0, 0, 0, 0));

jRadioButtonS100.setText("Windows + Open Office - 100$");
jRadioButtonS100.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jRadioButtonS100.setMargin(new java.awt.Insets(0, 0, 0, 0));

jRadioButtonS500.setText("Windows + MS Office - 500$");
jRadioButtonS500.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jRadioButtonS500.setMargin(new java.awt.Insets(0, 0, 0, 0));

jLabel35.setText("Software House");

jLabel36.setText("Choose software you would like to buy.");

jButtonSoftHouseBuy.setText("Buy!");
jButtonSoftHouseBuy.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonSoftHouseBuyMouseClicked(evt);
}
});

jButtonSoftHouseCancel.setText("Cancel");
jButtonSoftHouseCancel.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonSoftHouseCancelMouseClicked(evt);
}
});

org.jdesktop.layout.GroupLayout jDialogBuySoftwareLayout = new org.jdesktop.layout.GroupLayout(jDialogBuySoftware.getContentPane());
jDialogBuySoftware.getContentPane().setLayout(jDialogBuySoftwareLayout);
jDialogBuySoftwareLayout.setHorizontalGroup(
jDialogBuySoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogBuySoftwareLayout.createSequentialGroup()
.add(jDialogBuySoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogBuySoftwareLayout.createSequentialGroup()
.addContainerGap()
.add(jLabel35))
.add(jDialogBuySoftwareLayout.createSequentialGroup()
.add(54, 54, 54)
.add(jLabel36))
.add(jDialogBuySoftwareLayout.createSequentialGroup()
.add(94, 94, 94)
.add(jDialogBuySoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jRadioButtonS500)
.add(jRadioButtonS100, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jRadioButtonS20)
.add(jDialogBuySoftwareLayout.createSequentialGroup()
.add(13, 13, 13)
.add(jButtonSoftHouseBuy)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonSoftHouseCancel)))))
.addContainerGap(89, Short.MAX_VALUE))
);
jDialogBuySoftwareLayout.setVerticalGroup(
jDialogBuySoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogBuySoftwareLayout.createSequentialGroup()
.addContainerGap()
.add(jLabel35)
.add(22, 22, 22)
.add(jLabel36)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jRadioButtonS20)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jRadioButtonS100)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jRadioButtonS500)
.add(73, 73, 73)
.add(jDialogBuySoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jButtonSoftHouseBuy)
.add(jButtonSoftHouseCancel))
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jDialogInstallSoftware.setTitle("Software Installation");
jButtonSIBySpecialist.setText("Install with specialist");
jButtonSIBySpecialist.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonSIBySpecialistMouseClicked(evt);
}
});

jButtonSICancel.setText("Cancel");
jButtonSICancel.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonSICancelMouseClicked(evt);
}
});

jLabel38.setText("How would you like to install your software:");

jLabel39.setText("Software info:");

jLabelSoftInfoOnDialog.setText("---");

jLabel40.setText("Price for installing by specialist:");

jButtonSIByMyself.setText("Install by yourself");
jButtonSIByMyself.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonSIByMyselfMouseClicked(evt);
}
});

jLabel41.setText("Probability,that you will install software good is:");

jLabel42.setText("14 %");

jLabelSISpecPrice.setText("---");

org.jdesktop.layout.GroupLayout jDialogInstallSoftwareLayout = new org.jdesktop.layout.GroupLayout(jDialogInstallSoftware.getContentPane());
jDialogInstallSoftware.getContentPane().setLayout(jDialogInstallSoftwareLayout);
jDialogInstallSoftwareLayout.setHorizontalGroup(
jDialogInstallSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogInstallSoftwareLayout.createSequentialGroup()
.add(jDialogInstallSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogInstallSoftwareLayout.createSequentialGroup()
.addContainerGap()
.add(jLabel38, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 321, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(jDialogInstallSoftwareLayout.createSequentialGroup()
.add(41, 41, 41)
.add(jDialogInstallSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel40)
.add(jLabel41)
.add(jLabel39))
.add(22, 22, 22)
.add(jDialogInstallSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabelSISpecPrice)
.add(jLabel42)
.add(jLabelSoftInfoOnDialog, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE))))
.addContainerGap())
.add(org.jdesktop.layout.GroupLayout.TRAILING, jDialogInstallSoftwareLayout.createSequentialGroup()
.addContainerGap(89, Short.MAX_VALUE)
.add(jButtonSIBySpecialist)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonSIByMyself)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonSICancel)
.add(106, 106, 106))
);
jDialogInstallSoftwareLayout.setVerticalGroup(
jDialogInstallSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogInstallSoftwareLayout.createSequentialGroup()
.addContainerGap()
.add(jLabel38)
.add(19, 19, 19)
.add(jDialogInstallSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabelSoftInfoOnDialog)
.add(jLabel39))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jDialogInstallSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel40)
.add(jLabelSISpecPrice))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jDialogInstallSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel41)
.add(jLabel42))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 35, Short.MAX_VALUE)
.add(jDialogInstallSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jButtonSIBySpecialist)
.add(jButtonSIByMyself)
.add(jButtonSICancel))
.addContainerGap())
);
jDialogIConnection.setTitle("Choose Internet Connection Now!");
jButtonDialogBuyConnection.setText("Buy connection!");
jButtonDialogBuyConnection.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonDialogBuyConnectionMouseClicked(evt);
}
});

jButton7.setText("Cancel");
jButton7.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton7MouseClicked(evt);
}
});

jComboBoxICType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
jComboBoxICType.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBoxICTypeActionPerformed(evt);
}
});

jLabel37.setText("Connection type:");

jComboBoxICSpeed.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
jComboBoxICSpeed.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBoxICSpeedActionPerformed(evt);
}
});

jComboBoxICProvider.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
jComboBoxICProvider.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBoxICProviderActionPerformed(evt);
}
});
jComboBoxICProvider.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
jComboBoxICProviderPropertyChange(evt);
}
});

jLabel49.setText("Connection speed:");

jLabel50.setText("Internet Provider:");

jLabel51.setText("Choose the following parameters for your internet connection:");

jLabel52.setText("Month fee:");

jTextFieldMonthFee.setText("Month Fee");

org.jdesktop.layout.GroupLayout jDialogIConnectionLayout = new org.jdesktop.layout.GroupLayout(jDialogIConnection.getContentPane());
jDialogIConnection.getContentPane().setLayout(jDialogIConnectionLayout);
jDialogIConnectionLayout.setHorizontalGroup(
jDialogIConnectionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogIConnectionLayout.createSequentialGroup()
.add(jDialogIConnectionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogIConnectionLayout.createSequentialGroup()
.addContainerGap()
.add(jLabel51))
.add(jDialogIConnectionLayout.createSequentialGroup()
.add(22, 22, 22)
.add(jDialogIConnectionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogIConnectionLayout.createSequentialGroup()
.add(jLabel50)
.add(57, 57, 57))
.add(jComboBoxICProvider, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 144, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jDialogIConnectionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jComboBoxICType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLabel37))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jDialogIConnectionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jComboBoxICSpeed, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 105, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLabel49))
.add(jDialogIConnectionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogIConnectionLayout.createSequentialGroup()
.add(8, 8, 8)
.add(jLabel52))
.add(jDialogIConnectionLayout.createSequentialGroup()
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextFieldMonthFee, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 99, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))))
.addContainerGap())
.add(org.jdesktop.layout.GroupLayout.TRAILING, jDialogIConnectionLayout.createSequentialGroup()
.addContainerGap(164, Short.MAX_VALUE)
.add(jButtonDialogBuyConnection)
.add(16, 16, 16)
.add(jButton7)
.add(142, 142, 142))
);
jDialogIConnectionLayout.setVerticalGroup(
jDialogIConnectionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogIConnectionLayout.createSequentialGroup()
.addContainerGap()
.add(jLabel51)
.add(jDialogIConnectionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDialogIConnectionLayout.createSequentialGroup()
.add(17, 17, 17)
.add(jDialogIConnectionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel52)
.add(jDialogIConnectionLayout.createSequentialGroup()
.add(jDialogIConnectionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel37)
.add(jLabel49))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jDialogIConnectionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jComboBoxICType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jComboBoxICSpeed, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jTextFieldMonthFee, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))))
.add(jDialogIConnectionLayout.createSequentialGroup()
.add(18, 18, 18)
.add(jLabel50)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jComboBoxICProvider, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 40, Short.MAX_VALUE)
.add(jDialogIConnectionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jButtonDialogBuyConnection)
.add(jButton7))
.addContainerGap())
);

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Home Internet (c) 2007");
setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
setIconImage(getIconImage());
setLocationByPlatform(true);
setResizable(false);
jButton1.setText("Create a New Human");
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1MouseClicked(evt);
}
});

jLabel5.setText("Created:");

jLabelHumanCreated.setText("jLabelHumanCreated");

jLabel7.setText("Name:");

jLabelHumanName.setText("jLabelHumanName");

jLabel10.setText("Cash flow:");

jLabelHumanCashFlow.setText("jLabelHumanCashFlow");

jLabel53.setText("Process status:");

jLabel54.setText("Computer:");

jLabelSComputer.setText("jLabelSComputer");

jLabel56.setText("Software:");

jLabelSSoftware.setText("jLabelSSoftware");

jLabelSFurniture.setText("jLabelSFurniture");

jLabel59.setText("Furniture:");

jLabel60.setText("Internet connection:");

jLabelSInetConnection.setText("jLabelSInetConnection");

jLabelSStatus.setText("jLabelSStatus");

jLabel55.setText("Software Installed:");

jLabelSSoftwareInstalled.setText("jLabelSSoftwareInstalled");

org.jdesktop.layout.GroupLayout jPanelHumanLayout = new org.jdesktop.layout.GroupLayout(jPanelHuman);
jPanelHuman.setLayout(jPanelHumanLayout);
jPanelHumanLayout.setHorizontalGroup(
jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanelHumanLayout.createSequentialGroup()
.add(jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanelHumanLayout.createSequentialGroup()
.add(40, 40, 40)
.add(jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel59)
.add(jLabel60)
.add(jLabel54)
.add(jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
.add(org.jdesktop.layout.GroupLayout.LEADING, jLabel56, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jLabel55, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.add(34, 34, 34)
.add(jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabelSSoftwareInstalled)
.add(jLabelSSoftware)
.add(jLabelSComputer)
.add(jLabelSInetConnection)
.add(jLabelSFurniture)))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanelHumanLayout.createSequentialGroup()
.addContainerGap()
.add(jLabel53)
.add(59, 59, 59)
.add(jLabelSStatus))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanelHumanLayout.createSequentialGroup()
.add(40, 40, 40)
.add(jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel5)
.add(jLabel7)
.add(jLabel10))
.add(88, 88, 88)
.add(jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabelHumanCreated)
.add(jLabelHumanName)
.add(jLabelHumanCashFlow))))
.add(78, 78, 78))
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanelHumanLayout.createSequentialGroup()
.addContainerGap()
.add(jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jSeparator6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)
.add(jButton1))
.add(20, 20, 20))
);
jPanelHumanLayout.setVerticalGroup(
jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelHumanLayout.createSequentialGroup()
.add(27, 27, 27)
.add(jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelHumanLayout.createSequentialGroup()
.add(jLabelHumanCreated)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabelHumanName)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabelHumanCashFlow, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(jPanelHumanLayout.createSequentialGroup()
.add(jLabel5)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel7)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel10)))
.add(24, 24, 24)
.add(jButton1)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jSeparator6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel53)
.add(jLabelSStatus))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 27, Short.MAX_VALUE)
.add(jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(jPanelHumanLayout.createSequentialGroup()
.add(jLabel54)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel56)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel55))
.add(jPanelHumanLayout.createSequentialGroup()
.add(jLabelSComputer)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabelSSoftware)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabelSSoftwareInstalled)))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel59)
.add(jLabelSFurniture))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanelHumanLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel60)
.add(jLabelSInetConnection))
.add(28, 28, 28))
);
jTabbedPane.addTab("Human", new javax.swing.ImageIcon("images\\human.gif"), jPanelHuman);

jLabel6.setText("Computer:");

jLabel11.setText("Productivity:");

jLabel20.setText("Cost:");

jLabelCCost.setText("---");

jLabelCProductivity.setText("---");

jLabelCComputer.setText("---");

jLabel21.setText("Seller:");

jLabelCSeller.setText("---");

org.jdesktop.layout.GroupLayout jPanelComputerLayout = new org.jdesktop.layout.GroupLayout(jPanelComputer);
jPanelComputer.setLayout(jPanelComputerLayout);
jPanelComputerLayout.setHorizontalGroup(
jPanelComputerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelComputerLayout.createSequentialGroup()
.addContainerGap()
.add(jPanelComputerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelComputerLayout.createSequentialGroup()
.add(jPanelComputerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel6)
.add(jLabel6))
.add(47, 47, 47)
.add(jLabel9))
.add(jLabel11)
.add(jLabel20)
.add(jLabel21))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 16, Short.MAX_VALUE)
.add(jPanelComputerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabelCComputer)
.add(jLabelCProductivity)
.add(jLabelCCost)
.add(jLabelCSeller))
.addContainerGap(216, Short.MAX_VALUE))
);
jPanelComputerLayout.setVerticalGroup(
jPanelComputerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelComputerLayout.createSequentialGroup()
.addContainerGap()
.add(jPanelComputerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel6)
.add(jLabel9)
.add(jLabelCComputer))
.add(19, 19, 19)
.add(jPanelComputerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel11)
.add(jLabelCProductivity))
.add(20, 20, 20)
.add(jPanelComputerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel20)
.add(jLabelCCost))
.add(19, 19, 19)
.add(jPanelComputerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel21)
.add(jLabelCSeller))
.addContainerGap(188, Short.MAX_VALUE))
);
jTabbedPane.addTab("Computer", new javax.swing.ImageIcon("images\\computer.gif"), jPanelComputer);

jLabel12.setText("Software package:");

jLabel17.setText("Operation system:");

jLabel25.setText("Office tools:");

jLabel27.setText("Installed:");

jLabel29.setText("Installed by:");

jLabel31.setText("Price:");

jLabelSPackage.setText("jLabel32");

jLabelSOperationSystem.setText("jLabel32");

jLabelSOffice.setText("jLabel32");

jLabelSPrice.setText("jLabel32");

jLabelSInstalled.setText("jLabel32");

jLabelSInstalledBy.setText("jLabel32");

jButtonInstallSoftware.setText("Install Software");
jButtonInstallSoftware.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonInstallSoftwareMouseClicked(evt);
}
});

org.jdesktop.layout.GroupLayout jPanelSoftwareLayout = new org.jdesktop.layout.GroupLayout(jPanelSoftware);
jPanelSoftware.setLayout(jPanelSoftwareLayout);
jPanelSoftwareLayout.setHorizontalGroup(
jPanelSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelSoftwareLayout.createSequentialGroup()
.addContainerGap()
.add(jPanelSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel12)
.add(jLabel17)
.add(jLabel25)
.add(jLabel31)
.add(jLabel27)
.add(jLabel29))
.add(49, 49, 49)
.add(jPanelSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabelSInstalledBy)
.add(jLabelSInstalled)
.add(jLabelSPrice)
.add(jLabelSOffice)
.add(jLabelSOperationSystem)
.add(jLabelSPackage))
.addContainerGap(162, Short.MAX_VALUE))
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanelSoftwareLayout.createSequentialGroup()
.addContainerGap(231, Short.MAX_VALUE)
.add(jButtonInstallSoftware)
.addContainerGap())
);
jPanelSoftwareLayout.setVerticalGroup(
jPanelSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelSoftwareLayout.createSequentialGroup()
.addContainerGap()
.add(jPanelSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel12)
.add(jLabelSPackage))
.add(19, 19, 19)
.add(jPanelSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel17)
.add(jLabelSOperationSystem))
.add(18, 18, 18)
.add(jPanelSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel25)
.add(jLabelSOffice))
.add(20, 20, 20)
.add(jPanelSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel31)
.add(jLabelSPrice))
.add(22, 22, 22)
.add(jPanelSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel27)
.add(jLabelSInstalled))
.add(20, 20, 20)
.add(jPanelSoftwareLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel29)
.add(jLabelSInstalledBy))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 85, Short.MAX_VALUE)
.add(jButtonInstallSoftware)
.addContainerGap())
);
jTabbedPane.addTab("Software", new javax.swing.ImageIcon("images\\software.gif"), jPanelSoftware);

jLabel24.setText("Furniture:");

jLabelFName.setText("---");

jLabel26.setText("Comfort:");

jLabelFComfort.setText("---");

jLabel28.setText("Price:");

jLabelFPrice.setText("---");

jLabel30.setText("Seller:");

jLabelFSeller.setText("---");

org.jdesktop.layout.GroupLayout jPanelFurnitureLayout = new org.jdesktop.layout.GroupLayout(jPanelFurniture);
jPanelFurniture.setLayout(jPanelFurnitureLayout);
jPanelFurnitureLayout.setHorizontalGroup(
jPanelFurnitureLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelFurnitureLayout.createSequentialGroup()
.addContainerGap()
.add(jPanelFurnitureLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel24)
.add(jLabel26)
.add(jLabel28)
.add(jLabel30))
.add(60, 60, 60)
.add(jPanelFurnitureLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabelFSeller)
.add(jLabelFPrice)
.add(jLabelFComfort)
.add(jLabelFName))
.addContainerGap(222, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
);
jPanelFurnitureLayout.setVerticalGroup(
jPanelFurnitureLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelFurnitureLayout.createSequentialGroup()
.addContainerGap()
.add(jPanelFurnitureLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel24)
.add(jLabelFName))
.add(21, 21, 21)
.add(jPanelFurnitureLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel26)
.add(jLabelFComfort))
.add(23, 23, 23)
.add(jPanelFurnitureLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel28)
.add(jLabelFPrice))
.add(30, 30, 30)
.add(jPanelFurnitureLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel30)
.add(jLabelFSeller))
.addContainerGap(172, Short.MAX_VALUE))
);
jTabbedPane.addTab("Furniture", new javax.swing.ImageIcon("images\\furniture.gif"), jPanelFurniture);

jLabel43.setText("Connected:");

jLabel44.setText("Connection speed:");

jLabel45.setText("Provider name:");

jLabel46.setText("Month fee:");

jLabelIConnected.setText("jLabel48");

jLabelIConnectionSpeed.setText("jLabel49");

jLabelIMonthFee.setText("jLabel50");

jLabelIProviderName.setText("jLabel51");

jLabel48.setText("Connection type:");

jLabelIConnectionType.setText("jLabel49");

jButtonIConnect.setText("Connect to the Internet");
jButtonIConnect.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonIConnectMouseClicked(evt);
}
});

org.jdesktop.layout.GroupLayout jPanelInternetLayout = new org.jdesktop.layout.GroupLayout(jPanelInternet);
jPanelInternet.setLayout(jPanelInternetLayout);
jPanelInternetLayout.setHorizontalGroup(
jPanelInternetLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelInternetLayout.createSequentialGroup()
.addContainerGap()
.add(jPanelInternetLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel47)
.add(jPanelInternetLayout.createSequentialGroup()
.add(jPanelInternetLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel43)
.add(jLabel44)
.add(jLabel46)
.add(jLabel45)
.add(jLabel48))
.add(42, 42, 42)
.add(jPanelInternetLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabelIConnectionType)
.add(jLabelIProviderName)
.add(jLabelIMonthFee)
.add(jLabelIConnectionSpeed)
.add(jLabelIConnected))))
.addContainerGap(170, Short.MAX_VALUE))
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanelInternetLayout.createSequentialGroup()
.addContainerGap(193, Short.MAX_VALUE)
.add(jButtonIConnect)
.addContainerGap())
);
jPanelInternetLayout.setVerticalGroup(
jPanelInternetLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelInternetLayout.createSequentialGroup()
.addContainerGap()
.add(jPanelInternetLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel43)
.add(jLabelIConnected))
.add(15, 15, 15)
.add(jPanelInternetLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel44)
.add(jLabelIConnectionSpeed))
.add(16, 16, 16)
.add(jPanelInternetLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel45)
.add(jLabelIProviderName))
.add(18, 18, 18)
.add(jPanelInternetLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel46)
.add(jLabelIMonthFee))
.add(20, 20, 20)
.add(jLabel47)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanelInternetLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel48)
.add(jLabelIConnectionType))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 123, Short.MAX_VALUE)
.add(jButtonIConnect)
.addContainerGap())
);
jTabbedPane.addTab("Internet", new javax.swing.ImageIcon("images\\internet.gif"), jPanelInternet);

jButton4.setText("Buy computer");
jButton4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton4MouseClicked(evt);
}
});

jButton5.setText("Buy furniture");
jButton5.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton5MouseClicked(evt);
}
});

jButtonSBuySoftwareFrame.setText("Buy software");
jButtonSBuySoftwareFrame.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonSBuySoftwareFrameMouseClicked(evt);
}
});

jComboBoxComputers.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

jComboBoxFurniture.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

jLabel32.setText("Computer shop:");

jLabel33.setText("Furniture shop:");

jLabel34.setText("Software shop:");

org.jdesktop.layout.GroupLayout jPanelSHOPLayout = new org.jdesktop.layout.GroupLayout(jPanelSHOP);
jPanelSHOP.setLayout(jPanelSHOPLayout);
jPanelSHOPLayout.setHorizontalGroup(
jPanelSHOPLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelSHOPLayout.createSequentialGroup()
.addContainerGap()
.add(jPanelSHOPLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelSHOPLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel32)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanelSHOPLayout.createSequentialGroup()
.add(jPanelSHOPLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel33)
.add(jLabel34))
.add(270, 270, 270))
.add(jPanelSHOPLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
.add(org.jdesktop.layout.GroupLayout.LEADING, jComboBoxFurniture, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jComboBoxComputers, 0, 325, Short.MAX_VALUE)
.add(jPanelSHOPLayout.createSequentialGroup()
.add(jButtonSBuySoftwareFrame)
.add(7, 7, 7))
.add(jPanelSHOPLayout.createSequentialGroup()
.add(jButton5)
.add(9, 9, 9))
.add(jPanelSHOPLayout.createSequentialGroup()
.add(jButton4)
.add(8, 8, 8))))
.add(jSeparator5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 184, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanelSHOPLayout.setVerticalGroup(
jPanelSHOPLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelSHOPLayout.createSequentialGroup()
.add(12, 12, 12)
.add(jLabel32)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jComboBoxComputers, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(24, 24, 24)
.add(jButton4)
.add(18, 18, 18)
.add(jLabel33)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jComboBoxFurniture, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(17, 17, 17)
.add(jButton5)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 12, Short.MAX_VALUE)
.add(jLabel34)
.add(15, 15, 15)
.add(jSeparator5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(11, 11, 11)
.add(jButtonSBuySoftwareFrame)
.add(21, 21, 21))
);
jTabbedPane.addTab("SHOP", new javax.swing.ImageIcon("images\\shop.gif"), jPanelSHOP);

jLabel13.setText("Students: Konstantin V. Filippov");

jLabel14.setText("gr.3305 MOEVM ETU 2007");

jLabel15.setText("konstantin.filippov@gmail.com");

jLabel18.setText("Software Development Theory");

jLabel19.setText("MOEVM ETU 2007");

jLabel22.setText("Mwenge Mulenga");

jLabel23.setText("mwenge2008@yahoo.co.uk");

jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);

jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);

jLabel16.setText("Teacher: Samoilenko V.P.");

jLabel57.setText("Home Internet (c) 2007");

jLabel58.setText("We'll take care about all the stuff.");

org.jdesktop.layout.GroupLayout jPanelAboutLayout = new org.jdesktop.layout.GroupLayout(jPanelAbout);
jPanelAbout.setLayout(jPanelAboutLayout);
jPanelAboutLayout.setHorizontalGroup(
jPanelAboutLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelAboutLayout.createSequentialGroup()
.addContainerGap()
.add(jPanelAboutLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelAboutLayout.createSequentialGroup()
.add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jPanelAboutLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelAboutLayout.createSequentialGroup()
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanelAboutLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelAboutLayout.createSequentialGroup()
.add(jLabel13, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
.add(jPanelAboutLayout.createSequentialGroup()
.add(jLabel16, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanelAboutLayout.createSequentialGroup()
.add(jPanelAboutLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanelAboutLayout.createSequentialGroup()
.add(109, 109, 109)
.add(jPanelAboutLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel19, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
.add(jLabel18, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jSeparator2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(jPanelAboutLayout.createSequentialGroup()
.add(110, 110, 110)
.add(jPanelAboutLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel23, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)
.add(jLabel14, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)
.add(jLabel22, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)
.add(jLabel15, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE))))
.add(24, 24, 24))))
.add(jPanelAboutLayout.createSequentialGroup()
.add(94, 94, 94)
.add(jLabel57))
.add(jPanelAboutLayout.createSequentialGroup()
.add(58, 58, 58)
.add(jLabel58)))
.add(20, 20, 20))
.add(jSeparator4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 315, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jSeparator3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 318, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
jPanelAboutLayout.setVerticalGroup(
jPanelAboutLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanelAboutLayout.createSequentialGroup()
.addContainerGap()
.add(jPanelAboutLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jSeparator2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE)
.add(jPanelAboutLayout.createSequentialGroup()
.add(jLabel57)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel58, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jSeparator3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(18, 18, 18)
.add(jLabel13)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel14)
.add(42, 42, 42)
.add(jLabel16)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(15, 15, 15)
.add(jSeparator4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE))
.addContainerGap())
);
jTabbedPane.addTab("About", new javax.swing.ImageIcon("images\\about.gif"), jPanelAbout);

jLabel1.setText("Home Internet connection process:");

org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
.add(194, 194, 194))
.add(layout.createSequentialGroup()
.add(10, 10, 10)
.add(jTabbedPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 357, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 39, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTabbedPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 357, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents

private void jButtonDialogBuyConnectionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonDialogBuyConnectionMouseClicked
// TODO add your handling code here:
if(readyToConnect) {
if(currConnection.getMonthFee() > h.getBudget().cash()) {
JOptionPane.showMessageDialog(jDialogIConnection, "You have no enough money to establish this connection!",
"Choose another connection", JOptionPane.ERROR_MESSAGE);
generateICCombos();
readyToConnect=false;
return;
}
else {
boolean b = h.buyIConnection(currProv, currConnection);
updateAllInfo();
JOptionPane.showMessageDialog(jDialogIConnection, "Congratulations! \n\rYou\'ve been connected to the internet right now.",
"Connection successfull", JOptionPane.PLAIN_MESSAGE);
jDialogIConnection.setVisible(false);
}
}

}//GEN-LAST:event_jButtonDialogBuyConnectionMouseClicked

private void jComboBoxICSpeedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxICSpeedActionPerformed
// TODO add your handling code here:
generateIMonthFee();

}//GEN-LAST:event_jComboBoxICSpeedActionPerformed

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

private void jComboBoxICProviderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxICProviderActionPerformed
// TODO add your handling code here:

generateIConnTypes();

}//GEN-LAST:event_jComboBoxICProviderActionPerformed

private void jComboBoxICProviderPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jComboBoxICProviderPropertyChange
// TODO add your handling code here:

}//GEN-LAST:event_jComboBoxICProviderPropertyChange

private void jButton7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton7MouseClicked
// TODO add your handling code here:
jDialogIConnection.setVisible(false);
}//GEN-LAST:event_jButton7MouseClicked

private void jButtonIConnectMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonIConnectMouseClicked
// TODO add your handling code here:
// TODO add your handling code here:
if (h==null ) {
JOptionPane.showMessageDialog(this, "Create a human!", "Human was not created",
JOptionPane.ERROR_MESSAGE);
return;
}
if(h.getPC() == null) {
JOptionPane.showMessageDialog(this, "Buy a computer!", "Computer was no bought",
JOptionPane.ERROR_MESSAGE);
return;
}
if(h.getPC().getSoftwarePackage() == null) {
JOptionPane.showMessageDialog(this, "Buy a software package!", "Software package not found",
JOptionPane.ERROR_MESSAGE);
return;
}
if(h.getPC().getSoftwarePackage().getInstalled().equalsIgnoreCase("NO")) {
JOptionPane.showMessageDialog(this, "Install software!", "Software package should be installed",
JOptionPane.ERROR_MESSAGE);
return;
}
if(h.getIConnection()!=null || h.getIProvider() != null) {
JOptionPane.showMessageDialog(this, "Connection is already established!", "Internet connection was established earlier.",
JOptionPane.ERROR_MESSAGE);
return;
}

generateICCombos();
jButtonDialogBuyConnection.setEnabled(readyToConnect);
jComboBoxICProvider.setEnabled(true);
jComboBoxICSpeed.setEnabled(false);
jComboBoxICType.setEnabled(false);
jDialogIConnection.setSize(550,190);
jDialogIConnection.setVisible(true);

}//GEN-LAST:event_jButtonIConnectMouseClicked

private void jButtonSIByMyselfMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonSIByMyselfMouseClicked
// TODO add your handling code here:
boolean myself = h.getPC().getSoftwarePackage().startInstallationMyself(h.getName());
String errs[] = {
" You've chosed an invalid path for the installation.",
" You did not accept a licence agreement.",
"Install.msi is not an originally setup program. Run setup.exe.",
"Unhandled exception in module 1F43AC: can't install software." };
if(myself) {
JOptionPane.showMessageDialog(jDialogInstallSoftware, "Gongratulations! Software Package installed successfully",
"Software installed", JOptionPane.OK_OPTION);
jDialogInstallSoftware.setVisible(false);
updateAllInfo();

}
else {
JOptionPane.showMessageDialog(jDialogInstallSoftware, "Sorry, you did somthing wrong. "+errs[((int)(Math.random()*10)%4)],
"Software was not installed", JOptionPane.OK_OPTION);
}
}//GEN-LAST:event_jButtonSIByMyselfMouseClicked

private void jButtonSIBySpecialistMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonSIBySpecialistMouseClicked
// TODO add your handling code here:
if(h.getBudget().cash() < specPrice) {
JOptionPane.showMessageDialog(jDialogInstallSoftware, "You have no enough money to call specialist!", "Money left: "+h.getBudget().cash()+"$",
JOptionPane.ERROR_MESSAGE);
return;
}
SoftwarePackage spp = h.getPC().getSoftwarePackage();
String []names = {"Alexander First", "John Murray", "Ilay Whindows",
"Jimmy Black Cat", "Ai Washere", "Konstantin Filippov", "Mwenge Mulenga"};
ComputerSpecialist cs = new ComputerSpecialist(names[((int)Math.random()*10)%7]);
boolean ret = cs.install(spp, h.getBudget());
if(!ret) {
JOptionPane.showMessageDialog(jDialogInstallSoftware, "You have no enough money to call specialist!", "Money left: "+h.getBudget().cash()+"$",
JOptionPane.ERROR_MESSAGE);
return;
}
else {
JOptionPane.showMessageDialog(jDialogInstallSoftware, "Installation successful.", "Software was installed",
JOptionPane.PLAIN_MESSAGE);
jDialogInstallSoftware.setVisible(false);
updateAllInfo();
}

}//GEN-LAST:event_jButtonSIBySpecialistMouseClicked

private void jButtonSICancelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonSICancelMouseClicked
// TODO add your handling code here:
jDialogInstallSoftware.setVisible(false);
}//GEN-LAST:event_jButtonSICancelMouseClicked

private void jButtonInstallSoftwareMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonInstallSoftwareMouseClicked
// TODO add your handling code here:
if (h==null ) {
JOptionPane.showMessageDialog(this, "Create a human!", "Human was not created",
JOptionPane.ERROR_MESSAGE);
return;
}
if(h.getPC() == null) {
JOptionPane.showMessageDialog(this, "Buy a computer!", "Computer was no bought",
JOptionPane.ERROR_MESSAGE);
return;
}
if(h.getPC().getSoftwarePackage() == null) {
JOptionPane.showMessageDialog(this, "Buy a software package!", "Software package not found",
JOptionPane.ERROR_MESSAGE);
return;
}
if(h.getPC().getSoftwarePackage().getInstalled().equalsIgnoreCase("YES") ) {
JOptionPane.showMessageDialog(this, "Already installed!", "Software is already installed",
JOptionPane.ERROR_MESSAGE);
return;
}
jDialogInstallSoftware.setSize(570,190);
SoftwarePackage spp = h.getPC().getSoftwarePackage();

jLabelSoftInfoOnDialog.setText(spp.getOSName()+" + "+spp.getOfficeName()+" / "+
spp.getPrice()+"$");

switch((int)spp.getPrice()) {
case 20:
specPrice = 150;
jLabelSISpecPrice.setText(""+specPrice);
break;
case 100:
specPrice = 100;
jLabelSISpecPrice.setText(""+specPrice);
break;
case 500:
specPrice = 50;
jLabelSISpecPrice.setText(""+specPrice);
break;
default:
specPrice = 125;
jLabelSISpecPrice.setText(""+specPrice);
}
jDialogInstallSoftware.setVisible(true);
}//GEN-LAST:event_jButtonInstallSoftwareMouseClicked

private void jButtonSoftHouseCancelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonSoftHouseCancelMouseClicked
// TODO add your handling code here:
jDialogBuySoftware.setVisible(false);
}//GEN-LAST:event_jButtonSoftHouseCancelMouseClicked

/*private void jButtonSInstallSoftwareMouseClicked(java.awt.event.MouseEvent evt) {

}
*/
private void jButtonSoftHouseBuyMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonSoftHouseBuyMouseClicked
// TODO add your handling code here:
if(h.getPC().getSoftwarePackage()!=null ) {
JOptionPane.showMessageDialog(jDialogBuySoftware, "Software package is already bought!", "Can not buy software package",
JOptionPane.ERROR_MESSAGE);
return;
}
SoftwarePackage sp = null;
if(jRadioButtonS20.isSelected()){
sp = new SoftwarePackage("Linux ", "Open Office", 20);

}
if(jRadioButtonS100.isSelected()){
sp = new SoftwarePackage("Windows ", "Open Office", 100);
}
if(jRadioButtonS500.isSelected()){
sp = new SoftwarePackage("Windows ", "MS Office", 500);
}
if(h.getBudget().cash() < sp.getPrice()) {
JOptionPane.showMessageDialog(jDialogBuySoftware, "You have no enough money to buy this software package!", "Can not buy software package",
JOptionPane.ERROR_MESSAGE);
return;
}
h.buySoftwarePackage(sp);
jDialogBuySoftware.setVisible(false);
updateAllInfo();
}//GEN-LAST:event_jButtonSoftHouseBuyMouseClicked

private void jButtonSBuySoftwareFrameMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonSBuySoftwareFrameMouseClicked
// TODO add your handling code here:
//buy software
if(h == null) {
JOptionPane.showMessageDialog(this, "Create a human!", "Human was not created",
JOptionPane.ERROR_MESSAGE);
return;
}
if(h.getPC() == null) {
JOptionPane.showMessageDialog(this, "Buy a computer!", "Computer was no bought",
JOptionPane.ERROR_MESSAGE);
return;
}

jDialogBuySoftware.setSize(350,270);
jDialogBuySoftware.setVisible(true);

}//GEN-LAST:event_jButtonSBuySoftwareFrameMouseClicked

private void jButton5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton5MouseClicked
// TODO add your handling code here:
// buying furniture
if(h==null ) {
JOptionPane.showMessageDialog(this, "Create a human!", "Human was not created",
JOptionPane.ERROR_MESSAGE);
return;
}
if( h.getFurniture() != null) {
JOptionPane.showMessageDialog(this, "Furniture was bought!", "Can not buy another one..",
JOptionPane.OK_OPTION);
return;
}

String choice = (String)jComboBoxFurniture.getSelectedItem();
int a = choice.indexOf("=");
int b = choice.indexOf("-");
U.log("-------------------------");
U.log(choice);
U.log("a "+a);
U.log("b "+b);

char ch[] = new char[7];
choice.getChars(a+2, a+9, ch, 0);

//price
String price = new String(ch);
Float f = new Float(price);
float fuPrice = f.floatValue();

//productivity
char []fuBeauty = new char[1];
choice.getChars(0,1,fuBeauty,0);
Furniture.Beauty beauty;
switch (fuBeauty[0]) {
case 'H': beauty = Furniture.Beauty.high; break;
case 'M': beauty = Furniture.Beauty.medium; break;
case 'L': beauty =Furniture.Beauty.low; break;
default: beauty = Furniture.Beauty.medium; break;
}

//company-seller
char seller[] = new char[20];
for(int k =0; k<seller.length; k++)
seller[k]=' ';
choice.getChars(b+2, choice.length(), seller, 0);
String fuSeller = new String(seller);



//computer name
char funame[] = new char[20];
for(int k =0; k<funame.length; k++)
funame[k]=' ';
choice.getChars(0, a, funame, 0);
String fuName = new String(funame);

U.log("---------- name:"+fuName);

Furniture fur = new Furniture(beauty);
U.log("price :"+fuPrice+": seller :"+fuSeller);
fur.setPrice(fuPrice);
fur.setSeller(fuSeller);
fur.setName(fuName);


if(fur.getPrice() > h.getBudget().cash()) {
JOptionPane.showMessageDialog(this, "You have no enough money to pay for this furniture!",
"Choose another furniture please", JOptionPane.OK_OPTION);
return;
}
boolean bo = h.buyFurniture(fur);
updateAllInfo();
jComboBoxFurniture.setEnabled(false);
}//GEN-LAST:event_jButton5MouseClicked

private void jButton4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton4MouseClicked
// TODO add your handling code here:
// buying computer
if(h==null ) {
JOptionPane.showMessageDialog(this, "Create a human!", "Human was not created",
JOptionPane.ERROR_MESSAGE);
return;
}
if( h.getPC() != null) {
JOptionPane.showMessageDialog(this, "Computer was bought!", "Can not buy another one computer",
JOptionPane.OK_OPTION);
return;
}

String choice = (String)jComboBoxComputers.getSelectedItem();
int a = choice.indexOf("=");
int b = choice.indexOf("-");
U.log("-------------------------");
U.log(choice);
U.log("a "+a);
U.log("b "+b);

char ch[] = new char[7];
choice.getChars(a+2, a+9, ch, 0);

//price
String price = new String(ch);
Float f = new Float(price);
float pcPrice = f.floatValue();

//productivity
char []pcProductivity = new char[1];
choice.getChars(0,1,pcProductivity,0);
Computer.Productivity prod;
switch (pcProductivity[0]) {
case 'H': prod = Computer.Productivity.high; break;
case 'M': prod = Computer.Productivity.medium; break;
case 'L': prod = Computer.Productivity.low; break;
default: prod = Computer.Productivity.medium; break;
}

//company-seller
char seller[] = new char[20];
for(int k =0; k<seller.length; k++)
seller[k]=' ';
choice.getChars(b+2, choice.length(), seller, 0);
String pcSeller = new String(seller);



//computer name
char pcname[] = new char[20];
for(int k =0; k<pcname.length; k++)
pcname[k]=' ';
choice.getChars(0, a, pcname, 0);
String pcName = new String(pcname);

U.log("---------- name:"+pcName);

Computer c = new Computer(prod);
U.log("price :"+pcPrice+": seller :"+pcSeller);
c.setPrice(pcPrice);
c.setSeller(pcSeller);
c.setName(pcName);


if(c.getPrice() > h.getBudget().cash()) {
JOptionPane.showMessageDialog(this, "You have no enough money to pay for this computer!",
"Choose another pc please", JOptionPane.OK_OPTION);
return;
}
boolean bo = h.buyComputer(c);
updateAllInfo();
jComboBoxComputers.setEnabled(false);
}//GEN-LAST:event_jButton4MouseClicked

private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
// TODO add your handling code here:
jDialogNewHuman.setSize(400,260);
jDialogNewHuman.setVisible(true);
updateAllInfo();
}//GEN-LAST:event_jButton1MouseClicked

private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
// TODO add your handling code here:
if(jTextFieldName.getText().length()<5) {
JOptionPane.showMessageDialog(jDialogNewHuman, "Too short or empty name.",
"Try again", JOptionPane.ERROR_MESSAGE);
return;
}
if(jRadioButton500.isSelected()){
h = new Human(jTextFieldName.getText(), 500);
}
if(jRadioButton1000.isSelected()){
h = new Human(jTextFieldName.getText(), 1000);
}
if(jRadioButton5000.isSelected()){
h = new Human(jTextFieldName.getText(), 5000);
}
jDialogNewHuman.setVisible(false);
Соседние файлы в папке gui