org.cruxframework.crux.widgets.client.slideshow
Class SlideshowBaseController

java.lang.Object
  extended by org.cruxframework.crux.core.client.controller.crossdevice.DeviceAdaptiveController
      extended by org.cruxframework.crux.widgets.client.slideshow.SlideshowBaseController
All Implemented Interfaces:
com.google.gwt.user.client.ui.IsWidget, org.cruxframework.crux.core.client.screen.DeviceAdaptive, org.cruxframework.crux.core.client.screen.views.OrientationChangeHandler, Slideshow
Direct Known Subclasses:
SlideshowKeyboardController, SlideshowTouchController, SlideshowTvController

public abstract class SlideshowBaseController
extends org.cruxframework.crux.core.client.controller.crossdevice.DeviceAdaptiveController
implements Slideshow, org.cruxframework.crux.core.client.screen.views.OrientationChangeHandler

Author:
Thiago da Rosa de Bustamante

Nested Class Summary
protected static class SlideshowBaseController.SlideshowEvent
           
 
Nested classes/interfaces inherited from interface org.cruxframework.crux.widgets.client.slideshow.Slideshow
Slideshow.Layout, Slideshow.Name, Slideshow.Position
 
Nested classes/interfaces inherited from interface org.cruxframework.crux.core.client.screen.DeviceAdaptive
org.cruxframework.crux.core.client.screen.DeviceAdaptive.Device, org.cruxframework.crux.core.client.screen.DeviceAdaptive.Input, org.cruxframework.crux.core.client.screen.DeviceAdaptive.Size, org.cruxframework.crux.core.client.screen.DeviceAdaptive.Template, org.cruxframework.crux.core.client.screen.DeviceAdaptive.Templates
 
Field Summary
protected  int activeImage
           
protected  PhotoAlbum album
           
protected  com.google.gwt.user.client.Timer autoPlayTimer
           
protected  org.cruxframework.crux.core.client.collection.FastList<SlideshowComponent> components
           
protected  org.cruxframework.crux.core.client.collection.FastMap<com.google.gwt.user.client.ui.Image> imagesCache
           
protected  SlideshowPhotoPanel photoPanel
           
protected  boolean preloadNextImages
           
protected  int previousImage
           
protected  boolean SCALE_IMAGES
           
protected  com.google.gwt.user.client.ui.DockPanel table
           
protected  int transitionDelay
           
 
Constructor Summary
SlideshowBaseController()
           
 
Method Summary
 void addComponent(SlideshowComponent component, Slideshow.Position position)
           
protected  void adjustImageSize(com.google.gwt.user.client.ui.Widget referencePanel, Photo photo, com.google.gwt.user.client.ui.Image image)
           
abstract  void configurePhotoPanel()
           
 int getActivePhoto()
           
 PhotoAlbum getAlbum()
           
 AlbumService getAlbumService()
           
 Photo getPhoto(int index)
           
 int getPhotoCount()
           
 SlideshowPhotoPanel getPhotoPanel()
           
 int getTransitionDelay()
           
protected  boolean hasMorePhotos()
           
protected  void init()
           
 boolean isPlaying()
           
 boolean isPreloadNextImages()
           
 boolean isScaleImages()
           
 void load(AlbumService.Callback callback)
           
 com.google.gwt.user.client.ui.Image loadImage(int index)
           
protected  com.google.gwt.user.client.ui.Image loadImage(int index, boolean preloadNext)
           
 boolean next()
           
protected  void notifyComponents(SlideshowBaseController.SlideshowEvent event)
           
 void onOrientationChange()
           
 void play()
           
 boolean previous()
           
protected  void reset()
           
 void setAlbum(PhotoAlbum album)
           
 void setAlbumService(AlbumService albumService)
           
 void setHeight(SlideshowComponent component, String height)
           
 void setHorizontalAlignment(SlideshowComponent component, com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant align)
           
 void setLayout(Slideshow.Layout layout)
           
 void setPreloadNextImages(boolean preloadNextImages)
           
 void setScaleImages(boolean scaleImages)
           
 void setTransitionDelay(int transitionDelay)
           
 void setVerticalAlignment(SlideshowComponent component, com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant align)
           
 void setWidth(SlideshowComponent component, String width)
           
protected  void showComponents()
           
 void showFirstPhoto()
           
 void showPhoto(int index)
           
 void stop()
           
 
Methods inherited from class org.cruxframework.crux.core.client.controller.crossdevice.DeviceAdaptiveController
addAttachHandler, addHandler, addWidget, asWidget, fireEvent, getChildWidget, getElement, getStyleName, getTitle, isVisible, setHeight, setStyleName, setTitle, setVisible, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.cruxframework.crux.core.client.screen.DeviceAdaptive
addAttachHandler, addHandler, getElement, getStyleName, getTitle, isVisible, setHeight, setStyleName, setTitle, setVisible, setWidth
 
Methods inherited from interface com.google.gwt.user.client.ui.IsWidget
asWidget
 

Field Detail

SCALE_IMAGES

protected boolean SCALE_IMAGES

photoPanel

protected SlideshowPhotoPanel photoPanel

album

protected PhotoAlbum album

table

protected com.google.gwt.user.client.ui.DockPanel table

imagesCache

protected org.cruxframework.crux.core.client.collection.FastMap<com.google.gwt.user.client.ui.Image> imagesCache

components

protected org.cruxframework.crux.core.client.collection.FastList<SlideshowComponent> components

activeImage

protected int activeImage

previousImage

protected int previousImage

autoPlayTimer

protected com.google.gwt.user.client.Timer autoPlayTimer

preloadNextImages

protected boolean preloadNextImages

transitionDelay

protected int transitionDelay
Constructor Detail

SlideshowBaseController

public SlideshowBaseController()
Method Detail

setLayout

public void setLayout(Slideshow.Layout layout)
Specified by:
setLayout in interface Slideshow
Parameters:
layout -

play

public void play()
Specified by:
play in interface Slideshow

stop

public void stop()
Specified by:
stop in interface Slideshow

isPlaying

public boolean isPlaying()
Specified by:
isPlaying in interface Slideshow
Returns:

next

public boolean next()
Specified by:
next in interface Slideshow
Returns:

previous

public boolean previous()
Specified by:
previous in interface Slideshow
Returns:

addComponent

public void addComponent(SlideshowComponent component,
                         Slideshow.Position position)
Specified by:
addComponent in interface Slideshow
Parameters:
component -
direction -

getTransitionDelay

public int getTransitionDelay()
Specified by:
getTransitionDelay in interface Slideshow
Returns:

setTransitionDelay

public void setTransitionDelay(int transitionDelay)
Specified by:
setTransitionDelay in interface Slideshow
Parameters:
transitionDelay -

setHorizontalAlignment

public void setHorizontalAlignment(SlideshowComponent component,
                                   com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant align)
Specified by:
setHorizontalAlignment in interface Slideshow
Parameters:
component -
align -

setVerticalAlignment

public void setVerticalAlignment(SlideshowComponent component,
                                 com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant align)
Specified by:
setVerticalAlignment in interface Slideshow
Parameters:
component -
align -

setHeight

public void setHeight(SlideshowComponent component,
                      String height)
Specified by:
setHeight in interface Slideshow
Parameters:
component -
height -

setWidth

public void setWidth(SlideshowComponent component,
                     String width)
Specified by:
setWidth in interface Slideshow
Parameters:
component -
width -

setAlbum

public void setAlbum(PhotoAlbum album)
Specified by:
setAlbum in interface Slideshow
Parameters:
album -

showFirstPhoto

public void showFirstPhoto()
Specified by:
showFirstPhoto in interface Slideshow

getAlbum

public PhotoAlbum getAlbum()
Specified by:
getAlbum in interface Slideshow
Returns:

showPhoto

public void showPhoto(int index)
Specified by:
showPhoto in interface Slideshow
Parameters:
index -

loadImage

public com.google.gwt.user.client.ui.Image loadImage(int index)
Specified by:
loadImage in interface Slideshow
Parameters:
index -
Returns:

showComponents

protected void showComponents()

getActivePhoto

public int getActivePhoto()
Specified by:
getActivePhoto in interface Slideshow
Returns:

getPhotoPanel

public SlideshowPhotoPanel getPhotoPanel()
Specified by:
getPhotoPanel in interface Slideshow

getPhoto

public Photo getPhoto(int index)
Specified by:
getPhoto in interface Slideshow
Parameters:
index -
Returns:

getPhotoCount

public int getPhotoCount()
Specified by:
getPhotoCount in interface Slideshow
Returns:

isPreloadNextImages

public boolean isPreloadNextImages()
Specified by:
isPreloadNextImages in interface Slideshow
Returns:

setPreloadNextImages

public void setPreloadNextImages(boolean preloadNextImages)
Specified by:
setPreloadNextImages in interface Slideshow
Parameters:
preloadNextImages -

getAlbumService

public AlbumService getAlbumService()
Specified by:
getAlbumService in interface Slideshow

setAlbumService

public void setAlbumService(AlbumService albumService)
Specified by:
setAlbumService in interface Slideshow

load

public void load(AlbumService.Callback callback)
Specified by:
load in interface Slideshow

onOrientationChange

public void onOrientationChange()
Specified by:
onOrientationChange in interface org.cruxframework.crux.core.client.screen.views.OrientationChangeHandler

init

protected void init()
Overrides:
init in class org.cruxframework.crux.core.client.controller.crossdevice.DeviceAdaptiveController

configurePhotoPanel

public abstract void configurePhotoPanel()

loadImage

protected com.google.gwt.user.client.ui.Image loadImage(int index,
                                                        boolean preloadNext)
Parameters:
index -
preloadNext -
Returns:

adjustImageSize

protected void adjustImageSize(com.google.gwt.user.client.ui.Widget referencePanel,
                               Photo photo,
                               com.google.gwt.user.client.ui.Image image)
Parameters:
referencePanel -
photo -
image -

hasMorePhotos

protected boolean hasMorePhotos()
Returns:

notifyComponents

protected void notifyComponents(SlideshowBaseController.SlideshowEvent event)
Parameters:
event -

reset

protected void reset()

isScaleImages

public boolean isScaleImages()
Specified by:
isScaleImages in interface Slideshow

setScaleImages

public void setScaleImages(boolean scaleImages)
Specified by:
setScaleImages in interface Slideshow


Copyright © 2015. All rights reserved.