diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/assembly.xml b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/assembly.xml new file mode 100644 index 00000000..9e7ffd35 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/assembly.xml @@ -0,0 +1,23 @@ + + sources + + tar.gz + + false + + + . + + pom.xml + assembly.xml + + true + + + src + true + + + diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/pom.xml b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/pom.xml new file mode 100644 index 00000000..882a0c57 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/pom.xml @@ -0,0 +1,302 @@ + + + + 4.0.0 + + com.ur.urcap.examples + tooliocontrolswing + 1.0-SNAPSHOT + Tool I/O Control Swing + bundle + + + + + + + + + com.ur.urcap.examples.tooliocontrolswing + Universal Robots + Energivej 25, 5260 Odense S, Denmark + Copyright (C) 2009-${copyright.year} Universal Robots. All Rights Reserved + Tool I/O interface control sample URCap + Sample license + true + true + + + + + localhost + root + easybot + + + + + + + ur + easybot + + + ${maven.build.timestamp} + yyyy + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.0 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.1 + + alphabetical + false + + + + maven-jar-plugin + 3.0.2 + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + maven-resources-plugin + 3.0.2 + + + org.apache.felix + maven-bundle-plugin + 2.4.0 + true + + + bundle-manifest + process-classes + + manifest + + + + + + + URCap + com.ur.urcap.examples.tooliocontrol.Activator + ${urcap.vendor} + ${urcap.contactAddress} + ${urcap.copyright} + ${urcap.licenseType} + ${urcap.description} + ${urcap.compatibility.CB3} + ${urcap.compatibility.eSeries} + + + com.ur.urcap.api*, + * + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.1 + + + + package-urcap + package + + exec + + + cp + target/${project.build.finalName}.jar target/${project.build.finalName}.urcap + . + + + + + + maven-assembly-plugin + + + assembly.xml + + + + + package + + single + + + + + + + + + + org.osgi + org.osgi.core + 4.3.0 + + + + com.ur.urcap + api + 1.7.0 + provided + + + + + junit + junit + 4.12 + test + + + + + + remote + + + + org.codehaus.mojo + exec-maven-plugin + 1.1 + + + remote-install-urcap + install + + exec + + + sshpass + -p ${urcap.install.password} scp -o StrictHostKeyChecking=no target/${project.build.finalName}.jar ${urcap.install.username}@${urcap.install.host}:/root/.urcaps/${urcap.symbolicname}.jar + . + + + + remote-restart-ui + install + + exec + + + sshpass + -p ${urcap.install.password} ssh ${urcap.install.username}@${urcap.install.host} pkill java + . + + + + + + + + + local + + + + org.codehaus.mojo + exec-maven-plugin + 1.1 + + + local-install-urcap + install + + exec + + + cp + target/${project.build.finalName}.jar ${user.home}/.urcaps/${urcap.symbolicname}.jar + . + + + + + + + + + ursim + + + + org.codehaus.mojo + exec-maven-plugin + 1.1 + + + ursim-install-urcap + install + + exec + + + cp + target/${project.build.finalName}.jar ${ursim.home}/.urcaps/${urcap.symbolicname}.jar + . + + + + + + + + + ursimvm + + + + org.codehaus.mojo + exec-maven-plugin + 1.1 + + + ursimvm-install-urcap + install + + exec + + + sshpass + -p ${ursimvm.install.password} scp -o StrictHostKeyChecking=no target/${project.build.finalName}.jar ${ursimvm.install.username}@${ursimvm.install.host}:/home/ur/ursim-current/.urcaps/${urcap.symbolicname}.jar + . + + + + + + + + + diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/Activator.java b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/Activator.java new file mode 100644 index 00000000..57d5aa96 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/Activator.java @@ -0,0 +1,20 @@ +package com.ur.urcap.examples.tooliocontrol; + +import com.ur.urcap.api.contribution.installation.swing.SwingInstallationNodeService; +import com.ur.urcap.api.contribution.program.swing.SwingProgramNodeService; +import com.ur.urcap.examples.tooliocontrol.installation.ToolIOControlInstallationNodeService; +import com.ur.urcap.examples.tooliocontrol.program.ToolIOControlProgramNodeService; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + @Override + public void start(BundleContext bundleContext) throws Exception { + bundleContext.registerService(SwingInstallationNodeService.class, new ToolIOControlInstallationNodeService(), null); + bundleContext.registerService(SwingProgramNodeService.class, new ToolIOControlProgramNodeService(), null); + } + + @Override + public void stop(BundleContext bundleContext) throws Exception { + } +} diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeContribution.java b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeContribution.java new file mode 100644 index 00000000..744b720c --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeContribution.java @@ -0,0 +1,38 @@ +package com.ur.urcap.examples.tooliocontrol.installation; + +import com.ur.urcap.api.contribution.InstallationNodeContribution; +import com.ur.urcap.api.contribution.installation.InstallationAPIProvider; +import com.ur.urcap.api.domain.resource.ControllableResourceModel; +import com.ur.urcap.api.domain.script.ScriptWriter; + +public class ToolIOControlInstallationNodeContribution implements InstallationNodeContribution { + private final ToolIOControlInstallationNodeView view; + private final ToolIOController toolIOController; + + public ToolIOControlInstallationNodeContribution(InstallationAPIProvider apiProvider, ToolIOControlInstallationNodeView view) { + this.view = view; + + ControllableResourceModel resourceModel = apiProvider.getInstallationAPI().getControllableResourceModel(); + toolIOController = new ToolIOController(resourceModel, apiProvider.getSystemAPI().getCapabilityManager()); + resourceModel.requestControl(toolIOController); + } + + @Override + public void openView() { + view.showHelp(!toolIOController.hasControl()); + } + + @Override + public void closeView() { + + } + + @Override + public void generateScript(ScriptWriter writer) { + + } + + public boolean isSetupCorrect() { + return toolIOController.isSetupCorrect(); + } +} diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeService.java b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeService.java new file mode 100644 index 00000000..a5b134a7 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeService.java @@ -0,0 +1,32 @@ +package com.ur.urcap.examples.tooliocontrol.installation; + +import com.ur.urcap.api.contribution.ViewAPIProvider; +import com.ur.urcap.api.contribution.installation.ContributionConfiguration; +import com.ur.urcap.api.contribution.installation.CreationContext; +import com.ur.urcap.api.contribution.installation.InstallationAPIProvider; +import com.ur.urcap.api.contribution.installation.swing.SwingInstallationNodeService; +import com.ur.urcap.api.domain.data.DataModel; + +import java.util.Locale; + +public class ToolIOControlInstallationNodeService implements SwingInstallationNodeService { + + @Override + public void configureContribution(ContributionConfiguration configuration) { + } + + @Override + public String getTitle(Locale locale) { + return "Tool I/O Control"; + } + + @Override + public ToolIOControlInstallationNodeView createView(ViewAPIProvider apiProvider) { + return new ToolIOControlInstallationNodeView(apiProvider); + } + + @Override + public ToolIOControlInstallationNodeContribution createInstallationNode(InstallationAPIProvider apiProvider, ToolIOControlInstallationNodeView view, DataModel model, CreationContext context) { + return new ToolIOControlInstallationNodeContribution(apiProvider, view); + } +} diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeView.java b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeView.java new file mode 100644 index 00000000..d18b3532 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeView.java @@ -0,0 +1,45 @@ +package com.ur.urcap.examples.tooliocontrol.installation; + +import com.ur.urcap.api.contribution.ViewAPIProvider; +import com.ur.urcap.api.contribution.installation.swing.SwingInstallationNodeView; +import com.ur.urcap.api.domain.robot.RobotModel; + +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JPanel; +import java.awt.Component; + +public class ToolIOControlInstallationNodeView implements SwingInstallationNodeView { + private static final int SPACING = 10; + private static final String HELP_E_SERIES = "Please assign control to this URCap on the Tool I/O installation tab."; + private static final String HELP_CB3 = "Please assign control to this URCap on the I/O tab."; + + private final boolean isESeries; + private Box help; + + public ToolIOControlInstallationNodeView(ViewAPIProvider apiProvider) { + isESeries = apiProvider.getSystemAPI().getRobotModel().getRobotSeries().equals(RobotModel.RobotSeries.E_SERIES); + } + + @Override + public void buildUI(JPanel panel, ToolIOControlInstallationNodeContribution contribution) { + BoxLayout mgr = new BoxLayout(panel, BoxLayout.Y_AXIS); + panel.setLayout(mgr); + + help = Box.createHorizontalBox(); + help.add(new JLabel(new ImageIcon(getClass().getResource("/icons/warning.png")))); + help.add(new JLabel(isESeries ? HELP_E_SERIES : HELP_CB3)); + help.add(createSpacing()); + panel.add(help); + } + + public void showHelp(boolean show) { + help.setVisible(show); + } + + private Component createSpacing() { + return Box.createVerticalStrut(SPACING); + } +} diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOController.java b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOController.java new file mode 100644 index 00000000..4efa23af --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOController.java @@ -0,0 +1,178 @@ +package com.ur.urcap.examples.tooliocontrol.installation; + +import com.ur.urcap.api.domain.resource.ResourceModel; +import com.ur.urcap.api.domain.resource.tooliointerface.AnalogInputDomainConfig; +import com.ur.urcap.api.domain.resource.tooliointerface.AnalogInputDomainConfig.AnalogDomain; +import com.ur.urcap.api.domain.resource.tooliointerface.AnalogInputModeConfig; +import com.ur.urcap.api.domain.resource.tooliointerface.CommunicationInterfaceConfig; +import com.ur.urcap.api.domain.resource.tooliointerface.CommunicationInterfaceConfig.BaudRate; +import com.ur.urcap.api.domain.resource.tooliointerface.CommunicationInterfaceConfig.Parity; +import com.ur.urcap.api.domain.resource.tooliointerface.CommunicationInterfaceConfig.StopBits; +import com.ur.urcap.api.domain.resource.tooliointerface.DigitalOutputModeConfig; +import com.ur.urcap.api.domain.resource.tooliointerface.StandardDigitalOutputModeConfig; +import com.ur.urcap.api.domain.resource.tooliointerface.StandardDigitalOutputModeConfig.OutputMode; +import com.ur.urcap.api.domain.resource.tooliointerface.ToolIOInterface; +import com.ur.urcap.api.domain.resource.tooliointerface.ToolIOInterface.OutputVoltage; +import com.ur.urcap.api.domain.resource.tooliointerface.control.AnalogInputModeConfigFactory; +import com.ur.urcap.api.domain.resource.tooliointerface.control.DigitalOutputModeConfigFactory; +import com.ur.urcap.api.domain.resource.tooliointerface.control.ToolIOInterfaceControlEvent; +import com.ur.urcap.api.domain.resource.tooliointerface.control.ToolIOInterfaceControllable; +import com.ur.urcap.api.domain.resource.tooliointerface.control.ToolIOInterfaceController; +import com.ur.urcap.api.domain.system.capability.CapabilityManager; + +import static com.ur.urcap.api.domain.resource.tooliointerface.AnalogInputModeConfig.ConfigType.ANALOG_INPUT_DOMAIN; +import static com.ur.urcap.api.domain.resource.tooliointerface.AnalogInputModeConfig.ConfigType.TOOL_COMMUNICATION_INTERFACE; +import static com.ur.urcap.api.domain.resource.tooliointerface.DigitalOutputModeConfig.ConfigType.STANDARD_DIGITAL_OUTPUT_MODE; +import static com.ur.urcap.api.domain.system.capability.tooliointerface.ToolIOCapability.COMMUNICATION_INTERFACE_MODE; +import static com.ur.urcap.api.domain.system.capability.tooliointerface.ToolIOCapability.DIGITAL_OUTPUT_MODE; + +class ToolIOController implements ToolIOInterfaceController { + + private static final OutputVoltage REQUIRED_VOLTAGE = OutputVoltage.OUTPUT_VOLTAGE_24V; + private static final OutputVoltage SHUTDOWN_VOLTAGE = OutputVoltage.OUTPUT_VOLTAGE_0V; + private static final BaudRate REQUIRED_BAUDRATE = BaudRate.BAUD_2M; + private static final BaudRate SHUTDOWN_BAUDRATE = BaudRate.BAUD_115200; + private static final Parity REQUIRED_PARITY = Parity.EVEN; + private static final Parity SHUTDOWN_PARITY = Parity.NONE; + private static final StopBits REQUIRED_STOPBITS = StopBits.TWO; + private static final StopBits SHUTDOWN_STOPBITS = StopBits.ONE; + private static final double REQUIRED_RXIDLE = 5.0; + private static final double SHUTDOWN_RXIDLE = 1.5; + private static final double REQUIRED_TXIDLE = 5.5; + private static final double SHUTDOWN_TXIDLE = 3.5; + private static final OutputMode REQUIRED_DIGITAL_OUTPUT_0 = OutputMode.SOURCING_PNP; + private static final OutputMode SHUTDOWN_DIGITAL_OUTPUT_0 = OutputMode.SINKING_NPN; + private static final OutputMode REQUIRED_DIGITAL_OUTPUT_1 = OutputMode.PUSH_PULL; + private static final OutputMode SHUTDOWN_DIGITAL_OUTPUT_1 = OutputMode.SINKING_NPN; + private static final AnalogDomain REQUIRED_ANALOGDOMAIN = AnalogDomain.CURRENT; + private static final AnalogDomain SHUTDOWN_ANALOGDOMAIN = AnalogDomain.VOLTAGE; + + private static final float ACCEPTED_TOLERANCE = 0.01f; + + private final ToolIOInterface toolIOInterface; + private final CapabilityManager capabilityManager; + private ToolIOInterfaceControllable controllableInstance; + + public ToolIOController(ResourceModel resourceModel, CapabilityManager capabilityManager) { + toolIOInterface = resourceModel.getToolIOInterface(); + this.capabilityManager = capabilityManager; + } + + @Override + public void onControlGranted(ToolIOInterfaceControlEvent event) { + controllableInstance = event.getControllableResource(); + powerOnTool(); + } + + @Override + public void onControlToBeRevoked(ToolIOInterfaceControlEvent event) { + shutDownTool(); + } + + public boolean hasControl() { + return controllableInstance != null && controllableInstance.hasControl(); + } + + private void powerOnTool() { + controllableInstance.setOutputVoltage(REQUIRED_VOLTAGE); + + if (capabilityManager.hasCapability(COMMUNICATION_INTERFACE_MODE)) { + controlTCI(REQUIRED_BAUDRATE, REQUIRED_PARITY, REQUIRED_STOPBITS, REQUIRED_RXIDLE, REQUIRED_TXIDLE); + } else { + controlAnalogInputDomain(REQUIRED_ANALOGDOMAIN); + } + + if (capabilityManager.hasCapability(DIGITAL_OUTPUT_MODE)) { + controlToolOutput(REQUIRED_DIGITAL_OUTPUT_0, REQUIRED_DIGITAL_OUTPUT_1); + } + } + + private void shutDownTool() { + controllableInstance.setOutputVoltage(SHUTDOWN_VOLTAGE); + + if (capabilityManager.hasCapability(COMMUNICATION_INTERFACE_MODE)) { + controlTCI(SHUTDOWN_BAUDRATE, SHUTDOWN_PARITY, SHUTDOWN_STOPBITS, SHUTDOWN_RXIDLE, SHUTDOWN_TXIDLE); + } else { + controlAnalogInputDomain(SHUTDOWN_ANALOGDOMAIN); + } + + if (capabilityManager.hasCapability(DIGITAL_OUTPUT_MODE)) { + controlToolOutput(SHUTDOWN_DIGITAL_OUTPUT_0, SHUTDOWN_DIGITAL_OUTPUT_1); + } + } + + private void controlAnalogInputDomain(AnalogDomain analogdomain) { + AnalogInputModeConfigFactory factory = controllableInstance.getAnalogInputModeConfigFactory(); + AnalogInputDomainConfig config = factory.createAnalogInputDomainConfig(analogdomain, analogdomain); + controllableInstance.setAnalogInputModeConfig(config); + } + + private void controlToolOutput(OutputMode digitalOutput0, OutputMode digitalOutput1) { + DigitalOutputModeConfigFactory factory = controllableInstance.getDigitalOutputModeConfigFactory(); + StandardDigitalOutputModeConfig config = factory.createStandardDigitalOutputModeConfig(digitalOutput0, digitalOutput1); + controllableInstance.setDigitalOutputModeConfig(config); + } + + private void controlTCI(BaudRate baudrate, Parity parity, StopBits stopbits, double rxidle, double txidle) { + AnalogInputModeConfigFactory factory = controllableInstance.getAnalogInputModeConfigFactory(); + CommunicationInterfaceConfig config = factory.createCommunicationInterfaceConfig(baudrate, parity, stopbits, rxidle, txidle); + controllableInstance.setAnalogInputModeConfig(config); + } + + public boolean isSetupCorrect() { + if (toolIOInterface.getOutputVoltage() != REQUIRED_VOLTAGE ) { + return false; + } + + AnalogInputModeConfig config = toolIOInterface.getAnalogInputModeConfig(); + if(capabilityManager.hasCapability(COMMUNICATION_INTERFACE_MODE)) { + if(!isRequiredTCI(config)) { + return false; + } + } else { + if(!isRequiredAnalogInput(config)){ + return false; + } + } + + if (capabilityManager.hasCapability(DIGITAL_OUTPUT_MODE)) { + return isRequiredToolOutput(); + } + + return true; + } + + private Boolean isRequiredToolOutput() { + DigitalOutputModeConfig config = toolIOInterface.getDigitalOutputModeConfig(); + if (config.getConfigType() != STANDARD_DIGITAL_OUTPUT_MODE) { + return false; + } + + StandardDigitalOutputModeConfig digitalOutputModeConfig = ((StandardDigitalOutputModeConfig) config); + return digitalOutputModeConfig.getOutputModeForOutput0() == REQUIRED_DIGITAL_OUTPUT_0 + && digitalOutputModeConfig.getOutputModeForOutput1() == REQUIRED_DIGITAL_OUTPUT_1; + } + + private boolean isRequiredAnalogInput(AnalogInputModeConfig toolInputModeConfig) { + if(toolInputModeConfig.getConfigType() != ANALOG_INPUT_DOMAIN) { + return false; + } + + AnalogInputDomainConfig config = ((AnalogInputDomainConfig) toolInputModeConfig); + return config.getAnalogDomainForInput0() == REQUIRED_ANALOGDOMAIN + && config.getAnalogDomainForInput1() == REQUIRED_ANALOGDOMAIN; + } + + private boolean isRequiredTCI(AnalogInputModeConfig toolInputModeConfig) { + if(toolInputModeConfig.getConfigType() != TOOL_COMMUNICATION_INTERFACE) { + return false; + } + + CommunicationInterfaceConfig toolCommunicationInterfaceConfig = ((CommunicationInterfaceConfig) toolInputModeConfig); + return toolCommunicationInterfaceConfig.getBaudRate() == REQUIRED_BAUDRATE + && toolCommunicationInterfaceConfig.getParity() == REQUIRED_PARITY + && toolCommunicationInterfaceConfig.getStopBits() == REQUIRED_STOPBITS + && Math.abs(toolCommunicationInterfaceConfig.getRxIdleChars() - REQUIRED_RXIDLE) < ACCEPTED_TOLERANCE + && Math.abs(toolCommunicationInterfaceConfig.getTxIdleChars() - REQUIRED_TXIDLE) < ACCEPTED_TOLERANCE; + } +} diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeContribution.java b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeContribution.java new file mode 100644 index 00000000..b510f276 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeContribution.java @@ -0,0 +1,59 @@ +package com.ur.urcap.examples.tooliocontrol.program; + +import com.ur.urcap.api.contribution.ProgramNodeContribution; +import com.ur.urcap.api.contribution.program.CreationContext; +import com.ur.urcap.api.contribution.program.ProgramAPIProvider; +import com.ur.urcap.api.domain.ProgramAPI; +import com.ur.urcap.api.domain.data.DataModel; +import com.ur.urcap.api.domain.script.ScriptWriter; +import com.ur.urcap.examples.tooliocontrol.installation.ToolIOControlInstallationNodeContribution; + +public class ToolIOControlProgramNodeContribution implements ProgramNodeContribution { + private final ProgramAPIProvider apiProvider; + private final ToolIOControlProgramNodeView view; + + public ToolIOControlProgramNodeContribution(ProgramAPIProvider apiProvider, ToolIOControlProgramNodeView view, DataModel model, CreationContext context) { + this.apiProvider = apiProvider; + this.view = view; + } + + @Override + public void openView() { + view.showHelp(!isSetupCorrect()); + } + + @Override + public void closeView() { + + } + + @Override + public String getTitle() { + return "Tool I/O Control"; + } + + @Override + public boolean isDefined() { + return isSetupCorrect(); + } + + private boolean isSetupCorrect() { + ToolIOControlInstallationNodeContribution installationNode = getInstallationNode(); + return installationNode.isSetupCorrect(); + } + + private ToolIOControlInstallationNodeContribution getInstallationNode() { + return getProgramAPI().getInstallationNode(ToolIOControlInstallationNodeContribution.class); + } + + private ProgramAPI getProgramAPI() { + return apiProvider.getProgramAPI(); + } + + @Override + public void generateScript(ScriptWriter writer) { + //Start welding torch + writer.writeChildren(); + //Stop welding torch + } +} diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeService.java b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeService.java new file mode 100644 index 00000000..6d59fce4 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeService.java @@ -0,0 +1,37 @@ +package com.ur.urcap.examples.tooliocontrol.program; + +import com.ur.urcap.api.contribution.ViewAPIProvider; +import com.ur.urcap.api.contribution.program.ContributionConfiguration; +import com.ur.urcap.api.contribution.program.CreationContext; +import com.ur.urcap.api.contribution.program.ProgramAPIProvider; +import com.ur.urcap.api.contribution.program.swing.SwingProgramNodeService; +import com.ur.urcap.api.domain.data.DataModel; + +import java.util.Locale; + +public class ToolIOControlProgramNodeService implements SwingProgramNodeService { + @Override + public String getId() { + return "ToolIOControl"; + } + + @Override + public void configureContribution(ContributionConfiguration configuration) { + configuration.setChildrenAllowed(true); + } + + @Override + public String getTitle(Locale locale) { + return "Tool I/O Control"; + } + + @Override + public ToolIOControlProgramNodeView createView(ViewAPIProvider apiProvider) { + return new ToolIOControlProgramNodeView(apiProvider); + } + + @Override + public ToolIOControlProgramNodeContribution createNode(ProgramAPIProvider apiProvider, ToolIOControlProgramNodeView view, DataModel model, CreationContext context) { + return new ToolIOControlProgramNodeContribution(apiProvider, view, model, context); + } +} diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeView.java b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeView.java new file mode 100644 index 00000000..a44863db --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeView.java @@ -0,0 +1,43 @@ +package com.ur.urcap.examples.tooliocontrol.program; + +import com.ur.urcap.api.contribution.ContributionProvider; +import com.ur.urcap.api.contribution.ViewAPIProvider; +import com.ur.urcap.api.contribution.program.swing.SwingProgramNodeView; + +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JPanel; +import java.awt.Component; + +public class ToolIOControlProgramNodeView implements SwingProgramNodeView { + private static final int SPACING = 10; + + protected final ViewAPIProvider apiProvider; + private Box help; + + public ToolIOControlProgramNodeView(ViewAPIProvider apiProvider) { + this.apiProvider = apiProvider; + } + + @Override + public void buildUI(JPanel panel, ContributionProvider provider) { + BoxLayout mgr = new BoxLayout(panel, BoxLayout.Y_AXIS); + panel.setLayout(mgr); + + help = Box.createHorizontalBox(); + help.add(new JLabel(new ImageIcon(getClass().getResource("/icons/warning.png")))); + help.add(new JLabel("Incompatible Tool I/O interface settings.")); + help.add(createSpacing()); + panel.add(help); + } + + public void showHelp(boolean show) { + help.setVisible(show); + } + + protected Component createSpacing() { + return Box.createVerticalStrut(SPACING); + } +} diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/resources/META-INF/LICENSE b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/resources/META-INF/LICENSE new file mode 100644 index 00000000..a8beff27 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/resources/META-INF/LICENSE @@ -0,0 +1,34 @@ + +*********************************************************************** +* Insert your own licenses here * +* An example is shown below * +*********************************************************************** + + +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by the . +4. Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/resources/icons/warning.png b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/resources/icons/warning.png new file mode 100644 index 00000000..bbc9a08a Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/resources/icons/warning.png differ diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/META-INF/LICENSE b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/META-INF/LICENSE new file mode 100644 index 00000000..a8beff27 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/META-INF/LICENSE @@ -0,0 +1,34 @@ + +*********************************************************************** +* Insert your own licenses here * +* An example is shown below * +*********************************************************************** + + +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by the . +4. Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/META-INF/MANIFEST.MF b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 00000000..fe591edd --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,42 @@ +Manifest-Version: 1.0 +Bnd-LastModified: 1667837996790 +Build-Jdk: 1.8.0_342 +Built-By: root +Bundle-Activator: com.ur.urcap.examples.tooliocontrol.Activator +Bundle-Category: URCap +Bundle-ContactAddress: Energivej 25, 5260 Odense S, Denmark +Bundle-Copyright: Copyright (C) 2009-2022 Universal Robots. All Rights R + eserved +Bundle-Description: Tool I/O interface control sample URCap +Bundle-LicenseType: Sample license +Bundle-ManifestVersion: 2 +Bundle-Name: Tool I/O Control Swing +Bundle-SymbolicName: com.ur.urcap.examples.tooliocontrolswing +Bundle-Vendor: Universal Robots +Bundle-Version: 1.0.0.SNAPSHOT +Created-By: Apache Maven Bundle Plugin +Export-Package: com.ur.urcap.examples.tooliocontrol;version="1.0.0.SNAPS + HOT";uses:="org.osgi.framework",com.ur.urcap.examples.tooliocontrol.ins + tallation;version="1.0.0.SNAPSHOT";uses:="com.ur.urcap.api.contribution + ,com.ur.urcap.api.contribution.installation,com.ur.urcap.api.contributi + on.installation.swing,com.ur.urcap.api.domain.data,com.ur.urcap.api.dom + ain.script,javax.swing",com.ur.urcap.examples.tooliocontrol.program;ver + sion="1.0.0.SNAPSHOT";uses:="com.ur.urcap.api.contribution,com.ur.urcap + .api.contribution.program,com.ur.urcap.api.contribution.program.swing,c + om.ur.urcap.api.domain.data,com.ur.urcap.api.domain.script,javax.swing" +Import-Package: com.ur.urcap.api.contribution;version="[1.7,2)",com.ur.u + rcap.api.contribution.installation;version="[1.7,2)",com.ur.urcap.api.c + ontribution.installation.swing;version="[1.7,2)",com.ur.urcap.api.contr + ibution.program;version="[1.7,2)",com.ur.urcap.api.contribution.program + .swing;version="[1.7,2)",com.ur.urcap.api.domain;version="[1.7,2)",com. + ur.urcap.api.domain.data;version="[1.7,2)",com.ur.urcap.api.domain.reso + urce;version="[1.7,2)",com.ur.urcap.api.domain.resource.tooliointerface + ;version="[1.7,2)",com.ur.urcap.api.domain.resource.tooliointerface.con + trol;version="[1.7,2)",com.ur.urcap.api.domain.robot;version="[1.7,2)", + com.ur.urcap.api.domain.script;version="[1.7,2)",com.ur.urcap.api.domai + n.system.capability;version="[1.7,2)",com.ur.urcap.api.domain.system.ca + pability.tooliointerface;version="[1.7,2)",javax.swing,org.osgi.framewo + rk;version="[1.6,2)" +Tool: Bnd-2.1.0.20130426-122213 +URCapCompatibility-CB3: true +URCapCompatibility-eSeries: true diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/Activator.class b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/Activator.class new file mode 100644 index 00000000..8b096435 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/Activator.class differ diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeContribution.class b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeContribution.class new file mode 100644 index 00000000..db6e043a Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeContribution.class differ diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeService.class b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeService.class new file mode 100644 index 00000000..fce4cdd5 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeService.class differ diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeView.class b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeView.class new file mode 100644 index 00000000..c0e780e3 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeView.class differ diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/installation/ToolIOController.class b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/installation/ToolIOController.class new file mode 100644 index 00000000..a0097744 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/installation/ToolIOController.class differ diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeContribution.class b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeContribution.class new file mode 100644 index 00000000..f92f2e8a Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeContribution.class differ diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeService.class b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeService.class new file mode 100644 index 00000000..ceb2f549 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeService.class differ diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeView.class b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeView.class new file mode 100644 index 00000000..45bf0753 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeView.class differ diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/icons/warning.png b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/icons/warning.png new file mode 100644 index 00000000..bbc9a08a Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/classes/icons/warning.png differ diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 00000000..e69de29b diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 00000000..7417422a --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,8 @@ +/workspaces/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/Activator.java +/workspaces/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeService.java +/workspaces/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeContribution.java +/workspaces/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeView.java +/workspaces/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeService.java +/workspaces/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOControlInstallationNodeContribution.java +/workspaces/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/installation/ToolIOController.java +/workspaces/samples/swing/com.ur.urcap.examples.tooliocontrolswing/src/main/java/com/ur/urcap/examples/tooliocontrol/program/ToolIOControlProgramNodeView.java diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/tooliocontrolswing-1.0-SNAPSHOT-sources.tar.gz b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/tooliocontrolswing-1.0-SNAPSHOT-sources.tar.gz new file mode 100644 index 00000000..e7b91c34 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/tooliocontrolswing-1.0-SNAPSHOT-sources.tar.gz differ diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/tooliocontrolswing-1.0-SNAPSHOT.jar b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/tooliocontrolswing-1.0-SNAPSHOT.jar new file mode 100644 index 00000000..0664a853 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/tooliocontrolswing-1.0-SNAPSHOT.jar differ diff --git a/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/tooliocontrolswing-1.0-SNAPSHOT.urcap b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/tooliocontrolswing-1.0-SNAPSHOT.urcap new file mode 100644 index 00000000..0664a853 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.tooliocontrolswing/target/tooliocontrolswing-1.0-SNAPSHOT.urcap differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/assembly.xml b/samples/swing/com.ur.urcap.examples.userinput/assembly.xml new file mode 100644 index 00000000..9e7ffd35 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/assembly.xml @@ -0,0 +1,23 @@ + + sources + + tar.gz + + false + + + . + + pom.xml + assembly.xml + + true + + + src + true + + + diff --git a/samples/swing/com.ur.urcap.examples.userinput/pom.xml b/samples/swing/com.ur.urcap.examples.userinput/pom.xml new file mode 100644 index 00000000..b2eea07f --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/pom.xml @@ -0,0 +1,302 @@ + + + + 4.0.0 + + com.ur.urcap.examples + userinput + 1.0-SNAPSHOT + User Input + bundle + + + + + + + + + com.ur.urcap.examples.userinput + Universal Robots + Energivej 25, 5260 Odense S, Denmark + Copyright (C) 2009-${copyright.year} Universal Robots. All Rights Reserved + User Input Swing sample URCap + Sample license + true + true + + + + + localhost + root + easybot + + + + + + + ur + easybot + + + ${maven.build.timestamp} + yyyy + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.0 + + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.1 + + alphabetical + false + + + + maven-jar-plugin + 3.0.2 + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + maven-resources-plugin + 3.0.2 + + + org.apache.felix + maven-bundle-plugin + 2.4.0 + true + + + bundle-manifest + process-classes + + manifest + + + + + + + URCap + com.ur.urcap.examples.userinput.impl.Activator + ${urcap.vendor} + ${urcap.contactAddress} + ${urcap.copyright} + ${urcap.licenseType} + ${urcap.description} + ${urcap.compatibility.CB3} + ${urcap.compatibility.eSeries} + + + com.ur.urcap.api*, + * + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.1 + + + + package-urcap + package + + exec + + + cp + target/${project.build.finalName}.jar target/${project.build.finalName}.urcap + . + + + + + + maven-assembly-plugin + + + assembly.xml + + + + + package + + single + + + + + + + + + + org.osgi + org.osgi.core + 4.3.0 + + + + com.ur.urcap + api + 1.3.0 + provided + + + + + junit + junit + 4.12 + test + + + + + + remote + + + + org.codehaus.mojo + exec-maven-plugin + 1.1 + + + remote-install-urcap + install + + exec + + + sshpass + -p ${urcap.install.password} scp -o StrictHostKeyChecking=no target/${project.build.finalName}.jar ${urcap.install.username}@${urcap.install.host}:/root/.urcaps/${urcap.symbolicname}.jar + . + + + + remote-restart-ui + install + + exec + + + sshpass + -p ${urcap.install.password} ssh ${urcap.install.username}@${urcap.install.host} pkill java + . + + + + + + + + + local + + + + org.codehaus.mojo + exec-maven-plugin + 1.1 + + + local-install-urcap + install + + exec + + + cp + target/${project.build.finalName}.jar ${user.home}/.urcaps/${urcap.symbolicname}.jar + . + + + + + + + + + ursim + + + + org.codehaus.mojo + exec-maven-plugin + 1.1 + + + ursim-install-urcap + install + + exec + + + cp + target/${project.build.finalName}.jar ${ursim.home}/.urcaps/${urcap.symbolicname}.jar + . + + + + + + + + + ursimvm + + + + org.codehaus.mojo + exec-maven-plugin + 1.1 + + + ursimvm-install-urcap + install + + exec + + + sshpass + -p ${ursimvm.install.password} scp -o StrictHostKeyChecking=no target/${project.build.finalName}.jar ${ursimvm.install.username}@${ursimvm.install.host}:/home/ur/ursim-current/.urcaps/${urcap.symbolicname}.jar + . + + + + + + + + + diff --git a/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/Activator.java b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/Activator.java new file mode 100644 index 00000000..279259b1 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/Activator.java @@ -0,0 +1,16 @@ +package com.ur.urcap.examples.userinput.impl; + +import com.ur.urcap.api.contribution.installation.swing.SwingInstallationNodeService; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + @Override + public void start(BundleContext context) throws Exception { + context.registerService(SwingInstallationNodeService.class, new UserInputInstallationNodeService(), null); + } + + @Override + public void stop(BundleContext context) throws Exception { + } +} diff --git a/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/PasswordValidator.java b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/PasswordValidator.java new file mode 100644 index 00000000..dd0b2099 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/PasswordValidator.java @@ -0,0 +1,18 @@ +package com.ur.urcap.examples.userinput.impl; + + +import com.ur.urcap.api.domain.userinteraction.inputvalidation.InputValidator; + +public class PasswordValidator implements InputValidator { + + @Override + public boolean isValid(String value) { + //At least 1 letter (a-zA-Z), 1 digit and minimum 8 characters long + return value.matches("^(?=.*[A-Za-z])(?=.*[0-9]).{8,}$"); + } + + @Override + public String getMessage(String value) { + return "The password must be at least 8 characters long, contain min. 1 letter and min. 1 number"; + } +} diff --git a/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/Style.java b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/Style.java new file mode 100644 index 00000000..d4931ab4 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/Style.java @@ -0,0 +1,50 @@ +package com.ur.urcap.examples.userinput.impl; + +import javax.swing.*; +import javax.swing.border.Border; +import java.awt.*; + +public abstract class Style { + private static final int VERTICAL_SPACING = 10; + private static final int HORIZONTAL_SPACING = 10; + private static final Color SUCCESS_BACKGROUND = new Color(194, 246, 214); + private static final Border SUCCESS_BORDER = BorderFactory.createLineBorder(new Color(134, 222, 136)); + private static final Color ERROR_BACKGROUND = new Color(237, 206, 206); + private static final Border ERROR_BORDER = BorderFactory.createLineBorder(new Color(236, 165, 165)); + private static final Color WARNING_BACKGROUND = new Color(251, 238, 198); + private static final Border WARNING_BORDER = BorderFactory.createLineBorder(new Color(235, 202, 132)); + + public int getVerticalSpacing() { + return VERTICAL_SPACING; + } + + public int getHorizontalSpacing() { + return HORIZONTAL_SPACING; + } + + public Color getSuccessBackground() { + return SUCCESS_BACKGROUND; + } + + public Border getSuccessBorder() { + return SUCCESS_BORDER; + } + + public Color getErrorBackground() { + return ERROR_BACKGROUND; + } + + public Border getErrorBorder() { + return ERROR_BORDER; + } + + public Color getWarningBackground() { + return WARNING_BACKGROUND; + } + + public Border getWarningBorder() { + return WARNING_BORDER; + } + + public abstract Dimension getInputfieldDimension(); +} diff --git a/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution.java b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution.java new file mode 100644 index 00000000..a5730fb1 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution.java @@ -0,0 +1,181 @@ +package com.ur.urcap.examples.userinput.impl; + +import com.ur.urcap.api.contribution.InstallationNodeContribution; +import com.ur.urcap.api.contribution.installation.InstallationAPIProvider; +import com.ur.urcap.api.domain.data.DataModel; +import com.ur.urcap.api.domain.script.ScriptWriter; +import com.ur.urcap.api.domain.userinteraction.inputvalidation.InputValidationFactory; +import com.ur.urcap.api.domain.userinteraction.keyboard.KeyboardInputCallback; +import com.ur.urcap.api.domain.userinteraction.keyboard.KeyboardInputFactory; +import com.ur.urcap.api.domain.userinteraction.keyboard.KeyboardNumberInput; +import com.ur.urcap.api.domain.userinteraction.keyboard.KeyboardTextInput; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +public class UserInputInstallationNodeContribution implements InstallationNodeContribution { + + private static final String IP_ADDRESS = "IpAddress"; + private static final String POSITIVE_DOUBLE = "PositiveDouble"; + private static final String TEXT = "Text"; + private static final String PASSWORD_KEY = "Password"; + + private static final String IP_ADDRESS_DEFAULT = "0.0.0.0"; + + private final UserInputInstallationNodeView view; + private final DataModel model; + private final InputValidationFactory validatorFactory; + private final KeyboardInputFactory keyboardInputFactory; + private MessageDigest messageDigest; + + public UserInputInstallationNodeContribution(InstallationAPIProvider apiProvider, + UserInputInstallationNodeView view, + DataModel model) { + this.view = view; + this.model = model; + this.keyboardInputFactory = apiProvider.getUserInterfaceAPI().getUserInteraction().getKeyboardInputFactory(); + this.validatorFactory = apiProvider.getUserInterfaceAPI().getUserInteraction().getInputValidationFactory(); + + try { + messageDigest = MessageDigest.getInstance("SHA-256"); + } catch (NoSuchAlgorithmException ignored) { + } + } + + @Override + public void openView() { + view.setIpAddress(getIpAddress()); + view.setPositiveDouble(getPositiveDouble()); + view.setText(getText()); + view.setPasswordField(getPasswordPlaceholder()); + view.hidePasswordInfo(); + } + + @Override + public void closeView() { + + } + + @Override + public void generateScript(ScriptWriter writer) { + + } + + public KeyboardTextInput getKeyboardForIpAddress() { + KeyboardTextInput keyboard = keyboardInputFactory.createIPAddressKeyboardInput(); + keyboard.setInitialValue(model.get(IP_ADDRESS, "")); + return keyboard; + } + + public KeyboardInputCallback getCallbackForIpAddress() { + return new KeyboardInputCallback() { + @Override + public void onOk(String value) { + model.set(IP_ADDRESS, value); + view.setIpAddress(value); + } + }; + } + + public KeyboardNumberInput getKeyboardForPositiveNumber() { + KeyboardNumberInput keyboard = keyboardInputFactory.createPositiveDoubleKeypadInput(); + keyboard.setInitialValue(model.get(POSITIVE_DOUBLE, 0D)); + return keyboard; + } + + public KeyboardInputCallback getCallbackForPositiveNumber() { + return new KeyboardInputCallback() { + @Override + public void onOk(Double value) { + model.set(POSITIVE_DOUBLE, value); + view.setPositiveDouble(value); + } + }; + } + + public KeyboardTextInput getKeyboardForTextField() { + KeyboardTextInput keyboardInput = keyboardInputFactory.createStringKeyboardInput(); + keyboardInput.setInitialValue(model.get(TEXT, "")); + keyboardInput.setErrorValidator(validatorFactory.createStringLengthValidator(1, 15)); + return keyboardInput; + } + + public KeyboardInputCallback getCallbackForTextField() { + return new KeyboardInputCallback() { + @Override + public void onOk(String value) { + model.set(TEXT, value); + view.setText(value); + } + }; + } + + public KeyboardTextInput getKeyboardForPassword() { + KeyboardTextInput keyboard = keyboardInputFactory.createPasswordKeyboardInput(); + keyboard.setErrorValidator(new PasswordValidator()); + return keyboard; + } + + public KeyboardInputCallback getCallbackForPassword() { + return new KeyboardInputCallback() { + @Override + public void onOk(String value) { + model.set(PASSWORD_KEY, encrypt(value)); + view.setPasswordField(getPasswordPlaceholder()); + } + }; + } + + public KeyboardTextInput getKeyboardForTestPassword() { + return keyboardInputFactory.createPasswordKeyboardInput(); + } + + public KeyboardInputCallback getCallbackForTestPassword() { + return new KeyboardInputCallback() { + @Override + public void onOk(String value) { + if (!model.isSet(PASSWORD_KEY)) { + view.setPasswordNotSet(); + } else if (model.get(PASSWORD_KEY, "").equals(encrypt(value))) { + view.setPasswordIsCorrect(); + } else { + view.setPasswordIsNotCorrect(); + } + } + }; + } + + public void onClearPasswordClicked() { + model.remove(PASSWORD_KEY); + view.setPasswordField(""); + } + + private String encrypt(String value) { + byte[] bytes = messageDigest.digest(value.getBytes()); + return convertByteToHex(bytes); + } + + private String convertByteToHex(byte[] bytes) { + StringBuilder sb = new StringBuilder(); + for (byte data : bytes) { + sb.append(Integer.toString((data & 0xff) + 0x100, 16).substring(1)); + } + return sb.toString(); + } + + private String getIpAddress() { + return model.get(IP_ADDRESS, IP_ADDRESS_DEFAULT); + } + + private double getPositiveDouble() { + return model.get(POSITIVE_DOUBLE, 0D); + } + + private String getText() { + return model.get(TEXT, ""); + } + + private String getPasswordPlaceholder() { + return model.isSet(PASSWORD_KEY) ? "Placeholder" : ""; + } +} diff --git a/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeService.java b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeService.java new file mode 100644 index 00000000..32f7f3ce --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeService.java @@ -0,0 +1,39 @@ +package com.ur.urcap.examples.userinput.impl; + +import com.ur.urcap.api.contribution.ViewAPIProvider; +import com.ur.urcap.api.contribution.installation.ContributionConfiguration; +import com.ur.urcap.api.contribution.installation.CreationContext; +import com.ur.urcap.api.contribution.installation.InstallationAPIProvider; +import com.ur.urcap.api.contribution.installation.swing.SwingInstallationNodeService; +import com.ur.urcap.api.domain.SystemAPI; +import com.ur.urcap.api.domain.data.DataModel; + +import java.util.Locale; + +public class UserInputInstallationNodeService implements SwingInstallationNodeService { + + @Override + public void configureContribution(ContributionConfiguration configuration) { + } + + @Override + public String getTitle(Locale locale) { + return "User Input"; + } + + @Override + public UserInputInstallationNodeView createView(ViewAPIProvider apiProvider) { + SystemAPI systemAPI = apiProvider.getSystemAPI(); + Style style = systemAPI.getSoftwareVersion().getMajorVersion() >= 5 ? new V5Style() : new V3Style(); + return new UserInputInstallationNodeView(style); + } + + @Override + public UserInputInstallationNodeContribution createInstallationNode( + InstallationAPIProvider apiProvider, + UserInputInstallationNodeView view, + DataModel model, + CreationContext context) { + return new UserInputInstallationNodeContribution(apiProvider, view, model); + } +} diff --git a/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView.java b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView.java new file mode 100644 index 00000000..3e9a359e --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView.java @@ -0,0 +1,192 @@ +package com.ur.urcap.examples.userinput.impl; + +import com.ur.urcap.api.contribution.installation.swing.SwingInstallationNodeView; +import com.ur.urcap.api.domain.userinteraction.keyboard.KeyboardNumberInput; +import com.ur.urcap.api.domain.userinteraction.keyboard.KeyboardTextInput; + +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JPasswordField; +import javax.swing.JTextField; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.text.DecimalFormat; + +public class UserInputInstallationNodeView implements SwingInstallationNodeView { + + private static final int MAXIMUM_FRACTION_DIGITS = 8; + + private final Style style; + private JTextField ipAddress = new JTextField(); + private JTextField positiveDouble = new JTextField(); + private JTextField text = new JTextField(); + private JPasswordField passwordField = new JPasswordField(); + private JLabel passwordInfoLabel; + private Box passwordInfoBox; + + public UserInputInstallationNodeView(Style style) { + this.style = style; + } + + @Override + public void buildUI(JPanel jPanel, final UserInputInstallationNodeContribution installationNode) { + jPanel.setLayout(new BoxLayout(jPanel, BoxLayout.Y_AXIS)); + + ipAddress.setHorizontalAlignment(JTextField.RIGHT); + jPanel.add(createLabelInputField("IP Address: ", ipAddress, new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + KeyboardTextInput keyboardInput = installationNode.getKeyboardForIpAddress(); + keyboardInput.show(ipAddress, installationNode.getCallbackForIpAddress()); + } + })); + + jPanel.add(createVerticalSpacing()); + positiveDouble.setHorizontalAlignment(JTextField.RIGHT); + jPanel.add(createLabelInputField("Positive number: ", positiveDouble, new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + KeyboardNumberInput keyboardInput = installationNode.getKeyboardForPositiveNumber(); + keyboardInput.show(positiveDouble, installationNode.getCallbackForPositiveNumber()); + } + })); + + jPanel.add(createVerticalSpacing()); + jPanel.add(createLabelInputField("Text (min. 1 character): ", text, new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + KeyboardTextInput keyboard = installationNode.getKeyboardForTextField(); + keyboard.show(text, installationNode.getCallbackForTextField()); + } + })); + + jPanel.add(createVerticalSpacing()); + Box passwordBox = createPasswordBox(installationNode); + jPanel.add(passwordBox); + + jPanel.add(createVerticalSpacing()); + passwordInfoBox = createPasswordInfoBox(); + jPanel.add(passwordInfoBox); + passwordInfoBox.setMaximumSize(passwordBox.getPreferredSize()); + } + + private Box createPasswordBox(final UserInputInstallationNodeContribution installationNode) { + Box passwordBox = createLabelInputField("Set password: ", passwordField, new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + KeyboardTextInput keyboardInput = installationNode.getKeyboardForPassword(); + keyboardInput.show(passwordField, installationNode.getCallbackForPassword()); + } + }); + + JButton clearButton = new JButton("Clear"); + clearButton.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + installationNode.onClearPasswordClicked(); + } + }); + + JButton testPassword = new JButton("Test password"); + testPassword.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + KeyboardTextInput keyboardInput = installationNode.getKeyboardForTestPassword(); + keyboardInput.show(passwordField, installationNode.getCallbackForTestPassword()); + } + }); + + passwordBox.add(createHorizontalSpacing()); + passwordBox.add(clearButton); + passwordBox.add(createHorizontalSpacing()); + passwordBox.add(testPassword); + return passwordBox; + } + + private Component createVerticalSpacing() { + return Box.createRigidArea(new Dimension(0, style.getVerticalSpacing())); + } + + private Box createLabelInputField(String label, final JTextField inputField, MouseAdapter mouseAdapter) { + Box horizontalBox = Box.createHorizontalBox(); + horizontalBox.setAlignmentX(Component.LEFT_ALIGNMENT); + + JLabel jLabel = new JLabel(label); + inputField.setFocusable(false); + inputField.setPreferredSize(style.getInputfieldDimension()); + inputField.setMaximumSize(inputField.getPreferredSize()); + inputField.addMouseListener(mouseAdapter); + + horizontalBox.add(jLabel); + horizontalBox.add(inputField); + + return horizontalBox; + } + + private Box createPasswordInfoBox() { + Box horizontalBox = Box.createHorizontalBox(); + horizontalBox.setAlignmentX(Component.LEFT_ALIGNMENT); + horizontalBox.setOpaque(true); + + passwordInfoLabel = new JLabel(); + + horizontalBox.add(Box.createHorizontalGlue()); + horizontalBox.add(passwordInfoLabel); + horizontalBox.add(Box.createHorizontalGlue()); + + return horizontalBox; + } + + private Component createHorizontalSpacing() { + return Box.createRigidArea(new Dimension(style.getHorizontalSpacing(), 0)); + } + + public void setIpAddress(String value) { + ipAddress.setText(value); + } + + public void setPositiveDouble(Double value) { + DecimalFormat df = new DecimalFormat("#"); + df.setMaximumFractionDigits(MAXIMUM_FRACTION_DIGITS); + String stringValue = df.format((double) value); + positiveDouble.setText(stringValue); + } + + public void setText(String value) { + text.setText(value); + } + + public void setPasswordField(String value) { + passwordField.setText(value); + } + + public void setPasswordIsCorrect() { + passwordInfoLabel.setText("Password is correct"); + passwordInfoBox.setBackground(style.getSuccessBackground()); + passwordInfoBox.setBorder(style.getSuccessBorder()); + passwordInfoBox.setVisible(true); + } + + public void setPasswordIsNotCorrect() { + passwordInfoLabel.setText("Password is NOT correct"); + passwordInfoBox.setBackground(style.getErrorBackground()); + passwordInfoBox.setBorder(style.getErrorBorder()); + passwordInfoBox.setVisible(true); + } + + public void setPasswordNotSet() { + passwordInfoLabel.setText("Password is not set"); + passwordInfoBox.setBackground(style.getWarningBackground()); + passwordInfoBox.setBorder(style.getWarningBorder()); + passwordInfoBox.setVisible(true); + } + + public void hidePasswordInfo() { + passwordInfoBox.setVisible(false); + } +} diff --git a/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/V3Style.java b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/V3Style.java new file mode 100644 index 00000000..2ebc336a --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/V3Style.java @@ -0,0 +1,12 @@ +package com.ur.urcap.examples.userinput.impl; + +import java.awt.*; + +public class V3Style extends Style { + private static final Dimension INPUTFIELD_SIZE = new Dimension(200, 24); + + @Override + public Dimension getInputfieldDimension() { + return INPUTFIELD_SIZE; + } +} diff --git a/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/V5Style.java b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/V5Style.java new file mode 100644 index 00000000..6c32bb1d --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/V5Style.java @@ -0,0 +1,12 @@ +package com.ur.urcap.examples.userinput.impl; + +import java.awt.*; + +public class V5Style extends Style { + private static final Dimension INPUTFIELD_SIZE = new Dimension(200, 30); + + @Override + public Dimension getInputfieldDimension() { + return INPUTFIELD_SIZE; + } +} diff --git a/samples/swing/com.ur.urcap.examples.userinput/src/main/resources/META-INF/LICENSE b/samples/swing/com.ur.urcap.examples.userinput/src/main/resources/META-INF/LICENSE new file mode 100644 index 00000000..6f732576 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/src/main/resources/META-INF/LICENSE @@ -0,0 +1,28 @@ +Example: +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by the . +4. Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/META-INF/LICENSE b/samples/swing/com.ur.urcap.examples.userinput/target/classes/META-INF/LICENSE new file mode 100644 index 00000000..6f732576 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/target/classes/META-INF/LICENSE @@ -0,0 +1,28 @@ +Example: +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by the . +4. Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/META-INF/MANIFEST.MF b/samples/swing/com.ur.urcap.examples.userinput/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5491b137 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,29 @@ +Manifest-Version: 1.0 +Bnd-LastModified: 1667836242780 +Build-Jdk: 1.8.0_342 +Built-By: root +Bundle-Activator: com.ur.urcap.examples.userinput.impl.Activator +Bundle-Category: URCap +Bundle-ContactAddress: Energivej 25, 5260 Odense S, Denmark +Bundle-Copyright: Copyright (C) 2009-2022 Universal Robots. All Rights R + eserved +Bundle-Description: User Input Swing sample URCap +Bundle-LicenseType: Sample license +Bundle-ManifestVersion: 2 +Bundle-Name: User Input +Bundle-SymbolicName: com.ur.urcap.examples.userinput +Bundle-Vendor: Universal Robots +Bundle-Version: 1.0.0.SNAPSHOT +Created-By: Apache Maven Bundle Plugin +Import-Package: com.ur.urcap.api.contribution;version="[1.3,2)",com.ur.u + rcap.api.contribution.installation;version="[1.3,2)",com.ur.urcap.api.c + ontribution.installation.swing;version="[1.3,2)",com.ur.urcap.api.domai + n;version="[1.3,2)",com.ur.urcap.api.domain.data;version="[1.3,2)",com. + ur.urcap.api.domain.script;version="[1.3,2)",com.ur.urcap.api.domain.us + erinteraction;version="[1.3,2)",com.ur.urcap.api.domain.userinteraction + .inputvalidation;version="[1.3,2)",com.ur.urcap.api.domain.userinteract + ion.keyboard;version="[1.3,2)",javax.swing,javax.swing.border,org.osgi. + framework;version="[1.6,2)" +Tool: Bnd-2.1.0.20130426-122213 +URCapCompatibility-CB3: true +URCapCompatibility-eSeries: true diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/Activator.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/Activator.class new file mode 100644 index 00000000..3b1148c8 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/Activator.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/PasswordValidator.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/PasswordValidator.class new file mode 100644 index 00000000..b5183210 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/PasswordValidator.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/Style.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/Style.class new file mode 100644 index 00000000..4d6afeb9 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/Style.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$1.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$1.class new file mode 100644 index 00000000..e25e13cb Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$1.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$2.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$2.class new file mode 100644 index 00000000..1894cbc5 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$2.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$3.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$3.class new file mode 100644 index 00000000..a490c7b5 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$3.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$4.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$4.class new file mode 100644 index 00000000..871d4d77 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$4.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$5.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$5.class new file mode 100644 index 00000000..7ab9d70b Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution$5.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution.class new file mode 100644 index 00000000..7e0ae563 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeService.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeService.class new file mode 100644 index 00000000..ec9b498a Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeService.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$1.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$1.class new file mode 100644 index 00000000..639c1855 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$1.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$2.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$2.class new file mode 100644 index 00000000..6a2cf3e0 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$2.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$3.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$3.class new file mode 100644 index 00000000..64cbdf9c Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$3.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$4.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$4.class new file mode 100644 index 00000000..24688d89 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$4.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$5.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$5.class new file mode 100644 index 00000000..0319ccd4 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$5.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$6.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$6.class new file mode 100644 index 00000000..f0c5da62 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView$6.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView.class new file mode 100644 index 00000000..16e2e244 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/V3Style.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/V3Style.class new file mode 100644 index 00000000..2a92591b Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/V3Style.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/V5Style.class b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/V5Style.class new file mode 100644 index 00000000..0d672ea0 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/classes/com/ur/urcap/examples/userinput/impl/V5Style.class differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/samples/swing/com.ur.urcap.examples.userinput/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 00000000..e69de29b diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/samples/swing/com.ur.urcap.examples.userinput/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 00000000..f7fbe4e0 --- /dev/null +++ b/samples/swing/com.ur.urcap.examples.userinput/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,8 @@ +/workspaces/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/PasswordValidator.java +/workspaces/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeContribution.java +/workspaces/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeService.java +/workspaces/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/UserInputInstallationNodeView.java +/workspaces/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/V5Style.java +/workspaces/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/Style.java +/workspaces/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/Activator.java +/workspaces/samples/swing/com.ur.urcap.examples.userinput/src/main/java/com/ur/urcap/examples/userinput/impl/V3Style.java diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/userinput-1.0-SNAPSHOT-sources.tar.gz b/samples/swing/com.ur.urcap.examples.userinput/target/userinput-1.0-SNAPSHOT-sources.tar.gz new file mode 100644 index 00000000..23db1f9b Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/userinput-1.0-SNAPSHOT-sources.tar.gz differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/userinput-1.0-SNAPSHOT.jar b/samples/swing/com.ur.urcap.examples.userinput/target/userinput-1.0-SNAPSHOT.jar new file mode 100644 index 00000000..d948f051 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/userinput-1.0-SNAPSHOT.jar differ diff --git a/samples/swing/com.ur.urcap.examples.userinput/target/userinput-1.0-SNAPSHOT.urcap b/samples/swing/com.ur.urcap.examples.userinput/target/userinput-1.0-SNAPSHOT.urcap new file mode 100644 index 00000000..d948f051 Binary files /dev/null and b/samples/swing/com.ur.urcap.examples.userinput/target/userinput-1.0-SNAPSHOT.urcap differ