import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.plaf.metal.*; import java.net.*; import java.io.*; import java.util.*; import java.util.Properties; import java.text.*; public class WOR_FormDialog extends JDialog { static int openFrameCount = 0; static final int offset = 20; private JDialog wor_d; JTextField desPSField, desDateField, engPSField, engDateField, projPSField, custPSField, platPSField, IRField, WORField, aDateField, CadField, DrwField, engApField; JTextArea EJDcontent; String des_prop_val, eng_prop_val, proj_prop_val, cust_prop_val, plat_prop_val; String ROG_desSTG = "ROG_des.", ROG_engSTG = "ROG_eng.", ROG_projSTG = "ROG_proj.", ROG_custSTG = "ROG_cust.", ROG_platSTG = "ROG_plat."; String des_propsfile = "ROG_des.properties", eng_propsfile = "ROG_eng.properties", proj_propsfile = "ROG_proj.properties", cust_propsfile = "ROG_cust.properties", plat_propsfile = "ROG_plat.properties"; Properties des_props = new Properties (); Properties eng_props = new Properties (); Properties proj_props = new Properties (); Properties cust_props = new Properties (); Properties plat_props = new Properties (); String[] engAp_val = { "No","Yes" }; String[] Cad_val = { "ProEng","Catia","Cadra","UG","Acad" }; String[] Drw_val = { "Layout","Experimental","Z Drawing","Released" }; String if_wor, irTxt = "", NEJDstg, EJDgetstg, EJDstgtmp, savestg; String prjcts, dsgns, engns, cstmrs, pltfms, dtstg, dtstgsh, aDateStg; String fCadStg, fDrwStg, projStg, desStg, engStg, custStg, platStg; String desDt, engDt, engApStg, shworflnm, rworflnmver3; String WOR_DIR = "./wor"; String EJDstg = "1. On Drawing ***, Change the following:\n\n" + "2. On Drawing ***, Change the following:\n\n" + "3. On Drawing ***, Change the following:\n\n" + "4. On Drawing ***, Change the following:\n\n" + "5. On Drawing ***, Change the following:\n"; public WOR_FormDialog ( String if_wor, String savestg ){ wor_d=new JDialog(new JFrame(),"Work Order Request",true); wor_d.setSize(500,600); wor_d.setResizable( false ); try { UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (Exception exc) {} //super("", true, true, true, true); setResizable( true ); openFrameCount++; // Designers try { des_props.load(new BufferedInputStream(new FileInputStream(des_propsfile))); } catch (IOException e) {} String[] des_prop_val = new String[des_props.size()]; for (int n = 0; n < des_props.size(); n++) { des_prop_val[n] = des_props.getProperty(ROG_desSTG + n); } // Engineers try { eng_props.load(new BufferedInputStream(new FileInputStream(eng_propsfile))); } catch (IOException e) {} String[] eng_prop_val = new String[eng_props.size()]; for (int n = 0; n < eng_props.size(); n++) { eng_prop_val[n] = eng_props.getProperty(ROG_engSTG + n); } // Projects try { proj_props.load(new BufferedInputStream(new FileInputStream(proj_propsfile))); } catch (IOException e) {} String[] proj_prop_val = new String[proj_props.size()]; for (int n = 0; n < proj_props.size(); n++) { proj_prop_val[n] = proj_props.getProperty(ROG_projSTG + n); } // Customers try { cust_props.load(new BufferedInputStream(new FileInputStream(cust_propsfile))); } catch (IOException e) {} String[] cust_prop_val = new String[cust_props.size()]; for (int n = 0; n < cust_props.size(); n++) { cust_prop_val[n] = cust_props.getProperty(ROG_custSTG + n); } // Platforms try { plat_props.load(new BufferedInputStream(new FileInputStream(plat_propsfile))); } catch (IOException e) {} String[] plat_prop_val = new String[plat_props.size()]; for (int n = 0; n < plat_props.size(); n++) { plat_prop_val[n] = plat_props.getProperty(ROG_platSTG + n); } if ( if_wor == "null-stg" ) { setTitle("PRODUCT DESIGN WORK ORDER REQUEST " + openFrameCount + " : New Form"); dtstg = getDatestg(); NEJDstg = EJDstg; engApStg = engAp_val[0]; desDt = engDt = aDateStg = getDatestgsh(); desStg = engStg = projStg = custStg = platStg = fCadStg = fDrwStg = ""; } else { setTitle("PRODUCT DESIGN WORK ORDER REQUEST " + openFrameCount + " : Existing Form"); // Read WOR Properties file final String WOR_propsfile = if_wor; Properties WOR_props = new Properties (); try { InputStream din = new FileInputStream(WOR_propsfile); WOR_props.load(din); din.close(); dtstg = WOR_props.getProperty("WOR_File_Name"); dtstgsh = WOR_props.getProperty("Date_STG"); irTxt = WOR_props.getProperty("IR_Packet"); desStg = WOR_props.getProperty("Designer"); desDt = WOR_props.getProperty("Designer_Date"); engStg = WOR_props.getProperty("Engineer"); engDt = WOR_props.getProperty("Engineer_Date"); projStg = WOR_props.getProperty("Project"); custStg = WOR_props.getProperty("Customer"); platStg = WOR_props.getProperty("Platform"); aDateStg = WOR_props.getProperty("Date_Reqd"); fCadStg = WOR_props.getProperty("Cad_Sys"); fDrwStg = WOR_props.getProperty("Drawing_Format"); engApStg = WOR_props.getProperty("Eng_Approval"); EJDgetstg = WOR_props.getProperty("Eng_Job_Descr_STG"); NEJDstg = get_dnd2n(); } catch (IOException e) {} } JPanel topPanel = new JPanel(); topPanel.setBorder(new EmptyBorder(1,1,1,1)); topPanel.setLayout(new BorderLayout()); // WOR Form Grid JPanel WORformGrid = new JPanel(); GridBagLayout gbc0 = new GridBagLayout(); WORformGrid.setLayout(gbc0); // Header Panel JPanel HeaderPanel = new JPanel(); GridBagLayout gbc6 = new GridBagLayout(); HeaderPanel.setLayout(gbc6); dtstgsh = getDatestgsh(); // WORPanel Layout JPanel WORPanel = new JPanel(); JLabel WORLabel = new JLabel( "Work Order Request #: " ); if ( if_wor == "null-stg" ) WORField = new JTextField(10); else WORField = new JTextField(dtstg, 10); WORField.setEditable( false ); WORPanel.add(WORLabel); WORPanel.add(WORField); // Date Layout JPanel datePanel = new JPanel(); JLabel dateLabel = new JLabel( "Date: " + dtstgsh ); datePanel.add(dateLabel); HeaderPanel.add(WORPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); HeaderPanel.add(datePanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); // Designers JPanel desPanel = new JPanel(); GridBagLayout gbc2 = new GridBagLayout(); desPanel.setLayout(gbc2); JPanel desPSPanel = new JPanel(); JLabel desPSLabel = new JLabel ("Designer: "); desPSField = new JTextField(desStg,12); desPSPanel.add(desPSLabel); desPSPanel.add(desPSField); JPanel desCBPanel = new JPanel(); final JComboBox dsgnsComboBox = new JComboBox(des_prop_val); dsgnsComboBox.setSelectedItem(desStg); desCBPanel.add(dsgnsComboBox); dsgnsComboBox.addItemListener( new ItemListener() { public void itemStateChanged( ItemEvent e ) { if( e.getStateChange() == ItemEvent.SELECTED ){ desPSField.setText("" + ((JComboBox)e.getSource()).getSelectedItem()); } } } ); // Designer Date Layout JPanel desDatePanelLt = new JPanel(); JLabel desDateLabel = new JLabel( "Date: " ); desDatePanelLt.add(desDateLabel); JPanel desDatePanelRt = new JPanel(); desDateField = new JTextField(""+ desDt, 6); desDatePanelRt.add(desDateField); desPanel.add(desPSPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); desPanel.add(desCBPanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); desPanel.add(desDatePanelLt, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); desPanel.add(desDatePanelRt, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); // Engineers JPanel engPanel = new JPanel(); GridBagLayout gbc3 = new GridBagLayout(); engPanel.setLayout(gbc3); JPanel engPSPanel = new JPanel(); JLabel engPSLabel = new JLabel ("Engineer: "); engPSField = new JTextField(engStg,11); engPSPanel.add(engPSLabel); engPSPanel.add(engPSField); JPanel engCBPanel = new JPanel(); final JComboBox engnsComboBox = new JComboBox(eng_prop_val); engnsComboBox.setSelectedItem(engStg); engCBPanel.add(engnsComboBox); engnsComboBox.addItemListener( new ItemListener() { public void itemStateChanged( ItemEvent e ) { if( e.getStateChange() == ItemEvent.SELECTED ){ engPSField.setText("" + ((JComboBox)e.getSource()).getSelectedItem()); } } } ); // Engineer Date Layout JPanel engDatePanelLt = new JPanel(); JLabel engDateLabel = new JLabel( "Date: " ); engDatePanelLt.add(engDateLabel); JPanel engDatePanelRt = new JPanel(); engDateField = new JTextField(""+ engDt, 6); engDatePanelRt.add(engDateField); engPanel.add(engPSPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); engPanel.add(engCBPanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); engPanel.add(engDatePanelLt, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); engPanel.add(engDatePanelRt, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); // Projects JPanel projPanel = new JPanel(); GridBagLayout gbc1 = new GridBagLayout(); projPanel.setLayout(gbc1); JPanel projPSPanel = new JPanel(); JLabel projPSLabel = new JLabel ("Project #: "); projPSField = new JTextField(projStg,28); projPSPanel.add(projPSLabel); projPSPanel.add(projPSField); JPanel projCBPanel = new JPanel(); final JComboBox prjctsComboBox = new JComboBox(proj_prop_val); prjctsComboBox.setSelectedItem(projStg); projCBPanel.add(prjctsComboBox); prjctsComboBox.addItemListener( new ItemListener() { public void itemStateChanged( ItemEvent e ) { if( e.getStateChange() == ItemEvent.SELECTED ){ projPSField.setText("" + ((JComboBox)e.getSource()).getSelectedItem()); } } } ); projPanel.add(projPSPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); projPanel.add(projCBPanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); // Customers JPanel custPanel = new JPanel(); GridBagLayout gbc4 = new GridBagLayout(); custPanel.setLayout(gbc4); JPanel custPSPanel = new JPanel(); JLabel custPSLabel = new JLabel ("Customer: "); custPSField = new JTextField(custStg,23); custPSPanel.add(custPSLabel); custPSPanel.add(custPSField); JPanel custCBPanel = new JPanel(); final JComboBox cstmrsComboBox = new JComboBox(cust_prop_val); cstmrsComboBox.setSelectedItem(custStg); custCBPanel.add(cstmrsComboBox); cstmrsComboBox.addItemListener( new ItemListener() { public void itemStateChanged( ItemEvent e ) { if( e.getStateChange() == ItemEvent.SELECTED ){ custPSField.setText("" + ((JComboBox)e.getSource()).getSelectedItem()); } } } ); custPanel.add(custPSPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); custPanel.add(custCBPanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); // Platforms JPanel platPanel = new JPanel(); GridBagLayout gbc5 = new GridBagLayout(); platPanel.setLayout(gbc5); JPanel platPSPanel = new JPanel(); JLabel platPSLabel = new JLabel ("Vehicle Platform: "); platPSField = new JTextField(platStg,18); platPSPanel.add(platPSLabel); platPSPanel.add(platPSField); JPanel platCBPanel = new JPanel(); final JComboBox pltfmsComboBox = new JComboBox(plat_prop_val); pltfmsComboBox.setSelectedItem(platStg); platCBPanel.add(pltfmsComboBox); pltfmsComboBox.addItemListener( new ItemListener() { public void itemStateChanged( ItemEvent e ) { if( e.getStateChange() == ItemEvent.SELECTED ){ platPSField.setText("" + ((JComboBox)e.getSource()).getSelectedItem()); } } } ); platPanel.add(platPSPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); platPanel.add(platCBPanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); JPanel EJDPanel = new JPanel(); EJDPanel.setBorder(new EmptyBorder(2,2,2,2)); EJDPanel.setLayout(new BorderLayout()); JLabel EJDLabel = new JLabel("Engineering Job Description:"); EJDcontent = new JTextArea(NEJDstg, 10,40); EJDcontent.setBorder( new EmptyBorder(2,2,2,2)); EJDcontent.setLineWrap(false); JScrollPane textScroller = new JScrollPane(EJDcontent, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED ); EJDPanel.add(EJDLabel, BorderLayout.NORTH); EJDPanel.add(textScroller, BorderLayout.SOUTH); // Grid Panel Layout WORformGrid.add(HeaderPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); WORformGrid.add(desPanel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); WORformGrid.add(engPanel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); WORformGrid.add(projPanel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); WORformGrid.add(custPanel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); WORformGrid.add(platPanel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); WORformGrid.add(EJDPanel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); // Side Grid Panel JPanel SideGridPanel = new JPanel(); GridBagLayout gbc10 = new GridBagLayout(); SideGridPanel.setLayout(gbc10); // IR Grid Panel JPanel IRGridPanel = new JPanel(); GridBagLayout gbc15 = new GridBagLayout(); IRGridPanel.setLayout(gbc15); JPanel IRPanelUp = new JPanel(); JLabel IRLabel = new JLabel( "IR Packet #: " ); IRPanelUp.add(IRLabel); JPanel IRPanelLw = new JPanel(); IRField = new JTextField(""+ irTxt, 8); IRPanelLw.add(IRField); // Action Date Grid Panel IRGridPanel.add(IRPanelUp, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); IRGridPanel.add(IRPanelLw, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); JPanel aDateGridPanel = new JPanel(); GridBagLayout gbc11 = new GridBagLayout(); aDateGridPanel.setLayout(gbc11); // Action Date Layout JPanel aDatePanelUp = new JPanel(); JLabel aDateLabel = new JLabel( "Date Req'd: " ); aDatePanelUp.add(aDateLabel); JPanel aDatePanelDn = new JPanel(); aDateField = new JTextField(""+ aDateStg, 8); aDatePanelDn.add(aDateField); // Action Date Grid Panel aDateGridPanel.add(aDatePanelUp, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); aDateGridPanel.add(aDatePanelDn, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); // Cad Grid Panel JPanel CadGridPanel = new JPanel(); GridBagLayout gbc12 = new GridBagLayout(); CadGridPanel.setLayout(gbc12); JPanel CadPanelUp = new JPanel(); JLabel CadLabel = new JLabel ("Cad System: "); CadPanelUp.add(CadLabel); JPanel CadPanelMid = new JPanel(); CadField = new JTextField(""+ fCadStg, 8); CadPanelMid.add(CadField); JPanel CadPanelLw = new JPanel(); final JComboBox CadComboBox = new JComboBox(Cad_val); CadComboBox.setSelectedItem(Cad_val[0]); CadPanelLw.add(CadComboBox); CadComboBox.addItemListener( new ItemListener() { public void itemStateChanged( ItemEvent e ) { if( e.getStateChange() == ItemEvent.SELECTED ){ CadField.setText("" + ((JComboBox)e.getSource()).getSelectedItem()); } } } ); // Cad Grid Panel Layout CadGridPanel.add(CadPanelUp, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); CadGridPanel.add(CadPanelMid, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); CadGridPanel.add(CadPanelLw, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); // Drw Grid Panel JPanel DrwGridPanel = new JPanel(); GridBagLayout gbc13 = new GridBagLayout(); DrwGridPanel.setLayout(gbc13); JPanel DrwPanelUp = new JPanel(); JLabel DrwLabel = new JLabel ("Drawing Format: "); DrwPanelUp.add(DrwLabel); JPanel DrwPanelMid = new JPanel(); DrwField = new JTextField(""+ fDrwStg, 9); DrwPanelMid.add(DrwField); JPanel DrwPanelLw = new JPanel(); final JComboBox DrwComboBox = new JComboBox(Drw_val); DrwComboBox.setSelectedItem(Drw_val[0]); DrwPanelLw.add(DrwComboBox); DrwComboBox.addItemListener( new ItemListener() { public void itemStateChanged( ItemEvent e ) { if( e.getStateChange() == ItemEvent.SELECTED ){ DrwField.setText("" + ((JComboBox)e.getSource()).getSelectedItem()); } } } ); // Drw Grid Panel Layout DrwGridPanel.add(DrwPanelUp, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); DrwGridPanel.add(DrwPanelMid, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); DrwGridPanel.add(DrwPanelLw, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); // Engineer Approved Grid Panel JPanel engApGridPanel = new JPanel(); GridBagLayout gbc14 = new GridBagLayout(); engApGridPanel.setLayout(gbc14); // Engineer Approved Layout JPanel engApPanelUp = new JPanel(); JLabel engApLabel = new JLabel( "Eng. Approved: " ); engApPanelUp.add(engApLabel); JPanel engApPanelMid = new JPanel(); engApField = new JTextField(""+ engApStg, 4); engApPanelMid.add(engApField); JPanel engApPanelLw = new JPanel(); final JComboBox engApComboBox = new JComboBox(engAp_val); engApComboBox.setSelectedItem(engAp_val[0]); engApPanelLw.add(engApComboBox); engApComboBox.addItemListener( new ItemListener() { public void itemStateChanged( ItemEvent e ) { if( e.getStateChange() == ItemEvent.SELECTED ){ engApField.setText("" + ((JComboBox)e.getSource()).getSelectedItem()); } } } ); engApGridPanel.add(engApPanelUp, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); engApGridPanel.add(engApPanelMid, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); engApGridPanel.add(engApPanelLw, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); // Side Grid Panel Layout SideGridPanel.add(IRGridPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); SideGridPanel.add(aDateGridPanel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); SideGridPanel.add(CadGridPanel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); SideGridPanel.add(DrwGridPanel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); SideGridPanel.add(engApGridPanel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 1, 0)); topPanel.add(WORformGrid, BorderLayout.WEST); topPanel.add(SideGridPanel, BorderLayout.EAST); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout ( new FlowLayout(FlowLayout.CENTER) ); JButton SaveBut = new JButton("SAVE"); SaveBut.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SaveSelected(); }}); if ( savestg == "save" ) { buttonPanel.add(SaveBut); } JButton ExitBut = new JButton("EXIT"); ExitBut.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ExitSelected(); }}); buttonPanel.add(ExitBut); topPanel.add(buttonPanel, BorderLayout.SOUTH); //setContentPane(topPanel); //pack(); //setLocation( offset * openFrameCount, offset * openFrameCount); wor_d.getContentPane().add(topPanel); wor_d.toFront (); wor_d.pack(); wor_d.show(); wor_d.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { KickOff.stop(); } }); } public void SaveSelected() { String irTxt = getirField(); String prjcts = getProj(); String dsgns = getDes(); String desDt = getdesDateStg(); String engns = getEng(); String engDt = getengDateStg(); String cstmrs = getCust(); String pltfms = getPlat(); String EJDn2dnd = put_n2dnd(); String EJDn2br = put_n2br(); String aDateStg = getaDateStg(); String fCadStg = getaCadStg(); String fDrwStg = getaDrwStg(); String engApStg = getengApStg(); String dtstgsh = getDatestgsh(); String shworflnm = dtstg + ".wor"; String shhtmflnm = dtstg + ".htm"; String worflnm = WOR_DIR + "/" + shworflnm; String htmflnm = WOR_DIR + "/" + shhtmflnm; String revstg = getRevstg( shworflnm ); String rworflnm = WOR_DIR + "/" + revstg; try { PrintStream ff = new PrintStream(new FileOutputStream(worflnm)); ff.println( "WOR_File_Name=" + dtstg ); ff.println( "Date_STG=" + dtstgsh ); ff.println( "IR_Packet=" + irTxt ); ff.println( "Project=" + prjcts ); ff.println( "Designer=" + dsgns ); ff.println( "Designer_Date=" + desDt ); ff.println( "Engineer=" + engns ); ff.println( "Engineer_Date=" + engDt ); ff.println( "Customer=" + cstmrs ); ff.println( "Platform=" + pltfms ); ff.println( "Date_Reqd=" + aDateStg ); ff.println( "Cad_Sys=" + fCadStg ); ff.println( "Drawing_Format=" + fDrwStg ); ff.println( "Eng_Approval=" + engApStg ); ff.println( "Eng_Job_Descr_STG=" + EJDn2dnd ); ff.flush(); ff.close(); } catch(java.io.IOException IOEx) { System.out.println("Cannot create " + worflnm + " file."); } try { PrintStream ff2 = new PrintStream(new FileOutputStream(rworflnm)); ff2.println( "WOR_File_Name=" + dtstg ); ff2.println( "Date_STG=" + dtstgsh ); ff2.println( "IR_Packet=" + irTxt ); ff2.println( "Project=" + prjcts ); ff2.println( "Designer=" + dsgns ); ff2.println( "Designer_Date=" + desDt ); ff2.println( "Engineer=" + engns ); ff2.println( "Engineer_Date=" + engDt ); ff2.println( "Customer=" + cstmrs ); ff2.println( "Platform=" + pltfms ); ff2.println( "Date_Reqd=" + aDateStg ); ff2.println( "Cad_Sys=" + fCadStg ); ff2.println( "Drawing_Format=" + fDrwStg ); ff2.println( "Eng_Approval=" + engApStg ); ff2.println( "Eng_Job_Descr_STG=" + EJDn2dnd ); ff2.flush(); ff2.close(); } catch(java.io.IOException IOEx) { System.out.println("Cannot create " + rworflnm + " file."); } try { PrintStream p = new PrintStream(new FileOutputStream(htmflnm)); p.println( "
" ); p.println( "Product Design Work Order Request | |
Work Order Request #: " + dtstg + " | " );
p.println( "Date: " + dtstgsh + " |
IR Packet #: " + irTxt + " | " );
p.println( "Project: " + prjcts + " |
Designer: " + dsgns + " | " );
p.println( "Date: " + desDt + " |
Engineer: " + engns + " | " );
p.println( "Date: " + engDt + " |
Customer: " + cstmrs + " | " );
p.println( "Platform: " + pltfms + " |
Date Reqd: " + aDateStg + " | " );
p.println( "Cad System: " + fCadStg + " |
Drawing Format: " + fDrwStg + " | " );
p.println( "Engineering Approval: " + engApStg + " |
Engineering Job Description: | |