Exemplo n.º 1
0
        public DialogEdit(Control Parent, Molecule Mol, List<int> SelIdx)
		{
            // super(Parent, "Edit Molecule", true)

            mol = Mol.Clone();
            aselidx = SelIdx;
            //UPGRADE_ISSUE: The following fragment of code could not be parsed and was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1156'"
            bselidx = new List<int>();
            for (int n = 1; n <= mol.NumBonds(); n++)
                if (aselidx.IndexOf(mol.BondFrom(n)) >= 0 && aselidx.IndexOf(mol.BondTo(n)) >= 0)
                    bselidx.Add(n);

            //UPGRADE_ISSUE: Method 'javax.swing.JDialog.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJDialogsetLayout_javaawtLayoutManager'"
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtBorderLayout'"
            /*
            setLayout(new BorderLayout());*/

            atoms = new AnonymousClassJTable(this, CompileAtomData(), new System.String[] { "#", "El", "X", "Y", "Charge", "Unpaired", "HExplicit" });
            bonds = new AnonymousClassJTable1(this, CompileBondData(), new System.String[] { "#", "From", "To", "Order", "Type" });

            //UPGRADE_TODO: Method 'javax.swing.table.TableColumn.setCellEditor' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1095'"
            //UPGRADE_TODO: The equivalent in .NET for method 'javax.swing.table.TableColumnModel.getColumn' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
            // ((System.Data.DataTable)atoms.DataSource).Columns[0].setCellEditor(null);
            System.Windows.Forms.ComboBox bondTypes = new System.Windows.Forms.ComboBox();
            for (int n = 0; n < BOND_TYPES.Length; n++)
                bondTypes.Items.Add(BOND_TYPES[n]);
            //UPGRADE_TODO: Method 'javax.swing.table.TableColumn.setCellEditor' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1095'"
            //UPGRADE_TODO: The equivalent in .NET for method 'javax.swing.table.TableColumnModel.getColumn' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
            //UPGRADE_ISSUE: Constructor 'javax.swing.DefaultCellEditor.DefaultCellEditor' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingDefaultCellEditor'"
            // TODO: Have to see this in action before I can tel what they need to do. 
            // ((System.Data.DataTable)bonds.DataSource).Columns[4].setCellEditor(new DefaultCellEditor(bondTypes));

            System.Windows.Forms.Panel tabAtoms = new System.Windows.Forms.Panel(), tabBonds = new System.Windows.Forms.Panel();
            //UPGRADE_ISSUE: Method 'java.awt.Container.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtContainersetLayout_javaawtLayoutManager'"
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtBorderLayout'"
            /*
            tabAtoms.setLayout(new BorderLayout());*/
            //UPGRADE_ISSUE: Method 'java.awt.Container.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtContainersetLayout_javaawtLayoutManager'"
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtBorderLayout'"
            /*
            tabBonds.setLayout(new BorderLayout());*/

            //UPGRADE_ISSUE: Method 'javax.swing.JTable.setPreferredScrollableViewportSize' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJTablesetPreferredScrollableViewportSize_javaawtDimension'"
            
            // TODO: atoms.setPreferredScrollableViewportSize(new System.Drawing.Size(350, 200));
            //UPGRADE_ISSUE: Method 'javax.swing.JTable.setPreferredScrollableViewportSize' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJTablesetPreferredScrollableViewportSize_javaawtDimension'"
            // TODO: bonds.setPreferredScrollableViewportSize(new System.Drawing.Size(350, 200));

            //UPGRADE_TODO: Constructor 'javax.swing.JScrollPane.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl.ScrollableControl' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJScrollPaneJScrollPane_javaawtComponent'"
            System.Windows.Forms.ScrollableControl temp_scrollablecontrol2;
            temp_scrollablecontrol2 = new System.Windows.Forms.ScrollableControl();
            temp_scrollablecontrol2.AutoScroll = true;
            temp_scrollablecontrol2.Controls.Add(atoms);
            //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
            System.Windows.Forms.Control temp_Control;
            temp_Control = temp_scrollablecontrol2;
            tabAtoms.Controls.Add(temp_Control);
            //UPGRADE_TODO: Constructor 'javax.swing.JScrollPane.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl.ScrollableControl' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJScrollPaneJScrollPane_javaawtComponent'"
            System.Windows.Forms.ScrollableControl temp_scrollablecontrol4;
            temp_scrollablecontrol4 = new System.Windows.Forms.ScrollableControl();
            temp_scrollablecontrol4.AutoScroll = true;
            temp_scrollablecontrol4.Controls.Add(bonds);
            //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
            System.Windows.Forms.Control temp_Control2;
            temp_Control2 = temp_scrollablecontrol4;
            tabBonds.Controls.Add(temp_Control2);

            tabs = new System.Windows.Forms.TabControl();
            //UPGRADE_TODO: Method 'javax.swing.JTabbedPane.addTab' was converted to 'SupportClass.TabControlSupport.AddTab' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJTabbedPaneaddTab_javalangString_javaawtComponent'"
            SupportClass.TabControlSupport.AddTab(tabs, "Atoms", tabAtoms);
            //UPGRADE_TODO: Method 'javax.swing.JTabbedPane.addTab' was converted to 'SupportClass.TabControlSupport.AddTab' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJTabbedPaneaddTab_javalangString_javaawtComponent'"
            SupportClass.TabControlSupport.AddTab(tabs, "Bonds", tabBonds);
            //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
            Controls.Add(tabs);
            tabs.Dock = System.Windows.Forms.DockStyle.Fill;
            tabs.BringToFront();

            System.Windows.Forms.Panel buttons = new System.Windows.Forms.Panel();
            //UPGRADE_TODO: Constructor 'java.awt.FlowLayout.FlowLayout' was converted to 'System.Object[]' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtFlowLayoutFlowLayout_int'"
            buttons.Tag = new System.Object[] { (int)System.Drawing.ContentAlignment.TopRight, 5, 5 };
            buttons.Layout += new System.Windows.Forms.LayoutEventHandler(SupportClass.FlowLayoutResize);
            accept = SupportClass.ButtonSupport.CreateStandardButton("Accept");
            accept.Click += new System.EventHandler(this.actionPerformed);
            SupportClass.CommandManager.CheckCommand(accept);
            reject = SupportClass.ButtonSupport.CreateStandardButton("Reject");
            reject.Click += new System.EventHandler(this.actionPerformed);
            SupportClass.CommandManager.CheckCommand(reject);
            //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
            buttons.Controls.Add(accept);
            //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
            buttons.Controls.Add(reject);
            //UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
            Controls.Add(buttons);
            buttons.Dock = System.Windows.Forms.DockStyle.Bottom;
            buttons.SendToBack();

            // TODO: What does pack do? 
            // pack();
		}