Search in sources :

Example 1 with CommandPanel

use of com.willwinder.universalgcodesender.uielements.panels.CommandPanel 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();
}
Also used : ConnectionPanelGroup(com.willwinder.universalgcodesender.uielements.panels.ConnectionPanelGroup) JogService(com.willwinder.universalgcodesender.services.JogService) CommandPanel(com.willwinder.universalgcodesender.uielements.panels.CommandPanel) VisualizerPanel(com.willwinder.universalgcodesender.visualizer.VisualizerPanel) MacroPanel(com.willwinder.universalgcodesender.uielements.macros.MacroPanel) ComponentEvent(java.awt.event.ComponentEvent) javax.swing(javax.swing) ActionPanel(com.willwinder.universalgcodesender.uielements.panels.ActionPanel) java.awt(java.awt)

Example 2 with CommandPanel

use of com.willwinder.universalgcodesender.uielements.panels.CommandPanel 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);
}
Also used : JogPanel(com.willwinder.universalgcodesender.uielements.jog.JogPanel) ConnectionPanelGroup(com.willwinder.universalgcodesender.uielements.panels.ConnectionPanelGroup) BackendAPI(com.willwinder.universalgcodesender.model.BackendAPI) MacroPanel(com.willwinder.universalgcodesender.uielements.macros.MacroPanel) MigLayout(net.miginfocom.swing.MigLayout) GUIBackend(com.willwinder.universalgcodesender.model.GUIBackend) SendStatusPanel(com.willwinder.universalgcodesender.uielements.panels.SendStatusPanel) JogService(com.willwinder.universalgcodesender.services.JogService) CommandTextArea(com.willwinder.universalgcodesender.uielements.components.CommandTextArea) CommandPanel(com.willwinder.universalgcodesender.uielements.panels.CommandPanel) BorderLayout(java.awt.BorderLayout) MachineStatusPanel(com.willwinder.universalgcodesender.uielements.panels.MachineStatusPanel) ConnectionSettingsPanel(com.willwinder.universalgcodesender.uielements.panels.ConnectionSettingsPanel) MacroActionPanel(com.willwinder.universalgcodesender.uielements.macros.MacroActionPanel) OverridesPanel(com.willwinder.universalgcodesender.uielements.panels.OverridesPanel) ControllerProcessorSettingsPanel(com.willwinder.universalgcodesender.uielements.panels.ControllerProcessorSettingsPanel) ActionPanel(com.willwinder.universalgcodesender.uielements.panels.ActionPanel) MacroActionPanel(com.willwinder.universalgcodesender.uielements.macros.MacroActionPanel) ActionButtonPanel(com.willwinder.universalgcodesender.uielements.panels.ActionButtonPanel)

Aggregations

JogService (com.willwinder.universalgcodesender.services.JogService)2 MacroPanel (com.willwinder.universalgcodesender.uielements.macros.MacroPanel)2 ActionPanel (com.willwinder.universalgcodesender.uielements.panels.ActionPanel)2 CommandPanel (com.willwinder.universalgcodesender.uielements.panels.CommandPanel)2 ConnectionPanelGroup (com.willwinder.universalgcodesender.uielements.panels.ConnectionPanelGroup)2 BackendAPI (com.willwinder.universalgcodesender.model.BackendAPI)1 GUIBackend (com.willwinder.universalgcodesender.model.GUIBackend)1 CommandTextArea (com.willwinder.universalgcodesender.uielements.components.CommandTextArea)1 JogPanel (com.willwinder.universalgcodesender.uielements.jog.JogPanel)1 MacroActionPanel (com.willwinder.universalgcodesender.uielements.macros.MacroActionPanel)1 ActionButtonPanel (com.willwinder.universalgcodesender.uielements.panels.ActionButtonPanel)1 ConnectionSettingsPanel (com.willwinder.universalgcodesender.uielements.panels.ConnectionSettingsPanel)1 ControllerProcessorSettingsPanel (com.willwinder.universalgcodesender.uielements.panels.ControllerProcessorSettingsPanel)1 MachineStatusPanel (com.willwinder.universalgcodesender.uielements.panels.MachineStatusPanel)1 OverridesPanel (com.willwinder.universalgcodesender.uielements.panels.OverridesPanel)1 SendStatusPanel (com.willwinder.universalgcodesender.uielements.panels.SendStatusPanel)1 VisualizerPanel (com.willwinder.universalgcodesender.visualizer.VisualizerPanel)1 java.awt (java.awt)1 BorderLayout (java.awt.BorderLayout)1 ComponentEvent (java.awt.event.ComponentEvent)1