Advertisement
Guest User

Untitled

a guest
Oct 7th, 2015
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.29 KB | None | 0 0
  1. package org.test;
  2.  
  3. @SpringBootApplication
  4. @Configuration
  5. public class TestApplication {
  6.     public static void main(String[] args) {
  7.         SpringApplication.run(TestApplication.class, args);
  8.     }
  9. }
  10.  
  11. -----------------------------------
  12. package org.test;
  13.  
  14. @Widgetset("AppWidgetset")
  15. @PreserveOnRefresh
  16. @SpringUI
  17. public class TestUI extends UI {
  18.  
  19. //create Components, add them, etc
  20.  
  21. }
  22. -----------------------------------
  23.  
  24. package org.test.config;
  25. @Configuration
  26. public class TestConfig {
  27.     @Bean
  28.     ImageCache imageCache(){
  29.         return new ImageCache();
  30.     }
  31. }
  32.  
  33. -----------------------------------
  34.  
  35. ImageCache.java is nothing special just a class retrieving images from HTTP resources or if cached give them from disk
  36.  
  37. -----------------------------------
  38.  
  39. package org.test.ui;
  40. public class MovieComponent extends CustomComponent {
  41.     //some irrelevant fields
  42.  
  43.     @Autowired
  44.     private ImageCache imageCache;
  45.  
  46.     private static Integer COMPONENT_WIDTH = MovieSearchEngineComponent.posterSize.getWidth();
  47.     private static Integer COMPONENT_HEIGHT = MovieSearchEngineComponent.posterSize.getHeight();
  48.  
  49.     // public MovieComponent(MovieInfo movie) {
  50.     public MovieComponent(MovieDb movie) {
  51.         .....
  52.         imageCache.get(...);
  53.         ....
  54.         initGui();
  55.     }
  56.  
  57.     private void initGui() {
  58.         ........
  59.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement