package presentation; import java.util.Collection; import java.util.List; import format.*; /** * A Slide is the unit of the presentation that is displayed on screen. * A Slide is displayed in a fixed-aspect-ratio viewport, and the * presentation building procedures, for the most part, limit the content * on a slide to what will fit in the viewport. However, topics * that are expandable or have extended associated content may cause a * scrollbar to appear. *

* A Slide contains one or more topics, whose name and any associated * content are displayed on the slide. */ public abstract class Slide { /** Topics displayed on the slide. */ List topics; /** Whether drawing tools can currently be used on the slide. */ boolean drawable; /** * Expands the current topic in the slide. */ /*@ requires // //The topic is expandable // (topic.expandable == true) && // //The topic is currently collapsed // (topic.expandedInSlide == false); ensures // //If the topic is expandable and not already expanded, it gets expanded in the slide // (topic.expandedInSlide) && // // The slide cannot be drawn on while the topic is expanded // (!drawable); */ abstract void expandTopic(Topic topic); /** * Collapses the current topic in the slide. */ /*@ requires // //The topic is expandable // (topic.expandable == true) && // //The topic is already expanded // (topic.expandedInSlide); ensures // //If the topic is expandable and already expanded, it gets collapsed in the slide // (topic.expandedInSlide == false) && // //If no other topics are expanded, the slide can be drawn on // (drawable <==> (\forall Topic t; topics.contains(t); !t.expandedInSlide)) ; */ abstract void collapseTopic(Topic topic); }