|
| 1 | +package com.example.awt; |
| 2 | + |
| 3 | +import java.awt.AWTException; |
| 4 | +import java.awt.BufferCapabilities; |
| 5 | +import java.awt.Frame; |
| 6 | +import java.awt.GraphicsConfiguration; |
| 7 | + |
| 8 | +import liquidjava.specification.ExternalRefinementsFor; |
| 9 | +import liquidjava.specification.Refinement; |
| 10 | +import liquidjava.specification.StateRefinement; |
| 11 | +import liquidjava.specification.StateSet; |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +@ExternalRefinementsFor("java.awt.Window") |
| 16 | +@StateSet({"invisible", "visible"}) |
| 17 | +@StateSet({"displayable", "notDisplayable"}) |
| 18 | +@StateSet({"notFullscreen", "fullscreen"}) |
| 19 | +@StateSet({"decorated", "undecorated"}) |
| 20 | +public interface Window { |
| 21 | + @StateRefinement(to="invisible(this)") |
| 22 | + @StateRefinement(to="notDisplayable(this)") |
| 23 | + @StateRefinement(to="fullscreen(this)") |
| 24 | + @StateRefinement(to="undecorated(this)") |
| 25 | + void Window(Frame owner); |
| 26 | + |
| 27 | + @StateRefinement(to="invisible(this)") |
| 28 | + @StateRefinement(to="notDisplayable(this)") |
| 29 | + @StateRefinement(to="fullscreen(this)") |
| 30 | + @StateRefinement(to="undecorated(this)") |
| 31 | + void Window(Window owner); |
| 32 | + |
| 33 | + @StateRefinement(to="invisible(this)") |
| 34 | + @StateRefinement(to="notDisplayable(this)") |
| 35 | + @StateRefinement(to="fullscreen(this)") |
| 36 | + @StateRefinement(to="undecorated(this)") |
| 37 | + void Window(Window owner, GraphicsConfiguration gc); |
| 38 | + |
| 39 | + @StateRefinement(from="notDisplayable(this)") |
| 40 | + void setType(java.awt.Window.Type type); |
| 41 | + |
| 42 | + @StateRefinement(to="displayable(this)") |
| 43 | + public void addNotify(); |
| 44 | + |
| 45 | + @StateRefinement(to="displayable(this)") |
| 46 | + public void pack(); |
| 47 | + |
| 48 | + // Check this |
| 49 | + @StateRefinement(to="ite(visible, displayable(this), true) && ite(visible, visible(this), invisible(this))") |
| 50 | + public void setVisible(boolean visible); |
| 51 | + |
| 52 | + @StateRefinement(from="displayable(this)", to="notDisplayable(this) && invisible(this)") |
| 53 | + public void dispose(); |
| 54 | + |
| 55 | + @StateRefinement(from="displayable(this)") |
| 56 | + public void createBufferStrategy(@Refinement("numBuffers >= 1") int numBuffers); |
| 57 | + |
| 58 | + public void createBufferStrategy(@Refinement("numBuffers >= 1") int numBuffers, BufferCapabilities caps) throws AWTException; |
| 59 | + |
| 60 | + // Check this, not intuitive from javadoc |
| 61 | + @StateRefinement(from="undecorated(this) || notFullscreen(this) || opacity == 1.0") |
| 62 | + public void setOpacity(@Refinement("opacity >= 0.0 && opacity <= 1.0") float opacity); |
| 63 | + |
| 64 | + |
| 65 | + // TODO: Requires NULL support and constants |
| 66 | + // public void setShape(Shape shape); |
| 67 | +} |
0 commit comments