com.vaadin.addon.touchkit.settings
Class ViewPortSettings

java.lang.Object
  extended by com.vaadin.addon.touchkit.settings.ViewPortSettings
All Implemented Interfaces:
com.vaadin.server.BootstrapListener, Serializable, EventListener

public class ViewPortSettings
extends Object
implements com.vaadin.server.BootstrapListener

The ViewPortSettings class is responsible for configuring the viewport in the application bootstrap page. See the Apple developer documentation for details.

See Also:
Serialized Form

Constructor Summary
ViewPortSettings()
           
 
Method Summary
 Float getViewPortInitialScale()
           
 Float getViewPortMaximumScale()
           
 Float getViewPortMinimumScale()
           
 String getViewPortWidth()
           
 Boolean isViewPortUserScalable()
           
 void modifyBootstrapFragment(com.vaadin.server.BootstrapFragmentResponse response)
           
 void modifyBootstrapPage(com.vaadin.server.BootstrapPageResponse response)
           
 void setViewPortInitialScale(Float viewPortInitialScale)
          Sets the initial scale of the viewport.
 void setViewPortMaximumScale(Float viewPortMaximumScale)
          Sets the maximum scale allowed for the user.
 void setViewPortMinimumScale(Float viewPortMinimumScale)
          Sets the minimum scale allowed by the user.
 void setViewPortUserScalable(Boolean viewPortUserScalable)
          Sets whether the user should be allowed to zoom the content.
 void setViewPortWidth(String viewPortWidth)
          Sets the viewport width into which the client browsers should render the page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewPortSettings

public ViewPortSettings()
Method Detail

setViewPortUserScalable

public void setViewPortUserScalable(Boolean viewPortUserScalable)
Sets whether the user should be allowed to zoom the content. The default value for TouchKit apps is false, as we expect that applications are designed for smaller/all devices.

Parameters:
viewPortUserScalable - true to allow pinch-to-zoom

isViewPortUserScalable

public Boolean isViewPortUserScalable()
Returns:
true if the view port is user scalable (pinch-to-zoom)
See Also:
setViewPortUserScalable(Boolean)

setViewPortInitialScale

public void setViewPortInitialScale(Float viewPortInitialScale)
Sets the initial scale of the viewport.

Parameters:
viewPortInitialScale - The initial scale of the viewport as a multiplier.

getViewPortInitialScale

public Float getViewPortInitialScale()
Returns:
the initial scale of the viewport as a multiplier or null if none set.

setViewPortMaximumScale

public void setViewPortMaximumScale(Float viewPortMaximumScale)
Sets the maximum scale allowed for the user.

Parameters:
viewPortMaximumScale - the maximum scale allowed when zooming

getViewPortMaximumScale

public Float getViewPortMaximumScale()
Returns:
the maximum scale allowed for the user when zooming or null if none set.

setViewPortWidth

public void setViewPortWidth(String viewPortWidth)
Sets the viewport width into which the client browsers should render the page. The value can be pixels or "device-width". The device width constant is used as a default as we expect TouchKit Applications to be designed for small devices. If the value is null, browsers try to figure out a proper viewport width by themselves.

Parameters:
viewPortWidth - the requested viewport width.

getViewPortWidth

public String getViewPortWidth()
Returns:
the requested viewport width or null if none set.
See Also:
setViewPortWidth(String)

setViewPortMinimumScale

public void setViewPortMinimumScale(Float viewPortMinimumScale)
Sets the minimum scale allowed by the user.

Parameters:
viewPortMinimumScale - the minimum scale allowed when zooming.

getViewPortMinimumScale

public Float getViewPortMinimumScale()
Returns:
the minimum scale allowed when zooming.
See Also:
setViewPortMinimumScale(Float)

modifyBootstrapFragment

public void modifyBootstrapFragment(com.vaadin.server.BootstrapFragmentResponse response)
Specified by:
modifyBootstrapFragment in interface com.vaadin.server.BootstrapListener

modifyBootstrapPage

public void modifyBootstrapPage(com.vaadin.server.BootstrapPageResponse response)
Specified by:
modifyBootstrapPage in interface com.vaadin.server.BootstrapListener


Copyright © 2014 Vaadin Ltd. All rights reserved.