chemaxon.alchemist.utils
Class AlchemistLinearMoleculeView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by chemaxon.alchemist.utils.AlchemistLinearMoleculeView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class AlchemistLinearMoleculeView
extends javax.swing.JPanel

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int HORIZONTAL
          horizontal display mode
static int VERTICAL
          vertical display mode
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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
AlchemistLinearMoleculeView(int orientation)
          Creates an AlchemistLinearMoleculeView
 
Method Summary
 void addListSelectionListener(javax.swing.event.ListSelectionListener listener)
          Adds a list selection listener
 void clearSelection()
          Clears the selection
protected  void fireSelectionValueChanged(int firstIndex, int lastIndex, boolean isAdjusting)
          Fires the list selection change event to all registered listeners
 java.awt.Color getBackground()
           
 int getBlockIncrement()
          Returns the scrollbar block increment
 javax.swing.event.ListSelectionListener[] getListSelectionListeners()
          Returns the array of list selection listeners
 java.util.List getMoleculeList()
          Returns the molecule object list displayed
 java.lang.String[] getReactionNames()
          Returns the reaction names for reaction arrows or null
 int getSelectedIndex()
          Returns the selected index, or -1
 java.lang.Object getSelectedValue()
          Returns the selected value, or null
 int getUnitIncrement()
          Returns the scrollbar unit increment
 java.lang.String getWaitText()
          Returns the text displayed in waiting mode
 boolean isSelectable()
          Returns if molecules are selectable
 boolean isSelectedIndex(int index)
          Returns true, if index is selected
 boolean isSelectionEmpty()
          Returns true, if no molecule selected
 boolean isShowArrows()
          Returns if arrows are visible among molecules
 boolean isWaiting()
          Returns if molecule view is in waiting mode
 void redoLayout()
          This method re-initializes and draws molecule list.
 void removeListSelectionListener(javax.swing.event.ListSelectionListener listener)
          Removes a list selection listener
 void setBackground(java.awt.Color bg)
           
 void setBlockIncrement(int blockIncrement)
          Sets the scrollbar block increment
 void setEnabled(boolean enabled)
           
 void setMoleculeList(java.util.List moleculeList)
          Sets the molecule list to be displayed
 void setMoleculeList(java.util.List moleculeList, java.util.HashMap reactionNamesMap, java.lang.String[] reactionNamesArray)
          Sets the molecule list to be displayed
 void setSelectable(boolean selectable)
          Sets molecules selectable
 void setSelectedIndex(int index)
          Sets the selected index
 void setShowArrows(boolean value)
          Sets the visibility of arrows among molecules
 void setUnitIncrement(int unitIncrement)
          Sets the scrollbar unit increment
 void setWaiting(boolean value)
          Sets Waiting mode
 void setWaitText(java.lang.String text)
          Sets text displayed in waiting mode
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERTICAL

public static int VERTICAL
vertical display mode


HORIZONTAL

public static int HORIZONTAL
horizontal display mode

Constructor Detail

AlchemistLinearMoleculeView

public AlchemistLinearMoleculeView(int orientation)
Creates an AlchemistLinearMoleculeView

Parameters:
orientation - is the orientation of the view can be one of VERTICAL or HORIZONTAL
Method Detail

getMoleculeList

public java.util.List getMoleculeList()
Returns the molecule object list displayed

Returns:
the molecule object list displayed

setWaiting

public void setWaiting(boolean value)
Sets Waiting mode

Parameters:
value -

isWaiting

public boolean isWaiting()
Returns if molecule view is in waiting mode

Returns:
true if molecule view is in waiting mode

setWaitText

public void setWaitText(java.lang.String text)
Sets text displayed in waiting mode

Parameters:
text -

getWaitText

public java.lang.String getWaitText()
Returns the text displayed in waiting mode

Returns:
the text displayed in waiting mode

setMoleculeList

public void setMoleculeList(java.util.List moleculeList)
Sets the molecule list to be displayed

Parameters:
moleculeList -

setMoleculeList

public void setMoleculeList(java.util.List moleculeList,
                            java.util.HashMap reactionNamesMap,
                            java.lang.String[] reactionNamesArray)
Sets the molecule list to be displayed

Parameters:
moleculeList - are the molecules
reactionNamesMap - are the reaction names rendered above reaction arrows and used as tooltip on arrows (Keys are short names, Values are long names)
reactionNamesArray - are the reaction names rendered above reaction arrows

getReactionNames

public java.lang.String[] getReactionNames()
Returns the reaction names for reaction arrows or null

Returns:
the reaction names for reaction arrows or null

setUnitIncrement

public void setUnitIncrement(int unitIncrement)
Sets the scrollbar unit increment

Parameters:
unitIncrement -

getUnitIncrement

public int getUnitIncrement()
Returns the scrollbar unit increment

Returns:
the scrollbar unit increment

setBlockIncrement

public void setBlockIncrement(int blockIncrement)
Sets the scrollbar block increment

Parameters:
blockIncrement -

getBlockIncrement

public int getBlockIncrement()
Returns the scrollbar block increment

Returns:
the scrollbar block increment

redoLayout

public void redoLayout()
This method re-initializes and draws molecule list.


setBackground

public void setBackground(java.awt.Color bg)
Overrides:
setBackground in class javax.swing.JComponent

getBackground

public java.awt.Color getBackground()
Overrides:
getBackground in class java.awt.Component

setShowArrows

public void setShowArrows(boolean value)
Sets the visibility of arrows among molecules

Parameters:
value -

isShowArrows

public boolean isShowArrows()
Returns if arrows are visible among molecules

Returns:
boolean

isSelectable

public boolean isSelectable()
Returns if molecules are selectable

Returns:
if molecules are selectable

setSelectable

public void setSelectable(boolean selectable)
Sets molecules selectable

Parameters:
selectable - is the new value

addListSelectionListener

public void addListSelectionListener(javax.swing.event.ListSelectionListener listener)
Adds a list selection listener

Parameters:
listener - is the listener to be added

getListSelectionListeners

public javax.swing.event.ListSelectionListener[] getListSelectionListeners()
Returns the array of list selection listeners

Returns:
the array of list selection listeners

removeListSelectionListener

public void removeListSelectionListener(javax.swing.event.ListSelectionListener listener)
Removes a list selection listener

Parameters:
listener - is the listener to be removed

fireSelectionValueChanged

protected void fireSelectionValueChanged(int firstIndex,
                                         int lastIndex,
                                         boolean isAdjusting)
Fires the list selection change event to all registered listeners

Parameters:
firstIndex -
lastIndex -
isAdjusting -

clearSelection

public void clearSelection()
Clears the selection


getSelectedIndex

public int getSelectedIndex()
Returns the selected index, or -1

Returns:
the selected index, or -1

getSelectedValue

public java.lang.Object getSelectedValue()
Returns the selected value, or null

Returns:
the selected value, or null

isSelectedIndex

public boolean isSelectedIndex(int index)
Returns true, if index is selected

Parameters:
index -
Returns:
true, if index is selected

isSelectionEmpty

public boolean isSelectionEmpty()
Returns true, if no molecule selected

Returns:
true, if no molecule selected

setSelectedIndex

public void setSelectedIndex(int index)
Sets the selected index

Parameters:
index -

setEnabled

public void setEnabled(boolean enabled)
Overrides:
setEnabled in class javax.swing.JComponent