msg
Class ProteinElement

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 msg.ProteinElement
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class ProteinElement
extends javax.swing.JPanel
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ActionListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
ProteinElement(Msg_panel alles, ProteinMatrix panel, java.lang.String pdbcode, java.lang.String id, java.lang.String component, java.lang.String subcomponent, int x, int y, int vWidth, int vHeight, java.awt.Color colorBackground, int pX, int pY, int sizeX, int sizeY, int ratio, int mOffsetX, int mOffsetY, int rotation, java.util.Vector lipids)
          Initializes a new ProteinElement.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Performs the action of the action command.
 void activateHighlight()
          Highlights all components with the same id.
 void changeLipidCubeRotation(int sizeX, int sizeY, int rotation)
          Changes the values in the matrix of the lipids for a rotation of 90° of the matrix.
 void createProteinElement(java.lang.String id, int x, int y, int sizeX, int sizeY)
          Creates a new ProteinElement.
 void deactivateHighlight()
          Remove highlight of all components with the same id.
 java.lang.String generateToolTip()
          Generates the tooltip for this component.
 Msg_panel getAlles()
           
 int getBorderSize()
           
 int getBorderSizeHl()
           
 java.awt.Color getColorBackground()
           
 java.awt.Color getColorBackgroundHl()
           
 java.awt.Color getColorBackgroundPressed()
           
 java.awt.Color getColorBorder()
           
 java.awt.Color getColorBorderHl()
           
 java.awt.Color getColorText()
           
 java.awt.Color getColorTextPressed()
           
 java.lang.String getComponent()
           
 java.lang.String getId()
           
 java.lang.String getKey()
           
 java.util.Vector getLipids()
           
 java.util.Vector getLipids2()
           
 int getMOffsetX()
           
 int getMOffsetY()
           
 int getOldMouseX()
           
 int getOldMouseY()
           
 java.lang.String getPdbcode()
           
 javax.swing.JPopupMenu getPopupRotate()
           
 javax.swing.JLabel getProteinLabel()
           
 ProteinMatrix getProteinMatrix()
           
 int getPX()
           
 int getPXnew()
           
 int getPY()
           
 int getPYnew()
           
 int getRatio()
           
 java.lang.String getRotateProteinText()
           
 int getRotationAngle()
           
 int getSizeX()
           
 int getSizeY()
           
 int getStartMouseX()
           
 int getStartMouseY()
           
 java.lang.String getSubcomponent()
           
 int getVHeight()
           
 int getVWidth()
           
 int getXa()
           
 int getYa()
           
 boolean isPressed()
           
 void mouseClicked(java.awt.event.MouseEvent e)
          Features when the mouse button is clicked.
 void mouseDragged(java.awt.event.MouseEvent e)
          Features when the mouse is dragged with pressed left button.
 void mouseEntered(java.awt.event.MouseEvent e)
          Features when the mouse enteres this component.
 void mouseExited(java.awt.event.MouseEvent e)
          Features when the mouse lefts this component.
 void mouseMoved(java.awt.event.MouseEvent e)
          Features when the mouse is moved.
 void mousePressed(java.awt.event.MouseEvent e)
          Features when the mouse button is pressed.
 void mouseReleased(java.awt.event.MouseEvent e)
          Features when the mouse button is released.
 void paintComponent(java.awt.Graphics g)
          Paints the component.
 boolean rotateProteinElement()
          Rotates an ProteinElement with 90°.
 void setAlles(Msg_panel alles)
           
 void setBorderSize(int borderSize)
           
 void setBorderSizeHl(int borderSizeHl)
           
 void setColorBackground(java.awt.Color colorBackground)
           
 void setColorBackgroundHl(java.awt.Color colorBackgroundHl)
           
 void setColorBackgroundPressed(java.awt.Color colorBackgroundPressed)
           
 void setColorBorder(java.awt.Color colorBorder)
           
 void setColorBorderHl(java.awt.Color colorBorderHl)
           
 void setColorText(java.awt.Color colorText)
           
 void setColorTextPressed(java.awt.Color colorTextPressed)
           
 void setComponent(java.lang.String component)
           
 void setId(java.lang.String id)
           
 void setKey(java.lang.String key)
           
 void setLipids(java.util.Vector lipids)
           
 void setMOffsetX(int offsetX)
           
 void setMOffsetY(int offsetY)
           
 void setOldMouseX(int oldMouseX)
           
 void setOldMouseY(int oldMouseY)
           
 void setPdbcode(java.lang.String pdbcode)
           
 void setPopupRotate(javax.swing.JPopupMenu popupRotate)
           
 void setPressed(boolean pressed)
           
 void setProteinLabel(javax.swing.JLabel proteinLabel)
           
 void setProteinMatrix(ProteinMatrix proteinMatrix)
           
 void setPX(int px)
           
 void setPXnew(int xnew)
           
 void setPY(int py)
           
 void setPYnew(int ynew)
           
 void setRatio(int ratio)
           
 void setRotateProteinText(java.lang.String rotateProteinText)
           
 void setRotationAngle(int rotationAngle)
           
 void setSizeX(int sizeX)
           
 void setSizeY(int sizeY)
           
 void setStartMouseX(int startMouseX)
           
 void setStartMouseY(int startMouseY)
           
 void setSubcomponent(java.lang.String subcomponent)
           
 void setVHeight(int height)
           
 void setVWidth(int width)
           
 void setXa(int xa)
           
 void setYa(int ya)
           
 boolean testProteinMatrixPosition()
          Tests if the element could be moved to the new position in the given matrix.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
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, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProteinElement

public ProteinElement(Msg_panel alles,
                      ProteinMatrix panel,
                      java.lang.String pdbcode,
                      java.lang.String id,
                      java.lang.String component,
                      java.lang.String subcomponent,
                      int x,
                      int y,
                      int vWidth,
                      int vHeight,
                      java.awt.Color colorBackground,
                      int pX,
                      int pY,
                      int sizeX,
                      int sizeY,
                      int ratio,
                      int mOffsetX,
                      int mOffsetY,
                      int rotation,
                      java.util.Vector lipids)
Initializes a new ProteinElement.

Parameters:
alles - Msg_panel
panel - ProteinMatrix
pdbcode - String
id - String
component - String
subcomponent - String
x - int
y - int
vWidth - int
vHeight - int
colorBackground - Color
pX - int
pY - int
sizeX - int
sizeY - int
ratio - int
mOffsetX - int
mOffsetY - int
rotation - int
lipids - Vector
Method Detail

createProteinElement

public void createProteinElement(java.lang.String id,
                                 int x,
                                 int y,
                                 int sizeX,
                                 int sizeY)
Creates a new ProteinElement.

Parameters:
id - String
x - int
y - int
sizeX - int
sizeY - int

rotateProteinElement

public boolean rotateProteinElement()
Rotates an ProteinElement with 90°.

Returns:
boolean (rotations finished/possible)

testProteinMatrixPosition

public boolean testProteinMatrixPosition()
Tests if the element could be moved to the new position in the given matrix.

Returns:
boolean (test the new position for the element)

paintComponent

public void paintComponent(java.awt.Graphics g)
Paints the component.

Overrides:
paintComponent in class javax.swing.JComponent

changeLipidCubeRotation

public void changeLipidCubeRotation(int sizeX,
                                    int sizeY,
                                    int rotation)
Changes the values in the matrix of the lipids for a rotation of 90° of the matrix.

Parameters:
sizeX - int
sizeY - int
rotation - int

generateToolTip

public java.lang.String generateToolTip()
Generates the tooltip for this component.

Returns:
String (contains the tooltip content)

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Features when the mouse enteres this component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Features when the mouse lefts this component.

Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Features when the mouse button is pressed.

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Features when the mouse button is released.

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Features when the mouse is dragged with pressed left button.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Features when the mouse is moved.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Features when the mouse button is clicked.

Specified by:
mouseClicked in interface java.awt.event.MouseListener

activateHighlight

public void activateHighlight()
Highlights all components with the same id.


deactivateHighlight

public void deactivateHighlight()
Remove highlight of all components with the same id.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Performs the action of the action command.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

getLipids2

public java.util.Vector getLipids2()
Returns:
Returns the lipids.

getAlles

public Msg_panel getAlles()
Returns:
Returns the alles.

setAlles

public void setAlles(Msg_panel alles)
Parameters:
alles - The alles to set.

getBorderSize

public int getBorderSize()
Returns:
Returns the borderSize.

setBorderSize

public void setBorderSize(int borderSize)
Parameters:
borderSize - The borderSize to set.

getBorderSizeHl

public int getBorderSizeHl()
Returns:
Returns the borderSizeHl.

setBorderSizeHl

public void setBorderSizeHl(int borderSizeHl)
Parameters:
borderSizeHl - The borderSizeHl to set.

getColorBackground

public java.awt.Color getColorBackground()
Returns:
Returns the colorBackground.

setColorBackground

public void setColorBackground(java.awt.Color colorBackground)
Parameters:
colorBackground - The colorBackground to set.

getColorBackgroundHl

public java.awt.Color getColorBackgroundHl()
Returns:
Returns the colorBackgroundHl.

setColorBackgroundHl

public void setColorBackgroundHl(java.awt.Color colorBackgroundHl)
Parameters:
colorBackgroundHl - The colorBackgroundHl to set.

getColorBackgroundPressed

public java.awt.Color getColorBackgroundPressed()
Returns:
Returns the colorBackgroundPressed.

setColorBackgroundPressed

public void setColorBackgroundPressed(java.awt.Color colorBackgroundPressed)
Parameters:
colorBackgroundPressed - The colorBackgroundPressed to set.

getColorBorder

public java.awt.Color getColorBorder()
Returns:
Returns the colorBorder.

setColorBorder

public void setColorBorder(java.awt.Color colorBorder)
Parameters:
colorBorder - The colorBorder to set.

getColorBorderHl

public java.awt.Color getColorBorderHl()
Returns:
Returns the colorBorderHl.

setColorBorderHl

public void setColorBorderHl(java.awt.Color colorBorderHl)
Parameters:
colorBorderHl - The colorBorderHl to set.

getColorText

public java.awt.Color getColorText()
Returns:
Returns the colorText.

setColorText

public void setColorText(java.awt.Color colorText)
Parameters:
colorText - The colorText to set.

getColorTextPressed

public java.awt.Color getColorTextPressed()
Returns:
Returns the colorTextPressed.

setColorTextPressed

public void setColorTextPressed(java.awt.Color colorTextPressed)
Parameters:
colorTextPressed - The colorTextPressed to set.

getComponent

public java.lang.String getComponent()
Returns:
Returns the component.

setComponent

public void setComponent(java.lang.String component)
Parameters:
component - The component to set.

getId

public java.lang.String getId()
Returns:
Returns the id.

setId

public void setId(java.lang.String id)
Parameters:
id - The id to set.

getKey

public java.lang.String getKey()
Returns:
Returns the key.

setKey

public void setKey(java.lang.String key)
Parameters:
key - The key to set.

getLipids

public java.util.Vector getLipids()
Returns:
Returns the lipids.

setLipids

public void setLipids(java.util.Vector lipids)
Parameters:
lipids - The lipids to set.

getMOffsetX

public int getMOffsetX()
Returns:
Returns the mOffsetX.

setMOffsetX

public void setMOffsetX(int offsetX)
Parameters:
offsetX - The mOffsetX to set.

getMOffsetY

public int getMOffsetY()
Returns:
Returns the mOffsetY.

setMOffsetY

public void setMOffsetY(int offsetY)
Parameters:
offsetY - The mOffsetY to set.

getOldMouseX

public int getOldMouseX()
Returns:
Returns the oldMouseX.

setOldMouseX

public void setOldMouseX(int oldMouseX)
Parameters:
oldMouseX - The oldMouseX to set.

getOldMouseY

public int getOldMouseY()
Returns:
Returns the oldMouseY.

setOldMouseY

public void setOldMouseY(int oldMouseY)
Parameters:
oldMouseY - The oldMouseY to set.

getPdbcode

public java.lang.String getPdbcode()
Returns:
Returns the pdbcode.

setPdbcode

public void setPdbcode(java.lang.String pdbcode)
Parameters:
pdbcode - The pdbcode to set.

getPopupRotate

public javax.swing.JPopupMenu getPopupRotate()
Returns:
Returns the popupRotate.

setPopupRotate

public void setPopupRotate(javax.swing.JPopupMenu popupRotate)
Parameters:
popupRotate - The popupRotate to set.

isPressed

public boolean isPressed()
Returns:
Returns the pressed.

setPressed

public void setPressed(boolean pressed)
Parameters:
pressed - The pressed to set.

getProteinLabel

public javax.swing.JLabel getProteinLabel()
Returns:
Returns the proteinLabel.

setProteinLabel

public void setProteinLabel(javax.swing.JLabel proteinLabel)
Parameters:
proteinLabel - The proteinLabel to set.

getProteinMatrix

public ProteinMatrix getProteinMatrix()
Returns:
Returns the proteinMatrix.

setProteinMatrix

public void setProteinMatrix(ProteinMatrix proteinMatrix)
Parameters:
proteinMatrix - The proteinMatrix to set.

getPX

public int getPX()
Returns:
Returns the pX.

setPX

public void setPX(int px)
Parameters:
px - The pX to set.

getPXnew

public int getPXnew()
Returns:
Returns the pXnew.

setPXnew

public void setPXnew(int xnew)
Parameters:
xnew - The pXnew to set.

getPY

public int getPY()
Returns:
Returns the pY.

setPY

public void setPY(int py)
Parameters:
py - The pY to set.

getPYnew

public int getPYnew()
Returns:
Returns the pYnew.

setPYnew

public void setPYnew(int ynew)
Parameters:
ynew - The pYnew to set.

getRatio

public int getRatio()
Returns:
Returns the ratio.

setRatio

public void setRatio(int ratio)
Parameters:
ratio - The ratio to set.

getRotateProteinText

public java.lang.String getRotateProteinText()
Returns:
Returns the rotateProteinText.

setRotateProteinText

public void setRotateProteinText(java.lang.String rotateProteinText)
Parameters:
rotateProteinText - The rotateProteinText to set.

getRotationAngle

public int getRotationAngle()
Returns:
Returns the rotationAngle.

setRotationAngle

public void setRotationAngle(int rotationAngle)
Parameters:
rotationAngle - The rotationAngle to set.

getSizeX

public int getSizeX()
Returns:
Returns the sizeX.

setSizeX

public void setSizeX(int sizeX)
Parameters:
sizeX - The sizeX to set.

getSizeY

public int getSizeY()
Returns:
Returns the sizeY.

setSizeY

public void setSizeY(int sizeY)
Parameters:
sizeY - The sizeY to set.

getStartMouseX

public int getStartMouseX()
Returns:
Returns the startMouseX.

setStartMouseX

public void setStartMouseX(int startMouseX)
Parameters:
startMouseX - The startMouseX to set.

getStartMouseY

public int getStartMouseY()
Returns:
Returns the startMouseY.

setStartMouseY

public void setStartMouseY(int startMouseY)
Parameters:
startMouseY - The startMouseY to set.

getSubcomponent

public java.lang.String getSubcomponent()
Returns:
Returns the subcomponent.

setSubcomponent

public void setSubcomponent(java.lang.String subcomponent)
Parameters:
subcomponent - The subcomponent to set.

getVHeight

public int getVHeight()
Returns:
Returns the vHeight.

setVHeight

public void setVHeight(int height)
Parameters:
height - The vHeight to set.

getVWidth

public int getVWidth()
Returns:
Returns the vWidth.

setVWidth

public void setVWidth(int width)
Parameters:
width - The vWidth to set.

getXa

public int getXa()
Returns:
Returns the xa.

setXa

public void setXa(int xa)
Parameters:
xa - The xa to set.

getYa

public int getYa()
Returns:
Returns the ya.

setYa

public void setYa(int ya)
Parameters:
ya - The ya to set.