Example usage for com.vaadin.client VConsole log

List of usage examples for com.vaadin.client VConsole log

Introduction

In this page you can find the example usage for com.vaadin.client VConsole log.

Prototype

public static void log(Throwable e) 

Source Link

Usage

From source file:org.semanticsoft.vaaclipse.widgets.client.ui.fastview.FastViewConnector.java

License:Open Source License

@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
    super.onStateChanged(stateChangeEvent);

    Set<String> changedProperties = stateChangeEvent.getChangedProperties();
    if (changedProperties.contains("side")) {
        getWidget().side = getState().side;
        getWidget().trimmedWindowClientArea = ((ComponentConnector) getState().trimmedWindowClientArea)
                .getWidget();//from ww  w.  j a  v  a2s.com

        VConsole.log("FastView: side = " + getState().side.toString());
        setPaneLocation();
    }
}

From source file:org.semanticsoft.vaaclipse.widgets.client.ui.fastview.FastViewConnector.java

License:Open Source License

public void setPaneLocation() {
    VFastView fastView = getWidget();//  w  ww .j a v  a  2 s . com

    if (fastView.side == null)
        return;

    //VConsole.log(RootPanel.get().toString());

    //VExtendedVerticalLayout trimmedWindowClientArea = findTrimmedWindowClientArea(RootPanel.get());
    Widget trimmedWindowClientArea = fastView.trimmedWindowClientArea;

    if (trimmedWindowClientArea != null) {
        VConsole.log("TrimmedWindowArea finded!");

        int x, y;
        int w = 600, h = 400;
        if (Side.LEFT.equals(fastView.side)) {
            x = trimmedWindowClientArea.getAbsoluteLeft();
            y = trimmedWindowClientArea.getAbsoluteTop();
        } else if (Side.RIGHT.equals(fastView.side)) {
            x = trimmedWindowClientArea.getAbsoluteLeft() + trimmedWindowClientArea.getOffsetWidth() - w;
            y = trimmedWindowClientArea.getAbsoluteTop();
        } else
            return;

        VConsole.log("Position: x=" + x + " y=" + y);

        fastView.setPopupPosition(x, y);
        fastView.setWidth(w + "px");
        fastView.setHeight(h + "px");
    } else
        VConsole.log("TrimmedWindowArea is null!");

}

From source file:org.semanticsoft.vaaclipse.widgets.client.ui.stackwidget.StackWidgetConnector.java

License:Open Source License

/**
 * Called whenever an update is received from the server
 *//*from   w ww.j av  a2s  . co  m*/
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
    VStackWidget stackWidget = getWidget();

    stackWidget.id = uidl.getId();
    stackWidget.client = client;

    if (uidl.getIntAttribute("svoi") == 5) {
        int state = uidl.getIntAttribute("vaadock_tabsheet_state");
        VConsole.log("VStackWidget: set initial state = " + state);
        stackWidget.setState(state);
        stackWidget.maximizeEnabled = uidl.getBooleanAttribute("maximize_enabled");
        stackWidget.minimizeEnabled = uidl.getBooleanAttribute("minimize_enabled");

        if (!stackWidget.maximizeEnabled)
            stackWidget.maximizeButton.setAttribute("style", "display: none;");
        if (!stackWidget.minimizeEnabled)
            stackWidget.minimizeButton.setAttribute("style", "display: none;");
    }

    if (isRealUpdate(uidl) && !uidl.hasAttribute("hidden")) {
        UIDL acceptCrit = uidl.getChildByTagName("-ac");
        if (acceptCrit == null) {
            getWidget().setDropHandler(null);
        } else {
            if (getWidget().getDropHandler() == null) {
                getWidget().setDropHandler(new VStackWidgetDropHandler(getWidget(), client));
                VConsole.log("updateFromUIDL: VStackWidgetDropHandler installed");
            }
            getWidget().getDropHandler().updateAcceptRules(acceptCrit);
        }
    }

    super.updateFromUIDL(uidl, client);
}

From source file:org.vaadin.addon.leaflet.client.LeafletMapConnector.java

License:Apache License

@Override
protected void init() {
    super.init();
    /*//from   ww  w .java 2 s. com
     * Working with state can be really painfull in some cases. E.g. if we
     * keep extent, center and stuff in state, we'll get false "changes" if
     * children are updated at the same time. In maps case we might get some
     * nasty rounding erros -> weird "effects". Thus we have to do all live
     * updates via RPC and store same stuff in state for initial renderings
     * and reattaches. It is sooo easy...
     */
    registerRpc(LeafletMapClientRpc.class, new LeafletMapClientRpc() {

        @Override
        public void setCenter(Double lat, Double lon, Double zoom) {
            VConsole.log("To be center : " + lat + " " + lon + " ");
            if (zoom == null) {
                zoom = map.getZoom();
            }
            LatLng center;
            if (lon == null) {
                center = map.getBounds().getCenter();
            } else {
                center = LatLng.create(lat, lon);
            }
            map.setView(center, zoom);
        }

        @Override
        public void zoomToExtent(Bounds b) {
            LatLngBounds bounds = toLeafletBounds(b);
            map.fitBounds(bounds);
        }

        @Override
        public void setMaxBounds(Bounds bounds) {
            map.setMaxBounds(toLeafletBounds(bounds));
        }

    });

    getLayoutManager().addElementResizeListener(getWidget().getElement(), this);

}

From source file:org.vaadin.addon.leaflet.client.LeafletMapConnector.java

License:Apache License

@Override
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent connectorHierarchyChangeEvent) {
    List<ComponentConnector> oldChildren = connectorHierarchyChangeEvent.getOldChildren();
    updateChildren = new ArrayList<ServerConnector>();
    for (ServerConnector componentConnector : getChildren()) {
        if (!oldChildren.contains(componentConnector)) {
            updateChildren.add(componentConnector);
        }/*from  w  ww .  j  a  va  2  s  . co  m*/
        oldChildren.remove(componentConnector);
    }
    for (ComponentConnector componentConnector : oldChildren) {
        // Instance of check for Popup's that don't extend AbstractLeafletLayerConnector
        if (componentConnector instanceof AbstractLeafletLayerConnector) {
            AbstractLeafletLayerConnector<?> c = (AbstractLeafletLayerConnector<?>) componentConnector;
            Layer layer = c.getLayer();
            try {
                map.removeLayer(layer);
                if (layersControl != null) {
                    layersControl.removeLayer(layer);
                }
            } catch (Exception e) {
                VConsole.log("Removing failed, possibly due to timing issue...");
            }
        }
    }

    updateChildrens();
}