|
|||||||||
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
chemaxon.marvin.space.GraphicScene
public class GraphicScene
GraphicScene
is the main "entry point" to MarvinSpace. It is the
top level class of the visualization class hierarchy. It extends JPanel
to be able to use it as a swing component,
and represents a hardware accelerated OpenGL2 context called canvas.
GraphicScene
(scene) consits of cells, represented by
the GraphicCell
class. By default the entire scene is one cell.
Cells visualize GraphicComponents
(components) associtated to them.
Visualization settings are primarily passed to the scene namely camera view,
projection, rotation, zooming, etc. Component specific settings are passed
to each individual component by the cells.
Breif overview of main functions:
GraphicScene graphicScene = new GraphicScene( rowCount, columnCount ); graphicScene.setSize(600, 600); this.getContentPane().add(graphicScene); this.show(); graphicScene.getEventHandler().readMolecule(moleculeFile.pdb); graphicScene.processEvent("Protein.DrawType", "Stick"); graphicScene.processEvent( "Ligand.DrawType", "Spacefill"); graphicScene.processEvent( "Quality", "High");
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
CELL_RANGE
|
static int |
COMPONENT_RANGE
|
static java.lang.String |
GLInfo
|
static int |
MODE_MOVING
|
static int |
MODE_STANDING
|
static int |
SCENE_RANGE
|
static int |
VERBOSE_LEVEL_BASIC
|
static int |
VERBOSE_LEVEL_DEVEL
|
static int |
VERBOSE_LEVEL_NONE
|
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 | |
---|---|
GraphicScene()
Creates a hardware accelerated and double buffered GraphicScene . |
|
GraphicScene(int rowCount,
int columnCount)
Creates a hardware accelerated and double buffered GraphicScene. |
Method Summary | |
---|---|
void |
activateContainerCell(GraphicComponent component)
The containing cell of the GraphicComponent will be the active cell of the scene. |
boolean |
addComponent(GraphicComponent component)
Adds a component to the active or to the first cell. |
boolean |
addComponent(GraphicComponent component,
int cellIndex)
Adds a component to the cell having the given index. |
boolean |
addComponentToEmptyCell(GraphicComponent gc)
Adds a component to an empty cell. |
chemaxon.marvin.space.CoordinateComponent |
addCoordinateSystem(int cellIndex)
Adds a dummy graphic component that represents the coordinate system. |
void |
clearSelection(int index)
Sets all components and parts of components to be unselected in the given cell. |
boolean |
componentBecameSelected(int cellIdx)
Returns true if a component became selected previously in the given cell. |
boolean |
componentBecameUnselected(int cellIdx)
Returns true if a component became unselected previously in the given cell. |
boolean |
containsComponent(GraphicComponent gc)
Returns true if the component exists in the scene. |
int |
createImage(java.nio.Buffer buf,
int imageWidth,
int imageHeight)
|
void |
createNewCell()
Sets an empty cell to be the active cell. |
void |
deactivateActiveCell()
Sets the active cell to be no longer active. |
void |
display(javax.media.opengl.GLAutoDrawable glAutoDrawable)
Warning: this function should not be called directly, use refresh()
or redraw() instead. |
void |
displayChanged(javax.media.opengl.GLAutoDrawable glAutoDrawable,
boolean b,
boolean b1)
Called by the system. |
void |
dispose(javax.media.opengl.GLAutoDrawable glad)
|
void |
exclusiveSelection(chemaxon.marvin.space.UOID id)
Exclusive selection in the given component in its container cell. |
void |
extendSelection(chemaxon.marvin.space.UOID id)
Additive selection in the given component in its container cell. |
void |
fadeSelectedComponents()
Sets the drawing mode of all selected elements to faded so it will be hardly visible, and prevents them from clicking. |
void |
fadeUnselectedComponents()
Sets the drawing mode of all unselected elements to faded so it will be hardly visible, and prevents them from clicking. |
GraphicCell |
getActiveCell()
Returns the active cell of the scene. |
int |
getActiveCellIndex()
Returns the index of the active cell. |
java.util.ArrayList |
getAllComponents(java.lang.Class c)
|
java.awt.Color |
getBackgroundColor()
Returns the background color of the scene. |
java.awt.image.BufferedImage |
getBufferedImage()
Returns the Canvas as a BufferedImage with the same size in pixels. |
GraphicCell |
getCell(int cellIndex)
Returns the GraphicCell which has the given index. |
int |
getCellButtom()
Returns the y coordinate of the buttom of the active cell in pixels. |
int |
getCellCount()
Returns the number of cells in the scene. |
java.lang.String |
getCellDrawProperty(int cellIdx,
java.lang.String name)
Returns the draw property from the given cell or null if not defined. |
java.lang.String |
getCellDrawProperty(java.lang.String name)
Returns the draw property from the active cell or null if there is no active cell or the property is not defined in the active cell. |
int |
getCellHeight()
Returns the height of the cells. |
int |
getCellLeft()
Returns the x coordinate of the left edge of the active cell. |
int |
getCellRight()
Returns the x coordinate of the right edge of the active cell. |
int |
getCellTop()
Returns the y coordinate of the top of the active cell. |
int |
getCellWidth()
Returns the width of the cells. |
int |
getColumnCount()
Returns the number of columns in the scene. |
GraphicComponent |
getControllableObject(java.lang.String type)
Returns a selected component from the active cell what can be controlled by the given tye controller. |
java.lang.String |
getDrawProperty(java.lang.String name)
Returns the draw property of the scene or null if the property is not defined. |
chemaxon.marvin.space.MSpaceEventHandler |
getEventHandler()
Returns the event handler of the scene. |
javax.media.opengl.GL2 |
getGL()
Returns the OpenGL2 interface. |
javax.media.opengl.GLAutoDrawable |
getGLAutoDrawable()
Returns the GLAutoDrawable object. |
java.lang.String |
getGLInfo(boolean extended)
Returns the OpenGL2 Renderer, Version, and Vendor and Extensions in VERBOSE_LEVEL_DEVEL mode. |
javax.media.opengl.awt.GLJPanel |
getGLJPanel()
Returns the GL2 canvas. |
GraphicComponent |
getGraphicComponent(int componentIndex)
Returns the GraphicComponent having the given index in the active cell. |
GraphicComponent |
getGraphicComponent(int cellIndex,
int componentIndex)
Returns the GraphicComponent of the given cell. |
GraphicComponent |
getGraphicComponent(chemaxon.marvin.space.UOID id)
Returns the GraphicComponent with the given id. |
int |
getGraphicComponentCount()
Returns the total number of GraphicComponent s in the cells. |
int |
getRowCount()
Returns the number of rows in the scene. |
double |
getShiftX(int cellIndex)
Returns corrected shifting value of the given cell. |
double |
getShiftY(int cellIndex)
Returns corrected shifting value of the given cell. |
float[] |
getTransformationCenter()
Returns the center of transformation of the active cell or null if there is no active cell. |
int |
getVerboseLevel()
Gets the verbose level. |
int |
getViewportHeight()
Returns the phisical height of the viewport. |
int |
getViewportWidth()
Returns the phisical width of the viewport. |
boolean |
hasSelectedComponent()
Returns true if there is at least 1 selected component in the active cell. |
boolean |
hasSelectedComponentElement()
Returns true if there is at least 1 selected ComponentElement
in the active cell. |
void |
hideAllComponents(java.lang.Class c)
Sets all components of the given class in the active cell to be invisible. |
void |
hideAllMonitors()
Sets all monitor component of the active cell to invisible. |
void |
hideSelectedComponents()
Hides all selected components from the active cell with all related components (connected monitors, surface of a molecule). |
void |
hideUnselectedComponents()
Hides all unselected components from the active cell with all related components (connected monitors, surface of a molecule). |
void |
init(javax.media.opengl.GLAutoDrawable glAutoDrawable)
Called by the drawable immediately after the OpenGL2 context is initialized for the first time. |
void |
invertSelection(chemaxon.marvin.space.UOID id)
The previously picked part of the component will be selected if it was unselected and vice versa. |
boolean |
isActiveCell(int cellIndex)
Returns true if the cell having cellIndex is the active cell of the scene. |
boolean |
isAntialiasEnabled()
Returns true if full-screen antialias is enabled. |
boolean |
isGLInitialized()
Returns true if the OpenGL2 canvas is already initialized. |
boolean |
isSmoothBackgroundEnabled()
Returns true if the background is enabled to be smooth, so that it does not have a homogenous color. |
boolean |
isTransparentBackgroundEnabled()
Returns true if the background is transparent. |
boolean |
isVerbose()
Gets the verbose level. |
int |
locateCell(int x,
int y)
Returns the internal index of the cell under x,y position. |
chemaxon.marvin.space.UOID |
locateCellId(int x,
int y)
Returns the id of the cell under x, y position. |
chemaxon.marvin.space.UOID |
locateObject(int x,
int y)
Returns the identifire of the object under x,y position. |
chemaxon.marvin.space.UOID |
locateObject(int x,
int y,
java.lang.Class componentClass)
Returns the identifire of the given class object under x,y position. |
boolean |
locationNearEdge(int x,
int y)
Tells whether the given location is near to any edges of any cell. |
boolean |
locationNearEdgeX(int x,
int y)
Tells whether the given location is near the vertical edges of any cell. |
boolean |
locationNearEdgeY(int x,
int y)
Tells whether the given location is near the horizontal edges of any cell. |
void |
measureFrameRate()
Measures frame rate of drawing. |
void |
paint(java.awt.Graphics g)
|
static void |
printProperties()
|
void |
processAwtEvent(java.awt.AWTEvent evt,
java.lang.String evtID,
java.lang.String evtValue)
The given awt event will go to the queue of events, and will be performed during the next draw. |
void |
processCellEvent(java.lang.String evtID,
java.lang.String evtValue)
The given event will go to the queue of events, and will be performed during the next draw. |
void |
processComponentEvent(java.lang.Object component,
java.lang.String evtID,
java.lang.String evtValue)
The given event will go to the queue of events, and will be performed during the next draw. |
void |
processEvent(java.lang.String evtID,
java.lang.String evtValue)
The given event will go to the queue of events, and will be performed during the next draw. |
void |
redraw()
Redraws the entire scene. |
void |
refresh()
|
void |
removeAllComponents()
Removes all component from the scene and clears the selection panel. |
void |
removeAllComponents(java.lang.Class c)
Removes all component from the scene and clears the selection panel. |
void |
removeComponent(GraphicComponent component)
Removes a component from the scene. |
void |
removeComponent(chemaxon.marvin.space.UOID componentId)
Removes a component from the scene. |
void |
removeSelectedComponents()
Removes all selected components from the active cell with all related components (connected monitors, surface of a molecule). |
void |
removeUnselectedComponents()
Removes all unselected components from the active cell with all related components (connected monitors, surface of a molecule). |
void |
removeUnselectedMonitors()
Removes all unselected monitor component from the scene. |
void |
resetAll()
Resets view settings of all cells including rotation, zoom and shifting. |
void |
resetSettings()
Sets all draw properties to the default value and resets view. |
void |
resetView()
Resets view settings of the active cell including rotation, zoom and shifting. |
void |
reshape(javax.media.opengl.GLAutoDrawable glAutoDrawable,
int x,
int y,
int width,
int height)
Called by the drawable during the first repaint after the component has been resized. |
void |
rotate(double rx,
double ry,
double rz)
Sets the given rotation factor in the active cell or in every cells in case of synchronous mode. |
void |
rotateTo(float[] rm)
Sets the matrix of rotation explicitly in the active cell or in every cells in case of synchronous mode. |
void |
setActiveCell(int i)
Sets the ith cell to be the active cell of the scene. |
void |
setAntialias(boolean state)
Enables/disables full scene anti-aliasing. |
void |
setBackgroundColor(java.awt.Color newColor)
Sets the background color of the scene and an alpha value of 0 (transparent background). |
void |
setBounds(int x,
int y,
int width,
int height)
Moves and resizes this component. |
void |
setCellDrawProperty(int cellIndex,
java.lang.String propertyName,
java.lang.String propertyValue)
Sets the given draw property to the given cell. |
void |
setDrawProperty(java.util.Properties properties)
Sets the given draw properties to the entire scene. |
void |
setDrawProperty(java.lang.String propertyName,
java.lang.String propertyValue)
Sets the draw property for all cells. |
void |
setDrawProperty(java.lang.String propertyName,
java.lang.String propertyValue,
int range)
Sets the draw property either to the entire scene or to the active cell. |
void |
setDropTarget(java.awt.dnd.DropTargetListener dl)
Sets the DropTarget of the graphic canvas. |
void |
setMotionMode(int mode)
Notifies every cell of moving and standing modes. |
void |
setNearEdgeTolerance(int tolerance)
Sets a border near the boundary of the cells in which mouse handling can work other way. |
void |
setProgressBar(chemaxon.marvin.space.gui.JMSpaceProgressBar progressBar)
|
void |
setSceneSize(int rowCount,
int columnCount)
Sets the number of rows and columns. |
void |
setSize(int sizex,
int sizey)
Sets the physical size of the scene. |
void |
setSmoothBackground(boolean b)
Enables/disables shaded background. |
void |
setSynchronousMode(boolean state)
Sets handling of cells to synchronous/asynchronous. |
void |
setTransformationCenter(float[] c)
Sets the transformation center explicitly to the given value. |
void |
setTransformationCenter(chemaxon.marvin.space.UOID id)
Sets the center of transformation of the active cell to the coordinates of the named component. |
void |
setTransparentBackground(boolean b)
Enables/disables transparent background color. |
void |
setVerbose(boolean flag)
Sets the verbose level on/off. |
void |
setVerbose(int level)
Sets the verbose level to the given level. |
void |
shift(double shiftx,
double shifty)
Sets the given shift factor in the active cell or in every cells in case of synchronous mode. |
void |
shiftAnimated(double shiftx,
double shifty,
int n)
Sets the given shift factor dividing by n parts. |
void |
showAllComponents()
Sets all invisible component of the active cell to visible. |
void |
showAllComponents(java.lang.Class c)
Sets all components of the given class in the active cell to be visible. |
void |
showAllMonitors()
Sets all monitor component of the active cell to visible. |
void |
showFaded()
Sets the drawing mode of all faded elements back to the original drawing mode. |
void |
zoom(double factor)
Sets the given zoom factor in the active cell or in every cells in case of synchronous mode. |
void |
zoomAnimated(double f,
int n)
Sets the given zoom factor dividing by n parts. |
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, getBaseline, getBaselineResizeBehavior, 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, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, 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 |
---|
public static java.lang.String GLInfo
public static final int MODE_STANDING
public static final int MODE_MOVING
public static final int VERBOSE_LEVEL_NONE
public static final int VERBOSE_LEVEL_BASIC
public static final int VERBOSE_LEVEL_DEVEL
public static final int SCENE_RANGE
public static final int CELL_RANGE
public static final int COMPONENT_RANGE
Constructor Detail |
---|
public GraphicScene() throws java.lang.Exception
GraphicScene
.
It has one cell.
java.lang.Exception
public GraphicScene(int rowCount, int columnCount) throws java.lang.Exception
rowCount * columnCount
cells.
rowCount
- number of rows of cellscolumnCount
- number of columns of cells
java.lang.Exception
Method Detail |
---|
public static void printProperties()
public void setProgressBar(chemaxon.marvin.space.gui.JMSpaceProgressBar progressBar)
public boolean isVerbose()
getVerboseLevel()
.
public int getVerboseLevel()
VERBOSE_LEVEL_NONE
, VERBOSE_LEVEL_BASIC
, VERBOSE_LEVEL_DEVEL
.
public void setVerbose(boolean flag)
setVerbose(int level)
.
public void setVerbose(int level)
VERBOSE_LEVEL_NONE
, VERBOSE_LEVEL_BASIC
, VERBOSE_LEVEL_DEVEL
.
level
- level of verbosenesspublic void setDropTarget(java.awt.dnd.DropTargetListener dl)
DropTarget
of the graphic canvas.
dl
- public void processAwtEvent(java.awt.AWTEvent evt, java.lang.String evtID, java.lang.String evtValue)
evt
- AWTEvent
to processevtID
- identifier of the eventevtValue
- value of the event or empty String
public void processEvent(java.lang.String evtID, java.lang.String evtValue)
evtID
- identifier of the eventevtValue
- value of the eventpublic void processCellEvent(java.lang.String evtID, java.lang.String evtValue)
evtID
- identifier of the eventevtValue
- value of the eventpublic void processComponentEvent(java.lang.Object component, java.lang.String evtID, java.lang.String evtValue)
component
- range of eventevtID
- identifier of the eventevtValue
- value of the eventpublic chemaxon.marvin.space.MSpaceEventHandler getEventHandler()
public void setMotionMode(int mode)
mode
- see MODE_MOVING
, MODE_STANDING
public void setSynchronousMode(boolean state)
state
- synchronous mode is enabled or notpublic void measureFrameRate()
public int getViewportWidth()
public int getViewportHeight()
public void setSceneSize(int rowCount, int columnCount) throws java.lang.Exception
rowCount
- number of rows, must be greater than 0columnCount
- number of columns, must be greater than 0
java.lang.Exception
- on initialization failurepublic void createNewCell() throws java.lang.Exception
java.lang.Exception
public void setBounds(int x, int y, int width, int height)
x
and y
, and the
new size is specified by width
and height
.
setBounds
in class java.awt.Component
x
- the new x-coordinate of this componenty
- the new y-coordinate of this componentwidth
- the new width
of this componentheight
- the new height
of this
componentpublic void setSize(int sizex, int sizey)
setSize
in class java.awt.Component
sizex
- width in pixelssizey
- height in pixelspublic void setNearEdgeTolerance(int tolerance)
tolerance
- in pixelspublic int getCellTop()
public int getCellButtom()
public int getCellLeft()
public int getCellRight()
public int getCellWidth()
public int getCellHeight()
public int getRowCount()
public int getColumnCount()
public int getCellCount()
public int getGraphicComponentCount()
GraphicComponent
s in the cells.
public boolean addComponent(GraphicComponent component) throws java.lang.Exception
component
- to add
java.lang.Exception
public boolean addComponentToEmptyCell(GraphicComponent gc) throws java.lang.Exception
gc
- component to add
java.lang.Exception
public boolean addComponent(GraphicComponent component, int cellIndex) throws java.lang.Exception
component
- to addcellIndex
- internal index of the cell
java.lang.Exception
public chemaxon.marvin.space.CoordinateComponent addCoordinateSystem(int cellIndex) throws java.lang.Exception
cellIndex
- internal index of the cell
java.lang.Exception
public void removeSelectedComponents()
public void removeUnselectedComponents()
public void removeUnselectedMonitors()
public void removeAllComponents()
public void removeAllComponents(java.lang.Class c)
public void removeComponent(GraphicComponent component)
component
- to removepublic void removeComponent(chemaxon.marvin.space.UOID componentId)
componentId
- identifier of the component to removepublic boolean containsComponent(GraphicComponent gc)
public void setActiveCell(int i)
i
- internal index of the cellpublic void deactivateActiveCell()
public GraphicCell getCell(int cellIndex)
GraphicCell
which has the given index.
cellIndex
- internal index of the cell
public int getActiveCellIndex()
public GraphicCell getActiveCell()
public boolean isActiveCell(int cellIndex)
cellIndex
is the active cell of the scene.
cellIndex
- internal index of the cell
public boolean hasSelectedComponent()
public boolean hasSelectedComponentElement()
ComponentElement
in the active cell.
public GraphicComponent getGraphicComponent(int componentIndex)
GraphicComponent
having the given index in the active cell.
componentIndex
- internal index of the component
public GraphicComponent getGraphicComponent(int cellIndex, int componentIndex)
GraphicComponent
of the given cell.
componentIndex
- internal index of the componentcellIndex
- internal index of the cell
public GraphicComponent getGraphicComponent(chemaxon.marvin.space.UOID id)
GraphicComponent
with the given id.
public void hideSelectedComponents()
public void hideUnselectedComponents()
public void fadeSelectedComponents()
GraphicComponent
should implement this behaviour to take affect.
public void fadeUnselectedComponents()
GraphicComponent
should implement this behaviour to take affect.
public void showAllComponents()
public void showFaded()
GraphicComponent
should implement this behaviour to take affect.
public void hideAllMonitors()
public void showAllMonitors()
public void showAllComponents(java.lang.Class c)
public void hideAllComponents(java.lang.Class c)
public java.util.ArrayList getAllComponents(java.lang.Class c)
public java.lang.String getDrawProperty(java.lang.String name)
name
- identifier of the property
String
public java.lang.String getCellDrawProperty(java.lang.String name)
name
- the name of the draw property
String
public java.lang.String getCellDrawProperty(int cellIdx, java.lang.String name)
cellIdx
- internal index of the cell.name
- the name of the draw propertypublic void setCellDrawProperty(int cellIndex, java.lang.String propertyName, java.lang.String propertyValue) throws java.lang.Exception
cellIndex
- internal index of the cell.propertyName
- the name of the draw propertypropertyValue
- the value of the property
java.lang.Exception
public void setDrawProperty(java.util.Properties properties) throws java.lang.Exception
properties
- set of draw properties
java.lang.Exception
public void setDrawProperty(java.lang.String propertyName, java.lang.String propertyValue) throws java.lang.Exception
java.lang.Exception
public void setDrawProperty(java.lang.String propertyName, java.lang.String propertyValue, int range) throws java.lang.Exception
propertyName
- the name of the draw propertypropertyValue
- the value of the propertyrange
- SCENE_RANGE
, CELL_RANGE
java.lang.Exception
public void resetSettings() throws java.lang.Exception
java.lang.Exception
public void resetView()
public void resetAll()
public void setAntialias(boolean state)
state
- the required state of anti-aliasingpublic boolean isAntialiasEnabled()
public java.awt.Color getBackgroundColor()
java.awt.Color
public void setBackgroundColor(java.awt.Color newColor)
newColor
- color as java.awt.Color
public boolean isTransparentBackgroundEnabled()
public void setTransparentBackground(boolean b)
b
- public boolean isSmoothBackgroundEnabled()
public void setSmoothBackground(boolean b)
b
- public void reshape(javax.media.opengl.GLAutoDrawable glAutoDrawable, int x, int y, int width, int height)
GL2.glViewport(int, int, int, int);
. Note that for convenience the component has
already called GL2.glViewport(int, int, int, int)(x, y, width, height)
when this method is
called, so the client may not have to do anything in this method.
reshape
in interface javax.media.opengl.GLEventListener
glAutoDrawable
- The GLDrawable object.x
- The X Coordinate of the viewport rectangle.y
- The Y coordinate of the viewport rectanble.width
- The new width of the window.height
- The new height of the window.public void displayChanged(javax.media.opengl.GLAutoDrawable glAutoDrawable, boolean b, boolean b1)
public boolean isGLInitialized()
setSceneSize
in applets.
public javax.media.opengl.GL2 getGL()
public javax.media.opengl.GLAutoDrawable getGLAutoDrawable()
public javax.media.opengl.awt.GLJPanel getGLJPanel()
public java.lang.String getGLInfo(boolean extended)
extended
- the available extensions are to returned or not
String
public void init(javax.media.opengl.GLAutoDrawable glAutoDrawable)
init
in interface javax.media.opengl.GLEventListener
glAutoDrawable
- The GLAutoDrawable object.public void display(javax.media.opengl.GLAutoDrawable glAutoDrawable)
refresh()
or redraw()
instead.
Draws every cell of the scene. The result depends on the cells.
Called by the drawable to initiate OpenGL2 rendering by the client. After all
GLEventListeners have been notified of a display event, the drawable will swap its buffers
if necessary.
display
in interface javax.media.opengl.GLEventListener
glAutoDrawable
- The GLAutoDrawable object.public void refresh()
public void redraw()
public void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
public java.awt.image.BufferedImage getBufferedImage()
public int createImage(java.nio.Buffer buf, int imageWidth, int imageHeight)
public void activateContainerCell(GraphicComponent component)
public chemaxon.marvin.space.UOID locateObject(int x, int y)
x
- coordinate in pixelsy
- coordinate in pixelspublic chemaxon.marvin.space.UOID locateObject(int x, int y, java.lang.Class componentClass)
x
- coordinate in pixelsy
- coordinate in pixelscomponentClass
- components of other classes will be ignored in locationpublic chemaxon.marvin.space.UOID locateCellId(int x, int y)
x
- coordinate in pixelsy
- coordinate in pixelspublic int locateCell(int x, int y)
x
- window coordinatey
- window coordinatepublic GraphicComponent getControllableObject(java.lang.String type)
type
- identifier of the type of the controller, "Shift", "Rotate", "Resize"
public boolean locationNearEdgeX(int x, int y)
x
- horizontal mouse location in absolute window coordinatey
- vertical mouse location in absolute window coordinate
public boolean locationNearEdgeY(int x, int y)
x
- horizontal mouse location in absolute window coordinatey
- vertical mouse location in absolute window coordinate
public boolean locationNearEdge(int x, int y)
x
- horizontal mouse location in absolute window coordinatey
- vertical mouse location in absolute window coordinate
public void clearSelection(int index)
index
- internal index of the cellpublic void exclusiveSelection(chemaxon.marvin.space.UOID id)
id
- identifier of the componentpublic void extendSelection(chemaxon.marvin.space.UOID id)
id
- identifier of the componentpublic void invertSelection(chemaxon.marvin.space.UOID id)
id
- identifier of the componentpublic boolean componentBecameSelected(int cellIdx)
cellIdx
- internal index of the cell
public boolean componentBecameUnselected(int cellIdx)
cellIdx
- internal index of the cell
public float[] getTransformationCenter()
public double getShiftX(int cellIndex)
cellIndex
-
public double getShiftY(int cellIndex)
cellIndex
-
public void setTransformationCenter(chemaxon.marvin.space.UOID id)
GraphicComponent.getCoordinates(float[])
method
id
- identifier of the componentpublic void setTransformationCenter(float[] c)
c
- exact coordinates to be setpublic void zoom(double factor)
factor
- zooming factor, usually it is the changing of the
mouse coordinates in pixelspublic void zoomAnimated(double f, int n)
refresh()
event.
f
- zoom factorn
- number of zoom effects and refreshespublic void rotate(double rx, double ry, double rz)
rx
- rotation angle around the x axisry
- rotation angle around the y axisrz
- rotation angle around the z axispublic void rotateTo(float[] rm)
rm
- 4x4 matrix of rotationpublic void shift(double shiftx, double shifty)
shiftx
- translation along x axis in window coordinatesshifty
- translation along y axis in window coordinatespublic void shiftAnimated(double shiftx, double shifty, int n)
refresh()
event.
shiftx
- translation along x axis in window coordinatesshifty
- translation along y axis in window coordinatesn
- number of shift effects and refreshespublic void dispose(javax.media.opengl.GLAutoDrawable glad)
dispose
in interface javax.media.opengl.GLEventListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |