gate.gui
Class NameBearerHandle

java.lang.Object
  extended bygate.gui.NameBearerHandle
All Implemented Interfaces:
CreoleListener, EventListener, Handle, ProgressListener, StatusListener

public class NameBearerHandle
extends Object
implements Handle, StatusListener, ProgressListener, CreoleListener

Class used to store the GUI information about an open entity (resource, controller, datastore). Such information will include icon to be used for tree components, popup menu for right click events, large and small views, etc.


Nested Class Summary
(package private)  class NameBearerHandle.CloseAction
           
(package private)  class NameBearerHandle.CreateIndexAction
           
(package private)  class NameBearerHandle.CreateIndexAction1
           
(package private)  class NameBearerHandle.DeleteIndexAction
           
(package private)  class NameBearerHandle.DumpArffAction
           
protected  class NameBearerHandle.DumpPreserveFormatAction
          The action that is fired when the user wants to dump annotations preserving the original document format.
(package private)  class NameBearerHandle.DumpToFileAction
           
(package private)  class NameBearerHandle.OptimizeIndexAction
           
(package private)  class NameBearerHandle.PopulateCorpusAction
           
(package private)  class NameBearerHandle.ProxyStatusListener
           
(package private)  class NameBearerHandle.ReloadAction
           
(package private)  class NameBearerHandle.ReloadClassAction
          Saves a corpus as a set of xml files in a directory.
(package private)  class NameBearerHandle.SaveAction
           
(package private)  class NameBearerHandle.SaveAsXmlAction
          Used to save a document as XML
(package private)  class NameBearerHandle.SaveCorpusAsXmlAction
          Saves a corpus as a set of xml files in a directory.
(package private)  class NameBearerHandle.SaveToAction
           
 
Field Summary
protected  List actionPublishers
          Stores all the action providers for this resource.
(package private)  CorpusFillerComponent corpusFiller
          Component used to select the options for corpus populating
(package private)  Icon icon
           
(package private)  JComponent largeView
           
private  Vector progressListeners
           
(package private)  ResourceData rData
           
(package private)  StatusListener sListenerProxy
           
(package private)  JComponent smallView
           
protected  List staticPopupItems
          A list of menu items that constitute the static part of the popup.
private  Vector statusListeners
           
(package private)  NameBearer target
           
(package private)  String title
           
(package private)  String tooltipText
           
(package private)  Window window
          The top level GUI component this hadle belongs to.
 
Constructor Summary
NameBearerHandle(NameBearer target, Window window)
           
 
Method Summary
 void addProgressListener(ProgressListener l)
           
 void addStatusListener(StatusListener l)
           
protected  void buildViews()
           
protected  void cleanup()
          Releases the memory, removes the listeners, cleans up.
 void datastoreClosed(CreoleEvent e)
          Called when a DataStore has been closed
 void datastoreCreated(CreoleEvent e)
          Called when a DataStore has been created
 void datastoreOpened(CreoleEvent e)
          Called when a DataStore has been opened
private  void fillHMMActions(List popupItems)
          Fill HMM Save and Save As...
private  void fillProtegeActions(List popupItems)
          Fill Protege save, save as and save in format actions
protected  void fireProcessFinished()
           
protected  void fireProgressChanged(int e)
           
protected  void fireStatusChanged(String e)
           
 Action getCloseAction()
           
 Icon getIcon()
           
 JComponent getLargeView()
          Returns the large view for this resource.
 JPopupMenu getPopup()
           
 JComponent getSmallView()
          Returns a GUI component to be used as a small viewer/editor, e.g.
 Object getTarget()
           
 String getTitle()
           
 String getTooltipText()
           
 Window getWindow()
          Returns the top level GUI component that is a parent to all other GUI components
 void processFinished()
          Called when the process is finished.
 void progressChanged(int e)
          Called when the progress has changed
 void removeProgressListener(ProgressListener l)
           
 void removeStatusListener(StatusListener l)
           
 void resourceLoaded(CreoleEvent e)
          Called when a new Resource has been loaded into the system
 void resourceRenamed(Resource resource, String oldName, String newName)
          Called when the creole register has renamed a resource.1
 void resourceUnloaded(CreoleEvent e)
          Called when a Resource has been removed from the system
 void setIcon(Icon icon)
           
 void setTitle(String newTitle)
           
 void setTooltipText(String text)
           
 void statusChanged(String e)
          Calleed when there a new status message.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

title

String title

tooltipText

String tooltipText

target

NameBearer target

actionPublishers

protected List actionPublishers
Stores all the action providers for this resource. They will be questioned when the getPopup() method is called.


staticPopupItems

protected List staticPopupItems
A list of menu items that constitute the static part of the popup. Null values are used for separators.


window

Window window
The top level GUI component this hadle belongs to.


rData

ResourceData rData

icon

Icon icon

smallView

JComponent smallView

largeView

JComponent largeView

corpusFiller

CorpusFillerComponent corpusFiller
Component used to select the options for corpus populating


sListenerProxy

StatusListener sListenerProxy

progressListeners

private transient Vector progressListeners

statusListeners

private transient Vector statusListeners
Constructor Detail

NameBearerHandle

public NameBearerHandle(NameBearer target,
                        Window window)
Method Detail

getIcon

public Icon getIcon()
Specified by:
getIcon in interface Handle

setIcon

public void setIcon(Icon icon)

getTitle

public String getTitle()
Specified by:
getTitle in interface Handle

setTitle

public void setTitle(String newTitle)

getSmallView

public JComponent getSmallView()
Returns a GUI component to be used as a small viewer/editor, e.g. below the main tree in the Gate GUI for the selected resource

Specified by:
getSmallView in interface Handle

getLargeView

public JComponent getLargeView()
Returns the large view for this resource. This view will go into the main display area.

Specified by:
getLargeView in interface Handle

getPopup

public JPopupMenu getPopup()
Specified by:
getPopup in interface Handle

getTooltipText

public String getTooltipText()
Specified by:
getTooltipText in interface Handle

setTooltipText

public void setTooltipText(String text)

getTarget

public Object getTarget()
Specified by:
getTarget in interface Handle

getCloseAction

public Action getCloseAction()

fillProtegeActions

private void fillProtegeActions(List popupItems)
Fill Protege save, save as and save in format actions


fillHMMActions

private void fillHMMActions(List popupItems)
Fill HMM Save and Save As... actions


buildViews

protected void buildViews()

toString

public String toString()

removeProgressListener

public void removeProgressListener(ProgressListener l)

addProgressListener

public void addProgressListener(ProgressListener l)

cleanup

protected void cleanup()
Releases the memory, removes the listeners, cleans up. Will get called when the target resource is unloaded from the system


fireProgressChanged

protected void fireProgressChanged(int e)

fireProcessFinished

protected void fireProcessFinished()

removeStatusListener

public void removeStatusListener(StatusListener l)

addStatusListener

public void addStatusListener(StatusListener l)

fireStatusChanged

protected void fireStatusChanged(String e)

statusChanged

public void statusChanged(String e)
Description copied from interface: StatusListener
Calleed when there a new status message.

Specified by:
statusChanged in interface StatusListener
Parameters:
e -

progressChanged

public void progressChanged(int e)
Description copied from interface: ProgressListener
Called when the progress has changed

Specified by:
progressChanged in interface ProgressListener
Parameters:
e -

processFinished

public void processFinished()
Description copied from interface: ProgressListener
Called when the process is finished.

Specified by:
processFinished in interface ProgressListener

getWindow

public Window getWindow()
Description copied from interface: Handle
Returns the top level GUI component that is a parent to all other GUI components

Specified by:
getWindow in interface Handle

resourceLoaded

public void resourceLoaded(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a new Resource has been loaded into the system

Specified by:
resourceLoaded in interface CreoleListener

resourceUnloaded

public void resourceUnloaded(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a Resource has been removed from the system

Specified by:
resourceUnloaded in interface CreoleListener

resourceRenamed

public void resourceRenamed(Resource resource,
                            String oldName,
                            String newName)
Description copied from interface: CreoleListener
Called when the creole register has renamed a resource.1

Specified by:
resourceRenamed in interface CreoleListener

datastoreOpened

public void datastoreOpened(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a DataStore has been opened

Specified by:
datastoreOpened in interface CreoleListener

datastoreCreated

public void datastoreCreated(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a DataStore has been created

Specified by:
datastoreCreated in interface CreoleListener

datastoreClosed

public void datastoreClosed(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a DataStore has been closed

Specified by:
datastoreClosed in interface CreoleListener