Class GraphWindow

Class GraphWindow

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Dialog
                                   |
                                   +----GraphWindow

class GraphWindow
extends Dialog
GraphWindow is a window with a title bar, scrollbars, and a surface that users manipulate to draw and modify their graph.

GraphWindow(Frame, String, Zarbiff)
create a new GraphWindow.
GraphWindow(Frame, GraphInterface, String, Zarbiff)
create a GraphWindow for an already existing graph.

canvas()
get the canvas object for this window (the main area of the window that displays the graph)
coord()
get the Coordinates object for this window
disable()
grey out this window's scrollbars
enable()
reactivate this window's scrollbars after a disable
getInput()
get the input text field of the filter I/O
getText()
get the TextWindow object that is used for filter I/O
graph()
get the graph this window manipulates
handleEvent(Event)
Override standard Dialog handle event.
layout()
Called by AWT whenever the contents of this window (canvas, scrollbars, and little T button) need to be layed out.
minimumSize()
preferredSize()
setOutput(String)
set the output text field of the filter I/O
stripTitle()
extract filename from title
validate()
Should be called after creation of the window.

GraphWindow
  public GraphWindow(Frame parent,
                     String name,
                     Zarbiff z)
create a new GraphWindow.
parent: the parent frame that receives events not handled by the window
normally this is the main Zarbiff program
name: name of this window for titlebar
z: the main zarbiff program used by the GraphCanvas for this window

GraphWindow

  public GraphWindow(Frame parent,
                     GraphInterface g,
                     String name,
                     Zarbiff z)
create a GraphWindow for an already existing graph.
parent: the parent frame that receives events not handled by the window
normally this is the main Zarbiff program
g: an existing graph which this window will display and edit name: name of this window for titlebar
z: the main zarbiff program used by the GraphCanvas for this window

graph
  public GraphInterface graph()
get the graph this window manipulates

coord

  public Coordinates coord()
get the Coordinates object for this window

canvas

  public GraphCanvas canvas()
get the canvas object for this window (the main area of the window that displays the graph)

preferredSize

  public Dimension preferredSize()
minimumSize
  public Dimension minimumSize()
layout
  public void layout()
Called by AWT whenever the contents of this window (canvas, scrollbars, and little T button) need to be layed out. For example, this happens whenever the window changes size. We implement our own custom layout which uses pixel coordinates of objects. We do some serious fudging here in order to account for what we believe is a bug in the coordinates given to the window so that 0,0 is not the upper-left. If this is indeed a bug and it is later fixed then components might be layed out leaving empty space to the right of or below the scrollbars.
Overrides:
layout in class Container

stripTitle

  public String stripTitle()
extract filename from title

handleEvent

  public boolean handleEvent(Event evt)
Override standard Dialog handle event. Kill the window when it receives a destroy event. Catch scroll events and repaint the canvas. Catch absolute scroll events and inform the coordinates.
Overrides:
handleEvent in class Component

disable

  public void disable()
grey out this window's scrollbars
Overrides:
disable in class Component

enable

  public void enable()
reactivate this window's scrollbars after a disable
Overrides:
enable in class Component

validate

  public void validate()
Should be called after creation of the window. We don't know exactly what this does, but it seems to be important to the AWT for a window to work properly.
Overrides:
validate in class Container

getText

  public TextWindow getText()
get the TextWindow object that is used for filter I/O

setOutput

  public void setOutput(String str)
set the output text field of the filter I/O

getInput

  public String getInput()
get the input text field of the filter I/O