public Tuple6b getGridEnd() throws GkException { Unit<Length> unit = GokoPreference.getInstance().getLengthUnit(); Tuple6b end = new Tuple6b(unit, SI.DEGREE_ANGLE); end.setX(NumberQuantity.of(new BigDecimal(getString(GRID_END_X)), unit)); end.setY(NumberQuantity.of(new BigDecimal(getString(GRID_END_Y)), unit)); end.setZ(NumberQuantity.of(new BigDecimal(getString(GRID_END_Z)), unit)); return end; }
public Tuple6b getGridStart() throws GkException { Unit<Length> unit = GokoPreference.getInstance().getLengthUnit(); Tuple6b start = new Tuple6b(unit, SI.DEGREE_ANGLE); start.setX(NumberQuantity.of(new BigDecimal(getString(GRID_START_X)), unit)); start.setY(NumberQuantity.of(new BigDecimal(getString(GRID_START_Y)), unit)); start.setZ(NumberQuantity.of(new BigDecimal(getString(GRID_START_Z)), unit)); return start; }
protected void initCustomBindings(MPart part) throws GkException { getController().addTextDisplayBinding(lblUnit, "lengthUnitSymbol"); getController().bindEnableControlWithAction(btnHome, DefaultControllerAction.HOME); getController().bindButtonToExecuteAction(btnHome, DefaultControllerAction.HOME); getController().bindEnableControlWithAction(btnStart, DefaultControllerAction.START); getController().bindButtonToExecuteAction(btnStart, DefaultControllerAction.START); getController().bindEnableControlWithAction(btnPause, DefaultControllerAction.PAUSE); getController().bindButtonToExecuteAction(btnPause, DefaultControllerAction.PAUSE); getController().bindEnableControlWithAction(btnStop, DefaultControllerAction.STOP); getController().bindButtonToExecuteAction(btnStop, DefaultControllerAction.STOP); getController().bindEnableControlWithAction(btnResetZero, DefaultControllerAction.RESET_ZERO); getController().bindButtonToExecuteAction(btnResetZero, DefaultControllerAction.RESET_ZERO); getController().bindEnableControlWithAction(btnResetX, DefaultControllerAction.RESET_ZERO); getController() .bindButtonToExecuteAction( btnResetX, DefaultControllerAction.RESET_ZERO, IGkConstants.X_AXIS); getController().bindEnableControlWithAction(btnResetY, DefaultControllerAction.RESET_ZERO); getController() .bindButtonToExecuteAction( btnResetY, DefaultControllerAction.RESET_ZERO, IGkConstants.Y_AXIS); getController().bindEnableControlWithAction(btnResetZ, DefaultControllerAction.RESET_ZERO); getController() .bindButtonToExecuteAction( btnResetZ, DefaultControllerAction.RESET_ZERO, IGkConstants.Z_AXIS); getController().bindEnableControlWithAction(btnResetA, DefaultControllerAction.RESET_ZERO); getController() .bindButtonToExecuteAction( btnResetA, DefaultControllerAction.RESET_ZERO, IGkConstants.A_AXIS); getController().bindEnableControlWithAction(btnSpindleOn, DefaultControllerAction.SPINDLE_ON); getController().bindButtonToExecuteAction(btnSpindleOn, DefaultControllerAction.SPINDLE_ON); getController().bindEnableControlWithAction(btnSpindleOff, DefaultControllerAction.SPINDLE_OFF); getController().bindButtonToExecuteAction(btnSpindleOff, DefaultControllerAction.SPINDLE_OFF); getController().bindEnableControlWithAction(btnKillAlarm, DefaultControllerAction.KILL_ALARM); getController().bindButtonToExecuteAction(btnKillAlarm, DefaultControllerAction.KILL_ALARM); if (getDataModel().isStepModeChoiceEnabled()) { getController().addEnableBinding(btnIncrementalJog, "stepModeChoiceEnabled"); getController().addVisibleBinding(btnIncrementalJog, "stepModeChoiceEnabled"); getController().addSelectionBinding(btnIncrementalJog, "incrementalJog"); getController().addVisibleBinding(jogStepSpinner, "stepModeChoiceEnabled"); getController().addVisibleBinding(lblUnit, "stepModeChoiceEnabled"); getController().addVisibleBinding(lblJogStep, "stepModeChoiceEnabled"); getController() .bindEnableControlWithAction(jogStepSpinner, DefaultControllerAction.JOG_START); } else if (getDataModel().isIncrementalJog()) { getController() .bindEnableControlWithAction(jogStepSpinner, DefaultControllerAction.JOG_START); } getController().bindEnableControlWithAction(jogSpeedSpinner, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnJogYPos, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnJogYNeg, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnJogXPos, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnJogXNeg, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnJogZPos, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnJogZNeg, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnJogAPos, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnJogANeg, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnCSG54, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnCSG55, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnCSG56, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnCSG57, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnCSG58, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnCSG59, DefaultControllerAction.JOG_START); getController().bindEnableControlWithAction(btnResetCsZero, DefaultControllerAction.JOG_START); getController().bindJogButton(btnJogYPos, EnumControllerAxis.Y_POSITIVE); getController().bindJogButton(btnJogYNeg, EnumControllerAxis.Y_NEGATIVE); getController().bindJogButton(btnJogXPos, EnumControllerAxis.X_POSITIVE); getController().bindJogButton(btnJogXNeg, EnumControllerAxis.X_NEGATIVE); getController().bindJogButton(btnJogZPos, EnumControllerAxis.Z_POSITIVE); getController().bindJogButton(btnJogZNeg, EnumControllerAxis.Z_NEGATIVE); getController().bindJogButton(btnJogAPos, EnumControllerAxis.A_POSITIVE); getController().bindJogButton(btnJogANeg, EnumControllerAxis.A_NEGATIVE); GokoPreference.getInstance().addPropertyChangeListener(this); }
/** * Create contents of the view part. * * @throws GkException */ @PostConstruct public void createControls(Composite parent, MPart part) throws GkException { parent.setLayout(new FormLayout()); Composite composite = new Composite(parent, SWT.NONE); FormData fd_composite = new FormData(); fd_composite.top = new FormAttachment(0); fd_composite.left = new FormAttachment(0); composite.setLayoutData(fd_composite); GridLayout gl_composite = new GridLayout(3, false); gl_composite.verticalSpacing = 3; gl_composite.marginHeight = 3; gl_composite.marginWidth = 3; composite.setLayout(gl_composite); Group grpManualJog = new Group(composite, SWT.NONE); grpManualJog.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD)); grpManualJog.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1)); grpManualJog.setText("Manual jog"); GridLayout gl_grpManualJog = new GridLayout(1, false); gl_grpManualJog.verticalSpacing = 2; gl_grpManualJog.marginWidth = 4; gl_grpManualJog.marginHeight = 2; gl_grpManualJog.horizontalSpacing = 4; grpManualJog.setLayout(gl_grpManualJog); if (getDataModel().isStepModeChoiceEnabled()) { btnIncrementalJog = new Button(grpManualJog, SWT.CHECK); btnIncrementalJog.setEnabled(false); btnIncrementalJog.setText("Incremental jog"); } Composite composite_5 = new Composite(grpManualJog, SWT.NONE); composite_5.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); composite_5.setLayout(new GridLayout(3, false)); if (getDataModel().isIncrementalJog()) { lblJogStep = new Label(composite_5, SWT.NONE); lblJogStep.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblJogStep.setText("Step :"); jogStepSpinner = new Spinner(composite_5, SWT.BORDER); jogStepSpinner.setMaximum(100000); jogStepSpinner.setMinimum(1); jogStepSpinner.setDigits(GokoPreference.getInstance().getDigitCount()); GridData gd_jogSpinner = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); gd_jogSpinner.widthHint = 40; jogStepSpinner.setLayoutData(gd_jogSpinner); lblUnit = new Label(composite_5, SWT.NONE); lblUnit.setText("mm"); } Label lblJogSpeed = new Label(composite_5, SWT.NONE); lblJogSpeed.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblJogSpeed.setBounds(0, 0, 55, 15); lblJogSpeed.setText("Speed :"); jogSpeedSpinner = new Spinner(composite_5, SWT.BORDER); jogSpeedSpinner.setMaximum(10000); GridData gd_jogSpeedSpinner = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); gd_jogSpeedSpinner.widthHint = 40; jogSpeedSpinner.setLayoutData(gd_jogSpeedSpinner); new Label(composite_5, SWT.NONE); Composite composite_4 = new Composite(grpManualJog, SWT.NONE); GridLayout gl_composite_4 = new GridLayout(2, false); gl_composite_4.marginWidth = 0; gl_composite_4.marginHeight = 0; gl_composite_4.horizontalSpacing = 0; gl_composite_4.verticalSpacing = 0; composite_4.setLayout(gl_composite_4); Composite composite_2 = new Composite(composite_4, SWT.NONE); composite_2.setSize(45, 125); GridLayout gl_composite_2 = new GridLayout(1, false); gl_composite_2.marginWidth = 2; gl_composite_2.verticalSpacing = 2; gl_composite_2.horizontalSpacing = 2; gl_composite_2.marginHeight = 2; composite_2.setLayout(gl_composite_2); btnJogZPos = new Button(composite_2, SWT.NONE); btnJogZPos.setText("+Z"); GridData gd_btnJogZPos = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); gd_btnJogZPos.heightHint = 55; gd_btnJogZPos.widthHint = 35; btnJogZPos.setLayoutData(gd_btnJogZPos); btnJogZNeg = new Button(composite_2, SWT.NONE); btnJogZNeg.setText("-Z"); GridData gd_btnJogZNeg = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); gd_btnJogZNeg.widthHint = 35; gd_btnJogZNeg.heightHint = 55; btnJogZNeg.setLayoutData(gd_btnJogZNeg); Composite composite_1 = new Composite(composite_4, SWT.NONE); GridLayout gl_composite_1 = new GridLayout(3, false); gl_composite_1.verticalSpacing = 2; gl_composite_1.marginWidth = 2; gl_composite_1.horizontalSpacing = 0; gl_composite_1.marginHeight = 0; composite_1.setLayout(gl_composite_1); new Label(composite_1, SWT.NONE); btnJogYPos = new Button(composite_1, SWT.NONE); btnJogYPos.setText("+Y"); GridData gd_btnJogYPos = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); gd_btnJogYPos.heightHint = 35; gd_btnJogYPos.widthHint = 35; btnJogYPos.setLayoutData(gd_btnJogYPos); new Label(composite_1, SWT.NONE); btnJogXNeg = new Button(composite_1, SWT.NONE); btnJogXNeg.setText("-X"); GridData gd_btnJogXNeg = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); gd_btnJogXNeg.widthHint = 35; gd_btnJogXNeg.heightHint = 35; btnJogXNeg.setLayoutData(gd_btnJogXNeg); new Label(composite_1, SWT.NONE); btnJogXPos = new Button(composite_1, SWT.NONE); btnJogXPos.setText("+X"); GridData gd_btnJogXPos = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); gd_btnJogXPos.heightHint = 35; gd_btnJogXPos.widthHint = 35; btnJogXPos.setLayoutData(gd_btnJogXPos); new Label(composite_1, SWT.NONE); btnJogYNeg = new Button(composite_1, SWT.NONE); btnJogYNeg.setText("-Y"); GridData gd_btnJogYNeg = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); gd_btnJogYNeg.widthHint = 35; gd_btnJogYNeg.heightHint = 35; btnJogYNeg.setLayoutData(gd_btnJogYNeg); new Label(composite_1, SWT.NONE); new Label(composite_4, SWT.NONE); composite_7 = new Composite(composite_4, SWT.NONE); composite_7.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); GridLayout gl_composite_7 = new GridLayout(2, true); gl_composite_7.verticalSpacing = 2; gl_composite_7.marginWidth = 2; gl_composite_7.marginHeight = 2; gl_composite_7.horizontalSpacing = 2; composite_7.setLayout(gl_composite_7); btnJogANeg = new Button(composite_7, SWT.NONE); GridData gd_btnANeg = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gd_btnANeg.heightHint = 35; btnJogANeg.setLayoutData(gd_btnANeg); btnJogANeg.setText("A-"); btnJogAPos = new Button(composite_7, SWT.NONE); GridData gd_btnAPos = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gd_btnAPos.heightHint = 35; btnJogAPos.setLayoutData(gd_btnAPos); btnJogAPos.setText("A+"); Composite composite_9 = new Composite(composite, SWT.NONE); GridLayout gl_composite_9 = new GridLayout(1, false); gl_composite_9.horizontalSpacing = 4; gl_composite_9.verticalSpacing = 4; gl_composite_9.marginWidth = 0; gl_composite_9.marginHeight = 0; composite_9.setLayout(gl_composite_9); composite_9.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1)); Group grpCommands = new Group(composite_9, SWT.NONE); grpCommands.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD)); grpCommands.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); GridLayout gl_grpCommands = new GridLayout(1, false); gl_grpCommands.verticalSpacing = 2; gl_grpCommands.marginWidth = 2; gl_grpCommands.marginHeight = 2; gl_grpCommands.horizontalSpacing = 2; grpCommands.setLayout(gl_grpCommands); grpCommands.setText("Homing"); btnHome = new Button(grpCommands, SWT.NONE); btnHome.setText("Home"); GridData gd_btnNewButton_1 = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gd_btnNewButton_1.widthHint = 140; gd_btnNewButton_1.heightHint = 35; btnHome.setLayoutData(gd_btnNewButton_1); Label label = new Label(grpCommands, SWT.SEPARATOR | SWT.HORIZONTAL); label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); btnResetZero = new Button(grpCommands, SWT.NONE); btnResetZero.setText("Zero all axis"); GridData gd_btnNewButton_2 = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gd_btnNewButton_2.heightHint = 35; btnResetZero.setLayoutData(gd_btnNewButton_2); Composite composite_6 = new Composite(grpCommands, SWT.NONE); composite_6.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); GridLayout gl_composite_6 = new GridLayout(4, true); gl_composite_6.horizontalSpacing = 1; gl_composite_6.marginHeight = 0; gl_composite_6.verticalSpacing = 2; gl_composite_6.marginWidth = 0; composite_6.setLayout(gl_composite_6); btnResetX = new Button(composite_6, SWT.NONE); btnResetX.setText("X"); btnResetX.setFont(SWTResourceManager.getFont("Segoe UI", 8, SWT.NORMAL)); GridData gd_btnResetX = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gd_btnResetX.heightHint = 30; btnResetX.setLayoutData(gd_btnResetX); btnResetY = new Button(composite_6, SWT.NONE); btnResetY.setText("Y"); btnResetY.setFont(SWTResourceManager.getFont("Segoe UI", 8, SWT.NORMAL)); GridData gd_btnNewButton = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gd_btnNewButton.heightHint = 30; btnResetY.setLayoutData(gd_btnNewButton); btnResetZ = new Button(composite_6, SWT.NONE); btnResetZ.setText("Z"); btnResetZ.setFont(SWTResourceManager.getFont("Segoe UI", 8, SWT.NORMAL)); GridData gd_btnNewButton_21 = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); gd_btnNewButton_21.heightHint = 30; btnResetZ.setLayoutData(gd_btnNewButton_21); btnResetA = new Button(composite_6, SWT.NONE); GridData gd_btnResetA = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); gd_btnResetA.heightHint = 30; btnResetA.setLayoutData(gd_btnResetA); btnResetA.setText("A"); grpCoordinatesSystem = new Group(composite_9, SWT.NONE); grpCoordinatesSystem.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD)); GridLayout gl_grpCoordinatesSystem = new GridLayout(1, false); gl_grpCoordinatesSystem.verticalSpacing = 2; gl_grpCoordinatesSystem.marginWidth = 2; gl_grpCoordinatesSystem.marginHeight = 2; gl_grpCoordinatesSystem.horizontalSpacing = 2; grpCoordinatesSystem.setLayout(gl_grpCoordinatesSystem); grpCoordinatesSystem.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1)); grpCoordinatesSystem.setText("Coordinates system"); Composite composite_11 = new Composite(grpCoordinatesSystem, SWT.NONE); composite_11.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1)); GridLayout gl_composite_11 = new GridLayout(3, true); gl_composite_11.verticalSpacing = 2; gl_composite_11.horizontalSpacing = 2; gl_composite_11.marginWidth = 0; gl_composite_11.marginHeight = 0; composite_11.setLayout(gl_composite_11); btnCSG54 = new Button(composite_11, SWT.NONE); btnCSG54.setText("G54"); btnCSG54.addMouseListener( new MouseAdapter() { @Override public void mouseUp(MouseEvent e) { try { getController().setCoordinateSystem(EnumCoordinateSystem.G54); } catch (GkException e1) { displayMessage(e1); } } }); GridData gd_btnCSG54 = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gd_btnCSG54.heightHint = 30; btnCSG54.setLayoutData(gd_btnCSG54); btnCSG55 = new Button(composite_11, SWT.NONE); btnCSG55.setText("G55"); btnCSG55.addMouseListener( new MouseAdapter() { @Override public void mouseUp(MouseEvent e) { try { getController().setCoordinateSystem(EnumCoordinateSystem.G55); } catch (GkException e1) { displayMessage(e1); } } }); GridData gd_btnCSG55 = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); gd_btnCSG55.heightHint = 30; btnCSG55.setLayoutData(gd_btnCSG55); btnCSG56 = new Button(composite_11, SWT.NONE); btnCSG56.setText("G56"); btnCSG56.addMouseListener( new MouseAdapter() { @Override public void mouseUp(MouseEvent e) { try { getController().setCoordinateSystem(EnumCoordinateSystem.G56); } catch (GkException e1) { displayMessage(e1); } } }); GridData gd_btnCSG56 = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); gd_btnCSG56.heightHint = 30; btnCSG56.setLayoutData(gd_btnCSG56); btnCSG57 = new Button(composite_11, SWT.NONE); btnCSG57.setText("G57"); btnCSG57.addMouseListener( new MouseAdapter() { @Override public void mouseUp(MouseEvent e) { try { getController().setCoordinateSystem(EnumCoordinateSystem.G57); } catch (GkException e1) { displayMessage(e1); } } }); GridData gd_btnCSG57 = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); gd_btnCSG57.heightHint = 30; btnCSG57.setLayoutData(gd_btnCSG57); btnCSG58 = new Button(composite_11, SWT.NONE); btnCSG58.setText("G58"); btnCSG58.addMouseListener( new MouseAdapter() { @Override public void mouseUp(MouseEvent e) { try { getController().setCoordinateSystem(EnumCoordinateSystem.G58); } catch (GkException e1) { displayMessage(e1); } } }); GridData gd_btnCSG58 = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); gd_btnCSG58.heightHint = 30; btnCSG58.setLayoutData(gd_btnCSG58); btnCSG59 = new Button(composite_11, SWT.NONE); btnCSG59.setText("G59"); btnCSG59.addMouseListener( new MouseAdapter() { @Override public void mouseUp(MouseEvent e) { try { getController().setCoordinateSystem(EnumCoordinateSystem.G59); } catch (GkException e1) { displayMessage(e1); } } }); GridData gd_btnCSG59 = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); gd_btnCSG59.heightHint = 30; btnCSG59.setLayoutData(gd_btnCSG59); Composite composite_12 = new Composite(grpCoordinatesSystem, SWT.NONE); composite_12.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1)); GridLayout gl_composite_12 = new GridLayout(1, false); gl_composite_12.verticalSpacing = 2; gl_composite_12.marginHeight = 2; gl_composite_12.marginWidth = 0; gl_composite_12.horizontalSpacing = 0; composite_12.setLayout(gl_composite_12); btnResetCsZero = new Button(composite_12, SWT.NONE); btnResetCsZero.setText("Set current zero"); btnResetCsZero.addMouseListener( new MouseAdapter() { @Override public void mouseUp(MouseEvent e) { try { getController().zeroCoordinateSystem(); } catch (GkException e1) { displayMessage(e1); } } }); GridData gd_btnResetCsZero = new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1); gd_btnResetCsZero.heightHint = 35; gd_btnNewButton_1.heightHint = 35; btnResetCsZero.setLayoutData(gd_btnResetCsZero); btnResetCsZero.setBounds(0, 0, 75, 25); composite_10 = new Composite(composite, SWT.NONE); GridData gd_composite_10 = new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1); gd_composite_10.widthHint = 140; composite_10.setLayoutData(gd_composite_10); GridLayout gl_composite_10 = new GridLayout(1, false); gl_composite_10.verticalSpacing = 4; gl_composite_10.marginWidth = 2; gl_composite_10.marginHeight = 2; gl_composite_10.horizontalSpacing = 4; composite_10.setLayout(gl_composite_10); Group grpControls = new Group(composite_10, SWT.NONE); grpControls.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); grpControls.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD)); grpControls.setLayout(new GridLayout(1, false)); grpControls.setText("Controls"); Composite composite_8 = new Composite(grpControls, SWT.NONE); composite_8.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); GridLayout gl_composite_8 = new GridLayout(2, true); gl_composite_8.verticalSpacing = 2; gl_composite_8.horizontalSpacing = 2; gl_composite_8.marginWidth = 0; gl_composite_8.marginHeight = 0; composite_8.setLayout(gl_composite_8); btnStart = new Button(composite_8, SWT.NONE); GridData gd_btnStart = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); gd_btnStart.heightHint = 35; btnStart.setLayoutData(gd_btnStart); btnStart.setText("Resume"); btnPause = new Button(composite_8, SWT.NONE); GridData gd_btnPause = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gd_btnPause.heightHint = 35; btnPause.setLayoutData(gd_btnPause); btnPause.setText("Pause"); btnStop = new Button(grpControls, SWT.NONE); btnStop.setImage( ResourceManager.getPluginImage("org.goko.tools.commandpanel", "icons/stop.png")); btnStop.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED)); GridData gd_btnStop = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gd_btnStop.heightHint = 35; btnStop.setLayoutData(gd_btnStop); btnStop.setText("Stop"); btnKillAlarm = new Button(grpControls, SWT.NONE); btnKillAlarm.setImage( ResourceManager.getPluginImage("org.goko.tools.commandpanel", "icons/bell--minus.png")); GridData gd_btnKillAlarm = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); gd_btnKillAlarm.heightHint = 35; btnKillAlarm.setLayoutData(gd_btnKillAlarm); btnKillAlarm.setText("Kill alarm"); Group grpSpindle = new Group(composite_10, SWT.NONE); grpSpindle.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD)); grpSpindle.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); grpSpindle.setLayout(new FillLayout(SWT.HORIZONTAL)); grpSpindle.setText("Spindle"); Composite composite_3 = new Composite(grpSpindle, SWT.NONE); GridLayout gl_composite_3 = new GridLayout(2, true); gl_composite_3.marginWidth = 2; gl_composite_3.horizontalSpacing = 2; gl_composite_3.marginHeight = 2; composite_3.setLayout(gl_composite_3); btnSpindleOn = new Button(composite_3, SWT.NONE); btnSpindleOn.setText("On"); GridData gd_btnSpindleOn = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gd_btnSpindleOn.heightHint = 35; btnSpindleOn.setLayoutData(gd_btnSpindleOn); btnSpindleOff = new Button(composite_3, SWT.NONE); btnSpindleOff.setText("Off"); GridData gd_btnSpindleOff = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); gd_btnSpindleOff.heightHint = 35; btnSpindleOff.setLayoutData(gd_btnSpindleOff); getController().initilizeValues(); if (getDataModel().getJogSpeed() != null) { jogSpeedSpinner.setSelection( (int) (getDataModel().getJogSpeed().doubleValue() * Math.pow(10, jogSpeedSpinner.getDigits()))); } initCustomBindings(part); enableAdaptiveSpinner(); }