@Override protected DataflowActivity getActivity() { return (DataflowActivity) super.getActivity(); }
@Override protected JComponent getMainFrame() { return panelForHtml(buildHtml()); }
private String buildHtml() { String html = HtmlUtils.getHtmlHead(getBackgroundColour()); html += HtmlUtils.buildTableOpeningTag(); html += "<tr><th colspan=\"2\">" + getViewTitle() + "</th></tr>"; html += getRawTableRowsHtml() + "</table>"; html += "</body></html>"; return html; }
private String buildHtml() { String html = "<html><head>" + getStyle() + "</head><body>"; html += buildTableOpeningTag(); html += "<tr><td colspan=2>" + getViewTitle() + "</td></tr>"; html += getRawTableRowsHtml() + "</table>"; html += "</body></html>"; return html; }
@Override public JComponent getMainFrame() { JComponent mainFrame = super.getMainFrame(); JButton viewWorkflowButton = new JButton("Edit workflow"); viewWorkflowButton.addActionListener(new EditNestedDataflowAction(getActivity())); JButton configureButton = new JButton(new ReplaceNestedWorkflowAction( getActivity())); configureButton.setIcon(null); JPanel flowPanel = new JPanel(new FlowLayout()); flowPanel.add(viewWorkflowButton); flowPanel.add(configureButton); mainFrame.add(flowPanel, BorderLayout.SOUTH); return mainFrame; }
public String getBackgroundColour() { // FIXME would prefer instanceof but no class def found error was thrown // even though the pom had the activity in it - spring peoblem? if (getActivity().getClass().getName().equalsIgnoreCase( "net.sf.taverna.t2.activities.localworker.LocalworkerActivity")) { if (checkAnnotations()) { String colour = (String) ColourManager .getInstance() .getProperty( "net.sf.taverna.t2.activities.beanshell.BeanshellActivity"); return colour; } } String colour = (String) ColourManager.getInstance().getProperty(getActivity().getClass().getName()); return colour == null ? "#ffffff" : colour; }
/** * Update the html view with the latest information in the configuration * bean */ public void refreshView() { editorPane.setText(buildHtml()); } }
protected String getStyle() { String style = "<style type='text/css'>"; style += "table {align:center; border:solid black 1px; background-color:" + getBackgroundColour() + ";width:100%; height:100%; overflow:auto;}"; style += "</style>"; return style; }
/** * Gets the component from the {@link HTMLBasedActivityContextualView} and * adds buttons to it allowing Moby object details */ @Override protected JComponent getMainFrame() { final JComponent mainFrame = super.getMainFrame(); BiomobyObjectActivity activity = (BiomobyObjectActivity) getActivity(); if (activity.getMobyObject() != null) { JPanel flowPanel = new JPanel(new FlowLayout()); JButton button = new JButton(new MobyObjectDetailsAction(activity, null)); flowPanel.add(button); mainFrame.add(flowPanel, BorderLayout.SOUTH); } return mainFrame; } }
public String getBackgroundColour() { // FIXME would prefer instanceof but no class def found error was thrown // even though the pom had the activity in it - spring peoblem? if (getActivity().getClass().getName().equalsIgnoreCase( "net.sf.taverna.t2.activities.localworker.LocalworkerActivity")) { if (checkAnnotations()) { String colour = (String) ColourManager .getInstance() .getProperty( "net.sf.taverna.t2.activities.beanshell.BeanshellActivity"); return colour; } } String colour = (String) ColourManager.getInstance().getProperty(getActivity().getClass().getName()); return colour == null ? "#ffffff" : colour; }
/** * Update the html view with the latest information in the configuration * bean */ public void refreshView() { editorPane.setText(buildHtml()); } }
/** * Gets the component from the {@link HTMLBasedActivityContextualView} and * adds buttons to it allowing Moby object details */ @Override public JComponent getMainFrame() { final JComponent mainFrame = super.getMainFrame(); BiomobyObjectActivity activity = (BiomobyObjectActivity) getActivity(); if (activity.getMobyObject() != null) { JPanel flowPanel = new JPanel(new FlowLayout()); JButton button = new JButton(new MobyObjectDetailsAction(activity, null)); flowPanel.add(button); mainFrame.add(flowPanel, BorderLayout.SOUTH); } return mainFrame; }
@Override public DataflowActivity getActivity() { return (DataflowActivity) super.getActivity(); }
@Override public JComponent getMainFrame() { editorPane = HtmlUtils.createEditorPane(buildHtml()); return HtmlUtils.panelForHtml(editorPane); }
@Override protected JComponent getMainFrame() { JComponent mainFrame = super.getMainFrame(); JButton viewWorkflowButton = new JButton("Edit workflow"); viewWorkflowButton.addActionListener(new AbstractAction() {
private boolean checkAnnotations() { for (AnnotationChain chain : getActivity().getAnnotations()) { for (AnnotationAssertion<?> assertion : chain.getAssertions()) { Object detail = assertion.getDetail(); if (detail instanceof HostInstitution) { // this is a user defined localworker so use the beanshell // colour! return true; } } } return false; }
/** * Gets the component from the {@link HTMLBasedActivityContextualView} and * adds buttons to it allowing Moby service details */ @Override public JComponent getMainFrame() { final JComponent mainFrame = super.getMainFrame(); JPanel flowPanel = new JPanel(new FlowLayout()); BiomobyActivity activity = (BiomobyActivity)getActivity(); JButton button = new JButton(new MobyServiceDetailsAction(activity,null)); flowPanel.add(button); if (activity.getMobyService()!=null) { JButton button2 = new JButton(new MobyParserAction(activity,null)); flowPanel.add(button2); } mainFrame.add(flowPanel, BorderLayout.SOUTH); return mainFrame; }
private boolean checkAnnotations() { for (AnnotationChain chain : getActivity().getAnnotations()) { for (AnnotationAssertion<?> assertion : chain.getAssertions()) { Object detail = assertion.getDetail(); if (detail instanceof HostInstitution) { // this is a user defined localworker so use the beanshell // colour! return true; } } } return false; }
/** * Gets the component from the {@link HTMLBasedActivityContextualView} and * adds buttons to it allowing Moby service details */ @Override protected JComponent getMainFrame() { final JComponent mainFrame = super.getMainFrame(); JPanel flowPanel = new JPanel(new FlowLayout()); BiomobyActivity activity = (BiomobyActivity)getActivity(); JButton button = new JButton(new MobyServiceDetailsAction(activity,null)); flowPanel.add(button); if (activity.getMobyService()!=null) { JButton button2 = new JButton(new MobyParserAction(activity,null)); flowPanel.add(button2); } mainFrame.add(flowPanel, BorderLayout.SOUTH); return mainFrame; }