org.xwt
Class Surface

java.lang.Object
  extended byorg.xwt.PixelBuffer
      extended byorg.xwt.Surface
Direct Known Subclasses:
Surface.DoubleBufferedSurface

public abstract class Surface
extends PixelBuffer

A Surface, as described in the XWT Reference. Platform subclasses should include an inner class subclass of Surface to return from the Platform._createSurface() method Note that the members in the section 'state variables' are either in real-time (the actual size/position/state), or in Scheduler-time (the size/position/state at the time that the now-executing message was enqueued). This distinction is important.


Nested Class Summary
static class Surface.DoubleBufferedSurface
           
 class Surface.SimpleMessage
           
 
Field Summary
static Vec allSurfaces
          all instances of Surface which need to be refreshed by the Scheduler
static boolean alt
           
static boolean button1
           
static boolean button2
           
static boolean button3
           
static boolean control
           
 java.lang.String cursor
          < The Box at the root of this surface
 boolean maximized
           
 boolean minimized
           
 int mousex
           
 int mousey
           
 Box root
           
static boolean shift
           
 
Constructor Summary
Surface(Box root)
           
 
Method Summary
abstract  void _dispose()
           
protected abstract  void _setMaximized(boolean b)
           
protected abstract  void _setMinimized(boolean b)
           
protected abstract  void _setSize(int width, int height)
           
protected  void Click(int button)
           
protected  void Close()
           
 void dirty(int x, int y, int w, int h)
           
 void dispose(boolean quitIfAllSurfacesGone)
          Indicates that the Surface is no longer needed
protected  void DoubleClick(int button)
           
protected  void Focused(boolean b)
           
 int getHeight()
           
 int getWidth()
           
protected  void KeyPressed(java.lang.String key)
          sends a KeyPressed message; subclasses should not add the C- or A- prefixes, nor should they capitalize alphabet characters
protected  void KeyReleased(java.lang.String key)
          sends a KeyReleased message; subclasses should not add the C- or A- prefixes, nor should they capitalize alphabet characters
protected  void Maximized(boolean b)
           
protected  void Minimized(boolean b)
           
protected  void Move(int newmousex, int newmousey)
          Notify XWT that the mouse has moved.
protected  void PosChange(int x, int y)
           
protected  void Press(int button)
           
static void Refresh()
           
protected  void Release(int button)
           
 void render()
          runs the prerender() and render() pipelines in the root Box to regenerate the backbuffer, then blits it to the screen
abstract  void setIcon(Picture i)
           
abstract  void setInvisible(boolean b)
           
 void setLimits(int min_width, int min_height, int max_width, int max_height)
           
abstract  void setLocation()
           
 void setMaximized(boolean b)
           
 void setMinimized(boolean b)
           
protected  void setSize(int width, int height)
           
abstract  void setTitleBarText(java.lang.String s)
           
protected  void SizeChange(int width, int height)
           
abstract  void syncCursor()
           
abstract  void toBack()
           
abstract  void toFront()
           
 
Methods inherited from class org.xwt.PixelBuffer
drawLine, drawPicture, drawPictureAlphaOnly, fillTrapezoid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allSurfaces

public static Vec allSurfaces
all instances of Surface which need to be refreshed by the Scheduler


alt

public static boolean alt

control

public static boolean control

shift

public static boolean shift

button1

public static boolean button1

button2

public static boolean button2

button3

public static boolean button3

root

public Box root

cursor

public java.lang.String cursor
< The Box at the root of this surface


mousex

public int mousex

mousey

public int mousey

minimized

public boolean minimized

maximized

public boolean maximized
Constructor Detail

Surface

public Surface(Box root)
Method Detail

getWidth

public int getWidth()

getHeight

public int getHeight()

toBack

public abstract void toBack()

toFront

public abstract void toFront()

syncCursor

public abstract void syncCursor()

setInvisible

public abstract void setInvisible(boolean b)

_setMaximized

protected abstract void _setMaximized(boolean b)

_setMinimized

protected abstract void _setMinimized(boolean b)

setLocation

public abstract void setLocation()

setTitleBarText

public abstract void setTitleBarText(java.lang.String s)

setIcon

public abstract void setIcon(Picture i)

_dispose

public abstract void _dispose()

setLimits

public void setLimits(int min_width,
                      int min_height,
                      int max_width,
                      int max_height)

_setSize

protected abstract void _setSize(int width,
                                 int height)

setSize

protected final void setSize(int width,
                             int height)

Press

protected final void Press(int button)

Release

protected final void Release(int button)

Click

protected final void Click(int button)

DoubleClick

protected final void DoubleClick(int button)

KeyPressed

protected final void KeyPressed(java.lang.String key)
sends a KeyPressed message; subclasses should not add the C- or A- prefixes, nor should they capitalize alphabet characters


KeyReleased

protected final void KeyReleased(java.lang.String key)
sends a KeyReleased message; subclasses should not add the C- or A- prefixes, nor should they capitalize alphabet characters


Move

protected final void Move(int newmousex,
                          int newmousey)
Notify XWT that the mouse has moved. If the mouse leaves the surface, but the host windowing system does not provide its new position (for example, a Java MouseListener.mouseExited() message), the subclass should use (-1,-1).


SizeChange

protected final void SizeChange(int width,
                                int height)

PosChange

protected final void PosChange(int x,
                               int y)

Close

protected final void Close()

Minimized

protected final void Minimized(boolean b)

Maximized

protected final void Maximized(boolean b)

Focused

protected final void Focused(boolean b)

Refresh

public static void Refresh()

setMaximized

public final void setMaximized(boolean b)

setMinimized

public final void setMinimized(boolean b)

dispose

public final void dispose(boolean quitIfAllSurfacesGone)
Indicates that the Surface is no longer needed


dirty

public void dirty(int x,
                  int y,
                  int w,
                  int h)

render

public void render()
runs the prerender() and render() pipelines in the root Box to regenerate the backbuffer, then blits it to the screen