Revision 40609
Added by Ioannis Diplas almost 9 years ago
modules/uoa-stats-config/branches/json/src/main/java/eu/dnetlib/shared/ValuesOfFields.java | ||
---|---|---|
36 | 36 |
private String sizeSubtitle = new String(); |
37 | 37 |
private String sizeXaxis = new String(); |
38 | 38 |
private String sizeYaxis = new String(); |
39 |
private String fontFamily = new String(); |
|
39 | 40 |
|
40 | 41 |
|
41 | 42 |
private Data rowData = new Data(); |
... | ... | |
44 | 45 |
public ValuesOfFields(){ |
45 | 46 |
|
46 | 47 |
} |
47 |
|
|
48 |
|
|
49 |
public String getFontFamily() { |
|
50 |
return fontFamily; |
|
51 |
} |
|
52 |
|
|
53 |
public void setFontFamily(String fontFamily) { |
|
54 |
this.fontFamily = fontFamily; |
|
55 |
} |
|
56 |
|
|
48 | 57 |
public String getColorTitle() { |
49 | 58 |
return colorTitle; |
50 | 59 |
} |
... | ... | |
292 | 301 |
public static class Data implements IsSerializable{ |
293 | 302 |
|
294 | 303 |
private String DataSource = new String(); |
304 |
private String dataserieNaming = new String(); |
|
295 | 305 |
private String typeOf = new String(); |
296 | 306 |
private String extra_type = new String(); |
297 | 307 |
private String x_values = new String(); |
... | ... | |
323 | 333 |
this.enabled = enabled; |
324 | 334 |
} |
325 | 335 |
|
336 |
public String getDataserieNaming() { |
|
337 |
return dataserieNaming; |
|
338 |
} |
|
326 | 339 |
|
340 |
public void setDataserieNaming(String dataserieNaming) { |
|
341 |
this.dataserieNaming = dataserieNaming; |
|
342 |
} |
|
327 | 343 |
|
328 | 344 |
public String getTypeOfChart() { |
329 | 345 |
return typeOfChart; |
330 | 346 |
} |
331 | 347 |
|
332 |
|
|
333 |
|
|
334 | 348 |
public void setTypeOfChart(String typeOfChart) { |
335 | 349 |
this.typeOfChart = typeOfChart; |
336 | 350 |
} |
modules/uoa-stats-config/branches/json/src/main/java/eu/dnetlib/client/widgets/DropdownListWidget.java | ||
---|---|---|
66 | 66 |
} |
67 | 67 |
}); |
68 | 68 |
|
69 |
masterListBox.getElement().getStyle().setMarginBottom(0.0, Unit.PX); |
|
69 |
//masterListBox.getElement().getStyle().setMarginBottom(0.0, Unit.PX);
|
|
70 | 70 |
|
71 | 71 |
optionsPanel.add(masterListBox); |
72 | 72 |
optionsPanel.add(focusPanel); |
... | ... | |
148 | 148 |
|
149 | 149 |
treePanel.getElement().getStyle().setProperty("height", "auto"); |
150 | 150 |
treePanel.getElement().getStyle().setProperty("max-height", "270px"); |
151 |
treePanel.getElement().getStyle().setWidth(230.00, Unit.PX); |
|
151 |
|
|
152 |
treePanel.getElement().getStyle().setWidth(270.00, Unit.PX); |
|
152 | 153 |
treePanel.getElement().getStyle().setBorderWidth(1.00, Unit.PX); |
153 | 154 |
treePanel.getElement().getStyle().setBorderColor("#ccc"); |
154 | 155 |
treePanel.getElement().getStyle().setBorderStyle(BorderStyle.SOLID); |
modules/uoa-stats-config/branches/json/src/main/java/eu/dnetlib/client/leftColumn/AppearancePanel.java | ||
---|---|---|
65 | 65 |
appearancePanels.add(appearanceGroupPanel); |
66 | 66 |
|
67 | 67 |
Form appearanceForm = new Form(); |
68 |
appearanceForm.setType(FormType.HORIZONTAL); |
|
69 | 68 |
|
70 | 69 |
|
71 | 70 |
final TextBox nameOfDataseries = new TextBox(); |
... | ... | |
81 | 80 |
appearanceGroupPanel.setHeading("APPEARANCE FOR " + "\""+nameOfDataseries.getText()+"\""); |
82 | 81 |
|
83 | 82 |
}else{ |
84 |
appearanceGroupPanel.setHeading("APPEARANCE FOR DATASERIES " + (numberOfColumn+1));
|
|
83 |
appearanceGroupPanel.setHeading("APPEARANCE FOR DATASERIES \"untitled\"" );
|
|
85 | 84 |
} |
86 | 85 |
ValuesOfFields.getInstance().getColumnsDataList().get(numberOfColumn).setXaxisTitle(nameOfDataseries.getText()); |
87 | 86 |
Generate.getInstance().generateURLs(ValuesOfFields.getInstance(), 1); |
... | ... | |
93 | 92 |
|
94 | 93 |
|
95 | 94 |
appearanceGroupPanel.addStyleName("accordionPanel"); |
96 |
appearanceGroupPanel.setHeading("APPEARANCE FOR DATASERIES "+(numberOfColumn+1));
|
|
95 |
appearanceGroupPanel.setHeading("APPEARANCE FOR DATASERIES \"untitled\"");
|
|
97 | 96 |
appearanceGroupPanel.getHeading().addStyleName("accordionHeading"); |
98 | 97 |
appearanceGroupPanel.add(appearanceForm); |
99 | 98 |
appearanceGroupPanel.setIcon(IconType.PLUS); |
... | ... | |
123 | 122 |
public void designSpacing(){ |
124 | 123 |
|
125 | 124 |
Form borderOptionsForm = new Form(); |
126 |
borderOptionsForm.setType(FormType.HORIZONTAL); |
|
127 | 125 |
|
128 | 126 |
final TextBox spaceTopTextBox = new TextBox(); |
129 | 127 |
FormFieldSet spaceTopFieldSet = new FormFieldSet("Space from top", spaceTopTextBox); |
... | ... | |
208 | 206 |
|
209 | 207 |
public void designAppearanceForTitle(){ |
210 | 208 |
Form appearanceOptionsForm = new Form(); |
211 |
appearanceOptionsForm.setType(FormType.HORIZONTAL); |
|
212 | 209 |
|
213 | 210 |
final TextBox textColorTextBox = new TextBox(); |
214 | 211 |
FormFieldSet textColorFieldSet = new FormFieldSet("Text color", textColorTextBox); |
... | ... | |
266 | 263 |
|
267 | 264 |
public void designAppearanceForSubtitle(){ |
268 | 265 |
Form appearanceOptionsForm = new Form(); |
269 |
appearanceOptionsForm.setType(FormType.HORIZONTAL); |
|
270 | 266 |
|
271 | 267 |
final TextBox textColorTextBox = new TextBox(); |
272 | 268 |
FormFieldSet textColorFieldSet = new FormFieldSet("Text color", textColorTextBox); |
... | ... | |
323 | 319 |
|
324 | 320 |
public void designAppearanceForXaxis(){ |
325 | 321 |
Form appearanceOptionsForm = new Form(); |
326 |
appearanceOptionsForm.setType(FormType.HORIZONTAL); |
|
327 | 322 |
|
328 | 323 |
final TextBox textColorTextBox = new TextBox(); |
329 | 324 |
FormFieldSet textColorFieldSet = new FormFieldSet("Text color", textColorTextBox); |
... | ... | |
380 | 375 |
|
381 | 376 |
public void designAppearanceForYaxis(){ |
382 | 377 |
Form appearanceOptionsForm = new Form(); |
383 |
appearanceOptionsForm.setType(FormType.HORIZONTAL); |
|
384 | 378 |
|
385 | 379 |
final TextBox textColorTextBox = new TextBox(); |
386 | 380 |
FormFieldSet textColorFieldSet = new FormFieldSet("Text color", textColorTextBox); |
modules/uoa-stats-config/branches/json/src/main/java/eu/dnetlib/client/leftColumn/OptionsWidget.java | ||
---|---|---|
7 | 7 |
import com.github.gwtbootstrap.client.ui.CheckBox; |
8 | 8 |
import com.github.gwtbootstrap.client.ui.Form; |
9 | 9 |
import com.github.gwtbootstrap.client.ui.Image; |
10 |
import com.github.gwtbootstrap.client.ui.ListBox; |
|
10 | 11 |
import com.github.gwtbootstrap.client.ui.Tab; |
11 | 12 |
import com.github.gwtbootstrap.client.ui.TabPanel; |
12 | 13 |
import com.github.gwtbootstrap.client.ui.TextBox; |
13 | 14 |
import com.github.gwtbootstrap.client.ui.constants.ButtonType; |
14 |
import com.github.gwtbootstrap.client.ui.constants.FormType; |
|
15 | 15 |
import com.github.gwtbootstrap.client.ui.constants.IconType; |
16 | 16 |
import com.github.gwtbootstrap.client.ui.event.HideEvent; |
17 | 17 |
import com.github.gwtbootstrap.client.ui.event.HideHandler; |
... | ... | |
23 | 23 |
import com.google.gwt.event.dom.client.ClickHandler; |
24 | 24 |
import com.google.gwt.event.dom.client.LoadEvent; |
25 | 25 |
import com.google.gwt.event.dom.client.LoadHandler; |
26 |
import com.google.gwt.http.client.URL; |
|
27 |
import com.google.gwt.user.client.Window; |
|
28 | 26 |
import com.google.gwt.user.client.ui.FlowPanel; |
29 | 27 |
import com.google.gwt.user.client.ui.RootPanel; |
30 | 28 |
import com.google.gwt.user.client.ui.Widget; |
... | ... | |
42 | 40 |
private Tab appearanceTab = new Tab(); |
43 | 41 |
private Tab dataSeriesTab = new Tab(); |
44 | 42 |
private Tab generalTab = new Tab(); |
43 |
private Tab titlesTab = new Tab(); |
|
45 | 44 |
private int totalColumns=0; |
46 | 45 |
private int specialColumnCounter=0; |
47 | 46 |
private SchemaAnswer schemaFromServer; |
... | ... | |
51 | 50 |
private boolean isFromLoad; |
52 | 51 |
private final ArrayList<DataserieWidget> overallList = new ArrayList<DataserieWidget>(); |
53 | 52 |
private AppearancePanel apperancePanel = new AppearancePanel(); |
53 |
|
|
54 | 54 |
private ArrayList<FiltersPanel> filtersPanels = new ArrayList<FiltersPanel>(); |
55 | 55 |
private final Button applyChangesGeneral = new Button(); |
56 | 56 |
private final Button applyChangesTitles = new Button(); |
... | ... | |
69 | 69 |
|
70 | 70 |
designAppearanceTab(); |
71 | 71 |
designGeneralTab(); |
72 |
designTitlesTab(); |
|
72 | 73 |
designMainTabPanel(); |
73 | 74 |
|
74 | 75 |
//if(!isFromLoad) |
... | ... | |
88 | 89 |
addDataserie.addStyleName("add-serie-icon"); |
89 | 90 |
|
90 | 91 |
dataSeriesTab.addDecorate(addDataserie); |
91 |
addDataserie.addStyleName("flashing-button"); |
|
92 |
if(!isFromLoad) |
|
93 |
addDataserie.addStyleName("flashing-button"); |
|
92 | 94 |
|
93 |
addDataserie.addClickHandler(new ClickHandler() {
|
|
95 |
dataSeriesTab.addClickHandler(new ClickHandler() {
|
|
94 | 96 |
|
95 | 97 |
@Override |
96 |
public void onClick(ClickEvent arg0) { |
|
98 |
public void onClick(ClickEvent event) { |
|
99 |
// TODO Auto-generated method stub |
|
100 |
event.preventDefault(); |
|
101 |
addDataserie.removeStyleName("flashing-button"); |
|
102 |
DataserieWidget temp = new DataserieWidget(mainTabPanel,schemaFromServer,totalColumns,specialColumnCounter,deleteImageList,listBoxes,false,dataSeriesTab,true,apperancePanel,optionSelected,filtersPanels); |
|
103 |
overallList.add(temp); |
|
97 | 104 |
|
98 |
arg0.preventDefault(); |
|
99 |
addDataserie.removeStyleName("flashing-button"); |
|
100 |
DataserieWidget temp = new DataserieWidget(mainTabPanel,schemaFromServer,totalColumns,specialColumnCounter,deleteImageList,listBoxes,false,dataSeriesTab,true,apperancePanel,optionSelected,filtersPanels); |
|
101 |
overallList.add(temp); |
|
102 |
|
|
103 |
mainTabPanel.clear(); |
|
104 |
|
|
105 |
mainTabPanel.add(dataSeriesTab); |
|
106 |
for(int i=0;i<overallList.size();i++){ |
|
107 |
mainTabPanel.add(overallList.get(i).getSingleColumn()); |
|
108 |
if(i==overallList.size()-1){ |
|
109 |
mainTabPanel.selectTab(1+i); |
|
110 |
} |
|
105 |
mainTabPanel.clear(); |
|
106 |
|
|
107 |
mainTabPanel.add(dataSeriesTab); |
|
108 |
for(int i=0;i<overallList.size();i++){ |
|
109 |
mainTabPanel.add(overallList.get(i).getSingleColumn()); |
|
110 |
if(i==overallList.size()-1){ |
|
111 |
appearanceTab.setActive(false); |
|
112 |
generalTab.setActive(false); |
|
113 |
titlesTab.setActive(false); |
|
114 |
mainTabPanel.selectTab(1+i); |
|
115 |
overallList.get(i).getRenameTextBox().setFocus(true); |
|
111 | 116 |
} |
112 |
mainTabPanel.add(appearanceTab); |
|
113 |
mainTabPanel.add(generalTab); |
|
117 |
} |
|
118 |
mainTabPanel.add(appearanceTab); |
|
119 |
mainTabPanel.add(generalTab); |
|
120 |
mainTabPanel.add(titlesTab); |
|
121 |
|
|
122 |
|
|
123 |
apperancePanel.addAppearanceForDataserie(totalColumns); |
|
124 |
|
|
125 |
DeleteListener deleteListener = new DeleteListener() { |
|
114 | 126 |
|
115 |
|
|
116 |
apperancePanel.addAppearanceForDataserie(totalColumns); |
|
117 |
|
|
118 |
DeleteListener deleteListener = new DeleteListener() { |
|
119 |
|
|
120 |
@Override |
|
121 |
public void onEvent(int numberOfDeletedColumn) { |
|
122 |
overallList.remove(numberOfDeletedColumn); |
|
123 |
mainTabPanel.clear(); |
|
124 |
mainTabPanel.add(dataSeriesTab); |
|
125 |
for(int i=0;i<overallList.size();i++){ |
|
126 |
mainTabPanel.add(overallList.get(i).getSingleColumn()); |
|
127 |
if(i==overallList.size()-1){ |
|
128 |
|
|
129 |
mainTabPanel.selectTab(1+i); |
|
130 |
} |
|
127 |
@Override |
|
128 |
public void onEvent(int numberOfDeletedColumn) { |
|
129 |
overallList.remove(numberOfDeletedColumn); |
|
130 |
mainTabPanel.clear(); |
|
131 |
mainTabPanel.add(dataSeriesTab); |
|
132 |
for(int i=0;i<overallList.size();i++){ |
|
133 |
mainTabPanel.add(overallList.get(i).getSingleColumn()); |
|
134 |
if(i==overallList.size()-1){ |
|
135 |
mainTabPanel.selectTab(1+i); |
|
131 | 136 |
} |
132 |
mainTabPanel.add(appearanceTab); |
|
133 |
mainTabPanel.add(generalTab); |
|
134 |
apperancePanel.deleteAppearanceOfDataseries(numberOfDeletedColumn); |
|
135 |
for(int i=numberOfDeletedColumn;i<overallList.size();i++){ |
|
136 |
overallList.get(i).setNumberOfCurrentColumn(overallList.get(i).getNumberOfCurrentColumn()-1); |
|
137 |
} |
|
138 |
specialColumnCounter--; |
|
139 | 137 |
} |
140 |
}; |
|
141 |
overallList.get(specialColumnCounter).setDeleteListener(deleteListener); |
|
142 |
totalColumns++; |
|
143 |
specialColumnCounter++; |
|
144 |
// Generate.getInstance().generateURLs(ValuesOfFields.getInstance(), 1); |
|
145 |
} |
|
138 |
mainTabPanel.add(appearanceTab); |
|
139 |
mainTabPanel.add(generalTab); |
|
140 |
mainTabPanel.add(titlesTab); |
|
141 |
|
|
142 |
apperancePanel.deleteAppearanceOfDataseries(numberOfDeletedColumn); |
|
143 |
for(int i=numberOfDeletedColumn;i<overallList.size();i++){ |
|
144 |
overallList.get(i).setNumberOfCurrentColumn(overallList.get(i).getNumberOfCurrentColumn()-1); |
|
145 |
} |
|
146 |
specialColumnCounter--; |
|
147 |
} |
|
148 |
}; |
|
149 |
overallList.get(specialColumnCounter).setDeleteListener(deleteListener); |
|
150 |
totalColumns++; |
|
151 |
specialColumnCounter++; |
|
152 |
} |
|
146 | 153 |
}); |
147 | 154 |
|
155 |
|
|
148 | 156 |
dataSeriesTab.asTabLink().addClickHandler(new ClickHandler() { |
149 | 157 |
|
150 | 158 |
@Override |
... | ... | |
163 | 171 |
mainTabPanel.add(dataSeriesTab); |
164 | 172 |
mainTabPanel.add(appearanceTab); |
165 | 173 |
mainTabPanel.add(generalTab); |
174 |
mainTabPanel.add(titlesTab); |
|
166 | 175 |
|
167 | 176 |
if(isFromLoad){ |
168 | 177 |
totalColumns=0; |
169 | 178 |
specialColumnCounter=0; |
179 |
mainTabPanel.clear(); |
|
180 |
mainTabPanel.add(dataSeriesTab); |
|
170 | 181 |
for(int i=0;i<ValuesOfFields.getInstance().getColumnsDataList().size();i++){ |
171 | 182 |
|
172 | 183 |
specialColumnCounter = i; |
173 | 184 |
DataserieWidget temp = new DataserieWidget(mainTabPanel,schemaFromServer,totalColumns,specialColumnCounter,deleteImageList,listBoxes,true,dataSeriesTab,false,apperancePanel,optionSelected,filtersPanels); |
174 | 185 |
overallList.add(temp); |
175 |
|
|
176 | 186 |
apperancePanel.addAppearanceForDataserie(totalColumns); |
177 |
|
|
187 |
|
|
188 |
|
|
178 | 189 |
DeleteListener deleteListener = new DeleteListener() { |
179 | 190 |
|
180 | 191 |
@Override |
... | ... | |
190 | 201 |
} |
191 | 202 |
mainTabPanel.add(appearanceTab); |
192 | 203 |
mainTabPanel.add(generalTab); |
204 |
mainTabPanel.add(titlesTab); |
|
205 |
|
|
193 | 206 |
apperancePanel.deleteAppearanceOfDataseries(numberOfDeletedColumn); |
194 | 207 |
for(int i=numberOfDeletedColumn;i<overallList.size();i++){ |
195 | 208 |
overallList.get(i).setNumberOfCurrentColumn(overallList.get(i).getNumberOfCurrentColumn()-1); |
... | ... | |
200 | 213 |
overallList.get(specialColumnCounter).setDeleteListener(deleteListener); |
201 | 214 |
totalColumns++; |
202 | 215 |
specialColumnCounter++; |
203 |
|
|
216 |
mainTabPanel.add(temp.getSingleColumn()); |
|
217 |
temp.getSingleColumn().setHeading(ValuesOfFields.getInstance().getColumnsDataList().get(i).getDataserieNaming()); |
|
204 | 218 |
} |
219 |
mainTabPanel.add(appearanceTab); |
|
220 |
mainTabPanel.add(generalTab); |
|
221 |
mainTabPanel.add(titlesTab); |
|
205 | 222 |
Generate.getInstance().generateURLs(ValuesOfFields.getInstance(),1); |
206 | 223 |
} |
207 | 224 |
mainTabPanel.addStyleName("main-navigation-bar"); |
... | ... | |
215 | 232 |
appearanceTab.add(apperancePanel.asWidget()); |
216 | 233 |
} |
217 | 234 |
|
235 |
public void designTitlesTab(){ |
|
236 |
TitlesPanel titlesPanel = new TitlesPanel(isFromLoad,titlesTab); |
|
237 |
titlesTab.setHeading("Titles"); |
|
238 |
titlesTab.add(titlesPanel.asWidget()); |
|
239 |
} |
|
240 |
|
|
218 | 241 |
public void designGeneralTab(){ |
219 | 242 |
|
220 | 243 |
FlowPanel masterPanel = new FlowPanel(); |
... | ... | |
265 | 288 |
|
266 | 289 |
|
267 | 290 |
Form generalOptionsForm = new Form(); |
268 |
generalOptionsForm.setType(FormType.HORIZONTAL); |
|
269 | 291 |
|
270 | 292 |
final TextBox numberOfResults = new TextBox(); |
271 | 293 |
numberOfResults.getElement().setAttribute("type", "number"); |
... | ... | |
304 | 326 |
} |
305 | 327 |
}); |
306 | 328 |
|
307 |
|
|
308 | 329 |
final TextBox rotateTextBox = new TextBox(); |
309 | 330 |
rotateTextBox.setPlaceholder("Degrees.."); |
310 | 331 |
generalOptionsForm.add(new FormFieldSet("Rotation of labels", rotateTextBox)); |
... | ... | |
334 | 355 |
}); |
335 | 356 |
|
336 | 357 |
|
358 |
final ListBox fontFamily = new ListBox(); |
|
359 |
fontFamily.addItem("Courier"); |
|
360 |
fontFamily.addItem("Arial"); |
|
361 |
fontFamily.addItem("Verdana"); |
|
362 |
fontFamily.addItem("Georgia"); |
|
363 |
fontFamily.addItem("Palatino Linotype"); |
|
364 |
fontFamily.addItem("Times New Roman"); |
|
365 |
fontFamily.addItem("Comic Sans MS"); |
|
366 |
fontFamily.addItem("Impact"); |
|
367 |
fontFamily.addItem("Lucida Sans Unicode"); |
|
368 |
fontFamily.addItem("Tahoma"); |
|
369 |
fontFamily.addItem("Lucida Console"); |
|
370 |
fontFamily.addItem("Courier New"); |
|
371 |
fontFamily.addItem("Monaco"); |
|
372 |
|
|
373 |
fontFamily.addChangeHandler(new ChangeHandler() { |
|
374 |
|
|
375 |
@Override |
|
376 |
public void onChange(ChangeEvent event) { |
|
377 |
// TODO Auto-generated method stub |
|
378 |
ValuesOfFields.getInstance().setFontFamily(fontFamily.getSelectedItemText()); |
|
379 |
applyChangesGeneral.addStyleName("flashing-button-apply"); |
|
380 |
} |
|
381 |
}); |
|
382 |
ValuesOfFields.getInstance().setFontFamily("Courier"); |
|
383 |
generalOptionsForm.add(new FormFieldSet("Font family", fontFamily)); |
|
384 |
|
|
385 |
|
|
337 | 386 |
final AccordionGroup generalOptionsGroupPanel = new AccordionGroup(); |
338 | 387 |
generalOptionsGroupPanel.addStyleName("accordionPanel"); |
339 | 388 |
generalOptionsGroupPanel.setHeading("GENERAL OPTIONS"); |
... | ... | |
357 | 406 |
|
358 | 407 |
masterPanel.add(generalOptionsGroupPanel); |
359 | 408 |
|
360 |
|
|
361 |
|
|
362 |
Form headersForm = new Form(); |
|
363 |
headersForm.setType(FormType.HORIZONTAL); |
|
364 |
|
|
365 |
final TextBox titleTextBox = new TextBox(); |
|
366 |
titleTextBox.addChangeHandler(new ChangeHandler() { |
|
367 |
|
|
368 |
@Override |
|
369 |
public void onChange(ChangeEvent arg0) { |
|
370 |
// TODO Auto-generated method stub |
|
371 |
ValuesOfFields.getInstance().setTitle(URL.encode(titleTextBox.getText())); |
|
372 |
|
|
373 |
applyChangesTitles.addStyleName("flashing-button-apply"); |
|
374 |
// Generate.getInstance().generateURLs(ValuesOfFields.getInstance(), 1); |
|
375 |
} |
|
376 |
}); |
|
377 |
headersForm.add(new FormFieldSet("Chart title", titleTextBox)); |
|
378 |
|
|
379 |
final TextBox subtitleTextBox = new TextBox(); |
|
380 |
subtitleTextBox.addChangeHandler(new ChangeHandler() { |
|
381 |
|
|
382 |
@Override |
|
383 |
public void onChange(ChangeEvent arg0) { |
|
384 |
ValuesOfFields.getInstance().setSubtitle(subtitleTextBox.getText().replaceAll("\"", "\\\\\"")); |
|
385 |
applyChangesTitles.addStyleName("flashing-button-apply"); |
|
386 |
// Generate.getInstance().generateURLs(ValuesOfFields.getInstance(), 1); |
|
387 |
} |
|
388 |
}); |
|
389 |
headersForm.add(new FormFieldSet("Chart subtitle", subtitleTextBox)); |
|
390 |
|
|
391 |
final TextBox xaxisTextBox = new TextBox(); |
|
392 |
xaxisTextBox.addChangeHandler(new ChangeHandler() { |
|
393 |
|
|
394 |
@Override |
|
395 |
public void onChange(ChangeEvent arg0) { |
|
396 |
// TODO Auto-generated method stub |
|
397 |
ValuesOfFields.getInstance().setXaxis(xaxisTextBox.getText().replaceAll("\"", "\\\\\"")); |
|
398 |
applyChangesTitles.addStyleName("flashing-button-apply"); |
|
399 |
// Generate.getInstance().generateURLs(ValuesOfFields.getInstance(), 1); |
|
400 |
} |
|
401 |
}); |
|
402 |
headersForm.add(new FormFieldSet("Naming x-axis", xaxisTextBox)); |
|
403 |
|
|
404 |
final TextBox yaxisTextBox = new TextBox(); |
|
405 |
yaxisTextBox.addChangeHandler(new ChangeHandler() { |
|
406 |
|
|
407 |
@Override |
|
408 |
public void onChange(ChangeEvent arg0) { |
|
409 |
// TODO Auto-generated method stub |
|
410 |
ValuesOfFields.getInstance().setYaxis(yaxisTextBox.getText().replaceAll("\"", "\\\\\"")); |
|
411 |
applyChangesTitles.addStyleName("flashing-button-apply"); |
|
412 |
// Generate.getInstance().generateURLs(ValuesOfFields.getInstance(), 1); |
|
413 |
} |
|
414 |
}); |
|
415 |
headersForm.add(new FormFieldSet("Naming y-axis", yaxisTextBox)); |
|
416 |
|
|
417 |
final AccordionGroup titlesGroupPanel = new AccordionGroup(); |
|
418 |
titlesGroupPanel.addStyleName("accordionPanel"); |
|
419 |
titlesGroupPanel.setHeading("TITLE OPTIONS"); |
|
420 |
titlesGroupPanel.getHeading().addStyleName("accordionHeading"); |
|
421 |
titlesGroupPanel.add(headersForm); |
|
422 |
titlesGroupPanel.add(applyChangesTitles); |
|
423 |
titlesGroupPanel.setIcon(IconType.MINUS); |
|
424 |
titlesGroupPanel.setDefaultOpen(true); |
|
425 |
titlesGroupPanel.addShowHandler(new ShowHandler() { |
|
426 |
@Override |
|
427 |
public void onShow(ShowEvent showEvent) { |
|
428 |
titlesGroupPanel.setIcon(IconType.MINUS); |
|
429 |
} |
|
430 |
}); |
|
431 |
titlesGroupPanel.addHideHandler(new HideHandler() { |
|
432 |
@Override |
|
433 |
public void onHide(HideEvent hideEvent) { |
|
434 |
titlesGroupPanel.setIcon(IconType.PLUS); |
|
435 |
} |
|
436 |
}); |
|
437 |
|
|
438 |
masterPanel.add(titlesGroupPanel); |
|
439 |
|
|
440 |
if(isFromLoad){ |
|
441 |
if(!ValuesOfFields.getInstance().getTitle().isEmpty()){ |
|
442 |
titleTextBox.setText(ValuesOfFields.getInstance().getTitle()); |
|
443 |
titlesGroupPanel.show(); |
|
444 |
} |
|
445 |
|
|
446 |
if(!ValuesOfFields.getInstance().getXaxis().isEmpty()){ |
|
447 |
xaxisTextBox.setText(ValuesOfFields.getInstance().getXaxis()); |
|
448 |
titlesGroupPanel.show(); |
|
449 |
} |
|
450 |
|
|
451 |
if(!ValuesOfFields.getInstance().getYaxis().isEmpty()){ |
|
452 |
yaxisTextBox.setText(ValuesOfFields.getInstance().getYaxis()); |
|
453 |
titlesGroupPanel.show(); |
|
454 |
} |
|
455 |
|
|
456 |
if(!ValuesOfFields.getInstance().getSubtitle().isEmpty()){ |
|
457 |
subtitleTextBox.setText(ValuesOfFields.getInstance().getSubtitle()); |
|
458 |
titlesGroupPanel.show(); |
|
459 |
} |
|
460 |
} |
|
461 |
|
|
462 | 409 |
generalTab.add(masterPanel); |
463 | 410 |
|
464 | 411 |
} |
modules/uoa-stats-config/branches/json/src/main/java/eu/dnetlib/client/leftColumn/TitlesPanel.java | ||
---|---|---|
1 |
package eu.dnetlib.client.leftColumn; |
|
2 |
|
|
3 |
import com.github.gwtbootstrap.client.ui.AccordionGroup; |
|
4 |
import com.github.gwtbootstrap.client.ui.Button; |
|
5 |
import com.github.gwtbootstrap.client.ui.CheckBox; |
|
6 |
import com.github.gwtbootstrap.client.ui.Form; |
|
7 |
import com.github.gwtbootstrap.client.ui.ListBox; |
|
8 |
import com.github.gwtbootstrap.client.ui.Tab; |
|
9 |
import com.github.gwtbootstrap.client.ui.TextBox; |
|
10 |
import com.github.gwtbootstrap.client.ui.constants.ButtonType; |
|
11 |
import com.github.gwtbootstrap.client.ui.constants.FormType; |
|
12 |
import com.github.gwtbootstrap.client.ui.constants.IconType; |
|
13 |
import com.github.gwtbootstrap.client.ui.event.HideEvent; |
|
14 |
import com.github.gwtbootstrap.client.ui.event.HideHandler; |
|
15 |
import com.github.gwtbootstrap.client.ui.event.ShowEvent; |
|
16 |
import com.github.gwtbootstrap.client.ui.event.ShowHandler; |
|
17 |
import com.google.gwt.event.dom.client.ChangeEvent; |
|
18 |
import com.google.gwt.event.dom.client.ChangeHandler; |
|
19 |
import com.google.gwt.event.dom.client.ClickEvent; |
|
20 |
import com.google.gwt.event.dom.client.ClickHandler; |
|
21 |
import com.google.gwt.event.dom.client.LoadEvent; |
|
22 |
import com.google.gwt.event.dom.client.LoadHandler; |
|
23 |
import com.google.gwt.user.client.ui.FlowPanel; |
|
24 |
import com.google.gwt.user.client.ui.IsWidget; |
|
25 |
import com.google.gwt.user.client.ui.Widget; |
|
26 |
|
|
27 |
import eu.dnetlib.client.Generate; |
|
28 |
import eu.dnetlib.client.widgets.FormFieldSet; |
|
29 |
import eu.dnetlib.shared.ValuesOfFields; |
|
30 |
|
|
31 |
public class TitlesPanel implements IsWidget{ |
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
private FlowPanel flowPanel = new FlowPanel(); |
|
36 |
private Button applyChanges = new Button(); |
|
37 |
|
|
38 |
|
|
39 |
public TitlesPanel(boolean isFromLoad, Tab titlesTab) { |
|
40 |
|
|
41 |
FlowPanel masterPanel = new FlowPanel(); |
|
42 |
|
|
43 |
applyChanges.setText("Apply"); |
|
44 |
applyChanges.addStyleName("applychanges"); |
|
45 |
applyChanges.setType(ButtonType.PRIMARY); |
|
46 |
applyChanges.addClickHandler(new ClickHandler() { |
|
47 |
|
|
48 |
@Override |
|
49 |
public void onClick(ClickEvent event) { |
|
50 |
// TODO Auto-generated method stub |
|
51 |
applyChanges.setEnabled(false); |
|
52 |
applyChanges.removeStyleName("flashing-button-apply"); |
|
53 |
Generate.getInstance().getTheme1().addLoadHandler(new LoadHandler() { |
|
54 |
|
|
55 |
@Override |
|
56 |
public void onLoad(LoadEvent event) { |
|
57 |
applyChanges.setEnabled(true); |
|
58 |
} |
|
59 |
}); |
|
60 |
Generate.getInstance().generateURLs(ValuesOfFields.getInstance(),1); |
|
61 |
} |
|
62 |
}); |
|
63 |
|
|
64 |
Form headersForm = new Form(); |
|
65 |
|
|
66 |
final TextBox titleTextBox = new TextBox(); |
|
67 |
titleTextBox.addChangeHandler(new ChangeHandler() { |
|
68 |
|
|
69 |
@Override |
|
70 |
public void onChange(ChangeEvent arg0) { |
|
71 |
// TODO Auto-generated method stub |
|
72 |
ValuesOfFields.getInstance().setTitle(titleTextBox.getText().replaceAll("\"", "\\\\\"")); |
|
73 |
|
|
74 |
applyChanges.addStyleName("flashing-button-apply"); |
|
75 |
} |
|
76 |
}); |
|
77 |
headersForm.add(new FormFieldSet("Chart title", titleTextBox)); |
|
78 |
|
|
79 |
final TextBox subtitleTextBox = new TextBox(); |
|
80 |
subtitleTextBox.addChangeHandler(new ChangeHandler() { |
|
81 |
|
|
82 |
@Override |
|
83 |
public void onChange(ChangeEvent arg0) { |
|
84 |
ValuesOfFields.getInstance().setSubtitle(subtitleTextBox.getText().replaceAll("\"", "\\\\\"")); |
|
85 |
applyChanges.addStyleName("flashing-button-apply"); |
|
86 |
} |
|
87 |
}); |
|
88 |
headersForm.add(new FormFieldSet("Chart subtitle", subtitleTextBox)); |
|
89 |
|
|
90 |
final TextBox xaxisTextBox = new TextBox(); |
|
91 |
xaxisTextBox.addChangeHandler(new ChangeHandler() { |
|
92 |
|
|
93 |
@Override |
|
94 |
public void onChange(ChangeEvent arg0) { |
|
95 |
// TODO Auto-generated method stub |
|
96 |
ValuesOfFields.getInstance().setXaxis(xaxisTextBox.getText().replaceAll("\"", "\\\\\"")); |
|
97 |
applyChanges.addStyleName("flashing-button-apply"); |
|
98 |
} |
|
99 |
}); |
|
100 |
headersForm.add(new FormFieldSet("Naming x-axis", xaxisTextBox)); |
|
101 |
|
|
102 |
final TextBox yaxisTextBox = new TextBox(); |
|
103 |
yaxisTextBox.addChangeHandler(new ChangeHandler() { |
|
104 |
|
|
105 |
@Override |
|
106 |
public void onChange(ChangeEvent arg0) { |
|
107 |
// TODO Auto-generated method stub |
|
108 |
ValuesOfFields.getInstance().setYaxis(yaxisTextBox.getText().replaceAll("\"", "\\\\\"")); |
|
109 |
applyChanges.addStyleName("flashing-button-apply"); |
|
110 |
} |
|
111 |
}); |
|
112 |
headersForm.add(new FormFieldSet("Naming y-axis", yaxisTextBox)); |
|
113 |
|
|
114 |
final AccordionGroup titlesGroupPanel = new AccordionGroup(); |
|
115 |
titlesGroupPanel.addStyleName("accordionPanel"); |
|
116 |
titlesGroupPanel.setHeading("TITLE OPTIONS"); |
|
117 |
titlesGroupPanel.getHeading().addStyleName("accordionHeading"); |
|
118 |
titlesGroupPanel.add(headersForm); |
|
119 |
titlesGroupPanel.add(applyChanges); |
|
120 |
titlesGroupPanel.setIcon(IconType.MINUS); |
|
121 |
titlesGroupPanel.setDefaultOpen(true); |
|
122 |
titlesGroupPanel.addShowHandler(new ShowHandler() { |
|
123 |
@Override |
|
124 |
public void onShow(ShowEvent showEvent) { |
|
125 |
titlesGroupPanel.setIcon(IconType.MINUS); |
|
126 |
} |
|
127 |
}); |
|
128 |
titlesGroupPanel.addHideHandler(new HideHandler() { |
|
129 |
@Override |
|
130 |
public void onHide(HideEvent hideEvent) { |
|
131 |
titlesGroupPanel.setIcon(IconType.PLUS); |
|
132 |
} |
|
133 |
}); |
|
134 |
|
|
135 |
masterPanel.add(titlesGroupPanel); |
|
136 |
|
|
137 |
if(isFromLoad){ |
|
138 |
if(!ValuesOfFields.getInstance().getTitle().isEmpty()){ |
|
139 |
titleTextBox.setText(ValuesOfFields.getInstance().getTitle()); |
|
140 |
titlesGroupPanel.show(); |
|
141 |
} |
|
142 |
|
|
143 |
if(!ValuesOfFields.getInstance().getXaxis().isEmpty()){ |
|
144 |
xaxisTextBox.setText(ValuesOfFields.getInstance().getXaxis()); |
|
145 |
titlesGroupPanel.show(); |
|
146 |
} |
|
147 |
|
|
148 |
if(!ValuesOfFields.getInstance().getYaxis().isEmpty()){ |
|
149 |
yaxisTextBox.setText(ValuesOfFields.getInstance().getYaxis()); |
|
150 |
titlesGroupPanel.show(); |
|
151 |
} |
|
152 |
|
|
153 |
if(!ValuesOfFields.getInstance().getSubtitle().isEmpty()){ |
|
154 |
subtitleTextBox.setText(ValuesOfFields.getInstance().getSubtitle()); |
|
155 |
titlesGroupPanel.show(); |
|
156 |
} |
|
157 |
} |
|
158 |
|
|
159 |
flowPanel.add(masterPanel); |
|
160 |
|
|
161 |
|
|
162 |
} |
|
163 |
|
|
164 |
|
|
165 |
|
|
166 |
@Override |
|
167 |
public Widget asWidget() { |
|
168 |
return flowPanel; |
|
169 |
} |
|
170 |
|
|
171 |
|
|
172 |
|
|
173 |
|
|
174 |
|
|
175 |
|
|
176 |
} |
modules/uoa-stats-config/branches/json/src/main/java/eu/dnetlib/client/leftColumn/DataserieWidget.java | ||
---|---|---|
14 | 14 |
import com.github.gwtbootstrap.client.ui.base.IconAnchor; |
15 | 15 |
import com.github.gwtbootstrap.client.ui.constants.AlternateSize; |
16 | 16 |
import com.github.gwtbootstrap.client.ui.constants.ButtonType; |
17 |
import com.github.gwtbootstrap.client.ui.constants.FormType; |
|
18 | 17 |
import com.github.gwtbootstrap.client.ui.constants.IconSize; |
19 | 18 |
import com.github.gwtbootstrap.client.ui.constants.IconType; |
20 | 19 |
import com.github.gwtbootstrap.client.ui.event.HideEvent; |
... | ... | |
22 | 21 |
import com.github.gwtbootstrap.client.ui.event.ShowEvent; |
23 | 22 |
import com.github.gwtbootstrap.client.ui.event.ShowHandler; |
24 | 23 |
import com.google.gwt.dom.client.Element; |
24 |
import com.google.gwt.dom.client.Style.Display; |
|
25 | 25 |
import com.google.gwt.dom.client.Style.Overflow; |
26 | 26 |
import com.google.gwt.dom.client.Style.Unit; |
27 | 27 |
import com.google.gwt.event.dom.client.BlurEvent; |
... | ... | |
40 | 40 |
import com.google.gwt.event.logical.shared.SelectionEvent; |
41 | 41 |
import com.google.gwt.event.logical.shared.SelectionHandler; |
42 | 42 |
import com.google.gwt.user.client.Timer; |
43 |
import com.google.gwt.user.client.Window; |
|
44 |
import com.google.gwt.user.client.ui.FlexTable; |
|
45 | 43 |
import com.google.gwt.user.client.ui.FlowPanel; |
46 |
import com.google.gwt.user.client.ui.HorizontalPanel; |
|
47 | 44 |
import com.google.gwt.user.client.ui.Tree; |
48 | 45 |
import com.google.gwt.user.client.ui.TreeItem; |
49 | 46 |
import com.google.gwt.user.client.ui.Widget; |
... | ... | |
84 | 81 |
private final DropdownListWidget splitBy = new DropdownListWidget(); |
85 | 82 |
private ArrayList<FiltersPanel> filtersPanels = new ArrayList<FiltersPanel>(); |
86 | 83 |
private final Button applyChanges = new Button(); |
84 |
private final TextBox renameTextBox = new TextBox(); |
|
87 | 85 |
|
88 | 86 |
private final Image enabled = new Image( |
89 | 87 |
"https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/512/checked_checkbox.png"); |
... | ... | |
104 | 102 |
return singleColumn; |
105 | 103 |
} |
106 | 104 |
|
105 |
public TextBox getRenameTextBox(){ |
|
106 |
return renameTextBox; |
|
107 |
} |
|
107 | 108 |
|
108 | 109 |
public interface DeleteListener { |
109 | 110 |
public void onEvent(int numberOfColumn); |
... | ... | |
164 | 165 |
if (loadPresets && (specialColumnCounter == 0 || specialColumnCounter == 1)) { |
165 | 166 |
loadPresetChartTypes(optionsSelected); |
166 | 167 |
} |
168 |
|
|
169 |
|
|
167 | 170 |
} |
168 | 171 |
|
169 | 172 |
public void addDataserie() { |
... | ... | |
176 | 179 |
masterPanel.addStyleName("dataseries-content"); |
177 | 180 |
|
178 | 181 |
|
179 |
final TextBox renameTextBox = new TextBox(); |
|
180 | 182 |
renameTextBox.setAlternateSize(AlternateSize.MEDIUM); |
181 | 183 |
singleColumn.addDecorate(renameTextBox); |
182 | 184 |
renameTextBox.setVisible(false); |
... | ... | |
196 | 198 |
@Override |
197 | 199 |
public void onBlur(BlurEvent event) { |
198 | 200 |
if (renameTextBox.getText().trim().length() > 0) { |
199 |
singleColumn.setHeading(renameTextBox.getText()); |
|
200 |
generalOptionsGroupPanel.setHeading("DATASERIES \"" + singleColumn.getHeading() + "\""); |
|
201 |
ValuesOfFields.getInstance().getColumnsDataList() |
|
202 |
.get(numberOfCurrentColumn) |
|
203 |
.setXaxisTitle(singleColumn.getHeading()); |
|
204 |
//Generate.getInstance().generateURLs( |
|
205 |
// ValuesOfFields.getInstance(), 1); |
|
201 |
String finalTitle = new String(); |
|
202 |
if(renameTextBox.getText().length()>13){ |
|
203 |
finalTitle = renameTextBox.getText().substring(0,13) + "..."; |
|
204 |
}else{ |
|
205 |
finalTitle = renameTextBox.getText(); |
|
206 |
} |
|
207 |
|
|
208 |
singleColumn.setHeading(finalTitle); |
|
209 |
singleColumn.asWidget().setTitle(renameTextBox.getText()); |
|
210 |
generalOptionsGroupPanel.setHeading("DATASERIES \"" + singleColumn.asWidget().getTitle() + "\""); |
|
211 |
|
|
206 | 212 |
applyChanges.addStyleName("flashing-button-apply"); |
207 | 213 |
|
208 | 214 |
} else {// if only contains whitespaces |
209 | 215 |
singleColumn.setHeading("untitled"); |
216 |
singleColumn.asWidget().setTitle("untitled"); |
|
210 | 217 |
generalOptionsGroupPanel |
211 | 218 |
.setHeading("DATASERIES untitled"); |
212 | 219 |
} |
... | ... | |
215 | 222 |
.get(numberOfCurrentColumn) |
216 | 223 |
.setHeading( |
217 | 224 |
"APPEARANCE FOR \"untitled\"" ); |
218 |
|
|
225 |
ValuesOfFields.getInstance().getColumnsDataList().get(numberOfCurrentColumn).setDataserieNaming(singleColumn.asWidget().getTitle()); |
|
219 | 226 |
renameTextBox.setVisible(false); |
220 | 227 |
edit.setVisible(true); |
221 | 228 |
enabled.setVisible(true); |
... | ... | |
224 | 231 |
|
225 | 232 |
}); |
226 | 233 |
|
234 |
singleColumn.addClickHandler(new ClickHandler() { |
|
235 |
|
|
236 |
@Override |
|
237 |
public void onClick(ClickEvent event) { |
|
238 |
// TODO Auto-generated method stub |
|
239 |
if(singleColumn.isActive()){ |
|
240 |
renameTextBox.setText(singleColumn.asWidget().getTitle()); |
|
241 |
singleColumn.setHeading(""); |
|
242 |
renameTextBox.setSelectionRange(0, renameTextBox.getText() |
|
243 |
.length()); |
|
244 |
renameTextBox.setVisible(true); |
|
245 |
renameTextBox.setFocus(true); |
|
246 |
edit.setVisible(false); |
|
247 |
enabled.setVisible(false); |
|
248 |
deleteImage.setVisible(false); |
|
249 |
} |
|
250 |
} |
|
251 |
}); |
|
252 |
|
|
227 | 253 |
singleColumn.asWidget().addStyleName("dataserie-tab"); |
228 | 254 |
singleColumn.asWidget().addDomHandler(new DoubleClickHandler() { |
229 | 255 |
|
230 | 256 |
@Override |
231 | 257 |
public void onDoubleClick(DoubleClickEvent event) { |
232 | 258 |
|
233 |
renameTextBox.setText(singleColumn.getHeading());
|
|
259 |
renameTextBox.setText(singleColumn.asWidget().getTitle());
|
|
234 | 260 |
singleColumn.setHeading(""); |
235 | 261 |
renameTextBox.setSelectionRange(0, renameTextBox.getText() |
236 | 262 |
.length()); |
... | ... | |
248 | 274 |
|
249 | 275 |
@Override |
250 | 276 |
public void onClick(ClickEvent event) { |
251 |
if (enabled |
|
252 |
.getUrl() |
|
253 |
.equals("https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/512/unchecked_checkbox.png")) { |
|
277 |
if (enabled.getUrl().equals("https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/512/unchecked_checkbox.png")) { |
|
254 | 278 |
enabled.setUrl("https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/512/checked_checkbox.png"); |
255 | 279 |
ValuesOfFields.getInstance().getColumnsDataList() |
256 | 280 |
.get(numberOfCurrentColumn).setEnabled(true); |
... | ... | |
261 | 285 |
} |
262 | 286 |
Generate.getInstance().generateURLs( |
263 | 287 |
ValuesOfFields.getInstance(), 1); |
264 |
//applyChanges.addStyleName("flashing-button-apply"); |
|
265 | 288 |
} |
266 | 289 |
}); |
267 | 290 |
|
... | ... | |
272 | 295 |
@Override |
273 | 296 |
public void onClick(ClickEvent clickEvent) { |
274 | 297 |
|
275 |
renameTextBox.setText(singleColumn.getHeading());
|
|
298 |
renameTextBox.setText(singleColumn.asWidget().getTitle());
|
|
276 | 299 |
singleColumn.setHeading(""); |
277 |
renameTextBox.setSelectionRange(0, renameTextBox.getText() |
|
278 |
.length()); |
|
300 |
renameTextBox.setSelectionRange(0, renameTextBox.getText().length()); |
|
279 | 301 |
renameTextBox.setVisible(true); |
280 | 302 |
renameTextBox.setFocus(true); |
281 | 303 |
edit.setVisible(false); |
... | ... | |
307 | 329 |
bringSameOriginOptions(); |
308 | 330 |
} |
309 | 331 |
|
332 |
Generate.getInstance().generateURLs(ValuesOfFields.getInstance(), 1); |
|
310 | 333 |
|
311 |
Generate.getInstance().generateURLs( |
|
312 |
ValuesOfFields.getInstance(), 1); |
|
313 |
//applyChanges.addStyleName("flashing-button-apply"); |
|
314 |
|
|
315 | 334 |
} |
316 | 335 |
}); |
317 | 336 |
|
337 |
|
|
338 |
|
|
318 | 339 |
|
319 | 340 |
designOptionsForDataserie(singleColumn, totalColumns, |
320 | 341 |
specialColumnCounter); |
... | ... | |
322 | 343 |
deleteImageList.add(deleteImage); |
323 | 344 |
singleColumn.addDecorate(deleteImage); |
324 | 345 |
singleColumn.asTabLink().add(enabled); |
325 |
singleColumn.asTabLink().add(edit); |
|
346 |
//singleColumn.asTabLink().add(edit); |
|
347 |
|
|
348 |
if(!isFromLoad){ |
|
349 |
renameTextBox.setText(""); |
|
350 |
renameTextBox.setPlaceholder("Name your dataseries.."); |
|
351 |
singleColumn.setHeading(""); |
|
352 |
renameTextBox.setSelectionRange(0, renameTextBox.getText() |
|
353 |
.length()); |
|
354 |
renameTextBox.setVisible(true); |
|
355 |
|
|
356 |
edit.setVisible(false); |
|
357 |
enabled.setVisible(false); |
|
358 |
deleteImage.setVisible(false); |
|
359 |
renameTextBox.setFocus(true); |
|
360 |
} |
|
326 | 361 |
} |
362 |
|
|
327 | 363 |
|
328 | 364 |
public void designOptionsForDataserie(Tab whereToAttach, int certainColumn, |
329 | 365 |
final int numberOfCurrentColumn) { |
330 | 366 |
|
331 | 367 |
FlowPanel overallPanel = new FlowPanel(); |
332 |
HorizontalPanel aggPanel = new HorizontalPanel(); |
|
368 |
FlowPanel aggPanel = new FlowPanel(); |
|
369 |
final DropdownListWidget x_axisListBox = new DropdownListWidget(); |
|
333 | 370 |
final RadioButton totalNumberRadio = new RadioButton("Total number"); |
334 | 371 |
totalNumberRadio.setText("Total number"); |
335 | 372 |
final RadioButton aggRadio = new RadioButton(""); |
336 | 373 |
final DropdownListWidget y_axisListBox = new DropdownListWidget(); |
374 |
aggRadio.addStyleName("radio-button-accordion"); |
|
375 |
totalNumberRadio.addStyleName("radio-button-accordion"); |
|
376 |
|
|
337 | 377 |
|
378 |
typeOfChart.getListBox().getElement().getStyle().setWidth(90.0, Unit.PCT); |
|
379 |
tableListBox.getElement().getStyle().setWidth(90.0, Unit.PCT); |
|
380 |
splitBy.getListBox().getElement().getStyle().setWidth(90.0, Unit.PCT); |
|
381 |
x_axisListBox.getListBox().getElement().getStyle().setWidth(90.0, Unit.PCT); |
|
338 | 382 |
|
339 |
|
|
383 |
|
|
340 | 384 |
totalNumberRadio.addClickHandler(new ClickHandler() { |
341 | 385 |
|
342 | 386 |
@Override |
... | ... | |
347 | 391 |
ValuesOfFields.getInstance().getColumnsDataList().get(numberOfCurrentColumn).setY_values("*"); |
348 | 392 |
ValuesOfFields.getInstance().getColumnsDataList().get(numberOfCurrentColumn).setTypeOf("count"); |
349 | 393 |
ValuesOfFields.getInstance().getColumnsDataList().get(numberOfCurrentColumn).setIndexOfTypeOf(0); |
394 |
ValuesOfFields.getInstance().setYaxis(totalNumberRadio.getText()); |
|
350 | 395 |
applyChanges.addStyleName("flashing-button-apply"); |
351 | 396 |
|
352 | 397 |
} |
... | ... | |
364 | 409 |
|
365 | 410 |
|
366 | 411 |
Form generalOptionsForm = new Form(); |
367 |
generalOptionsForm.setType(FormType.HORIZONTAL); |
|
412 |
//generalOptionsForm.setType(FormType.HORIZONTAL);
|
|
368 | 413 |
|
369 | 414 |
designOptionsForTypeOfChart(typeOfChart); |
370 | 415 |
|
371 |
final DropdownListWidget x_axisListBox = new DropdownListWidget(); |
|
372 |
generalOptionsForm.add(new FormFieldSet("Type of chart", typeOfChart |
|
373 |
.asWidget())); |
|
374 |
generalOptionsForm.add(new FormFieldSet("Table", tableListBox)); |
|
375 |
generalOptionsForm.add(new FormFieldSet("X axis", x_axisListBox |
|
376 |
.asWidget())); |
|
416 |
|
|
417 |
|
|
377 | 418 |
listBoxes.add(x_axisListBox); |
378 | 419 |
|
379 | 420 |
TreeListener treeListener = new TreeListener() { |
... | ... | |
394 | 435 |
aggPanel.add(aggregateListBox); |
395 | 436 |
aggPanel.add(y_axisListBox); |
396 | 437 |
// tempPanel.getElement().getStyle().setMarginLeft(-82.0, Unit.PX); |
438 |
aggregateListBox.getElement().getStyle().setDisplay(Display.INLINE_BLOCK); |
|
439 |
y_axisListBox.asWidget().getElement().getStyle().setDisplay(Display.INLINE_BLOCK); |
|
397 | 440 |
|
398 | 441 |
overallPanel.add(totalNumberRadio); |
399 | 442 |
overallPanel.add(aggPanel); |
400 | 443 |
|
401 | 444 |
FormFieldSet finalFieldSet = new FormFieldSet("", overallPanel); |
402 |
finalFieldSet.asWidget().getElement().getStyle().setMarginLeft(-76.0, Unit.PX); |
|
445 |
generalOptionsForm.add(new FormFieldSet("Type of chart", typeOfChart.asWidget())); |
|
446 |
generalOptionsForm.add(new FormFieldSet("What do you want to see?", tableListBox)); |
|
447 |
|
|
403 | 448 |
generalOptionsForm.add(finalFieldSet); |
404 | 449 |
|
450 |
generalOptionsForm.add(new FormFieldSet("How do you want to break down?", x_axisListBox.asWidget())); |
|
405 | 451 |
aggregateListBox.setSize(2); |
406 | 452 |
aggregateListBox.addItem("avg of"); |
407 | 453 |
aggregateListBox.addItem("count of"); |
... | ... | |
426 | 472 |
ValuesOfFields.getInstance().getColumnsDataList() |
427 | 473 |
.get(numberOfCurrentColumn) |
428 | 474 |
.setIndexOfTypeOf(aggregateListBox.getSelectedIndex()); |
475 |
ValuesOfFields.getInstance().setYaxis(aggregateListBox.getSelectedItemText() + " " + y_axisListBox.getListBox().getSelectedItemText()); |
|
429 | 476 |
//Generate.getInstance().generateURLs( |
430 | 477 |
// ValuesOfFields.getInstance(), 1); |
431 | 478 |
applyChanges.addStyleName("flashing-button-apply"); |
... | ... | |
664 | 711 |
bringAllOfCertainTable(x_axisListBox, false); |
665 | 712 |
} else { |
666 | 713 |
bringAllOfCertainTable(x_axisListBox, false); |
667 |
x_axisListBox.getListBox().addItem( |
|
668 |
ValuesOfFields.getInstance().getColumnsDataList() |
|
669 |
.get(numberOfCurrentColumn).getX_values()); |
|
714 |
x_axisListBox.getListBox().addItem( ValuesOfFields.getInstance().getColumnsDataList().get(numberOfCurrentColumn).getXaxisTitle()); |
|
670 | 715 |
x_axisListBox.getListBox().setSelectedIndex(0); |
671 | 716 |
} |
672 | 717 |
} else if (ValuesOfFields.getInstance().getColumnsDataList().size() > 1) { |
... | ... | |
677 | 722 |
} else { |
678 | 723 |
bringSameOriginOptions(); |
679 | 724 |
// bringAllOfCertainTable(x_axisListBox, false); |
680 |
listBoxes |
|
681 |
.get(numberOfCurrentColumn) |
|
682 |
.getListBox() |
|
683 |
.addItem( |
|
684 |
ValuesOfFields.getInstance() |
|
685 |
.getColumnsDataList() |
|
686 |
.get(numberOfCurrentColumn) |
|
687 |
.getXaxisTitle()); |
|
688 |
listBoxes.get(numberOfCurrentColumn).getListBox() |
|
689 |
.setSelectedIndex(0); |
|
725 |
listBoxes.get(numberOfCurrentColumn).getListBox().addItem(ValuesOfFields.getInstance().getColumnsDataList().get(numberOfCurrentColumn).getXaxisTitle()); |
|
726 |
listBoxes.get(numberOfCurrentColumn).getListBox().setSelectedIndex(0); |
|
690 | 727 |
} |
691 | 728 |
} else { |
692 | 729 |
// min fereis tpt |
... | ... | |
721 | 758 |
ValuesOfFields.getInstance().getColumnsDataList() |
722 | 759 |
.get(numberOfCurrentColumn) |
723 | 760 |
.setX_values(splitted[0]); |
724 |
ValuesOfFields |
|
725 |
.getInstance() |
|
726 |
.getColumnsDataList() |
|
727 |
.get(numberOfCurrentColumn) |
|
728 |
.setXaxisTitle( |
|
729 |
event.getSelectedItem().getText()); |
|
761 |
ValuesOfFields.getInstance().getColumnsDataList().get(numberOfCurrentColumn).setXaxisTitle(event.getSelectedItem().getText()); |
|
730 | 762 |
// Generate.getInstance().generateURLs( |
731 | 763 |
// ValuesOfFields.getInstance(), 1); |
732 | 764 |
applyChanges.addStyleName("flashing-button-apply"); |
... | ... | |
862 | 894 |
aggregateListBox.addItem("sum of"); |
863 | 895 |
|
864 | 896 |
} |
865 |
//Generate.getInstance().generateURLs( |
|
866 |
// ValuesOfFields.getInstance(), 1); |
|
897 |
ValuesOfFields.getInstance().setYaxis(aggregateListBox.getSelectedItemText() + " " + y_axisListBox.getListBox().getSelectedItemText()); |
|
898 |
masterPanel.getElement().getStyle().clearOverflow(); |
|
899 |
masterPanel.getElement().getStyle().setOverflow(Overflow.AUTO); |
|
900 |
|
|
867 | 901 |
applyChanges.addStyleName("flashing-button-apply"); |
868 | 902 |
} |
869 | 903 |
}); |
... | ... | |
874 | 908 |
ValuesOfFields.getInstance().getColumnsDataList().get(numberOfCurrentColumn).setY_values("*"); |
875 | 909 |
ValuesOfFields.getInstance().getColumnsDataList().get(numberOfCurrentColumn).setTypeOf("count"); |
876 | 910 |
ValuesOfFields.getInstance().getColumnsDataList().get(numberOfCurrentColumn).setIndexOfTypeOf(0); |
911 |
ValuesOfFields.getInstance().setYaxis("Total number"); |
|
877 | 912 |
|
878 | 913 |
} |
879 | 914 |
|
modules/uoa-stats-config/branches/json/src/main/java/eu/dnetlib/client/leftColumn/SingleFilterWidget.java | ||
---|---|---|
8 | 8 |
import com.github.gwtbootstrap.client.ui.constants.BackdropType; |
9 | 9 |
import com.github.gwtbootstrap.client.ui.constants.IconSize; |
10 | 10 |
import com.github.gwtbootstrap.client.ui.constants.IconType; |
11 |
import com.google.gwt.dom.client.Style.Display; |
|
11 | 12 |
import com.google.gwt.event.dom.client.ClickEvent; |
12 | 13 |
import com.google.gwt.event.dom.client.ClickHandler; |
13 | 14 |
import com.google.gwt.user.client.Window; |
... | ... | |
116 | 117 |
isForEdit=filterWidget.isForEdit; |
117 | 118 |
applyFinalListener.onEvent(); |
118 | 119 |
} |
119 |
Window.alert(numberOfFilter + " as index for edit"); |
|
120 | 120 |
filterWidget.setIndexForEdit(numberOfFilter); |
121 | 121 |
} |
122 | 122 |
}; |
... | ... | |
135 | 135 |
content.add(new HTML("<div style=\"letter-spacing:1.5px; margin-left: 140px; font-size: 15px; font-weight: bold\">"+"</div>")); |
136 | 136 |
|
137 | 137 |
HTML fieldChosen = new HTML(); |
138 |
|
|
138 |
fieldChosen.getElement().getStyle().setDisplay(Display.INLINE_BLOCK); |
|
139 | 139 |
fieldChosen.setHTML("<dl class=\"dl-horizontal\"><dt>Field</dt><dd>" + filtersData.getDisplayedFieldValue() + "</dd></dl>"); |
140 | 140 |
content.add(fieldChosen); |
141 | 141 |
|
142 | 142 |
if(filtersData.getType().equals("Continuous")){ |
143 | 143 |
|
144 | 144 |
HTML valuesChosen = new HTML(); |
145 |
|
|
145 |
valuesChosen.getElement().getStyle().setDisplay(Display.INLINE_BLOCK); |
|
146 | 146 |
valuesChosen.setHTML("<dl class=\"dl-horizontal\"><dt>Values</dt><dd>" + filtersData.getValueFrom() + " - " + filtersData.getValueTo() + "</dd></dl>"); |
147 | 147 |
content.add(valuesChosen); |
148 | 148 |
|
... | ... | |
157 | 157 |
} |
158 | 158 |
|
159 | 159 |
HTML valuesChosen = new HTML(); |
160 |
valuesChosen.getElement().getStyle().setDisplay(Display.INLINE_BLOCK); |
|
160 | 161 |
valuesChosen.setHTML("<dl class=\"dl-horizontal\"><dt>Values</dt><dd>" + finalValues + "</dd></dl>"); |
161 | 162 |
content.add(valuesChosen); |
162 | 163 |
} |
... | ... | |
164 | 165 |
final IconAnchor remove = new IconAnchor(); |
165 | 166 |
remove.setIcon(IconType.REMOVE); |
166 | 167 |
remove.setTitle("Removes the filter"); |
167 |
remove.setIconSize(IconSize.TWO_TIMES);
|
|
168 |
remove.setIconSize(IconSize.DEFAULT);
|
|
168 | 169 |
remove.addStyleName("displayBlock"); |
169 | 170 |
remove.addClickHandler(new ClickHandler() { |
170 | 171 |
@Override |
... | ... | |
179 | 180 |
|
180 | 181 |
final IconAnchor edit = new IconAnchor(); |
181 | 182 |
edit.setIcon(IconType.EDIT); |
182 |
edit.setTitle("Opens a modal to edit the filter's information");
|
|
183 |
edit.setIconSize(IconSize.TWO_TIMES);
|
|
183 |
edit.setTitle("Edit the filter's information");
|
|
184 |
edit.setIconSize(IconSize.DEFAULT);
|
|
184 | 185 |
edit.addStyleName("displayBlock"); |
185 | 186 |
edit.addClickHandler(new ClickHandler() { |
186 | 187 |
@Override |
... | ... | |
191 | 192 |
|
192 | 193 |
final IconAnchor enabled = new IconAnchor(); |
193 | 194 |
|
195 |
|
|
194 | 196 |
enabled.setIcon(IconType.CHECK); |
195 | 197 |
enabled.setTitle("Enable or disable the filter"); |
196 |
enabled.setIconSize(IconSize.TWO_TIMES);
|
|
198 |
enabled.setIconSize(IconSize.DEFAULT);
|
|
197 | 199 |
enabled.addStyleName("displayBlock"); |
198 | 200 |
enabled.addClickHandler(new ClickHandler() { |
199 | 201 |
@Override |
... | ... | |
210 | 212 |
Generate.getInstance().generateURLs(ValuesOfFields.getInstance(),1); |
211 | 213 |
} |
212 | 214 |
}); |
215 |
if(isFromLoad){ |
|
216 |
if(ValuesOfFields.getInstance().getColumnsDataList().get(numberOfCurrentColumn).getFilters().get(numberOfFilter).isEnabled()){ |
|
217 |
enabled.setIcon(IconType.CHECK); |
|
218 |
isChecked = true; |
|
219 |
}else{ |
|
220 |
enabled.setIcon(IconType.CHECK_EMPTY); |
|
221 |
isChecked=false; |
|
222 |
} |
|
223 |
} |
|
213 | 224 |
|
214 | 225 |
|
215 | 226 |
contentPanel.add(content); |
modules/uoa-stats-config/branches/json/src/main/java/eu/dnetlib/client/Generate.java | ||
---|---|---|
185 | 185 |
}else{ |
186 | 186 |
URL_theme1 = URL_theme1.concat("&steps=false"); |
187 | 187 |
} |
188 |
|
|
188 |
URL_theme1 = URL_theme1.concat("&fontFamily="+fieldsValues.getFontFamily()); |
|
189 | 189 |
URL_theme1 = URL_theme1.concat("&spacing=["+fieldsValues.getSpacingTop()+","+fieldsValues.getSpacingRight()+","+fieldsValues.getSpacingBottom()+","+fieldsValues.getSpacingLeft()+"]"); |
190 | 190 |
URL_theme1 = URL_theme1.concat("&style=[{\"color\":\""+fieldsValues.getColorTitle()+"\",\"size\":\""+fieldsValues.getSizeTitle()+"\"},{\"color\":\""+fieldsValues.getColorSubtitle()+"\",\"size\":\""+fieldsValues.getSizeSubtitle()+"\"},{\"color\":\""+fieldsValues.getColorXaxis()+"\",\"size\":\""+fieldsValues.getSizeXaxis()+"\"},{\"color\":\""+fieldsValues.getColorYaxis()+"\",\"size\":\""+fieldsValues.getSizeYaxis()+"\"}]"); |
191 | 191 |
|
modules/uoa-stats-config/branches/json/src/main/java/eu/dnetlib/client/rightColumn/DataBox.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.client.rightColumn; |
2 | 2 |
|
3 |
import com.github.gwtbootstrap.client.ui.Heading; |
|
3 | 4 |
import com.github.gwtbootstrap.client.ui.constants.AlertType; |
4 | 5 |
import com.google.gwt.core.client.JsonUtils; |
5 | 6 |
import com.google.gwt.http.client.Request; |
... | ... | |
30 | 31 |
|
31 | 32 |
|
32 | 33 |
RootPanel.get("tableChart").clear(); |
34 |
final Heading infoHeading = new Heading(3); |
|
35 |
infoHeading.setText("The table of contents will be displayed here.."); |
|
36 |
infoHeading.addStyleName("info-preview"); |
|
37 |
RootPanel.get("tableChart").add(infoHeading); |
|
33 | 38 |
//designFakeDataBox(); |
34 | 39 |
} |
35 | 40 |
|
modules/uoa-stats-config/branches/json/src/main/webapp/StatsConfig.css | ||
---|---|---|
377 | 377 |
} |
378 | 378 |
|
379 | 379 |
.accordionPanel .control-label { |
380 |
width: 130px !important;
|
|
380 |
width: 90% !important;
|
|
381 | 381 |
} |
382 | 382 |
|
383 |
.accordionPanel > .controls { |
|
384 |
width:90% !important; |
|
385 |
} |
|
383 | 386 |
.accordionPanel .controls { |
384 |
margin-left: 150px !important; |
|
387 |
margin-left: 2% !important; |
|
388 |
margin-right: 2% !important; |
|
385 | 389 |
} |
386 | 390 |
|
387 |
.accordion-inner form { |
|
388 |
margin: 15px 0 !important; |
|
391 |
.accordion-inner > form { |
|
392 |
/*margin: 15px 0 !important;*/ |
|
393 |
margin-right:2%; |
|
394 |
margin-left:2%; |
|
389 | 395 |
} |
390 | 396 |
|
397 |
.accordion-inner > select { |
|
398 |
width:90% !important; |
|
399 |
} |
|
400 |
|
|
391 | 401 |
#accordionGeneral > .accordion-body{ |
392 | 402 |
overflow:visible !important; |
393 | 403 |
} |
... | ... | |
422 | 432 |
} |
423 | 433 |
|
424 | 434 |
.flashing-button{ |
425 |
-webkit-animation-name:successAnim; |
|
426 |
-webkit-animation-duration:3s; |
|
427 |
-webkit-animation-iteration-count : infinite; |
|
428 |
animation-name:successAnim; |
|
429 |
animation-duration:3s; |
|
430 |
animation-iteration-count: infinite; |
|
431 |
|
|
435 |
background-color:#ff9999; |
|
432 | 436 |
} |
433 | 437 |
|
434 | 438 |
|
... | ... | |
651 | 655 |
border: 1px dashed #ccc; |
652 | 656 |
margin: 10px 5px; |
653 | 657 |
padding: 15px; |
654 |
width: 75%;
|
|
658 |
width: 70%;
|
|
655 | 659 |
} |
656 | 660 |
|
657 | 661 |
.singleFilter-content dl { |
... | ... | |
718 | 722 |
} |
719 | 723 |
|
720 | 724 |
.displayBlock { |
721 |
display: block; |
|
725 |
/* display: block; */ |
|
726 |
margin-left:4px; |
|
722 | 727 |
} |
723 | 728 |
|
724 | 729 |
.deleteIcon { |
... | ... | |
773 | 778 |
margin-left:80%; |
774 | 779 |
} |
775 | 780 |
|
776 |
.controls > select { |
|
777 |
margin-right:30px; |
|
778 |
} |
|
781 |
.radio-button-accordion { |
|
782 |
margin-left : 6%; |
|
783 |
margin-right : 10px; |
|
784 |
text-align:left; |
|
785 |
min-height:0px !important; |
|
786 |
padding-left: 0px !important; |
|
787 |
} |
|
788 |
|
|
789 |
.accordion-inner > select { |
|
790 |
width : 90% !important; |
|
791 |
} |
|
792 |
|
|
793 |
select:enabled { |
|
794 |
background-color:white !important; |
|
795 |
} |
Also available in: Unified diff