Tool to display Walter Giers' notebooks in either chronological or in random order
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

notizheftanzeiger.pde 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import java.util.*;
  2. //////// Config
  3. int mode = RANDOM; //NORMAL or RANDOM order
  4. float timerTime = 250; //in milliseconds how long slide is shown
  5. float transitionTime = 100; //how long it takes to fade the next slide in. must not be greater than "timerTime"
  6. boolean displayText = true; //if the "date" should be written on screen
  7. boolean displayTimeline = true; //if the timeline should be drawn on screen
  8. //
  9. Timer timer;
  10. ArrayList<Notebook> notebooks = new ArrayList<Notebook>();
  11. PImage currentSlide, nextSlide;
  12. int currentNotebookNo, currentSlideNo;
  13. int startTransitionTime;
  14. boolean transition;
  15. float transitionProgress;
  16. final static int NORMAL = 0;
  17. final static int RANDOM = 1;
  18. String[] save;
  19. void setup() {
  20. //fullScreen(); //if using fullScreen, comment the next line
  21. size(960, 540);
  22. fill(255);
  23. save = loadStrings(dataPath("") + "/save.sav");
  24. currentNotebookNo = int(save[0]);
  25. currentSlideNo = int(save[1]);
  26. if (displayTimeline) {
  27. textSize(20);
  28. textAlign(CENTER);
  29. } else {
  30. textSize(20);
  31. }
  32. timer = new Timer(timerTime);
  33. createNotebooks();
  34. currentSlide = Slide(currentNotebookNo, currentSlideNo);
  35. //if (mode == RANDOM) nextSlide();
  36. }
  37. void draw() {
  38. timer.update();
  39. tint(255, 255);
  40. image(currentSlide, 0, 0, width, height);
  41. if (transition) {
  42. transitionProgress = map(millis(), startTransitionTime, startTransitionTime + transitionTime, 0, 255);
  43. tint(255, transitionProgress);
  44. image(nextSlide, 0, 0, width, height);
  45. if (millis() - startTransitionTime > transitionTime) {
  46. save[0] = str(currentNotebookNo);
  47. save[1] = str(currentSlideNo);
  48. saveStrings(dataPath("") + "/save.sav", save);
  49. currentSlide = nextSlide;
  50. transitionProgress = 0;
  51. transition = false;
  52. }
  53. }
  54. if (displayTimeline) {
  55. stroke(255, 127);
  56. strokeWeight(4);
  57. line(50, height-30, width-50, height-30);
  58. int xPos = (int)map(notebooks.get(currentNotebookNo).year, 1966, 2012, 50, width-50);
  59. ellipse(xPos, height-30, 20, 20);
  60. if (displayText) text(notebooks.get(currentNotebookNo).year, xPos, height-50);
  61. } else {
  62. if (displayText) text(notebooks.get(currentNotebookNo).dateText, 20, 40);
  63. }
  64. }