public DefaultChartEditor([In] JFreeChart obj0) { base.\u002Ector(); DefaultChartEditor defaultChartEditor = this; ((Container) this).setLayout((LayoutManager) new BorderLayout()); JPanel.__\u003Cclinit\u003E(); JPanel jpanel1 = new JPanel((LayoutManager) new BorderLayout()); ((JComponent) jpanel1).setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); JPanel.__\u003Cclinit\u003E(); JPanel jpanel2 = new JPanel((LayoutManager) new BorderLayout()); ((JComponent) jpanel2).setBorder((Border) BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), DefaultChartEditor.localizationResources.getString("General"))); JPanel.__\u003Cclinit\u003E(); JPanel jpanel3 = new JPanel((LayoutManager) new LCBLayout(6)); ((JComponent) jpanel3).setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); JCheckBox.__\u003Cclinit\u003E(); this.antialias = new JCheckBox(DefaultChartEditor.localizationResources.getString("Draw_anti-aliased")); ((AbstractButton) this.antialias).setSelected(obj0.getAntiAlias()); ((Container) jpanel3).add((Component) this.antialias); ((Container) jpanel3).add((Component) new JLabel("")); ((Container) jpanel3).add((Component) new JLabel("")); JPanel jpanel4 = jpanel3; JLabel.__\u003Cclinit\u003E(); JLabel jlabel1 = new JLabel(DefaultChartEditor.localizationResources.getString("Background_paint")); ((Container) jpanel4).add((Component) jlabel1); PaintSample.__\u003Cclinit\u003E(); this.background = new PaintSample(obj0.getBackgroundPaint()); ((Container) jpanel3).add((Component) this.background); JButton.__\u003Cclinit\u003E(); JButton jbutton1 = new JButton(DefaultChartEditor.localizationResources.getString("Select...")); ((AbstractButton) jbutton1).setActionCommand("BackgroundPaint"); ((AbstractButton) jbutton1).addActionListener((ActionListener) this); ((Container) jpanel3).add((Component) jbutton1); JPanel jpanel5 = jpanel3; JLabel.__\u003Cclinit\u003E(); JLabel jlabel2 = new JLabel(DefaultChartEditor.localizationResources.getString("Series_Paint")); ((Container) jpanel5).add((Component) jlabel2); JTextField.__\u003Cclinit\u003E(); JTextField jtextField1 = new JTextField(DefaultChartEditor.localizationResources.getString("No_editor_implemented")); ((JComponent) jtextField1).setEnabled(false); ((Container) jpanel3).add((Component) jtextField1); JButton.__\u003Cclinit\u003E(); JButton jbutton2 = new JButton(DefaultChartEditor.localizationResources.getString("Edit...")); ((AbstractButton) jbutton2).setEnabled(false); ((Container) jpanel3).add((Component) jbutton2); JPanel jpanel6 = jpanel3; JLabel.__\u003Cclinit\u003E(); JLabel jlabel3 = new JLabel(DefaultChartEditor.localizationResources.getString("Series_Stroke")); ((Container) jpanel6).add((Component) jlabel3); JTextField.__\u003Cclinit\u003E(); JTextField jtextField2 = new JTextField(DefaultChartEditor.localizationResources.getString("No_editor_implemented")); ((JComponent) jtextField2).setEnabled(false); ((Container) jpanel3).add((Component) jtextField2); JButton.__\u003Cclinit\u003E(); JButton jbutton3 = new JButton(DefaultChartEditor.localizationResources.getString("Edit...")); ((AbstractButton) jbutton3).setEnabled(false); ((Container) jpanel3).add((Component) jbutton3); JPanel jpanel7 = jpanel3; JLabel.__\u003Cclinit\u003E(); JLabel jlabel4 = new JLabel(DefaultChartEditor.localizationResources.getString("Series_Outline_Paint")); ((Container) jpanel7).add((Component) jlabel4); JTextField.__\u003Cclinit\u003E(); JTextField jtextField3 = new JTextField(DefaultChartEditor.localizationResources.getString("No_editor_implemented")); ((JComponent) jtextField3).setEnabled(false); ((Container) jpanel3).add((Component) jtextField3); JButton.__\u003Cclinit\u003E(); JButton jbutton4 = new JButton(DefaultChartEditor.localizationResources.getString("Edit...")); ((AbstractButton) jbutton4).setEnabled(false); ((Container) jpanel3).add((Component) jbutton4); JPanel jpanel8 = jpanel3; JLabel.__\u003Cclinit\u003E(); JLabel jlabel5 = new JLabel(DefaultChartEditor.localizationResources.getString("Series_Outline_Stroke")); ((Container) jpanel8).add((Component) jlabel5); JTextField.__\u003Cclinit\u003E(); JTextField jtextField4 = new JTextField(DefaultChartEditor.localizationResources.getString("No_editor_implemented")); ((JComponent) jtextField4).setEnabled(false); ((Container) jpanel3).add((Component) jtextField4); JButton.__\u003Cclinit\u003E(); JButton jbutton5 = new JButton(DefaultChartEditor.localizationResources.getString("Edit...")); ((AbstractButton) jbutton5).setEnabled(false); ((Container) jpanel3).add((Component) jbutton5); ((Container) jpanel2).add((Component) jpanel3, (object) "North"); ((Container) jpanel1).add((Component) jpanel2, (object) "North"); JPanel.__\u003Cclinit\u003E(); JPanel jpanel9 = new JPanel((LayoutManager) new BorderLayout()); TextTitle title = obj0.getTitle(); Plot plot = obj0.getPlot(); JTabbedPane jtabbedPane = new JTabbedPane(); this.titleEditor = new DefaultTitleEditor((Title) title); ((JComponent) this.titleEditor).setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); jtabbedPane.addTab(DefaultChartEditor.localizationResources.getString("Title"), (Component) this.titleEditor); this.plotEditor = new DefaultPlotEditor(plot); ((JComponent) this.plotEditor).setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); jtabbedPane.addTab(DefaultChartEditor.localizationResources.getString("Plot"), (Component) this.plotEditor); jtabbedPane.add(DefaultChartEditor.localizationResources.getString("Other"), (Component) jpanel1); ((Container) jpanel9).add((Component) jtabbedPane, (object) "North"); ((Container) this).add((Component) jpanel9); }
/// <summary> Create a GUI-Instance for Jamocha. /// /// </summary> /// <param name="">engine /// The Jamocha-engine that will be used in the GUI. /// /// </param> public JamochaGui(Rete engine) { InitBlock(); // set up the frame //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"' this.ContentPane.setLayout(new BorderLayout()); this.setTitle("Jamocha"); setSizeAndLocation(); // show logo //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"' JPanel logoPanel = new JPanel(new BorderLayout()); //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.EAST' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"' logoPanel.add(new JLabel(IconLoader.getImageIcon("jamocha")), BorderLayout.EAST); //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.NORTH' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"' this.ContentPane.add(logoPanel, BorderLayout.NORTH); // create a tabbed pane tabbedPane = new JTabbedPane(); //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"' this.ContentPane.add(tabbedPane, BorderLayout.CENTER); // add MenuBar menuBar = new JamochaMenuBar(this); this.setJMenuBar(menuBar); // create a rete engine this.engine = engine; // create a shell tab and add it to the tabbed pane ShellPanel shellPanel = new ShellPanel(this); tabbedPane.addTab("Shell", IconLoader.getImageIcon("application_osx_terminal"), shellPanel, "Jamocha Shell"); panels.add(shellPanel); FactsPanel factsPanel = new FactsPanel(this); tabbedPane.addTab("Facts", IconLoader.getImageIcon("database"), factsPanel, "View or modify Facts"); panels.add(factsPanel); TemplatesPanel templatesPanel = new TemplatesPanel(this); tabbedPane.addTab("Templates", IconLoader.getImageIcon("brick"), templatesPanel, "View or modify Templates"); panels.add(templatesPanel); FunctionsPanel functionsPanel = new FunctionsPanel(this); tabbedPane.addTab("Functions", IconLoader.getImageIcon("cog"), functionsPanel, "View Functions"); panels.add(functionsPanel); RetePanel retePanel = new RetePanel(this); tabbedPane.addTab("Rete", IconLoader.getImageIcon("eye"), retePanel, "View the Rete-network"); panels.add(retePanel); LogPanel logPanel = new LogPanel(this); tabbedPane.addTab("Log", IconLoader.getImageIcon("monitor"), logPanel, "View alle messages from or to the Rete-engine"); panels.add(logPanel); SettingsPanel settingsPanel = new SettingsPanel(this); tabbedPane.addTab("Settings", IconLoader.getImageIcon("wrench"), settingsPanel, "Settings for Jamocha"); panels.add(settingsPanel); // add the tab pane to the frame //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"' this.ContentPane.add(tabbedPane, BorderLayout.CENTER); tabbedPane.addChangeListener(this); // add a listener to the frame to kill the engine when the GUI is closed addWindowListener(new AnonymousClassWindowAdapter(this)); }
/// <summary> /// Initialize the interface. </summary> /// <param name="title"> Title to be displayed. </param> /// <param name="is_visible"> Indicates whether the display should be made visible at /// creation. </param> private void initialize(string title, bool is_visible) { GridBagLayout gbl = new GridBagLayout(); Insets insetsTLBR = new Insets(2, 2, 2, 2); // space around text // area // Add a panel to hold the main components... JPanel display_JPanel = new JPanel(); display_JPanel.setLayout(gbl); getContentPane().add(display_JPanel); JTabbedPane dataset_JTabbedPane = new JTabbedPane(); //dataset_JTabbedPane.addChangeListener ( this ); JGUIUtil.addComponent(display_JPanel, dataset_JTabbedPane, 0, 0, 10, 1, 0, 0, insetsTLBR, GridBagConstraints.BOTH, GridBagConstraints.CENTER); int y = 0; // Used for vertical positioning. // // Data Set Components... // // 1 row per component, each column width of 1 // JPanel components_JPanel = new JPanel(); components_JPanel.setLayout(gbl); dataset_JTabbedPane.addTab("Components", null, components_JPanel, "Components"); // Add the headers... int x = 0; JGUIUtil.addComponent(components_JPanel, new JLabel("Component"), x, y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.WEST); JGUIUtil.addComponent(components_JPanel, new JLabel("Created How"), ++x, y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.WEST); JGUIUtil.addComponent(components_JPanel, new JLabel("Input File"), ++x, y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.WEST); JGUIUtil.addComponent(components_JPanel, new JLabel("Count"), ++x, y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.WEST); JGUIUtil.addComponent(components_JPanel, new JLabel("Incomplete"), ++x, y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.WEST); JGUIUtil.addComponent(components_JPanel, new JLabel("Data File"), ++x, y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.WEST); // Now add the contents for each component... IList <DataSetComponent> components_Vector = __dataset.getComponents(); int size = components_Vector.Count; DataSetComponent component; y = 0; // Incremented below. True row 0 is used for headers above. IList <DataSetComponent> data = null; int data_size = 0; for (int i = 0; i < size; i++) { x = 0; component = components_Vector[i]; JTextField component_JTextField = new JTextField(component.getComponentName(), 20); component_JTextField.setEditable(false); JGUIUtil.addComponent(components_JPanel, component_JTextField, x, ++y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.WEST); if (component.isGroup()) { // Get each of the sub-component's information... if (component.getData() == null) { continue; } //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("unchecked") java.util.List<RTi.Util.IO.DataSetComponent> data0 = (java.util.List<RTi.Util.IO.DataSetComponent>)component.getData(); IList <DataSetComponent> data0 = (IList <DataSetComponent>)component.getData(); data = data0; data_size = 0; if (data != null) { data_size = data.Count; } for (int j = 0; j < data_size; j++) { x = 0; component = (DataSetComponent)data[j]; component_JTextField = new JTextField(" " + component.getComponentName(), 20); component_JTextField.setEditable(false); JGUIUtil.addComponent(components_JPanel, component_JTextField, x, ++y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.WEST); // REVISIT - need to track create method JTextField from_JTextField = new JTextField("?", 10); //from.getName(), 10 ); from_JTextField.setEditable(false); JGUIUtil.addComponent(components_JPanel, from_JTextField, ++x, y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.WEST); // REVISIT - need to indicate list or commands // file JTextField inputfile_JTextField = new JTextField("?", 10); //from.getName(), 10 ); inputfile_JTextField.setEditable(false); JGUIUtil.addComponent(components_JPanel, inputfile_JTextField, ++x, y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.WEST); int count = 0; try { count = ((System.Collections.IList)component.getData()).Count; } catch (Exception) { // REVISIT // Probably because not a Vector (GIS // and control) - need a more graceful // way to handle. count = -1; } JTextField object_JTextField = null; if (count >= 0) { object_JTextField = new JTextField("" + count, 5); } else { object_JTextField = new JTextField("-", 5); } object_JTextField.setEditable(false); JGUIUtil.addComponent(components_JPanel, object_JTextField, ++x, y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.WEST); // REVISIT - need to indicate how many are // incomplete JTextField incomplete_JTextField = new JTextField("?", 5); //from.getName(), 10 ); incomplete_JTextField.setEditable(false); JGUIUtil.addComponent(components_JPanel, incomplete_JTextField, ++x, y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.WEST); JTextField datafile_JTextField = new JTextField(component.getDataFileName(), 15); datafile_JTextField.setEditable(false); JGUIUtil.addComponent(components_JPanel, datafile_JTextField, ++x, y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.WEST); } } } // // Data Set Properties... // // 1 grid for labels, 6 for text fields (resizable). // y = 0; JPanel properties_JPanel = new JPanel(); properties_JPanel.setLayout(gbl); JGUIUtil.addComponent(properties_JPanel, new JLabel("Data Set Type:"), 0, y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.EAST); JTextField dataset_type_JTextField = new JTextField(__dataset.getDataSetName(), 20); dataset_type_JTextField.setEditable(false); JGUIUtil.addComponent(properties_JPanel, dataset_type_JTextField, 1, y, 2, 1, 0.0, 1.0, insetsTLBR, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); JGUIUtil.addComponent(properties_JPanel, new JLabel("Data Set Base Name:"), 0, ++y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.EAST); JTextField dataset_basename_JTextField = new JTextField(__dataset.getBaseName(), 20); dataset_basename_JTextField.setEditable(false); JGUIUtil.addComponent(properties_JPanel, dataset_basename_JTextField, 1, y, 2, 1, 0.0, 1.0, insetsTLBR, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); JGUIUtil.addComponent(properties_JPanel, new JLabel("Data Set Directory:"), 0, ++y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.EAST); JTextField dataset_dir_JTextField = new JTextField(__dataset.getDataSetDirectory(), 40); dataset_dir_JTextField.setEditable(false); JGUIUtil.addComponent(properties_JPanel, dataset_dir_JTextField, 1, y, 6, 1, 0.0, 1.0, insetsTLBR, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); JGUIUtil.addComponent(properties_JPanel, new JLabel("Data Set File:"), 0, ++y, 1, 1, 0.0, 0.0, insetsTLBR, GridBagConstraints.NONE, GridBagConstraints.EAST); JTextField dataset_file_JTextField = new JTextField(__dataset.getDataSetFileName(), 20); dataset_file_JTextField.setEditable(false); JGUIUtil.addComponent(properties_JPanel, dataset_file_JTextField, 1, y, 2, 1, 0.0, 1.0, insetsTLBR, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); dataset_JTabbedPane.addTab("Properties", null, properties_JPanel, "Properties"); // Show the interface... if ((string.ReferenceEquals(title, null)) || (title.Length == 0)) { setTitle("Data Set Manager"); } else { setTitle(title); } pack(); JGUIUtil.center(this); setResizable(true); setVisible(is_visible); }