use of com.willwinder.universalgcodesender.uielements.panels.ConnectionPanelGroup in project Universal-G-Code-Sender by winder.
the class ExperimentalWindow method initComponents.
/**
* This method is called from within the constructor to
* initialize the form.
*/
@SuppressWarnings("unchecked")
private void initComponents() {
// Initialize services
jogService = new JogService(backend);
controlContextTabbedPane = new JTabbedPane();
actionPanel = new ActionPanel(backend);
macroEditPanel = new JScrollPane();
macroPanel = new MacroPanel(backend);
visualizerPanel = new VisualizerPanel(backend);
connectionPanel = new ConnectionPanelGroup(backend, jogService);
commandPanel = new CommandPanel(backend);
mainMenuBar = new JMenuBar();
settingsMenu = new JMenu();
grblConnectionSettingsMenuItem = new javax.swing.JMenuItem();
firmwareSettingsMenu = new javax.swing.JMenu();
grblFirmwareSettingsMenuItem = new javax.swing.JMenuItem();
gcodeProcessorSettings = new javax.swing.JMenuItem();
pendantMenu = new com.willwinder.universalgcodesender.uielements.components.PendantMenu(backend);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMinimumSize(new java.awt.Dimension(640, 520));
controlContextTabbedPane.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
controlContextTabbedPane.setMinimumSize(new java.awt.Dimension(395, 175));
controlContextTabbedPane.setPreferredSize(new java.awt.Dimension(2000, 283));
controlContextTabbedPane.addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
controlContextTabbedPaneComponentShown(evt);
}
});
controlContextTabbedPane.addTab("Machine Control", actionPanel);
macroEditPanel.setViewportView(macroPanel);
controlContextTabbedPane.addTab("Macros", macroEditPanel);
controlContextTabbedPane.addTab("Visualizer", visualizerPanel);
connectionPanel.setMinimumSize(new java.awt.Dimension(1, 1));
connectionPanel.setPreferredSize(new java.awt.Dimension(275, 130));
settingsMenu.setText("Settings");
grblConnectionSettingsMenuItem.setText("Sender Settings");
grblConnectionSettingsMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
grblConnectionSettingsMenuItemActionPerformed(evt);
}
});
settingsMenu.add(grblConnectionSettingsMenuItem);
gcodeProcessorSettings.setText("Gcode Processor Settings");
gcodeProcessorSettings.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
gcodeProcessorSettingsActionPerformed(evt);
}
});
settingsMenu.add(gcodeProcessorSettings);
firmwareSettingsMenu.setText("Firmware Settings");
grblFirmwareSettingsMenuItem.setText("GRBL");
grblFirmwareSettingsMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
grblFirmwareSettingsMenuItemActionPerformed(evt);
}
});
firmwareSettingsMenu.add(grblFirmwareSettingsMenuItem);
settingsMenu.add(firmwareSettingsMenu);
mainMenuBar.add(settingsMenu);
pendantMenu.setText("Pendant");
mainMenuBar.add(pendantMenu);
setJMenuBar(mainMenuBar);
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(connectionPanel, 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(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(controlContextTabbedPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 764, Short.MAX_VALUE).add(commandPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))));
layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(layout.createSequentialGroup().add(controlContextTabbedPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 294, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(commandPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE)).add(connectionPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
pack();
}
use of com.willwinder.universalgcodesender.uielements.panels.ConnectionPanelGroup in project Universal-G-Code-Sender by winder.
the class WidgetPreviewer method main.
public static void main(String[] args) throws Exception {
BackendAPI backend = new GUIBackend();
backend.applySettings(SettingsFactory.loadSettings());
JPanel panel = new JPanel();
// Create the main frame.
JFrame frame = new JFrame("Widget Previewer");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(panel, BorderLayout.CENTER);
// Button panel...
panel.setLayout(new MigLayout("wrap 1"));
panel.add(frameLauncherButton("ConnectionPanelGroup", new ConnectionPanelGroup(backend, new JogService(backend))));
panel.add(frameLauncherButton("CommandTextArea", new CommandTextArea(backend)));
// panel.add(frameLauncherButton("ConnectionSettingsDialog", new ConnectionSettingsDialog(backend.getSettings()), null, false));
panel.add(dialogLauncherButton("ConnectionSettingsPanel", new UGSSettingsDialog("ConnectionSettingsPanel", backend.getSettings(), new ConnectionSettingsPanel(backend.getSettings()), frame, true)));
panel.add(dialogLauncherButton("ControllerProcessorSettingsPanel", new UGSSettingsDialog("ControllerProcessorSettingsPanel", backend.getSettings(), new ControllerProcessorSettingsPanel(backend.getSettings(), FirmwareUtils.getConfigFiles()), frame, true)));
panel.add(frameLauncherButton("MacroActionPanel", new MacroActionPanel(backend)));
panel.add(frameLauncherButton("MacroPanel", new MacroPanel(backend)));
panel.add(frameLauncherButton("OverridesPanel", new OverridesPanel(backend)));
panel.add(frameLauncherButton("SendStatusLine", new SendStatusLine(backend)));
panel.add(frameLauncherButton("SendStatusPanel", new SendStatusPanel(backend)));
panel.add(frameLauncherButton("ActionButtonPanel", new ActionButtonPanel(backend)));
panel.add(frameLauncherButton("ActionPanel", new ActionPanel(backend)));
panel.add(frameLauncherButton("CommandPanel", new CommandPanel(backend)));
panel.add(frameLauncherButton("JogPanel(true)", new JogPanel(backend, new JogService(backend), true)));
panel.add(frameLauncherButton("JogPanel(false)", new JogPanel(backend, new JogService(backend), false)));
panel.add(frameLauncherButton("MachineStatusPanel", new MachineStatusPanel(backend)));
// Display the main frame.
frame.pack();
frame.setVisible(true);
}
Aggregations