org.montsuqi.monsia
Class Interface

java.lang.Object
  extended by org.montsuqi.monsia.Interface

public class Interface
extends java.lang.Object

An class that represents the result of parsing Glade's interface definition.


Constructor Summary
Interface(java.util.List roots, Protocol protocol)
           
 
Method Summary
 void addAccels(java.awt.Component widget, WidgetInfo info)
           
 void addSignal(SignalData sData)
           
(package private)  void buildWidgetTree(java.util.List roots)
           
 java.awt.Component getWidget(java.lang.String name)
           
 java.awt.Component getWidgetByLongName(java.lang.String longName)
           
 java.lang.String getWidgetLongName(java.awt.Component widget)
           
static boolean handleAccels(java.awt.event.KeyEvent e)
           
static Interface parseInput(java.io.InputStream input, Protocol protocol)
          A factory method that builds an Interface instance.
 void setButtonGroup(javax.swing.JRadioButton button, java.lang.String groupName)
           
 void setDefaultWidget(java.awt.Component widget)
           
 void setFocusWidget(java.awt.Component widget)
           
 void setLongName(java.lang.String longName, java.awt.Component widget)
           
 void setMenuBar(javax.swing.JMenuBar menuBar)
           
 void setName(java.lang.String name, java.awt.Component widget)
           
 void setTopLevel(java.awt.Component widget)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Interface

Interface(java.util.List roots,
          Protocol protocol)
Method Detail

setDefaultWidget

public void setDefaultWidget(java.awt.Component widget)

setFocusWidget

public void setFocusWidget(java.awt.Component widget)

parseInput

public static Interface parseInput(java.io.InputStream input,
                                   Protocol protocol)

A factory method that builds an Interface instance.

This method takes its source XML from input InputStream and parses it using a SAX parser.

SAX parser is selected in following way:

  1. If system property "monsia.document.handler" is set, use it.
  2. Otherwise, if the input's beginning looks like old interface definition(root element is GTK-Interface and such), old handler is used.
  3. Otherwise, new handler is used.

Parameters:
input - source input stream from which the Glade file is read.
protocol - protocol(connection) object passed to signal connectors.
Returns:
an Interface instance.

getWidget

public java.awt.Component getWidget(java.lang.String name)

getWidgetByLongName

public java.awt.Component getWidgetByLongName(java.lang.String longName)

getWidgetLongName

public java.lang.String getWidgetLongName(java.awt.Component widget)

setButtonGroup

public void setButtonGroup(javax.swing.JRadioButton button,
                           java.lang.String groupName)

setTopLevel

public void setTopLevel(java.awt.Component widget)

addSignal

public void addSignal(SignalData sData)

addAccels

public void addAccels(java.awt.Component widget,
                      WidgetInfo info)

buildWidgetTree

void buildWidgetTree(java.util.List roots)

setName

public void setName(java.lang.String name,
                    java.awt.Component widget)

setLongName

public void setLongName(java.lang.String longName,
                        java.awt.Component widget)

handleAccels

public static boolean handleAccels(java.awt.event.KeyEvent e)

setMenuBar

public void setMenuBar(javax.swing.JMenuBar menuBar)