Package chemaxon.marvin.space
Class PharmacophoreArrow
- java.lang.Object
-
- chemaxon.marvin.space.GraphicComponent
-
- chemaxon.marvin.space.PharmacophoreArrow
-
- All Implemented Interfaces:
chemaxon.marvin.space.UsableObject
@PublicAPI public class PharmacophoreArrow extends GraphicComponent implements chemaxon.marvin.space.UsableObject
PharmacophoreArrow
provides an extension ofPharmacophorePoint
to represent pharmacophores by introducing directionality. The direction, the length and the thickness of the arrow can be changed.- Since:
- Marvin 4.0.2
-
-
Field Summary
Fields Modifier and Type Field Description static String[]
DRAW_TYPES
-
Fields inherited from class chemaxon.marvin.space.GraphicComponent
active, associatedComponents, boundingBox, COMPONENT_TYPE_ENTIRE, drawProperties, drawType, gl, glu, graphicCell, irm, modifiesOrigin, motionMode, mousex, mousey, name, pickedItem, RENDERING_QUALITY_HIGH, RENDERING_QUALITY_LOW, RENDERING_QUALITY_MEDIUM, renderingQuality, rm, uoid, visible
-
-
Constructor Summary
Constructors Constructor Description PharmacophoreArrow()
Creates a new instance ofPharmacophoreArrow
.PharmacophoreArrow(double x, double y, double z)
Creates aPharmacophoreArrow
at the given position.PharmacophoreArrow(ComponentElement ce)
Creates aPharmacophoreArrow
at the position of the givenComponentElement
getting the coordinates bygetCoordinates()
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanup()
void
draw()
Draws the component if it is opaque.void
drawTransparentPart()
Draws transparent parts of the component if there is any.Color
getColor()
Returns the color of the component.void
getCoordinates(ComponentElement item, float[] c)
Gets the position of the component.String
getDescription()
Returns a descriptive text.String
getDrawType()
Returns the name of the drawing type.String
getName()
Returns the name of the component.double
getRadius()
Returns the radius of the arrow.boolean
hasTransparentPart()
void
initDraw()
boolean
isControllable(String type)
Returns whether controling by the given type of controller is allowed to the component.boolean
isHighlighted()
Returns true if the component is highlighted.void
onRemoveGraphicComponent()
protected void
pickObject(int offset, double[] maxZ, float[] modelview)
SetsGraphicComponent.pickedItem
to be the picked part of the component.void
resize(double x, double y, double z)
Resizes the component according to the given factors in each direction.void
rotate(float[] v, float[] center)
Rotates the component around the 3 axis, x, y, z, and given center.void
select()
Sets the component to be selected.void
setDrawProperty(String propertyName, String propertyValue)
Sets adraw property
.void
setDrawType(String type)
Sets current drawing type.void
setHighlighted(boolean flag)
Sets the component to be highlighted.void
setPosition(double x, double y, double z)
Sets the position of thePharmacophoreArrow
.void
setRadius(double r)
Sets the radius of the arrow.void
setRenderingQuality(int quality)
Sets the rendering quality, seeRENDERING_*
constants.void
setRenderingQuality(String quality)
Sets the rendering quality and callssetRenderingQuality(int)
.String
toString()
void
translate(float[] v)
Translates the component with the parameter as a translation vector.void
unSelect()
Sets the component to be unselected.-
Methods inherited from class chemaxon.marvin.space.GraphicComponent
addDrawProperties, associate, draw2DPart, drawBoundingBox, drawCoordinateAxes, drawSelection, exclusiveSelection, exclusiveSelection, extendSelection, extendSelection, fadeSelected, fadeUnselected, getAssociatedComponents, getBoundingBox, getBoundingSphereRadius, getCell, getComponentElement, getCoordinates, getDescription, getDrawProperties, getDrawProperty, getGraphicComponent, getId, getLabelInformation, getLabelInformation, getRenderingQuality, getUsableObject, getZCoordinateTo2DPart, glColor, has2DPart, hasSelectedElements, hideSelected, hideUnselected, invertSelection, invertSelection, isGraphicComponent, isSelected, isSelected, isVisible, isVisible, locateObject, notifyCoordinateChange, notifyInvisibility, notifySelection, notifyUnSelection, notifyVisibility, projectVector, receiveNotificationOnCoordinateChange, receiveNotificationOnInvisibility, receiveNotificationOnSelection, receiveNotificationOnUnSelection, receiveNotificationOnVisibility, removeAssociation, rotate, rotate, select, selectComponentElementsInside, setColor, setColor, setColor, setColor, setDrawProperties, setGL, setMotionMode, setName, setProgressBar, setRotateMatrix, setVisible, showFaded, storeDrawProperty, touchObject, unSelect
-
-
-
-
Field Detail
-
DRAW_TYPES
public static final String[] DRAW_TYPES
-
-
Constructor Detail
-
PharmacophoreArrow
public PharmacophoreArrow()
Creates a new instance ofPharmacophoreArrow
. It will be placed at the origin by default, its position can be set bysetPosition()
.
-
PharmacophoreArrow
public PharmacophoreArrow(ComponentElement ce)
Creates aPharmacophoreArrow
at the position of the givenComponentElement
getting the coordinates bygetCoordinates()
.- Parameters:
ce
- reference to a component to get the coordinates
-
PharmacophoreArrow
public PharmacophoreArrow(double x, double y, double z)
Creates aPharmacophoreArrow
at the given position.- Parameters:
x
- coordinatey
- coordinatez
- coordinate
-
-
Method Detail
-
onRemoveGraphicComponent
public void onRemoveGraphicComponent()
- Overrides:
onRemoveGraphicComponent
in classGraphicComponent
-
setPosition
public void setPosition(double x, double y, double z)
Sets the position of thePharmacophoreArrow
.- Parameters:
x
- first coordinatey
- second coordinatez
- third coordinate
-
getCoordinates
public void getCoordinates(ComponentElement item, float[] c)
Gets the position of the component.- Overrides:
getCoordinates
in classGraphicComponent
- Parameters:
item
- ignored here (sincePharmacophoreArrow
is not subdivided further into smaller constituting elements)c
- output parameter to store 3 coordinates (must be allocated by caller)
-
getDescription
public String getDescription()
Returns a descriptive text.- Overrides:
getDescription
in classGraphicComponent
- Returns:
- "Pharmacophore arrow"
-
getName
public String getName()
Description copied from class:GraphicComponent
Returns the name of the component.- Specified by:
getName
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
getName
in classGraphicComponent
- Returns:
- name that is
getClass.getName()
by default.
-
toString
public String toString()
- Specified by:
toString
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
toString
in classGraphicComponent
-
getRadius
public double getRadius()
Returns the radius of the arrow.
-
setRadius
public void setRadius(double r)
Sets the radius of the arrow.
-
getColor
public Color getColor()
Returns the color of the component.- Specified by:
getColor
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
getColor
in classGraphicComponent
-
select
public void select()
Sets the component to be selected.- Specified by:
select
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
select
in classGraphicComponent
-
unSelect
public void unSelect()
Sets the component to be unselected.- Specified by:
unSelect
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
unSelect
in classGraphicComponent
-
isHighlighted
public boolean isHighlighted()
Returns true if the component is highlighted.
-
setHighlighted
public void setHighlighted(boolean flag)
Sets the component to be highlighted. The highlighted component will appear brighter.
-
translate
public void translate(float[] v)
Translates the component with the parameter as a translation vector.- Overrides:
translate
in classGraphicComponent
- Parameters:
v
- The translation vector.
-
rotate
public void rotate(float[] v, float[] center)
Rotates the component around the 3 axis, x, y, z, and given center.- Overrides:
rotate
in classGraphicComponent
- Parameters:
v
- Measurement of the rotation around the 3 axis, x, y, z.center
- Center of the rotation.
-
resize
public void resize(double x, double y, double z)
Resizes the component according to the given factors in each direction.- Overrides:
resize
in classGraphicComponent
-
isControllable
public boolean isControllable(String type)
Returns whether controling by the given type of controller is allowed to the component. This component is allowed to be translated and resized.- Overrides:
isControllable
in classGraphicComponent
- Parameters:
type
- "Shift", "Rotate", "Resize"- Returns:
- is the component aloowed to be controlled or not
-
hasTransparentPart
public boolean hasTransparentPart()
SeeGraphicComponent.hasTransparentPart()
. Returns true if the drawing type is notDRAW_TYPE_FILLED
.- Overrides:
hasTransparentPart
in classGraphicComponent
- Returns:
- will the component draw with transparency
-
drawTransparentPart
public void drawTransparentPart()
Draws transparent parts of the component if there is any.- Overrides:
drawTransparentPart
in classGraphicComponent
-
draw
public void draw()
Draws the component if it is opaque.- Overrides:
draw
in classGraphicComponent
-
initDraw
public void initDraw()
-
pickObject
protected void pickObject(int offset, double[] maxZ, float[] modelview)
Description copied from class:GraphicComponent
SetsGraphicComponent.pickedItem
to be the picked part of the component.- Overrides:
pickObject
in classGraphicComponent
- Parameters:
offset
- Integer used in the name stack to identify the part of the component.maxZ
- Stores the z coordinate of the part with maximum z coordinate in the actual picking. It has to be set if the part with the current offset has greater z coordinate than the stored one. Example to compute:int aIdx = GeomCalc.newVector( picked.x(), picked.y(), picked.z() );
GeomCalc.multVectorWithMatrix(aIdx, modelview);
z coordinate:maxZ[0] = GeomCalc.getZ(aIdx)
modelview
- Is to compute the proper z coordinate.
-
cleanup
public void cleanup()
- Overrides:
cleanup
in classGraphicComponent
-
setDrawType
public void setDrawType(String type)
Sets current drawing type.- Parameters:
type
- Solid, Mesh or Transparent
-
getDrawType
public String getDrawType()
Returns the name of the drawing type.- Returns:
- Solid, Mesh or Transparent
-
setRenderingQuality
public void setRenderingQuality(String quality)
Sets the rendering quality and callssetRenderingQuality(int)
.- Parameters:
quality
- Can be "High", "Medium", "Low".
-
setRenderingQuality
public void setRenderingQuality(int quality)
Sets the rendering quality, seeRENDERING_*
constants. Sets the precision of the drawn arrow.- Overrides:
setRenderingQuality
in classGraphicComponent
- Parameters:
quality
-
-
setDrawProperty
public void setDrawProperty(String propertyName, String propertyValue)
Sets adraw property
.
Accepts:- "Quality" -- "High", "Medium", "Low"
- "PharmacophoreArrow.DrawType" -- "Mesh", "Solid", "Transparent"
- Specified by:
setDrawProperty
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
setDrawProperty
in classGraphicComponent
- Parameters:
propertyName
- identifier of the draw propertypropertyValue
- value of the draw property as aString
-
-