public class DatabaseView extends javax.swing.JPanel implements java.awt.event.ActionListener, EditDBEntryDialogListener, javax.swing.event.ListSelectionListener, java.awt.event.MouseMotionListener
Modifier and Type | Field and Description |
---|---|
static java.util.Hashtable<java.lang.String,java.lang.Integer> |
ModelByFile |
javax.swing.JScrollPane |
scr2 |
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DatabaseView()
The constructor builds up the database Gui without setting any contents
yet
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent arg0)
Possible clicks on one of the 4 DB-Toolbar Buttons are handled here
|
void |
activateAddOptions(boolean b)
Turn the Options to add an Entry to the Membrane on or off
|
void |
addDatabaseViewListener(DatabaseViewListener listener)
Sets the listener to invoke Actions for Parent Classes
|
void |
addFromRSCB(java.io.File file)
Add a protein to the database.
|
void |
addFromRSCB(java.io.File file,
int group)
Add a protein or lipid to the database.
|
void |
addRow(java.util.Vector rowData,
int group)
adds a row of data to a table
|
java.io.File |
askPDBFile(java.io.File dir)
Pops up a Filechooser where the User may select a PDB File.
|
void |
autofill() |
void |
changeModelForFile(java.io.File file,
int model) |
void |
configureTables()
Configurates the Tables
|
boolean |
dbContainsCode(java.lang.String code) |
boolean |
dbContainsPdbFile(java.io.File file)
Tests if an Entry with the passed File already exists in both tables
|
void |
doLayout()
Overrides doLayout
|
void |
editEntry()
Opens a Dialog where the currently highlighted Entry can be edited
|
void |
fireUpdateTablesOnMembraneModel()
Just performs an update on the two tables.
|
java.util.Vector<java.lang.String>[] |
getAllLipids()
Returns all rowdatas for Lipids
|
java.util.Vector<java.lang.String>[] |
getAllProteins()
Returns all rowdatas for Proteins
|
org.jdom.Document |
getContents()
Prepares a Document for the Dom Parser to save and return it
|
java.io.File |
getCurrentFile()
Returns the current File the DB is set to
|
java.util.Vector |
getEmptyRowData(java.io.File file)
Creates and returns a new rowdata that is empty except for the path of
the passed file
|
int |
getTableOnFrontIndex()
Returns which table is currently on Front
|
boolean |
isCurrentlyEmpty() |
void |
mouseDragged(java.awt.event.MouseEvent arg0) |
void |
mouseMoved(java.awt.event.MouseEvent arg0) |
void |
resetModels()
sets new Models on the tables which means that they get completely
cleared
|
java.lang.String |
retrieveUserCommentFromDB(java.io.File file,
int mode) |
void |
setContents(org.jdom.Document doc)
Set up the tables values according to a DOM-Tree in an Document that was
produced in the Parser.
|
void |
setCurrentFile(java.io.File currentFile)
Sets the current File.
|
void |
storeSizes()
Stores the sizes of the columns in the Config
|
void |
updateAllFileAttributes() |
void |
valueChanged(javax.swing.event.ListSelectionEvent arg0) |
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, 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, 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, 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, transferFocusBackward, transferFocusUpCycle
public javax.swing.JScrollPane scr2
public static java.util.Hashtable<java.lang.String,java.lang.Integer> ModelByFile
public DatabaseView()
public void doLayout()
doLayout
in class java.awt.Container
public void configureTables()
public void addRow(java.util.Vector rowData, int group)
rowData
- a vecot containing data for each columngroup
- which table to add intopublic void editEntry()
public boolean dbContainsPdbFile(java.io.File file)
dbContainsPdbFile
in interface EditDBEntryDialogListener
file
- public void resetModels()
public void fireUpdateTablesOnMembraneModel()
public void setContents(org.jdom.Document doc)
doc
- the DOM Document created from the parserpublic org.jdom.Document getContents()
public void addDatabaseViewListener(DatabaseViewListener listener)
listener
- public java.io.File getCurrentFile()
public void setCurrentFile(java.io.File currentFile)
currentFile
- public void activateAddOptions(boolean b)
b
- public java.io.File askPDBFile(java.io.File dir)
askPDBFile
in interface EditDBEntryDialogListener
dir
- the file initially selectedpublic void actionPerformed(java.awt.event.ActionEvent arg0)
actionPerformed
in interface java.awt.event.ActionListener
public int getTableOnFrontIndex()
getTableOnFrontIndex
in interface EditDBEntryDialogListener
public java.util.Vector getEmptyRowData(java.io.File file)
file
- public void storeSizes()
public java.util.Vector<java.lang.String>[] getAllProteins()
public java.util.Vector<java.lang.String>[] getAllLipids()
public void addFromRSCB(java.io.File file, int group)
file
- PDB file pathgroup
- protein: 0, lipid: 1public void addFromRSCB(java.io.File file)
file
- PDB file pathpublic void valueChanged(javax.swing.event.ListSelectionEvent arg0)
valueChanged
in interface javax.swing.event.ListSelectionListener
public void mouseDragged(java.awt.event.MouseEvent arg0)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent arg0)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void updateAllFileAttributes()
public void changeModelForFile(java.io.File file, int model)
public java.lang.String retrieveUserCommentFromDB(java.io.File file, int mode)
public boolean isCurrentlyEmpty()
public void autofill()
public boolean dbContainsCode(java.lang.String code)