|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
belka.draw.MolPanel
public class MolPanel
Panel to draw structures of molecules.
Molecule to draw can be added by function
addMoleculeToDraw(Molecule)
and removed by function
removeMoleculeToDraw(Molecule)
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
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 | |
---|---|
MolPanel()
Object constructor. |
Method Summary | |
---|---|
void |
addMoleculeToDraw(Molecule mol)
Adds a molecule to draw in the panel. |
Molecule[] |
getMoleculesToDraw()
Returs molecules drawn in the panel. |
Dimension |
getPreferredSize()
Return preferred size of a panel. |
void |
paint(Graphics g)
The function painting molecules. |
void |
processEvent(AWTEvent e)
Function to process events. |
void |
removeMoleculeToDraw(Molecule mol)
Removes molecule from the panel. |
void |
setBounds(int x,
int y,
int width,
int height)
Sets bounds of the panel. |
void |
updateMoleculeView()
The function updates the view of molecules. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MolPanel()
Method Detail |
---|
public void updateMoleculeView()
paint(Graphics)
. The function sets nessesary flags for
paint(Graphics)
to know how to update the view.
public Molecule[] getMoleculesToDraw()
public void addMoleculeToDraw(Molecule mol)
public void removeMoleculeToDraw(Molecule mol)
public void setBounds(int x, int y, int width, int height)
setBounds
in class Component
x
- coordinate of the left edgey
- coordinate of the upper edgewidth
- width of the panelheight
- height of the panelpublic Dimension getPreferredSize()
getPreferredSize
in class JComponent
public void paint(Graphics g)
paint
in class JComponent
g
- graphics to paint on.public void processEvent(AWTEvent e)
processEvent
in class Container
e
- event
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |