|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Canvas
astex.MoleculeViewer
public class MoleculeViewer
A component that can draw a molecule.
| Field Summary | |
|---|---|
boolean |
announce
Are we announcing the origin of AstexViewer. |
java.lang.String[] |
builtinColors
|
java.util.Hashtable |
keyDefinitions
Definition of key bindings. |
MoleculeRenderer |
moleculeRenderer
The molecule renderer that this viewer will use. |
java.lang.String |
onClickLabel
|
boolean |
ready
Are we initialised? |
java.awt.Image |
splashImage
Are we initialised? |
UserInterface |
ui
The user interface that we will generated if necessary. |
| 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 | |
|---|---|
MoleculeViewer()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Implementation of ActionListener. |
void |
addMap(Map map)
Add a map to the renderer. |
void |
addMolecule(Molecule molecule)
Set the molecule that the renderer will use. |
void |
addNotify()
|
void |
addRepaintListener(java.awt.Component c)
|
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
AdjustmentListener to listen to contour levels being created. |
boolean |
animating()
Are we animating? |
void |
atomSelected(MoleculeRenderer renderer,
Atom atom)
Respond to an atom click event. |
void |
buildContourLevelDialog()
Actually build the contour level. |
java.lang.String |
checkExtension(Molecule mol,
java.lang.String f)
Check the file extension on a save file name. |
java.awt.Menu |
createBMPMenu()
|
java.awt.CheckboxMenuItem |
createCheckboxMenuItem(java.lang.String label,
boolean state)
Create a single checkbox menu item. |
java.awt.Menu |
createCloseMoleculeMenu()
Create the menu that lets us close molecules. |
java.awt.Menu |
createColorMenu()
Create the color menu. |
java.awt.Menu |
createDisplayMenu()
Create the display menu. |
java.awt.Menu |
createFileMenu()
Create the file menu. |
java.awt.Menu |
createLigandMenu()
Create the menu that lets us choose ligand groups. |
java.awt.Menu |
createMeasureMenu()
Create the menu that picks measurement options. |
java.awt.MenuBar |
createMenuBar()
Create the menu bar that we will use. |
java.awt.MenuItem |
createMenuItem(java.lang.String label)
Create a single menu item. |
java.awt.Menu |
createOptionsMenu()
Create the option menu. |
void |
createPopup(java.awt.event.MouseEvent e)
Create a popup menu. |
java.awt.Menu |
createSaveMoleculeMenu()
Create the menu that lets us save molecules. |
java.awt.Menu |
createSelectMenu()
Create the select menu. |
java.awt.Menu |
createViewMenu()
Create the view menu. |
void |
dirtyRepaint()
Mark the renderer dirty and ask for repaint(). |
void |
dispose()
|
void |
drawImage(java.awt.Component c,
java.awt.Graphics g)
Paint the image. |
void |
drawLoadingScreen(java.awt.Graphics g)
Function that paints the image when we load. |
void |
ensureMenusCreated()
Ensure that the close molecule menu is created. |
void |
execute(java.lang.String s)
Execute a command in the moleculeRenderer. |
void |
executeScript(java.lang.String filename)
|
void |
finalize()
|
void |
genericAdded(MoleculeRenderer renderer,
Generic generic)
A generic was added. |
void |
genericRemoved(MoleculeRenderer renderer,
Generic generic)
A generic was removed. |
java.lang.String |
getColor(int x,
int y)
Instruct AstexViewer to display its color gadget so that a JavaScript interface can use it for picking colours. |
MoleculeRenderer |
getMoleculeRenderer()
Get the molecule renderer that we contain. |
java.awt.Dimension |
getPreferredSize()
Return the preferred size. |
java.lang.String |
getView()
Return scripting description of the view. |
void |
handleAnimation(Arguments args)
Get the animation thread. |
boolean |
handleMenuAction(java.awt.event.ActionEvent e,
java.lang.String commandString)
Handle more complex menu actions. |
void |
handleMouseOver(java.awt.event.MouseEvent e)
|
void |
handleMouseOverCommand(java.awt.event.MouseEvent e)
|
void |
handlePrint(java.lang.String output)
Handle a print command in the scripting language. |
void |
hideContourLevelDialog()
Hide the contour level dialog. |
void |
install(java.lang.Object o)
|
boolean |
interactiveAnimation()
|
boolean |
isApplication()
Are we running in application. |
void |
itemStateChanged(java.awt.event.ItemEvent e)
Implementation of ItemListener. |
void |
keyPressed(java.awt.event.KeyEvent e)
Implementation of KeyListener. |
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
java.lang.String |
loadFile(java.lang.String title)
Convenience method for loading a file. |
void |
loadMap(java.lang.String filename)
Load a map given the name of its file. |
void |
loadMolecule(java.lang.String filename)
Load a molecule given the name of its file. |
static void |
main(java.lang.String[] args)
Main entry point. |
void |
mapAdded(MoleculeRenderer renderer,
Map map)
Respond to a map added event. |
void |
mapRemoved(MoleculeRenderer renderer,
Map map)
Respond to a map added event. |
void |
moleculeAdded(MoleculeRenderer renderer,
Molecule molecule)
Respond to a molecule added event. |
void |
moleculeRemoved(MoleculeRenderer renderer,
Molecule molecule)
Respond to a molecule removed event. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Handle the mouse being dragged. |
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
Handle a mousePressed event. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Handle a mouseReleased event. |
void |
paint(java.awt.Graphics g)
Override the paint method. |
void |
readKeyDefinitions()
|
void |
removeAnimationThread(java.lang.Thread t)
Try and remove a thread after it has finished running. |
void |
removeMap(Map map)
Remove a map from the renderer. |
void |
removeRepaintListener(java.awt.Component c)
|
void |
resetAwtImage()
Force the awt image to get replaced. |
void |
saveAndExit()
Save the whole state. |
java.lang.String |
saveFile(java.lang.String title,
java.lang.String[] extensions)
Get a file name to save to. |
void |
saveMolecule(Molecule molecule)
Save this molecule. |
void |
saveMoleculeByName(java.lang.String name)
Save this molecule. |
void |
saveMolecules()
Save the small molecules. |
void |
saveScript(java.lang.String scriptFile)
|
void |
setActiveLight(int al,
Light l)
|
void |
setApplication(boolean b)
Set whether we are running in application. |
void |
setArrayCopy(boolean arraycopy)
Should the renderer use arraycopy for clearing its buffers. |
void |
setBounds(int x,
int y,
int width,
int height)
Handle a resize. |
void |
setBounds(java.awt.Rectangle r)
Handle a resize in a different way. |
void |
setCenter(Point3d center)
Set the center point of the underlying renderer. |
void |
setPreferredSize(int w,
int h)
Set the preferred size. |
void |
setRadius(double radius)
Set the radius of the underlying renderer. |
void |
setShowVersion(boolean b)
Should we show the version. |
void |
setSymmetry(boolean symmetry)
Set whether we are displaying symmetry. |
void |
setUsePopupMenu(boolean state)
Set whether we should use the popup menu. |
static void |
showAt(java.awt.Dialog d,
int x,
int y)
Show the dialog at the position. |
void |
showContourLevelDialog()
Popup a dialog which allow us to alter contour levels. |
void |
suspendAnimationThread(boolean run)
Handle (de)activation of animation thread. |
void |
update(java.awt.Graphics g)
Overridden update method. |
void |
updateCloseMoleculeMenu()
Update the close molecule menu. |
void |
updateMenus()
Cause all the menus to get updated. |
void |
updateSaveMoleculeMenu()
Update the save molecule menu. |
void |
updateSelectMenu()
Update the contents of the select menu. |
void |
windowActivated(java.awt.event.WindowEvent e)
|
void |
windowClosed(java.awt.event.WindowEvent e)
|
void |
windowClosing(java.awt.event.WindowEvent e)
|
void |
windowDeactivated(java.awt.event.WindowEvent e)
|
void |
windowDeiconified(java.awt.event.WindowEvent e)
|
void |
windowIconified(java.awt.event.WindowEvent e)
|
void |
windowOpened(java.awt.event.WindowEvent e)
|
| Methods inherited from class java.awt.Canvas |
|---|
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public MoleculeRenderer moleculeRenderer
public boolean ready
public java.awt.Image splashImage
public boolean announce
public java.util.Hashtable keyDefinitions
public java.lang.String onClickLabel
public java.lang.String[] builtinColors
public transient UserInterface ui
| Constructor Detail |
|---|
public MoleculeViewer()
| Method Detail |
|---|
public boolean isApplication()
public void setApplication(boolean b)
public void handleAnimation(Arguments args)
public void removeAnimationThread(java.lang.Thread t)
public boolean animating()
public boolean interactiveAnimation()
public void handlePrint(java.lang.String output)
public void suspendAnimationThread(boolean run)
public void execute(java.lang.String s)
public void addNotify()
addNotify in class java.awt.Canvaspublic void readKeyDefinitions()
public void dispose()
public MoleculeRenderer getMoleculeRenderer()
public void setArrayCopy(boolean arraycopy)
public void addMolecule(Molecule molecule)
public void loadMolecule(java.lang.String filename)
public void executeScript(java.lang.String filename)
public void loadMap(java.lang.String filename)
public void setBounds(java.awt.Rectangle r)
setBounds in class java.awt.Component
public void setBounds(int x,
int y,
int width,
int height)
setBounds in class java.awt.Componentpublic void setCenter(Point3d center)
public void setRadius(double radius)
public void setSymmetry(boolean symmetry)
public void addMap(Map map)
public void removeMap(Map map)
public void setPreferredSize(int w,
int h)
public java.awt.Dimension getPreferredSize()
getPreferredSize in class java.awt.Componentpublic void update(java.awt.Graphics g)
update in class java.awt.Canvaspublic void paint(java.awt.Graphics g)
paint in class java.awt.Canvaspublic void drawLoadingScreen(java.awt.Graphics g)
public void resetAwtImage()
public void drawImage(java.awt.Component c,
java.awt.Graphics g)
public void finalize()
finalize in class java.lang.Object
public void setActiveLight(int al,
Light l)
public static void main(java.lang.String[] args)
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void windowClosing(java.awt.event.WindowEvent e)
windowClosing in interface java.awt.event.WindowListenerpublic void windowActivated(java.awt.event.WindowEvent e)
windowActivated in interface java.awt.event.WindowListenerpublic void windowClosed(java.awt.event.WindowEvent e)
windowClosed in interface java.awt.event.WindowListenerpublic void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated in interface java.awt.event.WindowListenerpublic void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified in interface java.awt.event.WindowListenerpublic void windowIconified(java.awt.event.WindowEvent e)
windowIconified in interface java.awt.event.WindowListenerpublic void windowOpened(java.awt.event.WindowEvent e)
windowOpened in interface java.awt.event.WindowListenerpublic void setUsePopupMenu(boolean state)
public void createPopup(java.awt.event.MouseEvent e)
public void setShowVersion(boolean b)
public void install(java.lang.Object o)
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void handleMouseOver(java.awt.event.MouseEvent e)
public void handleMouseOverCommand(java.awt.event.MouseEvent e)
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenerpublic java.awt.MenuBar createMenuBar()
public java.awt.Menu createFileMenu()
public java.awt.Menu createBMPMenu()
public java.awt.Menu createSelectMenu()
public java.awt.Menu createDisplayMenu()
public java.awt.Menu createColorMenu()
public java.awt.Menu createViewMenu()
public java.awt.Menu createOptionsMenu()
public java.awt.Menu createCloseMoleculeMenu()
public java.awt.Menu createSaveMoleculeMenu()
public java.awt.Menu createLigandMenu()
public java.awt.Menu createMeasureMenu()
public java.awt.MenuItem createMenuItem(java.lang.String label)
public java.awt.CheckboxMenuItem createCheckboxMenuItem(java.lang.String label,
boolean state)
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic void buildContourLevelDialog()
public void showContourLevelDialog()
public void hideContourLevelDialog()
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged in interface java.awt.event.AdjustmentListener
public boolean handleMenuAction(java.awt.event.ActionEvent e,
java.lang.String commandString)
public void saveMoleculeByName(java.lang.String name)
public java.lang.String checkExtension(Molecule mol,
java.lang.String f)
public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged in interface java.awt.event.ItemListenerpublic void dirtyRepaint()
public void addRepaintListener(java.awt.Component c)
public void removeRepaintListener(java.awt.Component c)
public java.lang.String loadFile(java.lang.String title)
public java.lang.String saveFile(java.lang.String title,
java.lang.String[] extensions)
public void moleculeAdded(MoleculeRenderer renderer,
Molecule molecule)
moleculeAdded in interface MoleculeRendererListener
public void moleculeRemoved(MoleculeRenderer renderer,
Molecule molecule)
moleculeRemoved in interface MoleculeRendererListener
public void mapAdded(MoleculeRenderer renderer,
Map map)
mapAdded in interface MoleculeRendererListener
public void mapRemoved(MoleculeRenderer renderer,
Map map)
mapRemoved in interface MoleculeRendererListener
public void atomSelected(MoleculeRenderer renderer,
Atom atom)
atomSelected in interface MoleculeRendererListener
public void genericAdded(MoleculeRenderer renderer,
Generic generic)
MoleculeRendererListener
genericAdded in interface MoleculeRendererListener
public void genericRemoved(MoleculeRenderer renderer,
Generic generic)
MoleculeRendererListener
genericRemoved in interface MoleculeRendererListenerpublic void ensureMenusCreated()
public void updateMenus()
public void updateCloseMoleculeMenu()
public void updateSaveMoleculeMenu()
public void updateSelectMenu()
public void saveMolecules()
public java.lang.String getView()
public void saveMolecule(Molecule molecule)
public void saveScript(java.lang.String scriptFile)
public void saveAndExit()
public java.lang.String getColor(int x,
int y)
public static void showAt(java.awt.Dialog d,
int x,
int y)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||