From b2b7cfc9905f52b79f11a4f0f4ec43002a760713 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Wed, 14 Jan 2015 14:18:10 +0000 Subject: [PATCH] Minor Update git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-charts-widget@111388 82a268e6-3cf1-43bd-a215-b396298e98cf --- .gwt/.gwt-log | 20 ++++++++ .../client/ChartSelectionCard.java | 8 +++- .../chartswidget/client/help/ChartHelp.java | 48 +++++++++++++++++++ .../TopRatingColumnSelectionCard.java | 2 +- .../TopRatingColumnSelectionGridPanel.java | 10 +++- 5 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 .gwt/.gwt-log create mode 100644 src/main/java/org/gcube/portlets/user/td/chartswidget/client/help/ChartHelp.java diff --git a/.gwt/.gwt-log b/.gwt/.gwt-log new file mode 100644 index 0000000..82e18aa --- /dev/null +++ b/.gwt/.gwt-log @@ -0,0 +1,20 @@ +Public resources found in... +Translatable source found in... +Found 0 cached/archived units. Used 0 / 3925 units from cache. +Compiling... +Public resources found in... +Translatable source found in... +Found 0 cached/archived units. Used 0 / 3925 units from cache. +Compiling... +Public resources found in... +Translatable source found in... +Found 0 cached/archived units. Used 0 / 3925 units from cache. +Compiling... +Public resources found in... +Translatable source found in... +Found 0 cached/archived units. Used 0 / 3925 units from cache. +Compiling... +Public resources found in... +Translatable source found in... +Found 0 cached/archived units. Used 0 / 3925 units from cache. +Compiling... diff --git a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/ChartSelectionCard.java b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/ChartSelectionCard.java index a6fc2a4..808ca1c 100644 --- a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/ChartSelectionCard.java +++ b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/ChartSelectionCard.java @@ -1,5 +1,6 @@ package org.gcube.portlets.user.td.chartswidget.client; +import org.gcube.portlets.user.td.chartswidget.client.help.ChartHelp; import org.gcube.portlets.user.td.chartswidget.client.properties.ChartTypePropertiesCombo; import org.gcube.portlets.user.td.chartswidget.client.store.ChartTypeElement; import org.gcube.portlets.user.td.chartswidget.client.store.ChartTypeStore; @@ -44,7 +45,7 @@ public class ChartSelectionCard extends WizardCard { private ChartType chartTypeSelected; private ComboBox comboChartType; private FieldLabel comboChartTypeLabel; - + private ChartHelp chartHelp; public ChartSelectionCard(final ChartSession chartSession) { @@ -87,10 +88,12 @@ public class ChartSelectionCard extends WizardCard { comboChartType.setTriggerAction(TriggerAction.ALL); comboChartTypeLabel = new FieldLabel(comboChartType, "Chart Type"); + + chartHelp=new ChartHelp(); content.add(comboChartTypeLabel, new VerticalLayoutData(1, -1, new Margins(0))); - + content.add(chartHelp, new VerticalLayoutData(1,-1, new Margins(0))); return panel; } @@ -119,6 +122,7 @@ public class ChartSelectionCard extends WizardCard { private void updateChartType(ChartType type) { chartTypeSelected = type; + chartHelp.updateChartType(type); } @Override diff --git a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/help/ChartHelp.java b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/help/ChartHelp.java new file mode 100644 index 0000000..ade6b66 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/help/ChartHelp.java @@ -0,0 +1,48 @@ +package org.gcube.portlets.user.td.chartswidget.client.help; + +import org.gcube.portlets.user.td.widgetcommonevent.shared.charts.ChartType; + +import com.google.gwt.user.client.ui.HTML; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; + +/** + * + * @author giancarlo email: g.panichi@isti.cnr.it + * + */ +public class ChartHelp extends SimpleContainer { + + public ChartHelp() { + super(); + init(); + } + + public void init() { + HTML suggestion = new HTML( + "

"); + add(suggestion); + } + + public void updateChartType(ChartType type) { + HTML suggestion; + clear(); + switch (type) { + case TopRating: + suggestion = new HTML( + "

Top Rating: given a dataset, " + + "crete a chart that has dimension values, with aggregate measure on y-axis and a time-dimension on x-axis

"); + add(suggestion); + break; + default: + suggestion = new HTML( + "

"); + add(suggestion); + break; + + } + + forceLayout(); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionCard.java b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionCard.java index 863f58a..11fe69f 100644 --- a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionCard.java +++ b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionCard.java @@ -32,7 +32,7 @@ public class TopRatingColumnSelectionCard extends WizardCard { public TopRatingColumnSelectionCard(final ChartSession chartSession, final ChartTopRatingSession chartTopRatingSession) { - super("Column Selection", ""); + super("Dimension Column Selection", ""); this.thisCard=this; if (chartTopRatingSession == null) { Log.error("ChartTopRatingSession is null"); diff --git a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionGridPanel.java b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionGridPanel.java index ec42395..7a05e10 100644 --- a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionGridPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionGridPanel.java @@ -6,6 +6,7 @@ import java.util.List; import org.gcube.portlets.user.td.chartswidget.client.grid.ColumnDataProperties; import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; +import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode; import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.core.client.GWT; @@ -51,7 +52,7 @@ public class TopRatingColumnSelectionGridPanel extends ContentPanel implements public TopRatingColumnSelectionGridPanel(TopRatingColumnSelectionCard parent, ChartSession chartSession) { this.parent=parent; Log.debug("TopRatingColumnSelectionGridPanel"); - setHeadingText("Colums"); + setHeadingText("Dimension Colums"); ColumnConfig labelCol = new ColumnConfig( props.label()); @@ -66,7 +67,12 @@ public class TopRatingColumnSelectionGridPanel extends ContentPanel implements ColumnModel cm = new ColumnModel(l); ListStore store = new ListStore(props.id()); - store.addAll(chartSession.getColumns()); + ArrayList coloumns=chartSession.getColumns(); + for(ColumnData col:coloumns){ + if(col.getTypeCode().compareTo(ColumnTypeCode.DIMENSION.toString())==0){ + store.add(col); + } + } grid = new Grid(store, cm); sm.setSelectionMode(SelectionMode.SINGLE);