org.jmol.shape
Class Shape
java.lang.Object
org.jmol.shape.Shape
- Direct Known Subclasses:
- AtomShape, BioShapeCollection, Dipoles, FontShape, Measures, MeshCollection, Object2dShape, Sticks
public abstract class Shape
- extends java.lang.Object
Shape now encompasses:
AtomShape (abstract)
|
Balls, Dots, Ellipsoids, Halos, Labels, Polyhedra, Stars, Vectors
|
GeoSurface
BioShapeCollection (abstract)
|
Backbone, Cartoon, MeshRibbon, Ribbons, Rockets, Strands, Trace
Dipoles
FontLineShape (abstract)
|
Axes, Bbcage, Frank, Uccage
Measures
MeshCollection (abstract)
| |
Draw Isosurface
|
LcaoCartoon, MolecularOrbital, Pmesh
Sticks
|
Hsticks, Sssticks
TextShape (abstract)
|
Echo, Hover
Constructor Summary |
Shape()
|
Method Summary |
static void |
appendCmd(java.lang.StringBuffer s,
java.lang.String cmd)
|
void |
checkBoundsMinMax(javax.vecmath.Point3f pointMin,
javax.vecmath.Point3f pointMax)
|
Point3fi |
checkObjectClicked(int x,
int y,
int modifiers,
java.util.BitSet bsVisible)
|
boolean |
checkObjectDragged(int prevX,
int prevY,
int x,
int y,
int modifiers,
java.util.BitSet bsVisible)
|
boolean |
checkObjectHovered(int x,
int y,
java.util.BitSet bsVisible)
|
protected int |
coordinateInRange(int x,
int y,
javax.vecmath.Point3f vertex,
int dmin2,
javax.vecmath.Point3i ptXY)
|
(package private) static java.lang.String |
encodeColor(short colix)
|
private static java.lang.String |
encodeTransColor(byte pid,
short colix,
boolean translucentAllowed)
|
void |
findNearestAtomIndex(int xMouse,
int yMouse,
Atom[] closest,
java.util.BitSet bsNot)
|
static short |
getColix(short[] colixes,
int i,
Atom atom)
|
java.lang.String |
getColorCommand(java.lang.String type,
byte pid,
short colix)
|
java.lang.String |
getColorCommand(java.lang.String type,
short colix)
|
static java.lang.String |
getFontCommand(java.lang.String type,
Font3D font)
|
int |
getIndexFromName(java.lang.String thisID)
|
java.lang.Object |
getProperty(java.lang.String property,
int index)
|
boolean |
getProperty(java.lang.String property,
java.lang.Object[] data)
|
static java.lang.String |
getShapeCommands(java.util.Hashtable htDefine,
java.util.Hashtable htMore)
|
static java.lang.String |
getShapeCommands(java.util.Hashtable htDefine,
java.util.Hashtable htMore,
java.lang.String selectCmd)
|
java.util.List |
getShapeDetail()
|
java.lang.String |
getShapeState()
|
int |
getSize(Group group)
|
int |
getSize(int atomIndex)
|
private static java.lang.String |
getTranslucentLabel(short colix)
|
Viewer |
getViewer()
|
void |
initializeShape(Viewer viewer,
Graphics3D g3d,
ModelSet modelSet,
int shapeID)
|
protected void |
initModelSet()
|
void |
initShape()
|
void |
merge(Shape shape)
|
protected short |
setColix(short colix,
byte paletteID,
Atom atom)
|
protected short |
setColix(short colix,
byte paletteID,
Bond bond)
|
short |
setColix(short colix,
byte paletteID,
int atomIndex)
|
void |
setModelClickability()
|
void |
setModelSet(ModelSet modelSet)
|
void |
setProperty(java.lang.String propertyName,
java.lang.Object value,
java.util.BitSet bsSelected)
may come from any source -- executed AFTER a shape's own setProperty method |
void |
setShapeProperty(java.lang.String propertyName,
java.lang.Object value,
java.util.BitSet bsSelected)
specifically from modelSet.setShapeProperty, mostly from ScriptEvaluation,
but not always -- definitely not from "super.setProperty" |
void |
setShapeSize(int size,
RadiusData rd,
java.util.BitSet bsSelected)
|
protected void |
setSize(int size,
java.util.BitSet bsSelected)
|
protected void |
setSize(RadiusData rd,
java.util.BitSet bsSelected)
|
static void |
setStateInfo(java.util.Hashtable ht,
int i1,
int i2,
java.lang.String key)
|
static void |
setStateInfo(java.util.Hashtable ht,
int i,
java.lang.String key)
|
void |
setVisibilityFlags(java.util.BitSet bs)
|
private boolean |
setXmlProperty(java.lang.String propertyName,
java.lang.Object value,
java.util.BitSet bs)
may NOT be over-ridden by shape; executed BEFORE shape's setProperty |
boolean |
wasClicked(int x,
int y)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RADIUS_MAX
public static final float RADIUS_MAX
- See Also:
- Constant Field Values
viewer
public Viewer viewer
modelSet
public ModelSet modelSet
g3d
public Graphics3D g3d
shapeID
public int shapeID
myVisibilityFlag
public int myVisibilityFlag
translucentLevel
protected float translucentLevel
translucentAllowed
protected boolean translucentAllowed
isBioShape
public boolean isBioShape
xmlProperties
protected java.util.List xmlProperties
Shape
public Shape()
getViewer
public Viewer getViewer()
initializeShape
public final void initializeShape(Viewer viewer,
Graphics3D g3d,
ModelSet modelSet,
int shapeID)
setModelSet
public void setModelSet(ModelSet modelSet)
initModelSet
protected void initModelSet()
initShape
public void initShape()
merge
public void merge(Shape shape)
setShapeSize
public void setShapeSize(int size,
RadiusData rd,
java.util.BitSet bsSelected)
setSize
protected void setSize(int size,
java.util.BitSet bsSelected)
setSize
protected void setSize(RadiusData rd,
java.util.BitSet bsSelected)
setShapeProperty
public void setShapeProperty(java.lang.String propertyName,
java.lang.Object value,
java.util.BitSet bsSelected)
- specifically from modelSet.setShapeProperty, mostly from ScriptEvaluation,
but not always -- definitely not from "super.setProperty"
- Parameters:
propertyName
- value
- bsSelected
-
setXmlProperty
private boolean setXmlProperty(java.lang.String propertyName,
java.lang.Object value,
java.util.BitSet bs)
- may NOT be over-ridden by shape; executed BEFORE shape's setProperty
- Parameters:
propertyName
- value
- bs
-
- Returns:
- true if we are done
setProperty
public void setProperty(java.lang.String propertyName,
java.lang.Object value,
java.util.BitSet bsSelected)
- may come from any source -- executed AFTER a shape's own setProperty method
- Parameters:
propertyName
- value
- bsSelected
-
getProperty
public boolean getProperty(java.lang.String property,
java.lang.Object[] data)
getProperty
public java.lang.Object getProperty(java.lang.String property,
int index)
getIndexFromName
public int getIndexFromName(java.lang.String thisID)
wasClicked
public boolean wasClicked(int x,
int y)
findNearestAtomIndex
public void findNearestAtomIndex(int xMouse,
int yMouse,
Atom[] closest,
java.util.BitSet bsNot)
checkBoundsMinMax
public void checkBoundsMinMax(javax.vecmath.Point3f pointMin,
javax.vecmath.Point3f pointMax)
setModelClickability
public void setModelClickability()
checkObjectClicked
public Point3fi checkObjectClicked(int x,
int y,
int modifiers,
java.util.BitSet bsVisible)
checkObjectHovered
public boolean checkObjectHovered(int x,
int y,
java.util.BitSet bsVisible)
checkObjectDragged
public boolean checkObjectDragged(int prevX,
int prevY,
int x,
int y,
int modifiers,
java.util.BitSet bsVisible)
coordinateInRange
protected int coordinateInRange(int x,
int y,
javax.vecmath.Point3f vertex,
int dmin2,
javax.vecmath.Point3i ptXY)
setColix
public short setColix(short colix,
byte paletteID,
int atomIndex)
setColix
protected short setColix(short colix,
byte paletteID,
Atom atom)
setColix
protected short setColix(short colix,
byte paletteID,
Bond bond)
getShapeDetail
public java.util.List getShapeDetail()
getShapeState
public java.lang.String getShapeState()
setVisibilityFlags
public void setVisibilityFlags(java.util.BitSet bs)
setStateInfo
public static void setStateInfo(java.util.Hashtable ht,
int i,
java.lang.String key)
setStateInfo
public static void setStateInfo(java.util.Hashtable ht,
int i1,
int i2,
java.lang.String key)
getShapeCommands
public static java.lang.String getShapeCommands(java.util.Hashtable htDefine,
java.util.Hashtable htMore)
getShapeCommands
public static java.lang.String getShapeCommands(java.util.Hashtable htDefine,
java.util.Hashtable htMore,
java.lang.String selectCmd)
appendCmd
public static void appendCmd(java.lang.StringBuffer s,
java.lang.String cmd)
getFontCommand
public static java.lang.String getFontCommand(java.lang.String type,
Font3D font)
getColorCommand
public java.lang.String getColorCommand(java.lang.String type,
short colix)
getColorCommand
public java.lang.String getColorCommand(java.lang.String type,
byte pid,
short colix)
encodeTransColor
private static java.lang.String encodeTransColor(byte pid,
short colix,
boolean translucentAllowed)
encodeColor
static java.lang.String encodeColor(short colix)
getTranslucentLabel
private static java.lang.String getTranslucentLabel(short colix)
getColix
public static short getColix(short[] colixes,
int i,
Atom atom)
getSize
public int getSize(int atomIndex)
getSize
public int getSize(Group group)