public virtual void actionPerformed(System.Object event_sender, System.EventArgs event_Renamed) { //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"' if (event_sender == fontColorChooserButton) { System.Drawing.Color newColor = JColorChooser.showDialog(this, "Choose a Fontcolor", new Color(gui.Preferences.getInt("shell.fontcolor", System.Drawing.Color.WHITE.RGB))); if (newColor != null) { fontColorChooserPreview.setBackground(newColor); } } else { //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"' if (event_sender == backgroundColorChooserButton) { System.Drawing.Color newColor = JColorChooser.showDialog(this, "Choose a Backgroundcolor", new Color(gui.Preferences.getInt("shell.backgroundcolor", System.Drawing.Color.BLACK.RGB))); if (newColor != null) { backgroundColorChooserPreview.setBackground(newColor); } } } }
public ShellSettingsPanel(JamochaGui gui) : base(gui) { //UPGRADE_ISSUE: Class 'java.awt.GridBagLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagLayout"' //UPGRADE_ISSUE: Constructor 'java.awt.GridBagLayout.GridBagLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagLayout"' GridBagLayout gridbag = new GridBagLayout(); //UPGRADE_ISSUE: Class 'java.awt.GridBagConstraints' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"' //UPGRADE_ISSUE: Constructor 'java.awt.GridBagConstraints.GridBagConstraints' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"' GridBagConstraints c = new GridBagConstraints(); //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.weightx' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"' c.weightx = 1.0; setLayout(gridbag); // Font addLabel(this, new JLabel("Font:"), gridbag, c, 0); GraphicsEnvironment ge = GraphicsEnvironment.LocalGraphicsEnvironment; System.Drawing.Font[] allFonts = ge.AllFonts; fonts = new JComboBox(allFonts); System.Drawing.Font selFont = null; System.String selFontName = gui.Preferences.get("shell.font", "Courier"); for (int idx = 0; idx < allFonts.Length; idx++) { System.Drawing.Font curFont = allFonts[idx]; if (curFont.FontName.equals(selFontName)) { selFont = curFont; break; } } if (selFont != null) { fonts.setSelectedItem(selFont); } fonts.setRenderer(new FontListCellRenderer(this)); addInputComponent(this, fonts, gridbag, c, 0); // Fontsize addLabel(this, new JLabel("Fontsize:"), gridbag, c, 1); System.Int32[] sizes = new System.Int32[17]; for (int i = 0; i < sizes.Length; ++i) { sizes[i] = 8 + i; } fontsizes = new JComboBox(sizes); //fontsizes.setSelectedItem(gui.getPreferences().getInt("shell.fontsize", // 12)); addInputComponent(this, fontsizes, gridbag, c, 1); // Fontcolor addLabel(this, new JLabel("Fontcolor:"), gridbag, c, 2); //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"' JPanel fontColorChooserPanel = new JPanel(new FlowLayout()); fontColorChooserPreview = new JTextField(5); fontColorChooserPreview.setEditable(false); fontColorChooserPreview.setBackground(new Color(gui.Preferences.getInt("shell.fontcolor", System.Drawing.Color.WHITE.RGB))); fontColorChooserButton = new JButton("Choose Color", IconLoader.getImageIcon("color_swatch")); fontColorChooserButton.addActionListener(this); fontColorChooserPanel.add(fontColorChooserPreview); fontColorChooserPanel.add(fontColorChooserButton); addInputComponent(this, fontColorChooserPanel, gridbag, c, 2); // Backgroundcolor addLabel(this, new JLabel("Backgroundcolor:"), gridbag, c, 3); //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"' JPanel backgroundColorChooserPanel = new JPanel(new FlowLayout()); backgroundColorChooserPreview = new JTextField(5); backgroundColorChooserPreview.setEditable(false); backgroundColorChooserPreview.setBackground(new Color(gui.Preferences.getInt("shell.backgroundcolor", System.Drawing.Color.BLACK.RGB))); backgroundColorChooserButton = new JButton("Choose Color", IconLoader.getImageIcon("color_swatch")); backgroundColorChooserButton.addActionListener(this); backgroundColorChooserPanel.add(backgroundColorChooserPreview); backgroundColorChooserPanel.add(backgroundColorChooserButton); addInputComponent(this, backgroundColorChooserPanel, gridbag, c, 3); }