org.xnap.gui.viewer
Class AbstractViewer

java.lang.Object
  extended by org.xnap.plugin.AbstractPlugin
      extended by org.xnap.gui.viewer.AbstractViewer
All Implemented Interfaces:
Viewer, Plugin
Direct Known Subclasses:
AcrobatViewerPlugin, ImageViewerPlugin, JMFPlayerPlugin, MP3TagEditorPlugin, TextViewerPlugin, VideoInfoPlugin, VorbisViewerPlugin, ZipViewerPlugin

public abstract class AbstractViewer
extends AbstractPlugin
implements Viewer

Provides the default implementation for a viewer.


Field Summary
 javax.swing.JComponent component
           
 java.lang.String[] extensions
           
 
Constructor Summary
AbstractViewer()
          Overwrite getExtensions() if you use this constructor.
AbstractViewer(java.lang.String[] extensions)
           
AbstractViewer(java.lang.String[] extensions, javax.swing.Icon icon)
           
 
Method Summary
 void close()
          Does nothing.
abstract  javax.swing.JComponent createComponent()
           
 javax.swing.JComponent getComponent()
          Hmm, that makes not much sense.
 java.lang.String[] getExtensions()
          Returns a an array of extensions that this plugin can display.
 javax.swing.Icon getIcon()
          Returns a 16x16 icon.
 java.lang.String getName()
          Implements the Viewer interface.
 void start()
          Does nothing.
 void startGUI()
          Registers the extensions at the ViewerManager.
 void stop()
          Does nothing.
 void stopGUI()
          Unregisters the extensions at the ViewerManager.
 java.lang.String toString()
          Returns the value get.Info().getName().
 
Methods inherited from class org.xnap.plugin.AbstractPlugin
getInfo, setInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xnap.gui.viewer.Viewer
open
 

Field Detail

extensions

public java.lang.String[] extensions

component

public javax.swing.JComponent component
Constructor Detail

AbstractViewer

public AbstractViewer(java.lang.String[] extensions)

AbstractViewer

public AbstractViewer()
Overwrite getExtensions() if you use this constructor.


AbstractViewer

public AbstractViewer(java.lang.String[] extensions,
                      javax.swing.Icon icon)
Method Detail

close

public void close()
Does nothing.

Specified by:
close in interface Viewer

createComponent

public abstract javax.swing.JComponent createComponent()

getComponent

public javax.swing.JComponent getComponent()
Description copied from interface: Viewer
Hmm, that makes not much sense. We want to support threading.

Specified by:
getComponent in interface Viewer

getExtensions

public java.lang.String[] getExtensions()
Returns a an array of extensions that this plugin can display.


getIcon

public javax.swing.Icon getIcon()
Description copied from interface: Viewer
Returns a 16x16 icon.

Specified by:
getIcon in interface Viewer

getName

public java.lang.String getName()
Implements the Viewer interface.

Specified by:
getName in interface Viewer
Returns:
the name of the plugin
See Also:
xnap.plugin.PluginInfo#getName()

start

public void start()
Does nothing.

Specified by:
start in interface Plugin
See Also:
xnap.plugin.Plugin#start()

startGUI

public void startGUI()
Registers the extensions at the ViewerManager.

Specified by:
startGUI in interface Plugin

stop

public void stop()
Does nothing.

Specified by:
stop in interface Plugin
See Also:
xnap.plugin.Plugin#stop()

stopGUI

public void stopGUI()
Unregisters the extensions at the ViewerManager.

Specified by:
stopGUI in interface Plugin

toString

public java.lang.String toString()
Returns the value get.Info().getName().

Overrides:
toString in class AbstractPlugin


Copyright © 2001-2005 XNap Team. All Rights Reserved.