/** * Check the proposed port name against the set of input ports that the * activity has * * @param name * @param set * @return */ private boolean inputPortNameExists(String name, Set<ActivityInputPort> set) { for (Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
/** * Check the proposed port name against the set of output ports that the * activity has * * @param name * @param set * @return */ private boolean outputPortNameExists(String name, Set<OutputPort> set) { for (Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
/** * Check the proposed port name against the set of output ports that the * activity has * * @param name * @param set * @return */ private boolean outputPortNameExists(final String name, final Set<OutputPort> set) { for (final Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
/** * Check the proposed port name against the set of output ports that the * activity has * * @param name * @param set * @return */ private boolean outputPortNameExists(String name, Set<OutputPort> set) { for (Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
/** * Check the proposed port name against the set of input ports that the * activity has * * @param name * @param set * @return */ private boolean inputPortNameExists(String name, Set<ActivityInputPort> set) { for (Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
/** * Check the proposed port name against the set of input ports that the * activity has * * @param name * @param set * @return */ private boolean inputPortNameExists(String name, Set<ActivityInputPort> set) { for (Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
/** * Check the proposed port name against the set of output ports that the * activity has * * @param name * @param set * @return */ private boolean outputPortNameExists(String name, Set<OutputPort> set) { for (Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
/** * Check the proposed port name against the set of input ports that the * activity has * * @param name * @param set * @return */ private boolean inputPortNameExists(final String name, final Set<ActivityInputPort> set) { for (final Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
private String describePort(Port port) { String html = "<tr><td>"+port.getName()+"</td><td>"; html+="Depth:"+port.getDepth()+"<br>"; html+="</td></tr>"; return html; }
/** * Method for generating a valid filename for a port * * @param Port * the port to generate a filename for * @return the filename * */ private String generateFilename(Port port) { String portName = port.getName(); SemanticTypes semanticType = outputSymanticTypes .get(portName); String extension; if (semanticType == RshellPortTypes.SemanticTypes.PNG_FILE) { extension = ".png"; } else if (semanticType == RshellPortTypes.SemanticTypes.TEXT_FILE) { extension = ".txt"; } // else if (semanticType == RshellPortTypes.SemanticTypes.PDF_FILE) { // extension = ".pdf"; // } else { extension = ""; } return portName.replaceAll("\\W", "_") + extension; }
private String describePort(Port port) { String html = "<tr><tr>"+port.getName()+"</td></td>"; html+="Depth:"+port.getDepth()+"<br>"; html+="</td></tr>"; return html; }
public static String findName(Port port) { if (port instanceof ProcessorPort) { String sourceProcessorName = ((ProcessorPort)port).getProcessor().getLocalName(); return sourceProcessorName + ":" + port.getName(); } else if (port instanceof MergePort) { String sourceMergeName = ((MergePort)port).getMerge().getLocalName(); return sourceMergeName + ":" + port.getName(); } else { return port.getName(); } } }
private String findName(Port port) { if (port instanceof ProcessorPort) { String sourceProcessorName = ((ProcessorPort)port).getProcessor().getLocalName(); return sourceProcessorName + ":" + port.getName(); } else if (port instanceof MergePort) { String sourceMergeName = ((MergePort)port).getMerge().getLocalName(); return sourceMergeName + ":" + port.getName(); } else { return port.getName(); } } }
private Object showPortOptions(List<? extends Port> ports, String portType, Component component, Point point) { Object result = null; if (ports.size() == 0) { JOptionPane.showMessageDialog(component, "Service has no " + portType + " ports to connect to"); } else if (ports.size() == 1) { result = ports.get(0); } else { ArrayList<Port> sortedPorts = new ArrayList<Port>(ports); Collections.sort(sortedPorts, portComparator); List<String> portNames = new ArrayList<String>(); for (Port port : sortedPorts) { portNames.add(port.getName()); } String portName = (String) JOptionPane.showInputDialog(component, "Select an " + portType + " port", "Port Chooser", JOptionPane.PLAIN_MESSAGE, null, portNames.toArray(), portNames.get(0)); if ((portName != null) && (portName.length() > 0)) { int index = portNames.indexOf(portName); if (index >= 0 && index < sortedPorts.size()) { result = sortedPorts.get(index); } } } return result; }
private String describePort(Port port, TypeDescriptor descriptor) { String html = "<tr><tr>"+port.getName()+"</td></td>"; if (descriptor!=null && descriptor.isOptional()) { html += "<em>optional</em><br>"; } html+="Depth:"+port.getDepth()+"<br>"; if (descriptor != null )html+="<code>"+descriptor.getQname().toString()+"</code><br>"; html+="</td></tr>"; return html; }
private String describePort(Port port, TypeDescriptor descriptor) { String html = "<tr><td>"+port.getName()+"</td><td>"; if (descriptor!=null && descriptor.isOptional()) { html += "<em>optional</em><br>"; } html+="Depth:"+port.getDepth()+"<br>"; if (descriptor != null ) { html+="<code>"+descriptor.getQname().toString()+"</code><br>"; if (descriptor.getDocumentation() != null && !descriptor.getDocumentation().isEmpty()){ html += "<p>"+descriptor.getDocumentation()+"</p>"; } } html+="</td></tr>"; return html; }
if (inPort.getName().equals("input1")) in1 = inPort; if (inPort.getName().equals("input2")) in2 = inPort; assertEquals("input1", in1.getName()); assertEquals(1, in1.getDepth()); assertEquals("input2", in2.getName()); assertEquals(0, in2.getDepth()); assertEquals("output", out1.getName()); assertEquals(0, out1.getDepth());
if (inPort.getName().equals("input1")) in1 = inPort; if (inPort.getName().equals("input2")) in2 = inPort; assertEquals("input1", in1.getName()); assertEquals(1, in1.getDepth()); assertEquals("input2", in2.getName()); assertEquals(0, in2.getDepth()); assertEquals("output", out1.getName()); assertEquals(0, out1.getDepth());
Port port = null; for (Port outputPort : outputPorts) { if (outputPort.getName().equals(portName)) { port = outputPort; break;