Class Viewer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended byViewer
All Implemented Interfaces:
javax.accessibility.Accessible, ElementSettable, java.awt.image.ImageObserver, Manager, java.awt.MenuContainer, java.io.Serializable

public class Viewer
extends java.applet.Applet
implements Manager, ElementSettable

See Also:
Serialized Form

Field Summary
static boolean resetViewOnLoad
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Viewer()
           
 
Method Summary
 void addEntry(Entry entry, boolean resetView)
          Adds the specified Entry to the application.
 void clearEntries(boolean silent)
          Removes all entries from the application.
 void clearStructureEntries()
          Clear only the entries that have structure representation.
 void closeBuilderDialog()
          Closes the builder dialog
 void closeCommandPanel()
           
 void closeImagePreviewPanel()
           
 void closeMonitorDialog()
          Closes the dialog that manages display markers
 void closeSequencePanel()
          Closes the panel that displays sequence data
 void closeStructureBrowserPanel()
           
 void colorAction()
           
 void destructor()
           
 void displayAction()
           
 void displayErrorMessage(java.lang.String t)
          Displays an error message.
 void displayExceptionMessage(java.lang.String t, java.lang.Exception ex)
          Displays an error message with an option to display details of the exception.
 void displayMessage(java.lang.String text)
          Displays a message in an information dialog.
 void displayRamachandranPlot(Structure structure)
           
 void displayTextMessage(java.lang.String title, java.lang.String text)
           
 void displayWaitScreen()
          Displays a wait screen.
 void doRcsbLoad(java.lang.String in)
          Loads entries from the PDB ftp server.
 javax.swing.JFrame getApplicationFrame()
          Returns a reference to the frame of the main application.
 java.awt.Rectangle getContainerBounds()
          Returns bounds of the application frame as a Rectangle object
 ListerDialog getDataListerDialog()
           
 DisplayDialog getDisplayDialog()
          Returns a reference to the currently displayed DisplayDialog.
 boolean getDisplayDialogStatus()
          Indicates whether any dialogs are currently open.
 ImagePreviewPanel getImagePreviewPanel()
           
 java.lang.String getLastUsedDirectory()
           
 MonitorDialog getMonitorDialog()
          Returns a reference to the currently open dialog that manages current display markers (distances, hydrogen bonds, labels, etc)
 StylesPreferences getPreferences()
          Returns current StylesPreferences.
 RamachandranViewer getRamachandranViewer(Structure structure)
           
 RasmolReader getRasmolReader()
           
 SequenceViewer getSequenceViewer()
          Returns a reference to SequenceViewer
 StructureBrowser getStructureBrowser()
           
 StructureViewer getStructureViewer()
          Returns a reference to the StructureViewer
 boolean getSuperimpose()
           
 WBManager getWBManager()
           
 void init()
           
 boolean isResetView()
           
 void loadFile(java.io.File f)
           
 void loadFragment(java.lang.String id)
          Loads fragment with specified id into the structure viewer.
static void main(java.lang.String[] args)
           
 void openImagePreviewPanel()
           
 void openSequence()
           
 void removeCloseListener(Entry entry)
          Called by the structure or sequence viewer when an entry is added or removed internally, without clicking the close menu items
 void removeCloseMenuItem(FileCloseListener listener)
           
 void removeRamachandranDialog(Structure structure)
           
 void removeRamachandranDialog(Viewer viewer)
           
 void removeWaitScreen()
          Removes wait screen.
 void renameEntry(Entry e, java.lang.String name)
          Triggers renaming of the specified Entry
 void renderingAction()
           
 void ribbonDisplayAction()
           
 void setBackgroundColor(float[] color)
          Sets background of the 3D display area.
 void setDisplayDialogStatus(boolean f)
          Sets a flag that indicates whether there are any dialogs open.
 void setDisplayDialogStatus(boolean f, DisplayDialog displayDialog)
          Sets a flag indicating whether a dialog is open, and sets the reference to the currently open dialog.
 void setElement(java.lang.String element)
          This method is called by element palette to set element selection
 void setLastUsedDirectory(java.lang.String dir)
           
 void setLoaded(boolean set)
           
 void setSelectionMode(int mode)
          Sets selection mode to either atom or residue level
 void setSeparateMotion(boolean flag)
          Sets mode of inndependent motion
 void setSuperimpose(boolean flag)
           
 void setUndo(boolean enabled)
          Sets undo mode
 void start()
           
 void stop()
           
 void updateAppearance()
          Causes the main application to refresh all visual elements.
 void updateBoundWaters()
          Update display of crystallographic waters
 void updateBuilderDialog()
          This method is called when the builder dialog is updated, e.g.
 void updateMonitorDialog()
          This method is called when any change has been made to the display markers and causes the dialog to redraw itself to reflect the change.
 void updateMouseResponse(int f)
          Update variables that control speed of the structure motion response to the motion of the mouse pointer
 void updateToolbar()
          Update the toolbar in response to any change in its configuration.
 void updateView()
          This method is different from updateAppearance, in that it doesn't mark all renderables as dirty, but only forces the geometry viewer to update the view by calling its display method.
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

resetViewOnLoad

public static boolean resetViewOnLoad
Constructor Detail

Viewer

public Viewer()
Method Detail

getApplicationFrame

public javax.swing.JFrame getApplicationFrame()
Description copied from interface: Manager
Returns a reference to the frame of the main application.

Specified by:
getApplicationFrame in interface Manager

setLoaded

public void setLoaded(boolean set)

init

public void init()

start

public void start()

stop

public void stop()

getLastUsedDirectory

public java.lang.String getLastUsedDirectory()
Specified by:
getLastUsedDirectory in interface Manager

setLastUsedDirectory

public void setLastUsedDirectory(java.lang.String dir)
Specified by:
setLastUsedDirectory in interface Manager

colorAction

public void colorAction()
Specified by:
colorAction in interface Manager

displayAction

public void displayAction()
Specified by:
displayAction in interface Manager

ribbonDisplayAction

public void ribbonDisplayAction()

renderingAction

public void renderingAction()
Specified by:
renderingAction in interface Manager

removeRamachandranDialog

public void removeRamachandranDialog(Viewer viewer)
Specified by:
removeRamachandranDialog in interface Manager

removeRamachandranDialog

public void removeRamachandranDialog(Structure structure)
Specified by:
removeRamachandranDialog in interface Manager

getRamachandranViewer

public RamachandranViewer getRamachandranViewer(Structure structure)
Specified by:
getRamachandranViewer in interface Manager

getDataListerDialog

public ListerDialog getDataListerDialog()
Specified by:
getDataListerDialog in interface Manager

loadFile

public void loadFile(java.io.File f)

displayErrorMessage

public void displayErrorMessage(java.lang.String t)
Description copied from interface: Manager
Displays an error message.

Specified by:
displayErrorMessage in interface Manager
Parameters:
t - text of the message

displayExceptionMessage

public void displayExceptionMessage(java.lang.String t,
                                    java.lang.Exception ex)
Description copied from interface: Manager
Displays an error message with an option to display details of the exception.

Specified by:
displayExceptionMessage in interface Manager
Parameters:
t - text of the message
ex - the thrown exception object

displayWaitScreen

public void displayWaitScreen()
Description copied from interface: Manager
Displays a wait screen. This method should be called when a lengthy operation is performed to notify the user that some action is being performed.

Specified by:
displayWaitScreen in interface Manager

removeWaitScreen

public void removeWaitScreen()
Description copied from interface: Manager
Removes wait screen.

Specified by:
removeWaitScreen in interface Manager

displayMessage

public void displayMessage(java.lang.String text)
Description copied from interface: Manager
Displays a message in an information dialog.

Specified by:
displayMessage in interface Manager
Parameters:
text - text of the message

destructor

public void destructor()

closeSequencePanel

public void closeSequencePanel()
Description copied from interface: Manager
Closes the panel that displays sequence data

Specified by:
closeSequencePanel in interface Manager

closeBuilderDialog

public void closeBuilderDialog()
Description copied from interface: Manager
Closes the builder dialog

Specified by:
closeBuilderDialog in interface Manager

closeMonitorDialog

public void closeMonitorDialog()
Description copied from interface: Manager
Closes the dialog that manages display markers

Specified by:
closeMonitorDialog in interface Manager

updateBuilderDialog

public void updateBuilderDialog()
Description copied from interface: Manager
This method is called when the builder dialog is updated, e.g. when a customm fragment is defined.

Specified by:
updateBuilderDialog in interface Manager

updateMonitorDialog

public void updateMonitorDialog()
Description copied from interface: Manager
This method is called when any change has been made to the display markers and causes the dialog to redraw itself to reflect the change.

Specified by:
updateMonitorDialog in interface Manager

getMonitorDialog

public MonitorDialog getMonitorDialog()
Description copied from interface: Manager
Returns a reference to the currently open dialog that manages current display markers (distances, hydrogen bonds, labels, etc)

Specified by:
getMonitorDialog in interface Manager
Returns:

closeStructureBrowserPanel

public void closeStructureBrowserPanel()

doRcsbLoad

public void doRcsbLoad(java.lang.String in)
Description copied from interface: Manager
Loads entries from the PDB ftp server.

Specified by:
doRcsbLoad in interface Manager
Parameters:
in - PDB id of the structure

isResetView

public boolean isResetView()
Specified by:
isResetView in interface Manager

addEntry

public void addEntry(Entry entry,
                     boolean resetView)
Description copied from interface: Manager
Adds the specified Entry to the application. Used by search panels for loading data into the application. Data returned by a database search can be packaged into an Entry (SequenceEntry or StructureEntry) and loaded using this method.

Specified by:
addEntry in interface Manager
Parameters:
entry - the Entry object that should be loaded
resetView - indicates whether the view should be redrawn. If multiple entries are loaded, should be set to false to minimize repainting of the entire display after each addition.

openSequence

public void openSequence()
Specified by:
openSequence in interface Manager

removeCloseListener

public void removeCloseListener(Entry entry)
Called by the structure or sequence viewer when an entry is added or removed internally, without clicking the close menu items

Specified by:
removeCloseListener in interface Manager

removeCloseMenuItem

public void removeCloseMenuItem(FileCloseListener listener)
Specified by:
removeCloseMenuItem in interface Manager

clearEntries

public void clearEntries(boolean silent)
Description copied from interface: Manager
Removes all entries from the application.

Specified by:
clearEntries in interface Manager

clearStructureEntries

public void clearStructureEntries()
Description copied from interface: Manager
Clear only the entries that have structure representation.

Specified by:
clearStructureEntries in interface Manager

getContainerBounds

public java.awt.Rectangle getContainerBounds()
Description copied from interface: Manager
Returns bounds of the application frame as a Rectangle object

Specified by:
getContainerBounds in interface Manager
Returns:

getDisplayDialog

public DisplayDialog getDisplayDialog()
Description copied from interface: Manager
Returns a reference to the currently displayed DisplayDialog.

Specified by:
getDisplayDialog in interface Manager

getDisplayDialogStatus

public boolean getDisplayDialogStatus()
Description copied from interface: Manager
Indicates whether any dialogs are currently open.

Specified by:
getDisplayDialogStatus in interface Manager

setBackgroundColor

public void setBackgroundColor(float[] color)
Description copied from interface: Manager
Sets background of the 3D display area.

Specified by:
setBackgroundColor in interface Manager

setSelectionMode

public void setSelectionMode(int mode)
Description copied from interface: Manager
Sets selection mode to either atom or residue level

Specified by:
setSelectionMode in interface Manager
Parameters:
mode -

setDisplayDialogStatus

public void setDisplayDialogStatus(boolean f)
Description copied from interface: Manager
Sets a flag that indicates whether there are any dialogs open.

Specified by:
setDisplayDialogStatus in interface Manager
Parameters:
f - open dialog flag

setDisplayDialogStatus

public void setDisplayDialogStatus(boolean f,
                                   DisplayDialog displayDialog)
Description copied from interface: Manager
Sets a flag indicating whether a dialog is open, and sets the reference to the currently open dialog. The flag is necessary for checks before opening new dialogs to avoid clashes with mutually exclusive behaviors of each dialog to stay on top when another commponent within the application is clicked

Specified by:
setDisplayDialogStatus in interface Manager
Parameters:
f -
displayDialog -

updateAppearance

public void updateAppearance()
Description copied from interface: Manager
Causes the main application to refresh all visual elements. Should be called after changing appearance or appearance-related settings.

Specified by:
updateAppearance in interface Manager

updateView

public void updateView()
This method is different from updateAppearance, in that it doesn't mark all renderables as dirty, but only forces the geometry viewer to update the view by calling its display method.

Specified by:
updateView in interface Manager

getPreferences

public StylesPreferences getPreferences()
Description copied from interface: Manager
Returns current StylesPreferences.

Specified by:
getPreferences in interface Manager
Returns:

getStructureViewer

public StructureViewer getStructureViewer()
Description copied from interface: Manager
Returns a reference to the StructureViewer

Specified by:
getStructureViewer in interface Manager
Returns:

getSequenceViewer

public SequenceViewer getSequenceViewer()
Description copied from interface: Manager
Returns a reference to SequenceViewer

Specified by:
getSequenceViewer in interface Manager
Returns:

getStructureBrowser

public StructureBrowser getStructureBrowser()
Specified by:
getStructureBrowser in interface Manager

main

public static void main(java.lang.String[] args)

loadFragment

public void loadFragment(java.lang.String id)
Description copied from interface: Manager
Loads fragment with specified id into the structure viewer.

Specified by:
loadFragment in interface Manager
Parameters:
id - identification number of the fragment in the library

updateBoundWaters

public void updateBoundWaters()
Description copied from interface: Manager
Update display of crystallographic waters

Specified by:
updateBoundWaters in interface Manager

updateMouseResponse

public void updateMouseResponse(int f)
Description copied from interface: Manager
Update variables that control speed of the structure motion response to the motion of the mouse pointer

Specified by:
updateMouseResponse in interface Manager
Parameters:
f - integer value from 1 to 5, with 5 being the fastest response speed.

setSeparateMotion

public void setSeparateMotion(boolean flag)
Description copied from interface: Manager
Sets mode of inndependent motion

Specified by:
setSeparateMotion in interface Manager
Parameters:
flag -

setUndo

public void setUndo(boolean enabled)
Description copied from interface: Manager
Sets undo mode

Specified by:
setUndo in interface Manager
Parameters:
enabled - boolean that indicates whether the undo mode should be enabled

updateToolbar

public void updateToolbar()
Description copied from interface: Manager
Update the toolbar in response to any change in its configuration. Called by the preferences dialog.

Specified by:
updateToolbar in interface Manager

displayRamachandranPlot

public void displayRamachandranPlot(Structure structure)
Specified by:
displayRamachandranPlot in interface Manager

getSuperimpose

public boolean getSuperimpose()
Specified by:
getSuperimpose in interface Manager

setSuperimpose

public void setSuperimpose(boolean flag)
Specified by:
setSuperimpose in interface Manager

renameEntry

public void renameEntry(Entry e,
                        java.lang.String name)
Description copied from interface: Manager
Triggers renaming of the specified Entry

Specified by:
renameEntry in interface Manager
Parameters:
e - Entry to be renamed
name - new name

setElement

public void setElement(java.lang.String element)
This method is called by element palette to set element selection

Specified by:
setElement in interface ElementSettable

closeCommandPanel

public void closeCommandPanel()
Specified by:
closeCommandPanel in interface Manager

displayTextMessage

public void displayTextMessage(java.lang.String title,
                               java.lang.String text)
Specified by:
displayTextMessage in interface Manager

openImagePreviewPanel

public void openImagePreviewPanel()
Specified by:
openImagePreviewPanel in interface Manager

closeImagePreviewPanel

public void closeImagePreviewPanel()
Specified by:
closeImagePreviewPanel in interface Manager

getImagePreviewPanel

public ImagePreviewPanel getImagePreviewPanel()
Specified by:
getImagePreviewPanel in interface Manager

getWBManager

public WBManager getWBManager()
Specified by:
getWBManager in interface Manager

getRasmolReader

public RasmolReader getRasmolReader()
Specified by:
getRasmolReader in interface Manager