2521: Explore the possibility to port the StatMan interface onto Dataminer

https://support.d4science.org/issues/2521

Fixed Layout on OperatorsPanel

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@126875 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-04-07 18:13:35 +00:00
parent b810bcbd83
commit cf12db1eb6
14 changed files with 726 additions and 540 deletions

View File

@ -18,8 +18,11 @@ import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.Style.Cursor;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.event.dom.client.MouseOverHandler;
//import com.google.gwt.event.logical.shared.ResizeEvent;
//import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.resources.client.ImageResource;
@ -28,6 +31,7 @@ import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.RootPanel;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.core.client.util.Padding;
import com.sencha.gxt.widget.core.client.ContentPanel;
import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer;
import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderLayoutData;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
@ -56,9 +60,9 @@ public class DataMinerManager implements EntryPoint {
private DataMinerManagerController dataMinerManagerController;
private DataSpacePanel dataSpacePanel = new DataSpacePanel();
private DataSpacePanel dataSpacePanel; // = new DataSpacePanel();
// private InputSpacePanel inputSpacePanel = new InputSpacePanel();
private ExperimentPanel experimentPanel = new ExperimentPanel();
private ExperimentPanel experimentPanel;// = new ExperimentPanel();
// private JobsPanel jobsPanel = new JobsPanel();
// private VerticalPanel verticalPanel = new VerticalPanel();
@ -118,7 +122,7 @@ public class DataMinerManager implements EntryPoint {
// mainPanelLayout.getElement().getStyle().setBackgroundColor("rgb(3, 126, 207)");
centerPanel = new SimpleContainer();
MarginData mainData = new MarginData(new Margins(2));
MarginData mainData = new MarginData(new Margins(0));
mainPanelLayout.setCenterWidget(centerPanel, mainData);
// Menu
@ -166,7 +170,8 @@ public class DataMinerManager implements EntryPoint {
previousPanel = homeMenu;
bind(mainPanelLayout);
mainPanelLayout.forceLayout();
bindEvents();
/*
* dataMinerManagerController.setMainPanelLayout(mainPanelLayout);
@ -272,25 +277,30 @@ public class DataMinerManager implements EntryPoint {
*/
private SimpleContainer createMenuPanel() {
SimpleContainer topLc = new SimpleContainer();
BoxLayoutData layoutData = new BoxLayoutData(new Margins(0, 0, 5, 0));
VBoxLayoutContainer lc = new VBoxLayoutContainer();
lc.setPadding(new Padding(5));
lc.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);
lc.setPack(BoxLayoutPack.CENTER);
topLc.setStylePrimaryName("smMenu");
topLc.addStyleName("smLayoutContainer");
VerticalLayoutContainer lc = new VerticalLayoutContainer();
VerticalLayoutData layoutTop=new VerticalLayoutData(-1, -1,
new Margins(20, 90, 10, 90));
VerticalLayoutData layoutNext=new VerticalLayoutData(-1, -1,
new Margins(10, 90, 10, 90));
SimpleContainer itemDataSpace = createMenuItem(
"Access to the Data Space",
"The data space contains the set of input and output data sets of the users. It is possible to upload and share tables. Data sources can be chosen from those hosted by the infrastructure. Outputs of the computations can be even saved in this space.",
resources.inputSpaceIcon(), new MouseDownHandler() {
/*
* LayoutContainer itemDataSpace = createMenuItem(
* "Access to the Data Space",
* "The data space contains the set of input and output data sets of the users. It is possible to upload and share tables. Data sources can be chosen from those hosted by the infrastructure. Outputs of the computations can be even saved in this space."
* , resources.inputSpaceIcon(), new Listener<BaseEvent>() {
*
* @Override public void handleEvent(BaseEvent be) {
* switchTo(dataSpacePanel);
* header.setMenuSelected(MenuItem.DATA_SPACE); } });
* lc.add(itemDataSpace);
*/
@Override
public void onMouseDown(MouseDownEvent event) {
if (experimentPanel == null) {
experimentPanel = new ExperimentPanel();
}
switchTo(dataSpacePanel);
header.setMenuSelected(MenuItem.DATA_SPACE);
}
});
lc.add(itemDataSpace, layoutTop);
SimpleContainer itemExperiment = createMenuItem(
"Execute an Experiment",
@ -299,13 +309,16 @@ public class DataMinerManager implements EntryPoint {
@Override
public void onMouseDown(MouseDownEvent event) {
if (experimentPanel == null) {
experimentPanel = new ExperimentPanel();
}
switchTo(experimentPanel);
header.setMenuSelected(MenuItem.EXPERIMENT);
}
});
lc.add(itemExperiment, layoutData);
lc.add(itemExperiment, layoutNext);
/*
* LayoutContainer itemJobs = createMenuItem( "Check the Computations",
@ -317,7 +330,6 @@ public class DataMinerManager implements EntryPoint {
* }); lc.add(itemJobs);
*/
topLc.add(lc);
topLc.forceLayout();
return topLc;
}
@ -325,44 +337,35 @@ public class DataMinerManager implements EntryPoint {
*
*/
private void switchTo(SimpleContainer lc) {
// boolean updt = (previousPanel != lc && (previousPanel == homeMenu ||
// lc == homeMenu));
centerPanel.remove(previousPanel);
centerPanel.add(lc);
centerPanel.forceLayout();
previousPanel = lc;
/*
* if (updt) updateSize();
*/
}
private SimpleContainer createMenuItem(String title, String description,
ImageResource imgResource, MouseDownHandler handle) {
HorizontalLayoutContainer horiz = new HorizontalLayoutContainer();
horiz.addDomHandler(handle, MouseDownEvent.getType());
Image img = new Image(imgResource);
HTML text = new HTML("<b>" + title + "</b><br>" + description);
text.addStyleName("smMenuItemText");
HorizontalLayoutData textLayoutData = new HorizontalLayoutData(500,
170, new Margins(10,5,10,10));
HorizontalLayoutData imgLayoutData = new HorizontalLayoutData(100, 100,
new Margins(10,10,10,5));
HorizontalLayoutData textLayoutData = new HorizontalLayoutData(400,
140, new Margins(10, 5, 10, 10));
HorizontalLayoutData imgLayoutData = new HorizontalLayoutData(140, 140,
new Margins(10, 10, 10, 5));
horiz.add(text, textLayoutData);
horiz.add(img, imgLayoutData);
SimpleContainer container = new SimpleContainer();
container.setWidth(600);
container.setHeight(190);
container.addStyleName("smLayoutContainer");
container.addStyleName("smMenu");
container.addDomHandler(handle, MouseDownEvent.getType());
container.setWidth(540);
container.setHeight(170);
container.addStyleName("smMenuItem");
container.addStyleOnOver(container.getElement(), "smMenuItem:HOVER");
container.add(horiz);
return container;
}

View File

@ -90,7 +90,6 @@ public class DataMinerManagerController {
public void onSuccess(UserInfo result) {
userInfo = result;
Log.info("Hello: " + userInfo.getUsername());
retrieveDataMinerWorkArea();
}
});

View File

@ -26,7 +26,6 @@ import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.ContentPanel;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.SelectEvent;

View File

@ -0,0 +1,58 @@
package org.gcube.portlets.user.dataminermanager.client.events;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.event.shared.HasHandlers;
/**
* Empty ComputationPanal Event
*
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class EmptyComputationPanelEvent extends
GwtEvent<EmptyComputationPanelEvent.EmptyComputationPanelEventHandler> {
public static Type<EmptyComputationPanelEventHandler> TYPE = new Type<EmptyComputationPanelEventHandler>();
public interface EmptyComputationPanelEventHandler extends EventHandler {
void onEmpty(EmptyComputationPanelEvent event);
}
public interface HasEmptyComputationPanelEventHandler extends HasHandlers {
public HandlerRegistration addEmptyComputationPanelEventHandler(
EmptyComputationPanelEventHandler handler);
}
public EmptyComputationPanelEvent() {
}
@Override
protected void dispatch(EmptyComputationPanelEventHandler handler) {
handler.onEmpty(this);
}
@Override
public Type<EmptyComputationPanelEventHandler> getAssociatedType() {
return TYPE;
}
public static Type<EmptyComputationPanelEventHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source,
EmptyComputationPanelEvent emptyComputationPanelEvent) {
source.fireEvent(emptyComputationPanelEvent);
}
@Override
public String toString() {
return "EmptyComputationPanelEvent []";
}
}

View File

@ -0,0 +1,214 @@
package org.gcube.portlets.user.dataminermanager.client.experimentArea;
import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationItem;
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
import org.gcube.portlets.user.dataminermanager.client.events.JobsGridGotDirtyEvent;
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationEvent;
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem;
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
/**
*
* @author Giancarlo Panichi email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ComputationExecutionPanel extends FramedPanel {
private List<ComputationStatusPanel> computationStatusPanels = new ArrayList<ComputationStatusPanel>();
private static final String DELETE_ALL_BUTTON_TOOLTIP = "Remove Computations Log";
private TextButton removeAllButton;
private VerticalLayoutContainer v;
private ToolBar toolBar;
private VerticalLayoutContainer topV;
/**
*
*/
public ComputationExecutionPanel() {
super();
init();
create();
bind();
}
private void init() {
// this.setHeading(".: Computation Execution");
setHeaderVisible(false);
addStyleName("computationExcecutionPanel");
setBodyStyle("backgroundColor:white;");
}
private void create() {
topV = new VerticalLayoutContainer();
setToolBar();
topV.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
SimpleContainer computations = new SimpleContainer();
v = new VerticalLayoutContainer();
v.setScrollMode(ScrollMode.AUTO);
computations.add(v);
topV.add(computations, new VerticalLayoutData(1, 1, new Margins(0)));
add(topV);
}
public void startNewComputation(final Operator operator,
String computationTitle, String computationDescription) {
Log.debug("Computation Panel: start new computation ");
final ComputationStatusPanel statusPanel = new ComputationStatusPanel(
operator);
computationStatusPanels.add(statusPanel);
Log.debug("Added status bar ");
v.insert(statusPanel, 0, new VerticalLayoutData(1, -1,
new Margins(0)));
removeAllButton.setEnabled(true);
DataMinerManager.getService().startComputation(operator,
computationTitle, computationDescription,
new AsyncCallback<ComputationId>() {
@Override
public void onSuccess(ComputationId computationId) {
if (computationId == null)
UtilsGXT3
.alert("ERROR",
"Failed to start computation "
+ operator.getName()
+ ", the computation id is null (1)");
else {
statusPanel.computationStarted(computationId);
EventBusProvider.INSTANCE
.fireEvent(new JobsGridGotDirtyEvent());
}
}
@Override
public void onFailure(Throwable caught) {
UtilsGXT3.alert(
"ERROR",
"Failed to start computation "
+ operator.getName()
+ " (2)<br/>Cause:" + caught.getCause()
+ "<br/>Message:" + caught.getMessage());
}
});
forceLayout();
}
private void bind() {
EventBusProvider.INSTANCE.addHandler(
ResubmitComputationEvent.getType(),
new ResubmitComputationEvent.ResubmitComputationHandler() {
@Override
public void onResubmitComputation(
ResubmitComputationEvent event) {
resubmitComputation(event.getJobItem());
}
});
}
public void resubmitComputation(final ComputationItem computationItem) {
final ComputationStatusPanel statusPanel = new ComputationStatusPanel(
computationItem.getOperator());
computationStatusPanels.add(statusPanel);
v.insert(statusPanel, 0, new VerticalLayoutData(1, -1,
new Margins(0)));
removeAllButton.setEnabled(true);
DataMinerManager.getService().resubmit(
computationItem.getComputationId(),
new AsyncCallback<ComputationId>() {
@Override
public void onSuccess(ComputationId id) {
if (id == null)
UtilsGXT3
.alert("ERROR",
"Failed to resubmit computation "
+ computationItem.getName()
+ ", the computation id is null (1)");
else {
statusPanel.computationStarted(id);
EventBusProvider.INSTANCE
.fireEvent(new JobsGridGotDirtyEvent());
}
}
@Override
public void onFailure(Throwable caught) {
UtilsGXT3.alert("ERROR",
"Failed to start computation "
+ computationItem.getName()
+ " (2)<br/>Cause:" + caught.getCause()
+ "<br/>Message:" + caught.getMessage());
}
});
forceLayout();
}
/**
*
*/
private void emptyPanel() {
// stop timers
for (ComputationStatusPanel statusPanel : computationStatusPanels)
statusPanel.stopTimer();
removeAllButton.setEnabled(false);
computationStatusPanels.clear();
v.clear();
forceLayout();
}
private void setToolBar() {
toolBar = new ToolBar();
removeAllButton = new TextButton("Remove All");
removeAllButton.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
emptyPanel();
}
});
removeAllButton.setIcon(DataMinerManager.resources.removeAll());
removeAllButton.setToolTip(DELETE_ALL_BUTTON_TOOLTIP);
//removeAllButton.setScale(ButtonScale.MEDIUM);
removeAllButton.setEnabled(false);
toolBar.add(new LabelToolItem("Tools:"));
toolBar.add(removeAllButton);
}
}

View File

@ -1,29 +1,27 @@
package org.gcube.portlets.user.dataminermanager.client.experimentArea;
import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationItem;
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
import org.gcube.portlets.user.dataminermanager.client.events.JobsGridGotDirtyEvent;
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationEvent;
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
import org.gcube.portlets.user.dataminermanager.client.events.EmptyComputationPanelEvent;
import org.gcube.portlets.user.dataminermanager.client.events.EmptyComputationPanelEvent.EmptyComputationPanelEventHandler;
import org.gcube.portlets.user.dataminermanager.client.events.EmptyComputationPanelEvent.HasEmptyComputationPanelEventHandler;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sencha.gxt.cell.core.client.ButtonCell.ButtonScale;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Image;
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.ContentPanel;
import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack;
import com.sencha.gxt.widget.core.client.container.CenterLayoutContainer;
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
import com.sencha.gxt.widget.core.client.form.FieldLabel;
import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem;
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
/**
@ -32,169 +30,95 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ComputationPanel extends ContentPanel {
private List<ComputationStatusPanel> computationStatusPanels = new ArrayList<ComputationStatusPanel>();
private static final String DELETE_ALL_BUTTON_TOOLTIP = "Remove Computations Log";
public class ComputationPanel extends FramedPanel implements
HasEmptyComputationPanelEventHandler {
private static final String DELETE_ALL_BUTTON_TOOLTIP = "Remove All Operators";
private TextButton removeAllButton;
private ToolBar toolBar;
private VerticalLayoutContainer topV;
private VerticalLayoutContainer v;
private VerticalLayoutContainer vert;
/**
*
*/
public ComputationPanel() {
super();
bind();
// this.setHeading(".: Computation Execution");
this.setHeaderVisible(false);
this.addStyleName("computationExcecutionPanel");
setToolsPanel();
vert = new VerticalLayoutContainer();
add(vert, new MarginData(0));
init();
create();
}
public void startNewComputation(final Operator operator,
String computationTitle, String computationDescription) {
Log.debug("Computation Panel: start new computation ");
final ComputationStatusPanel statusPanel = new ComputationStatusPanel(
operator);
computationStatusPanels.add(statusPanel);
Log.debug("Added status bar ");
vert.insert(statusPanel, 0, new VerticalLayoutData(1, -1,
new Margins(0)));
removeAllButton.setEnabled(true);
DataMinerManager.getService().startComputation(operator,
computationTitle, computationDescription,
new AsyncCallback<ComputationId>() {
@Override
public void onSuccess(ComputationId computationId) {
if (computationId == null)
UtilsGXT3
.alert("ERROR",
"Failed to start computation "
+ operator.getName()
+ ", the computation id is null (1)");
else {
statusPanel.computationStarted(computationId);
EventBusProvider.INSTANCE
.fireEvent(new JobsGridGotDirtyEvent());
}
}
@Override
public void onFailure(Throwable caught) {
UtilsGXT3.alert(
"ERROR",
"Failed to start computation "
+ operator.getName()
+ " (2)<br/>Cause:" + caught.getCause()
+ "<br/>Message:" + caught.getMessage());
}
});
forceLayout();
private void init() {
setHeaderVisible(false);
setBodyStyle("backgroundColor:white;");
;
}
private void bind() {
EventBusProvider.INSTANCE.addHandler(
ResubmitComputationEvent.getType(),
new ResubmitComputationEvent.ResubmitComputationHandler() {
@Override
public void onResubmitComputation(
ResubmitComputationEvent event) {
resubmitComputation(event.getJobItem());
}
});
private void create() {
topV = new VerticalLayoutContainer();
setToolBar();
topV.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
SimpleContainer operator = new SimpleContainer();
v = new VerticalLayoutContainer();
v.setScrollMode(ScrollMode.AUTO);
operator.add(v);
topV.add(operator, new VerticalLayoutData(1, 1, new Margins(0)));
add(topV);
emptyPanel();
}
public void resubmitComputation(final ComputationItem computationItem) {
final ComputationStatusPanel statusPanel = new ComputationStatusPanel(
computationItem.getOperator());
computationStatusPanels.add(statusPanel);
vert.insert(statusPanel, 0, new VerticalLayoutData(1, -1,
new Margins(0)));
removeAllButton.setEnabled(true);
DataMinerManager.getService().resubmit(
computationItem.getComputationId(),
new AsyncCallback<ComputationId>() {
@Override
public void onSuccess(ComputationId id) {
if (id == null)
UtilsGXT3
.alert("ERROR",
"Failed to resubmit computation "
+ computationItem.getName()
+ ", the computation id is null (1)");
else {
statusPanel.computationStarted(id);
EventBusProvider.INSTANCE
.fireEvent(new JobsGridGotDirtyEvent());
}
}
@Override
public void onFailure(Throwable caught) {
UtilsGXT3.alert("ERROR",
"Failed to start computation "
+ computationItem.getName()
+ " (2)<br/>Cause:" + caught.getCause()
+ "<br/>Message:" + caught.getMessage());
}
});
forceLayout();
}
/**
*
*/
private void emptyPanel() {
// stop timers
for (ComputationStatusPanel statusPanel : computationStatusPanels)
statusPanel.stopTimer();
private void setToolBar() {
toolBar = new ToolBar();
toolBar.add(new LabelToolItem("Tools:"));
removeAllButton = new TextButton(DELETE_ALL_BUTTON_TOOLTIP);
removeAllButton.setToolTip(DELETE_ALL_BUTTON_TOOLTIP);
removeAllButton.setIcon(DataMinerManager.resources.removeAll());
removeAllButton.setEnabled(false);
computationStatusPanels.clear();
vert.clear();
forceLayout();
}
private void setToolsPanel() {
ToolBar toolBar = new ToolBar();
removeAllButton = new TextButton("Remove All");
removeAllButton.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
emptyPanel();
EmptyComputationPanelEvent emptyEvent = new EmptyComputationPanelEvent();
fireEvent(emptyEvent);
}
});
removeAllButton.setIcon(DataMinerManager.resources.removeAll());
toolBar.add(removeAllButton);
}
removeAllButton.setToolTip(DELETE_ALL_BUTTON_TOOLTIP);
removeAllButton.setScale(ButtonScale.MEDIUM);
private void emptyPanel() {
removeAllButton.setEnabled(false);
FieldLabel toolsLabel = new FieldLabel(removeAllButton, "Tools");
toolBar.add(toolsLabel);
addTool(toolBar);
v.clear();
CenterLayoutContainer centerContainer = new CenterLayoutContainer();
centerContainer.add(new HTML(
"<p align='center'>Select an operator.</p>"));
v.add(centerContainer, new VerticalLayoutData(1, 1, new Margins(0)));
forceLayout();
}
/**
*
* @param workflowOperatorPanel
* algorithm
*/
public void addWorkflowOperatorPanel(
WorkflowOperatorPanel workflowOperatorPanel) {
v.clear();
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
hBox.setPack(BoxLayoutPack.CENTER);
hBox.add(new Image(DataMinerManager.resources.workflowConnector1()),
new BoxLayoutData(new Margins(0)));
v.add(hBox, new VerticalLayoutData(1, -1, new Margins(10,0,0,0)));
v.add(workflowOperatorPanel, new VerticalLayoutData(-1, -1,
new Margins(0))); // operator
removeAllButton.setEnabled(true);
forceLayout();
}
@Override
public HandlerRegistration addEmptyComputationPanelEventHandler(
EmptyComputationPanelEventHandler handler) {
return addHandler(handler, EmptyComputationPanelEvent.getType());
}
}

View File

@ -32,25 +32,26 @@ public class ExperimentPanel extends SimpleContainer implements
//
BorderLayoutContainer experimentPanelLayout = new BorderLayoutContainer();
experimentPanelLayout.setId("experimentPanelLayout");
//experimentPanelLayout.setId("experimentPanelLayout");
experimentPanelLayout.setBorders(false);
experimentPanelLayout.setResize(true);
experimentPanelLayout.getElement().getStyle()
.setBackgroundColor("#FFFFFF");
.setBackgroundColor("white");
// Center
MarginData mainData = new MarginData(new Margins(2));
MarginData mainData = new MarginData(new Margins(0));
experimentPanelLayout.setCenterWidget(workflowPanel, mainData);
// West
BorderLayoutData westData = new BorderLayoutData(300);
BorderLayoutData westData = new BorderLayoutData(320);
westData.setCollapsible(true);
westData.setSplit(true);
westData.setFloatable(true);
westData.setFloatable(false);
westData.setCollapseMini(false);
westData.setMargins(new Margins(0, 5, 0, 0));
westData.setCollapseHidden(true);
westData.setCollapseHidden(false);
experimentPanelLayout.setWestWidget(operatorsPanel, westData);
// filtersPanel.expand();
// filtersPanel.enable();

View File

@ -12,12 +12,19 @@ import org.gcube.portlets.user.dataminermanager.client.bean.OperatorCategory;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.HTML;
import com.sencha.gxt.core.client.Style.Side;
import com.sencha.gxt.core.client.util.Format;
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.tips.ToolTipConfig;
/**
*
* @author Giancarlo Panichi
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class OperatorCategoryPanel extends SimpleContainer {
private List<OperatorPanel> operatorPanelsList = null;
@ -25,27 +32,30 @@ public class OperatorCategoryPanel extends SimpleContainer {
private static final int TOOLTIP_WIDTH = 300;
private boolean isCollapsed = true;
private OperatorCategory category;
private HTML categoryHtml;
// private LayoutContainer collapsedPanel = new LayoutContainer();
private HtmlLayoutContainer categoryHtml;
private VerticalLayoutContainer v;
/**
*
* @param handler
* @param cat
*/
public OperatorCategoryPanel(OperatorsPanelHandler handler, OperatorCategory cat) {
super();
this.handler = handler;
this.category = cat;
init();
create();
}
private void init(){
private void create(){
v=new VerticalLayoutContainer();
add(v);
// set category info
categoryHtml = new HTML(category.getName() + " <span class='counter'>("+category.getOperators().size()+")</span>");
categoryHtml = new HtmlLayoutContainer(category.getName() + " <span class='counter'>("+category.getOperators().size()+")</span>");
categoryHtml.addStyleName("categoryItem");
categoryHtml.addStyleName("categoryItem-Collapsed");
ToolTipConfig tooltipConfig = createToolTip(category);
setToolTipConfig(tooltipConfig);
categoryHtml.setToolTipConfig(tooltipConfig);
addDomHandler(new ClickHandler() {
@ -56,12 +66,13 @@ public class OperatorCategoryPanel extends SimpleContainer {
}
}, ClickEvent.getType());
add(categoryHtml);
v.add(categoryHtml);
}
/**
*
* @param cat
* @return
*/
private ToolTipConfig createToolTip(OperatorCategory cat) {
@ -74,28 +85,30 @@ public class OperatorCategoryPanel extends SimpleContainer {
tooltipConfig.setBodyHtml(
getTooltipTemplate(GWT.getModuleBaseURL(), cat.getId(), cat.hasImage(), cat.getDescription())
);
// config.setCloseable(true);
tooltipConfig.setMaxWidth(TOOLTIP_WIDTH);
return tooltipConfig;
}
/**
*
* @param base
* @param id
* @param hasImage
* @param description
* @return
*/
private String getTooltipTemplate(String base, String id, boolean hasImage, String description){
String html =
"<div class='categoryItemTooltip'>"+
"<img src='" + base + "../images/categories/"+(hasImage ? id : "DEFAULT_IMAGE")+".png' >"+
description+
Format.ellipse(description, 100)+
"</div>";
// '<div><ul style="list-style: disc; margin: 0px 0px 5px 15px">',
// '<li>5 bedrooms</li>',
// '<li>2 baths</li>',
// '<li>Large backyard</li>',
// '<li>Close to metro</li>',
// '</ul>',
// '</div>'
return html;
};
/**
*
*/
public void switchOpenClose() {
if (isCollapsed)
expand();
@ -111,8 +124,8 @@ public class OperatorCategoryPanel extends SimpleContainer {
categoryHtml.addStyleName("categoryItem-Collapsed");
for (OperatorPanel op: this.operatorPanelsList)
this.remove(op);
this.isCollapsed = true;
v.remove(op);
isCollapsed = true;
forceLayout();
}
@ -132,8 +145,8 @@ public class OperatorCategoryPanel extends SimpleContainer {
categoryHtml.removeStyleName("categoryItem-Collapsed");
categoryHtml.addStyleName("categoryItem-Expanded");
for (OperatorPanel op: this.operatorPanelsList)
this.add(op);
this.isCollapsed = false;
v.add(op);
isCollapsed = false;
forceLayout();
}
}

View File

@ -10,6 +10,7 @@ import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.HTML;
import com.sencha.gxt.core.client.Style.Side;
import com.sencha.gxt.core.client.util.Format;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
@ -45,8 +46,9 @@ public class OperatorPanel extends SimpleContainer {
@Override
public void onClick(ClickEvent event) {
event.stopPropagation();
handler.addOperator(OperatorPanel.this, operator);
}
}, ClickEvent.getType());
@ -54,7 +56,7 @@ public class OperatorPanel extends SimpleContainer {
titleHtml = new HTML(operator.getName());
titleHtml.addStyleName("operatorPanel-title");
HTML descriptionHtml = new HTML(operator.getBriefDescription());
HTML descriptionHtml = new HTML(Format.ellipse(operator.getBriefDescription(),178));
descriptionHtml.addStyleName("operatorPanel-briefDescription");
vert=new VerticalLayoutContainer();
@ -104,7 +106,7 @@ public class OperatorPanel extends SimpleContainer {
String description) {
String template = "<div class='categoryItemTooltip'>" + "<img src='"
+ base + "../images/operators/"
+ (hasImage ? id : "DEFAULT_IMAGE") + ".png' >" + description
+ (hasImage ? id : "DEFAULT_IMAGE") + ".png' >" + Format.ellipse(description, 435)
+ "</div>";
return template;

View File

@ -23,28 +23,36 @@ import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HTML;
import com.sencha.gxt.widget.core.client.ContentPanel;
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.data.shared.Store;
import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.form.TextField;
import com.sencha.gxt.widget.core.client.form.StoreFilterField;
import com.sencha.gxt.widget.core.client.menu.Item;
import com.sencha.gxt.widget.core.client.menu.Menu;
import com.sencha.gxt.widget.core.client.menu.MenuItem;
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
/**
* @author ceras
*
* @author Giancarlo Panichi email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class OperatorsPanel extends ContentPanel {
public class OperatorsPanel extends FramedPanel {
private static final String LOADING_MESSAGE = "Loading Operators...";
private static final String ERROR_GET_OPERATORS = "Operators not loaded.";
private static final String SHOW_ALL_OPERATORS_TOOLTIP = "Show all Operators without category classification.";
private static final String SHOW_CATEGORIES_TOOLTIP = "Show Operators by Categories";
private OperatorsPanelHandler handler;
private ToolBar toolbar;
private VerticalLayoutContainer topV;
private ToolBar toolBar;
private VerticalLayoutContainer v;
// private ArrayList<OperatorCategoryPanel> categoryPanels;
@ -63,18 +71,26 @@ public class OperatorsPanel extends ContentPanel {
public OperatorsPanel(OperatorsPanelHandler handler) {
super();
this.handler = handler;
setHeadingText(".: Operators");
// this.setScrollMode(Scroll.AUTO);
setToolbar();
init();
create();
}
private void init() {
setHeadingText(".: Operators");
setBodyStyle("backgroundColor:white;");
}
private void create() {
topV = new VerticalLayoutContainer();
initToolbar();
topV.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
SimpleContainer operators = new SimpleContainer();
v = new VerticalLayoutContainer();
add(v);
v.setScrollMode(ScrollMode.AUTO);
operators.add(v);
topV.add(operators, new VerticalLayoutData(1, 1, new Margins(0)));
add(topV);
// if the operators classification is not loaded, let's load by an rpc
if (DataMinerManager.getOperatorsClassifications() == null) {
@ -105,10 +121,38 @@ public class OperatorsPanel extends ContentPanel {
/**
*
*/
private void setToolbar() {
toolbar = new ToolBar();
private void initToolbar() {
toolBar = new ToolBar();
TextButton showAllOperatorsButton = new TextButton("");
final StoreFilterField<String> filterField = new StoreFilterField<String>() {
@Override
protected boolean doSelect(Store<String> store, String parent,
String item, String filter) {
Log.debug("StoreFilterField: " + item + " " + filter);
return false;
}
};
filterField.addKeyUpHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent event) {
String searchText = filterField.getCurrentValue();
if (searchText == null || searchText.isEmpty()) {
showCategoriesList(false);
} else {
if (searchText.length() >= 2) {
showFilteredList(searchText);
}
}
}
});
filterField.setWidth(100);
TextButton showAllOperatorsButton = new TextButton();
showAllOperatorsButton.setIcon(DataMinerManager.resources
.sortAscending());
showAllOperatorsButton
@ -116,18 +160,20 @@ public class OperatorsPanel extends ContentPanel {
@Override
public void onSelect(SelectEvent event) {
filterField.clear();
showAllOperatorsList();
}
});
showAllOperatorsButton.setToolTip(SHOW_ALL_OPERATORS_TOOLTIP);
TextButton showCategoriesButton = new TextButton("");
TextButton showCategoriesButton = new TextButton();
showCategoriesButton.setIcon(DataMinerManager.resources.tree());
showCategoriesButton.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
filterField.clear();
showCategoriesList(false);
}
@ -135,32 +181,14 @@ public class OperatorsPanel extends ContentPanel {
showCategoriesButton.setToolTip(SHOW_CATEGORIES_TOOLTIP);
final TextField filterField = new TextField();
filterField.setWidth(100);
filterField.addKeyUpHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent event) {
String searchText = filterField.getCurrentValue();
if (searchText == null || searchText.isEmpty())
showCategoriesList(false);
if (searchText.length() >= 2)
showFilteredList(searchText);
}
});
final TextButton btnClear = new TextButton();
btnClear.addStyleName("x-form-clear-trigger");
btnClear.setToolTip("Clear");
final TextButton btnMenuPerspective = new TextButton(
currentClassificationName);
btnMenuPerspective
.setIcon(DataMinerManager.resources.userPerspective());
Menu menuPerspective = new Menu();
for (final String perspectiveName : Constants.ClassificationNames) {
final ImageResource img = perspectiveName
.equals(Constants.UserClassificationName) ? DataMinerManager.resources
@ -171,6 +199,7 @@ public class OperatorsPanel extends ContentPanel {
@Override
public void onSelection(SelectionEvent<Item> event) {
filterField.clear();
currentClassificationName = perspectiveName;
btnMenuPerspective.setText(perspectiveName);
btnMenuPerspective.setIcon(img);
@ -183,49 +212,41 @@ public class OperatorsPanel extends ContentPanel {
}
btnMenuPerspective.setMenu(menuPerspective);
toolbar.add(showCategoriesButton);
toolbar.add(showAllOperatorsButton);
toolbar.add(filterField);
toolbar.add(btnMenuPerspective);
toolBar.add(showCategoriesButton);
toolBar.add(showAllOperatorsButton);
toolBar.add(filterField);
toolBar.add(btnMenuPerspective);
addTool(toolbar);
return;
}
/**
private ToolTipConfig createToolTip(OperatorCategory cat) {
ToolTipConfig tooltipConfig = new ToolTipConfig();
tooltipConfig.setTitleHtml("<br>&nbsp;&nbsp;" + cat.getName());
tooltipConfig.setMouseOffsetX(0);
toolTipConfig.setMouseOffsetY(0);
tooltipConfig.setAnchor(Side.LEFT);
tooltipConfig.setDismissDelay(0);
tooltipConfig.setBodyHtml(getTooltipTemplate(
GWT.getModuleBaseURL(), cat.getId(), cat.hasImage(),
cat.getDescription()));
// config.setCloseable(true);
tooltipConfig.setMaxWidth(300);
return tooltipConfig;
}
private String getTooltipTemplate(String base, String id,
boolean hasImage, String description) {
String html=
"<div class='categoryItemTooltip'>"+
"<img src='" + base + "../images/categories/"+
(hasImage ? id : "DEFAULT_IMAGE") + ".png' >"+
description+"</div>";
// '<div><ul style="list-style: disc; margin: 0px 0px 5px 15px">',
// '<li>5 bedrooms</li>',
// '<li>2 baths</li>',
// '<li>Large backyard</li>',
// '<li>Close to metro</li>',
// '</ul>',
// '</div>'
return html;
};
*/
* private ToolTipConfig createToolTip(OperatorCategory cat) { ToolTipConfig
* tooltipConfig = new ToolTipConfig(); tooltipConfig.setTitleHtml("<br>
* &nbsp;&nbsp;" + cat.getName()); tooltipConfig.setMouseOffsetX(0);
* toolTipConfig.setMouseOffsetY(0); tooltipConfig.setAnchor(Side.LEFT);
* tooltipConfig.setDismissDelay(0);
* tooltipConfig.setBodyHtml(getTooltipTemplate( GWT.getModuleBaseURL(),
* cat.getId(), cat.hasImage(), cat.getDescription())); //
* config.setCloseable(true); tooltipConfig.setMaxWidth(300); return
* tooltipConfig; }
*
* private String getTooltipTemplate(String base, String id, boolean
* hasImage, String description) { String html=
* "<div class='categoryItemTooltip'>"+ "<img src='" + base +
* "../images/categories/"+ (hasImage ? id : "DEFAULT_IMAGE") + ".png' >"+
* description+"</div>"; // '<div>
* <ul style="list-style: disc; margin: 0px 0px 5px 15px">
* ', // '
* <li>5 bedrooms</li>', // '
* <li>2 baths</li>', // '
* <li>Large backyard</li>', // '
* <li>Close to metro</li>', // '
* </ul>
* ', // '</div>'
*
* return html; };
*/
private void waitMessage(boolean show) {
if (show)
this.mask(LOADING_MESSAGE);
@ -253,17 +274,17 @@ public class OperatorsPanel extends ContentPanel {
+ filteredOperators.size() + " item"
+ (filteredOperators.size() == 1 ? "" : "s") + " found)</span>");
html.addStyleName("filterResultText");
this.add(html);
v.add(html);
for (Operator op : filteredOperators)
this.add(new OperatorPanel(op, handler));
v.add(new OperatorPanel(op, handler));
view = View.FILTER;
forceLayout();
}
private void showCategoriesList(boolean force) {
try {
if (force || view != View.CATEGORIES) {
Log.debug("ShowCategoriesList");
@ -314,7 +335,7 @@ public class OperatorsPanel extends ContentPanel {
v.add(new OperatorPanel(op, handler));
view = View.ALL;
forceLayout();
}
}

View File

@ -6,170 +6,122 @@ package org.gcube.portlets.user.dataminermanager.client.experimentArea;
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
import org.gcube.portlets.user.dataminermanager.client.events.EmptyComputationPanelEvent;
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationEvent;
import org.gcube.portlets.user.dataminermanager.client.experimentArea.WorkflowOperatorPanel.WorkflowOperatorPanelHandler;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Image;
import com.sencha.gxt.cell.core.client.ButtonCell.ButtonScale;
import com.sencha.gxt.widget.core.client.ContentPanel;
import com.allen_sauer.gwt.log.client.Log;
import com.sencha.gxt.widget.core.client.TabItemConfig;
import com.sencha.gxt.widget.core.client.TabPanel;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem;
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
/**
* @author ceras
*
* @author Giancarlo Panichi email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class WorkflowPanel extends TabPanel {
public static final String DEFAULT_OPERATOR = "AQUAMAPS_SUITABLE";
private static final String DELETE_ALL_BUTTON_TOOLTIP = "Remove All Operators";
private static final boolean WORKFLOW_MODE = false;
private WorkflowOperatorPanel workflowOperatorPanel;
private TextButton removeAllButton = new TextButton(DELETE_ALL_BUTTON_TOOLTIP);
private ComputationExecutionPanel computationExecutionPanel;
private ComputationPanel computationPanel;
private ContentPanel workflowLc;
/**
*
*/
public WorkflowPanel() {
super();
init();
create();
bind();
}
private void init() {
setBodyBorder(false);
TabItemConfig tabWorkFlowLcItemConf = new TabItemConfig(
".: Computation", false);
tabWorkFlowLcItemConf.setIcon(DataMinerManager.resources.folderExplore());
workflowLc = new ContentPanel();
workflowLc.setHeaderVisible(false);
add(workflowLc, tabWorkFlowLcItemConf);
}
private void create() {
workflowOperatorPanel = null;
TabItemConfig tabWorkFlowLcItemConf = new TabItemConfig(
".: Computation", false);
tabWorkFlowLcItemConf.setIcon(DataMinerManager.resources
.folderExplore());
computationPanel = new ComputationPanel();
computationPanel
.addEmptyComputationPanelEventHandler(new EmptyComputationPanelEvent.EmptyComputationPanelEventHandler() {
@Override
public void onEmpty(EmptyComputationPanelEvent event) {
Log.debug("EmptyComputationPanelEvent Received");
workflowOperatorPanel = null;
}
});
add(computationPanel, tabWorkFlowLcItemConf);
TabItemConfig tabComputationPanelItemConf = new TabItemConfig(
".: Computations Execution", false);
tabComputationPanelItemConf.setIcon(DataMinerManager.resources.folderExplore());
computationPanel = new ComputationPanel();
add(computationPanel, tabComputationPanelItemConf);
tabComputationPanelItemConf.setIcon(DataMinerManager.resources
.folderExplore());
computationExecutionPanel = new ComputationExecutionPanel();
add(computationExecutionPanel, tabComputationPanelItemConf);
setToolsPanel();
emptyPanel();
setActiveWidget(computationPanel);
}
/**
*
*/
private void bind() {
EventBusProvider.INSTANCE.addHandler(ResubmitComputationEvent.getType(), new ResubmitComputationEvent.ResubmitComputationHandler() {
@Override
public void onResubmitComputation(ResubmitComputationEvent event) {
setActiveWidget(computationPanel);
}
});
EventBusProvider.INSTANCE.addHandler(
ResubmitComputationEvent.getType(),
new ResubmitComputationEvent.ResubmitComputationHandler() {
@Override
public void onResubmitComputation(
ResubmitComputationEvent event) {
setActiveWidget(computationExecutionPanel);
}
});
}
/**
* @param computationTitle
* @param operator
*
*/
private void emptyPanel() {
workflowOperatorPanel = null;
removeAllButton.setEnabled(false);
workflowLc.clear();
workflowLc.add(new HTML("<br><br><br><br><br><br><br><br><br><br><br><p align='center'>Select an operator.</p>"));
workflowLc.forceLayout();;
}
private void setToolsPanel() {
ToolBar toolBar = new ToolBar();
toolBar.add(new LabelToolItem("Tools"));
removeAllButton.setToolTip(DELETE_ALL_BUTTON_TOOLTIP);
removeAllButton.setIcon(DataMinerManager.resources.removeAll());
removeAllButton.setScale(ButtonScale.MEDIUM);
removeAllButton.setEnabled(false);
removeAllButton.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
emptyPanel();
}
});
toolBar.add(removeAllButton);
workflowLc.addTool(toolBar);
}
private void startComputation(String computationTitle,
String computationDescription) {
/**
* @param computationTitle
* @param operator
*
*/
private void startComputation(String computationTitle, String computationDescription) {
if (workflowOperatorPanel!=null) {
if (workflowOperatorPanel != null) {
forceLayout();
workflowOperatorPanel.updateOperatorParametersValues();
Operator op = workflowOperatorPanel.getOperator();
computationPanel.startNewComputation(op, computationTitle, computationDescription);
computationExecutionPanel.startNewComputation(op, computationTitle,
computationDescription);
}
}
public void addOperator(Operator op) {
if (!WORKFLOW_MODE)
workflowOperatorPanel = null;
setActiveWidget(workflowLc);
if (workflowOperatorPanel==null) {
workflowLc.clear();
workflowLc.add(new HTML("&nbsp;"));
workflowLc.forceLayout();
}
setActiveWidget(computationPanel);
workflowOperatorPanel = new WorkflowOperatorPanel(op);
workflowOperatorPanel.setHandler(new WorkflowOperatorPanelHandler() {
@Override
public void startComputation(String computationTitle, String computationDescription) {
WorkflowPanel.this.startComputation(computationTitle, computationDescription);
setActiveWidget(computationPanel);
public void startComputation(String computationTitle,
String computationDescription) {
WorkflowPanel.this.startComputation(computationTitle,
computationDescription);
setActiveWidget(computationExecutionPanel);
}
});
addConnector(true);
workflowLc.add(workflowOperatorPanel); // operator
workflowLc.forceLayout();
removeAllButton.setEnabled(true);
computationPanel.addWorkflowOperatorPanel(workflowOperatorPanel);
}
/**
*
* @param first
*/
private void addConnector(boolean first) {
SimpleContainer lc = new SimpleContainer();
lc.setHeight(first ? 26 : 22);
lc.add(new Image(
first ? DataMinerManager.resources.workflowConnector1() : DataMinerManager.resources.workflowConnector2()
));
workflowLc.add(lc);
}
}

View File

@ -26,8 +26,6 @@ import net.opengis.wps.x100.SupportedComplexDataInputType;
import net.opengis.wps.x100.impl.ExecuteResponseDocumentImpl;
import org.apache.xmlbeans.XmlString;
import org.gcube.common.resources.gcore.ServiceEndpoint;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus.Status;
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
@ -48,9 +46,6 @@ import org.gcube.portlets.user.dataminermanager.server.util.ServiceCredential;
import org.gcube.portlets.user.dataminermanager.shared.Constants;
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException;
import org.gcube.resources.discovery.client.api.DiscoveryClient;
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
import org.gcube.resources.discovery.icclient.ICFactory;
import org.n52.wps.client.ExecuteRequestBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -69,7 +64,7 @@ import org.w3c.dom.NodeList;
public class SClient4WPS extends SClient {
private static Logger logger = LoggerFactory.getLogger(SClient4WPS.class);
private static final int OPERATOR_BRIEF_DESCRIPTION_MAX_LENGHT = 170;
//private static final int OPERATOR_BRIEF_DESCRIPTION_MAX_LENGHT = 170;
private static final String OTHERS = "OTHERS";
private String wpsToken;
@ -109,10 +104,11 @@ public class SClient4WPS extends SClient {
} else {
wpsUser = userName;
}
List<String> serviceAddress = InformationSystemUtils.retrieveServiceAddress(
Constants.DATAMINER_SERVICE_CATEGORY,
Constants.DATA_MINER_SERVICE_NAME,
serviceCredential.getScope());
List<String> serviceAddress = InformationSystemUtils
.retrieveServiceAddress(
Constants.DATAMINER_SERVICE_CATEGORY,
Constants.DATA_MINER_SERVICE_NAME,
serviceCredential.getScope());
logger.debug("Service Address retrieved:" + serviceAddress);
if (serviceAddress == null || serviceAddress.size() < 1) {
logger.error("No DataMiner service address available!");
@ -144,7 +140,6 @@ public class SClient4WPS extends SClient {
}
private StatWPSClientSession createWPSClientSession() {
if (wpsClient == null) {
wpsClient = new StatWPSClientSession(wpsUser, wpsToken);
@ -185,16 +180,8 @@ public class SClient4WPS extends SClient {
String briefDescription;
for (ProcessBriefType processDescriptionType : processesDescriptionType) {
if (processDescriptionType.getAbstract().getStringValue().length() > OPERATOR_BRIEF_DESCRIPTION_MAX_LENGHT) {
briefDescription = processDescriptionType
.getAbstract()
.getStringValue()
.substring(0, OPERATOR_BRIEF_DESCRIPTION_MAX_LENGHT - 2);
briefDescription += "...";
} else {
briefDescription = processDescriptionType.getAbstract()
.getStringValue();
}
briefDescription = processDescriptionType.getAbstract()
.getStringValue();
String categoryName = operatorsToCategoriesMap
.get(processDescriptionType.getIdentifier()

View File

@ -1,4 +1,19 @@
.smLayoutContainer {
.smLayoutContainer {
/* Blue
box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.11), 0 0 0
rgba(255, 255, 255, 1), 0 0 5px rgba(0, 28, 121, 1), 0px 0 40px
rgba(0, 28, 121, 0.15);
-moz-box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.11), 0 0 0
rgba(255, 255, 255, 1), 0 0 5px rgba(0, 28, 121, 1), 0px 0 40px
rgba(0, 28, 121, 0.15);
-webkit-box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.11), 0 0 0
rgba(255, 255, 255, 1), 0 0 5px rgba(0, 28, 121, 1), 0px 0 40px
rgba(0, 28, 121, 0.15);
-o-box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.11), 0 0 0
rgba(255, 255, 255, 1), 0 0 5px rgba(0, 28, 121, 1), 71px 0 27px
rgba(0, 28, 121, 0.15);*/
box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.11), 0 0 0
rgba(255, 255, 255, 1), 0 0 5px rgba(196, 196, 196, 1), 0px 0 27px
rgba(0, 0, 0, 0.15);
@ -18,12 +33,10 @@
}
.smMenu {
/*width: 900px;*/
/*height: 220px;*/
/*padding-top: 50px;*/
width: 720px !important;
height: 400px !important;
margin: auto;
margin-bottom: 20px;
/*margin-left: 30px;*/
}
.layoutContainerArea {
@ -47,10 +60,10 @@
-moz-border-radius: 0;
-webkit-border-radius: 0;
-o-border-radius: 0;
padding: 10px;
margin-bottom: 30px;
/*padding: 10px;*/
/*margin-bottom: 30px;
margin-left: 200px;
width: 480px;
width: 480px;*/
}
.smMenuItem:HOVER {
@ -70,23 +83,22 @@
}
.smMenuItemText {
font: 12px/1.5 "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana,
sans-serif;
display: block;
color: #606060;
margin-right: 10px;
/*margin-right: 10px;*/
}
/* OPERATORS PANEL */
.opePanel
{
.opePanel {
}
.opePanel:hover {
cursor: pointer;
}
.categoryItem {
margin-top: 10px;
margin-left: 5px;
@ -105,7 +117,7 @@
}
.categoryItem-Expanded {
background-image: url(images/triangle-down.png);
background-image: url(images/triangle-down.png);
}
.categoryItem:hover {
@ -247,14 +259,15 @@
}
.computationExcecutionPanel {
}
.workflow-parameters-tableDescription {
font-size: 12px;
/* border: 1px solid gray;*/
/* border: 1px solid gray;*/
color: white;
margin-right: 5px;
padding-right: 4px;
padding-right: 4px;
padding-left: 4px;
background-color: gray;
}
@ -282,7 +295,6 @@
}
/* TABLE EXPLORER */
.tableSelector-details {
margin-top: 20px;
margin-left: 5px;
@ -291,12 +303,12 @@
.tableSelector-details img {
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 10px;
margin-left: auto;
margin-right: auto;
margin-bottom: 10px;
}
#computationGrid .x-grid3-cell{
#computationGrid .x-grid3-cell {
vertical-align: middle;
}
@ -304,6 +316,7 @@
.progressBar-pending {
border: 1px solid #AAAAAA;
}
.progressBar-pending .x-progress-bar {
border: medium none;
background-image: url("images/progress-gray.gif");
@ -313,6 +326,7 @@
.progressBar-failed {
border: 1px solid #AA0000;
}
.progressBar-failed .x-progress-bar {
border: medium none;
background-image: url("images/progress-red.gif");
@ -322,14 +336,13 @@
.progressBar-complete {
border: 1px solid #00AA00;
}
.progressBar-complete .x-progress-bar {
border: medium none;
background-image: url("images/progress-green.gif");
}
/* JOB VIEWER */
.jobViewer-title {
font-size: 16px;
color: #000077;
@ -356,29 +369,28 @@
-o-border-radius: 5px;
margin: 0px 5px 5px 10px; /* top right bottom left*/
padding: 5px;
/* overflow: hidden;*/
/* overflow: hidden;*/
}
.jobViewer-section-header {
border-bottom: 1px solid gray;
margin-bottom: 10px;
margin-left: 5px;
margin-top: 20px;
margin-left: 5px;
margin-top: 20px;
}
.jobViewer-section-header-title {
color: #333333;
font-size: 14px;
font-weight: bold;
margin-bottom: 5px;
font-size: 14px;
font-weight: bold;
margin-bottom: 5px;
}
.jobViewer-section-header-image {
margin-right: 5px;
}
.jobViewer-table
{
.jobViewer-table {
line-height: 1.6em;
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
@ -387,54 +399,56 @@
text-align: left;
border-collapse: collapse;
}
.jobViewer-table th
{
.jobViewer-table th {
font-size: 14px;
font-weight: normal;
padding: 12px 15px;
color: #039;
}
.jobViewer-table td
{
.jobViewer-table td {
padding: 3px 5px;
border-top: 1px solid #e8edff;
}
.jobViewer-table-oce-first
{
.jobViewer-table-oce-first {
background: #d0dafd;
border-right: 10px solid transparent;
border-left: 10px solid transparent;
}
.jobViewer-table tr:hover td
{
.jobViewer-table tr:hover td {
color: #339;
background: #eff2ff;
}
.jobViewer-output-outputType {
background-color: #EEEEEE;
border: 1px solid #BDBDBD;
font-weight: bold;
margin-bottom: 20px;
margin-top: 10px;
padding: 5px;
text-align: center;
background-color: #EEEEEE;
border: 1px solid #BDBDBD;
font-weight: bold;
margin-bottom: 20px;
margin-top: 10px;
padding: 5px;
text-align: center;
}
.jobViewer-output-groupTitle {
font-style: italic;
font-weight: bold;
margin-bottom: 5px;
font-style: italic;
font-weight: bold;
margin-bottom: 5px;
}
.jobViewer-output-separator {
border-top: 2px solid #AAAAAA;
height: 30px;
margin: 8px auto auto;
width: 400px;}
border-top: 2px solid #AAAAAA;
height: 30px;
margin: 8px auto auto;
width: 400px;
}
.menuImgLogo:HOVER {
/* cursor: pointer;*/
/* cursor: pointer;*/
}
.menuItemImage {
@ -449,15 +463,14 @@
.menuItemImage-selected {
opacity: 1;
}
.menuItemImage-selected:HOVER {
cursor:auto;
cursor: auto;
}
/* TABLE IMPORTER AND UPLOAD MONITOR */
.tableImporter, .uploadMonitor {
margin:auto;
margin: auto;
margin-top: 20px;
padding: 5px;
}
@ -477,10 +490,10 @@
.uploadMonitor-description, .tableImporter-description {
font-size: 12px;
color: #505050;
margin-top: 2px;
padding-left: 2px;
padding-right: 2px;
width: 380px;
margin-top: 2px;
padding-left: 2px;
padding-right: 2px;
width: 380px;
}
.tableImporter-form {
@ -512,7 +525,7 @@
.tableImporter-templateDescriptorPanel {
text-align: left;
margin:auto;
margin: auto;
margin-top: 10px;
padding: 5px;
}
@ -526,7 +539,7 @@
.imgCursor:hover {
cursor: pointer;
opacity:0.7;
opacity: 0.7;
margin: auto;
}
@ -542,36 +555,36 @@
height: 25px;
vertical-align: bottom;
}
.tableImporter-templateIcon {
margin: auto;
margin-bottom: -10px;
margin-top: -5px;
}
.tableImporter-templateIcon:hover {
cursor: pointer;
opacity:0.7;
opacity: 0.7;
}
.templateDescriptorPanel-description {
font-size: 13px;
color: #505050;
margin-top: 17px;
padding-left: 30px;
padding-right: 20px;
padding-top: 28px;
margin-top: 17px;
padding-left: 30px;
padding-right: 20px;
padding-top: 28px;
}
.templateDescriptorPanel-tableTemplateItem {
border-bottom: 1px solid gray;
font-size: 13px;
font-weight:bold;
font-weight: bold;
margin-left: 10px;
padding-top: 20px;
}
.templateDescriptorPanel-table
{
.templateDescriptorPanel-table {
line-height: 1.6em;
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
@ -580,32 +593,34 @@
text-align: left;
border-collapse: collapse;
}
.templateDescriptorPanel-table th
{
.templateDescriptorPanel-table th {
font-size: 13px;
font-weight: normal;
padding: 12px 15px;
color: #039;
}
.templateDescriptorPanel-table td
{
.templateDescriptorPanel-table td {
padding: 3px 5px;
color: #669;
border-top: 1px solid #e8edff;
}
.templateDescriptorPanel-table-oce-first
{
.templateDescriptorPanel-table-oce-first {
background: #d0dafd;
border-right: 10px solid transparent;
border-left: 10px solid transparent;
}
.templateDescriptorPanel-table tr:hover td
{
.templateDescriptorPanel-table tr:hover td {
color: #339;
background: #eff2ff;
}
.gcube_DialogBox .Caption { font-family: Arial Unicode !important; }
.gcube_DialogBox .Caption {
font-family: Arial Unicode !important;
}
.dataSpace-grid-templateImg {
display: inline;
@ -613,6 +628,4 @@
.dataSpace-grid-tableName {
font-weight: bold;
}
}

View File

@ -26,6 +26,6 @@
Your web browser must have JavaScript enabled in order for this
application to display correctly.</div>
</noscript>
<div id="contentDiv"></div>
<!-- <div id="contentDiv"></div> -->
</body>
</html>