Added new get methods

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/gis-viewer@124137 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2016-02-12 16:03:20 +00:00
parent bd602f9fba
commit 01ee152592
2 changed files with 62 additions and 37 deletions

View File

@ -79,19 +79,8 @@ implements ToolbarHandler, DataPanelHandler, LayersPanelHandler, CqlFilterHandle
private GisViewerLayout mainPanel;
private LayersPanel layersPanel;
private OpenLayersMap openLayersMap;
/**
* Gets the open layers map.
*
* @return the openLayersMap
*/
public OpenLayersMap getOpenLayersMap() {
return openLayersMap;
}
private ToolBarPanel toolBarPanel;
private GisViewerServiceAsync gisViewerServiceAsync;
private GisViewerSaveHandler gisViewerSaveHandler;
private GisViewerParameters parameters;
private String projection;
@ -1327,4 +1316,23 @@ implements ToolbarHandler, DataPanelHandler, LayersPanelHandler, CqlFilterHandle
first = false;
}
}
/**
* Gets the open layers map.
*
* @return the openLayersMap
*/
public OpenLayersMap getOpenLayersMap() {
return openLayersMap;
}
/**
* Gets the tool bar panel.
*
* @return the toolBarPanel
*/
public ToolBarPanel getToolBarPanel() {
return toolBarPanel;
}
}

View File

@ -23,7 +23,7 @@ import com.google.gwt.user.client.ui.Label;
public class ToolBarPanel extends ToolBar {
private OpenLayersMap om;
private HorizontalPanel transectPanel = new HorizontalPanel();
private Label labelTransect = new Label("Draw a line for a transect on the layer ");
@ -36,6 +36,7 @@ public class ToolBarPanel extends ToolBar {
private Button zoomOutButton = new Button();
private ToggleButton clickDataToggle = new ToggleButton();
private ToggleButton boxDataToggle = new ToggleButton();
private Button removeDataButton = new Button();
private Button exportButton;
private Button saveMapImageButton;
@ -68,7 +69,7 @@ public class ToolBarPanel extends ToolBar {
public ToolBarPanel(ToolbarHandler toolbarHandler, OpenLayersMap om) {
super();
super();
this.om = om;
this.toolBarHandler = toolbarHandler;
@ -88,8 +89,8 @@ public class ToolBarPanel extends ToolBar {
//this.add(zoomOutButton);
this.add(clickDataToggle);
this.add(boxDataToggle);
this.add(removeDataButton);
this.add(removeDataButton);
//COMMENTED BY FRANCESCO M.
this.add(new SeparatorMenuItem());
@ -106,16 +107,16 @@ public class ToolBarPanel extends ToolBar {
/**
*
*
*/
private void setOpenBrowserMapImageBox() {
// layer export
// layer export
exportButton = new Button("", Images.iconExport());
exportButton.setToolTip(EXPORT_TOOLTIP);
Menu menuExport = new Menu();
menuExport.setStyleName("gisViewerMenu");
int i=0;
for (final ExportFormat saveItem : ExportFormat.values()) {
for (final ExportFormat saveItem : ExportFormat.values()) {
menuExport.add(new MenuItem(saveItem.getLabel(), saveItem.getImg(), new SelectionListener<MenuEvent>(){
@Override
public void componentSelected(MenuEvent ce) {
@ -123,22 +124,22 @@ public class ToolBarPanel extends ToolBar {
}
}));
}
exportButton.setMenu(menuExport);
exportButton.setMenu(menuExport);
}
/**
*
*
*/
private void setSaveMapImageBox() {
// layer export
// layer export
saveMapImageButton = new Button("", Images.iconSave());
saveMapImageButton.setToolTip(SAVE_TOOLTIP);
Menu menuExport = new Menu();
menuExport.setStyleName("gisViewerMenu");
int i=0;
for (final ExportFormat saveItem : ExportFormat.values()) {
for (final ExportFormat saveItem : ExportFormat.values()) {
menuExport.add(new MenuItem(saveItem.getLabel(), saveItem.getImg(), new SelectionListener<MenuEvent>(){
@Override
public void componentSelected(MenuEvent ce) {
@ -146,25 +147,25 @@ public class ToolBarPanel extends ToolBar {
}
}));
}
saveMapImageButton.setMenu(menuExport);
saveMapImageButton.setMenu(menuExport);
}
/**
*
*
*/
private void addTransectBox() {
labelTransect.setStyleName("vertical_middle");
transectPanel.setBorders(true);
transectPanel.add(labelTransect);
transectPanel.setStyleName("geo-panel-body");
add(new Html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"));
transectPanel.setVisible(false);
add(transectPanel);
}
@ -172,10 +173,10 @@ public class ToolBarPanel extends ToolBar {
/**
* @param button
* @param boxDataTooltip
* @param abstractImagePrototype
* @param boxDataTooltip
* @param abstractImagePrototype
*/
private void setUpBotton(Button button, AbstractImagePrototype img, String toolTip) {
private void setUpBotton(Button button, AbstractImagePrototype img, String toolTip) {
button.setIcon(img);
// button.addStyleName("iconOpenlayersToolbar");
button.setToolTip(toolTip);
@ -241,7 +242,7 @@ public class ToolBarPanel extends ToolBar {
zoomOutButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
om.zoomOut();
om.zoomOut();
}
});
}
@ -257,7 +258,7 @@ public class ToolBarPanel extends ToolBar {
}
/**
*
*
*/
private void setRemoveDataButton() {
setUpBotton(removeDataButton, Images.iconToolbarRemove(), REMOVE_DATA_TOOLTIP);
@ -298,7 +299,7 @@ public class ToolBarPanel extends ToolBar {
/**
*
*
*/
public void setAllUp() {
om.activateClickData(false);
@ -306,11 +307,11 @@ public class ToolBarPanel extends ToolBar {
om.activateZoomIn(false);
om.activatePan(false);
}
private void addProjectionBox(){
// TODO
}
/**
* Added by Francesco M.
* @return
@ -318,7 +319,7 @@ public class ToolBarPanel extends ToolBar {
public boolean isPointDataTogglePressed(){
return clickDataToggle.isPressed();
}
/**
* Added by Francesco M.
* @return
@ -326,4 +327,20 @@ public class ToolBarPanel extends ToolBar {
public boolean isBoxDataTogglePressed(){
return boxDataToggle.isPressed();
}
/**
* @return the clickDataToggle
*/
public ToggleButton getClickDataToggle() {
return clickDataToggle;
}
/**
* @return the boxDataToggle
*/
public ToggleButton getBoxDataToggle() {
return boxDataToggle;
}
}