Update Chart Viewer

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-resources-widget@101630 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-11-17 16:16:23 +00:00
parent 66b792dbf9
commit a29dd08952
1 changed files with 12 additions and 16 deletions

View File

@ -77,6 +77,8 @@ public class ChartViewerPanel extends FramedPanel {
private static final int DRAW_WIDTH_INT = 780;
private static final int DRAW_HEIGHT_INT = 380;
private static final int TOOLBAR_HEIGHT = 30;
private enum Operation {
ZOOMIN, ZOOMOUT, MOVE
};
@ -403,26 +405,23 @@ public class ChartViewerPanel extends FramedPanel {
}
}, MouseUpEvent.getType());
paint.addDomHandler(new MouseWheelHandler() {
@Override
public void onMouseWheel(MouseWheelEvent event) {
spriteMouseWheel(event);
}
}, MouseWheelEvent.getType());
layout.add(toolBar, new VerticalLayoutData(1, 26, new Margins(0)));
layout.add(toolBar, new VerticalLayoutData(1, TOOLBAR_HEIGHT,
new Margins(0)));
layout.add(paint, new VerticalLayoutData(1, 1, new Margins(0)));
}
protected void openInNewWindow() {
String link;
if (test) {
@ -474,7 +473,7 @@ public class ChartViewerPanel extends FramedPanel {
Log.debug("Offset width:" + DRAW_WIDTH_INT + " height:"
+ DRAW_HEIGHT_INT);
Log.debug("Fit Scale: " + fitScale);
Log.debug("Chart Dimension: "+chartDimension);
Log.debug("Chart Dimension: " + chartDimension);
chartSprite.setScaling(new Scaling(fitScale.getX(), fitScale.getY()));
chartScale = fitScale.copy();
@ -536,8 +535,6 @@ public class ChartViewerPanel extends FramedPanel {
mouseTimer.cancel();
}
}
protected void spriteLeave(SpriteOutEvent event) {
Event browseEvent = event.getBrowserEvent();
@ -569,19 +566,18 @@ public class ChartViewerPanel extends FramedPanel {
}
}
protected void spriteMouseWheel(MouseWheelEvent event) {
int deltaY=event.getDeltaY();
Log.debug("Wheel: "+deltaY);
if(deltaY<0){
int deltaY = event.getDeltaY();
Log.debug("Wheel: " + deltaY);
if (deltaY < 0) {
zoomIn();
} else {
zoomOut();
}
draw();
}
protected void actionOnChartSpriteWhenMove() {
Log.debug("Operation:" + activeOperation);