|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchemaxon.marvin.space.ComponentElement
public class ComponentElement
Class to identify parts of GraphicComponents mainly during selection.
Examples:
ComponentElement pickedItem =
new ComponentElement( this, COMPONENT_TYPE_ATOM, selectBuf.get(offset) );
ComponentElement pickedItem =
new ComponentElement( this, COMPONENT_TYPE_ENTIRE, 0 );
MolAtom from a ComponentElement
ComponentElement item;
if(item.getType() == COMPONENT_TYPE_ATOM) {
chemaxon.struc.MolAtom mola = mol.getAtom( item.getIndex() );
}
Constructor Summary | |
---|---|
ComponentElement(ComponentElement element)
Copies the given ComponentElement . |
|
ComponentElement(GraphicComponent component,
int atomicElementType,
int atomicElementIndex)
Creates a new instance of ComponentElement of a simple
(not structured) GraphicComponent . |
|
ComponentElement(GraphicComponent component,
int atomicElementType,
java.lang.Integer atomicElementIndexObject)
Creates a new instance of ComponentElement |
|
ComponentElement(GraphicComponent component,
int componentPartId,
int atomicElementType,
int atomicElementIndex)
Creates a new instance of ComponentElement of a complex (structured) GraphicComponent . |
|
ComponentElement(GraphicComponent component,
int componentPartId,
int atomicElementType,
java.lang.Integer atomicElementIndexObject)
Creates a new instance of ComponentElement . |
Method Summary | |
---|---|
java.awt.Color |
getColor()
Returns the color that is assigned to the ComponentElement. |
GraphicComponent |
getComponent()
Returns the component which contains this ComponentElement . |
int |
getComponentPartId()
In case of complex components the componentPartId identifies
a part of the component. |
void |
getCoordinates(float[] c)
Returns the world coordinates of the ComponentElement . |
java.lang.String |
getDescription()
Returns the brief description of the ComponentElement ,
for example type of the atom. |
int |
getElementIndex()
Returns the internal index of the ComponentElement
in the GraphicComponent . |
int |
getElementType()
Returns the type of the ComponentElement . |
boolean |
isComponentPart()
Returns true if the if the component is a structured component. |
boolean |
isVisible()
Returns true if the ComponentElement is visible in the component. |
void |
setColor(java.awt.Color c)
Assignes a color to the CompnentElement. |
void |
setCoordinates(float[] c)
Sets the coordinates of the ComponentElement. |
void |
setDescription(java.lang.String d)
Sets a brief description to the ComponentElement that will
be returned by {#getDescription()}. |
java.lang.String |
toString()
Returs the indices of the CompnentElement . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ComponentElement(GraphicComponent component, int atomicElementType, int atomicElementIndex)
ComponentElement
of a simple
(not structured) GraphicComponent
.
component
- the GraphicComponent
whose element is this ComponentElement
ofatomicElementType
- identifies the type of the ComponentElement
,
which can be anything the GraphicComponent
can identifyatomicElementIndex
- the internal index of the atomic element of the component having given typepublic ComponentElement(GraphicComponent component, int atomicElementType, java.lang.Integer atomicElementIndexObject)
ComponentElement.
- Parameters:
component
- the GraphicComponent
whose element is this
ComponentElement
ofatomicElementType
- identifies the type of the ComponentElement
,
which can be anything the GraphicComponent
can identifyatomicElementIndexObject
- the internal index of the atomic element as an object
public ComponentElement(GraphicComponent component, int componentPartId, int atomicElementType, int atomicElementIndex)
ComponentElement
of a complex (structured) GraphicComponent
.
component
- the GraphicComponent
whose element is this
ComponentElement
ofcomponentPartId
- identifies the specific part of the complex GraphicComponent
atomicElementType
- identifies the type of the ComponentElement
,
which can be anything the GraphicComponent
can identifyatomicElementIndex
- the internal index of the atomic element of the component having given typepublic ComponentElement(GraphicComponent component, int componentPartId, int atomicElementType, java.lang.Integer atomicElementIndexObject)
ComponentElement
.
component
- the GraphicComponent
whose element is this
ComponentElement
ofcomponentPartId
- identifies the specific part of the complex GraphicComponent
atomicElementType
- identifies the type of the ComponentElement
,
which can be anything the GraphicComponent
can identifyatomicElementIndexObject
- the internal index of the atomic element as an objectpublic ComponentElement(ComponentElement element)
ComponentElement
.
element
- to copyMethod Detail |
---|
public boolean isComponentPart()
public int getComponentPartId()
componentPartId
identifies
a part of the component.
public int getElementType()
ComponentElement
.
public int getElementIndex()
ComponentElement
in the GraphicComponent
.
public void getCoordinates(float[] c)
ComponentElement
.
c
- allocated array where the coordinates will be putpublic void setCoordinates(float[] c)
GraphicComponent.getCoordinates(ComponentElement, float[])
.
Setting the coordinates explicitly prevents the calling of the above method.
c
- public java.lang.String getDescription()
ComponentElement
,
for example type of the atom.
public void setDescription(java.lang.String d)
ComponentElement
that will
be returned by {#getDescription()}.
d
- description String or null to get the description given by the componentpublic boolean isVisible()
ComponentElement
is visible in the component.
public GraphicComponent getComponent()
ComponentElement
.
public java.awt.Color getColor()
public void setColor(java.awt.Color c)
c
- public java.lang.String toString()
CompnentElement
.
toString
in class java.lang.Object
ComponentElement
as String
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |