# Class Shape

java.lang.Object
org.jmol.shape.Shape

Direct Known Subclasses:
  `AtomShape, BioShapeCollection, Dipoles, FontLineShape, Frank, MeshCollection, Sticks, TextShape`

public abstract class Shape extends 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

## Field Summary

Fields
Modifier and Type
Field
Description
`BS`
`bsColixSet`
`BS`
`bsSizeSet`
`boolean`
`isBioShape`
`ModelSet`
`ms`
`String`
`myType`
`static final float`
`RADIUS_MAX`
`int`
`shapeID`
`boolean`
`translucentAllowed`
`protected float`
`translucentLevel`
`int`
`vf`
shape visibility flag
`Viewer`
`vwr`

## Constructor Summary

Constructors
Constructor
Description
`Shape()`

## Method Summary

Modifier and Type
Method
Description
`protected static void`
`appendCmd(SB s, String cmd)`
`void`
`checkBoundsMinMax(P3 pointMin, P3 pointMax)`
`Map<String,Object>`
`checkObjectClicked(int x, int y, int modifiers, BS bsVisible, boolean drawPicking)`
`boolean`
`checkObjectDragged(int prevX, int prevY, int x, int y, int dragAction, BS bsVisible)`
`boolean`
`checkObjectHovered(int x, int y, BS bsVisible)`
`protected int`
`coordinateInRange(int x, int y, T3 vertex, int dmin2, P3i ptXY)`
`static String`
`encodeColor(short colix)`
`void`
`findNearestAtomIndex(int xMouse, int yMouse, Atom[] closest, BS bsNot)`
`static short`
`getColix(short[] colixes, int i, Atom atom)`
`protected short`
`getColixA(short colix, byte paletteID, Atom atom)`
`protected short`
`getColixB(short colix, int pid, Bond bond)`
`short`
`getColixI(short colix, byte paletteID, int atomIndex)`
`static String`
`getColorCommand(String type, byte pid, short colix, boolean translucentAllowed)`
`static String`
`getColorCommandUnk(String type, short colix, boolean translucentAllowed)`
`static String`
`getFontCommand(String type, Font font)`
`int`
`getIndexFromName(String thisID)`
`Object`
`getProperty(String property, int index)`
`boolean`
`getPropertyData(String property, Object[] data)`
`protected boolean`
`getPropShape(String property, Object[] data)`
`Object`
`getShapeDetail()`
`abstract String`
`getShapeState()`
`int`
`getSize(int atomIndex)`
overridden in Dots, CGOMesh, and AtomShape
`int`
`getSizeG(Group group)`
`static String`
`getTranslucentLabel(short colix)`
`final void`
`initializeShape(Viewer vwr, ModelSet modelSet, int shapeID)`
`protected void`
`initModelSet()`
`abstract void`
`initShape()`
`void`
`replaceGroup(Group g0, Group g1)`
`void`
`setAtomClickability()`
`void`
`setModelSet(ModelSet modelSet)`
`void`
`setModelVisibilityFlags(BS bsModels)`
`void`
`setProperties(Object value)`
`abstract void`
`setProperty(String propertyName, Object value, BS bsSelected)`
`protected void`
`setPropS(String propertyName, Object value, BS bsSelected)`
`void`
`setShapeSizeRD(int size, RadiusData rd, BS bsSelected)`
`protected void`
`setSize(int size, BS bsSelected)`
`protected void`
`setSizeRD(RadiusData rd, BS bsSelected)`
`boolean`
`wasClicked(int x, int y)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### myType

public String myType

### RADIUS_MAX

public static final float RADIUS_MAX

See Also:
  - Constant Field Values

### vwr

public Viewer vwr

### ms

public ModelSet ms

### shapeID

public int shapeID

### vf

public int vf
shape visibility flag

### translucentLevel

protected float translucentLevel

### translucentAllowed

public boolean translucentAllowed

### isBioShape

public boolean isBioShape

### bsSizeSet

public BS bsSizeSet

### bsColixSet

public BS bsColixSet

## Constructor Details

### Shape

public Shape()

## Method Details

### getShapeState

public abstract String getShapeState()

### setProperty

public abstract void setProperty(String propertyName, Object value, BS bsSelected)

### initializeShape

public final void initializeShape(Viewer vwr, ModelSet modelSet, int shapeID)

### initShape

public abstract void initShape()

### setModelVisibilityFlags

public void setModelVisibilityFlags(BS bsModels)

Parameters:
  `bsModels` -

### getSize

public int getSize(int atomIndex)
overridden in Dots, CGOMesh, and AtomShape

Parameters:
  `atomIndex` -
Returns:
  size

### getSizeG

public int getSizeG(Group group)

Parameters:
  `group` -
Returns:
  size

### replaceGroup

public void replaceGroup(Group g0, Group g1)

Parameters:
  `g0` -
  `g1` -

### setModelSet

public void setModelSet(ModelSet modelSet)

### initModelSet

protected void initModelSet()

### setShapeSizeRD

public void setShapeSizeRD(int size, RadiusData rd, BS bsSelected)

### setSize

protected void setSize(int size, BS bsSelected)

Parameters:
  `size` -
  `bsSelected` -

### setSizeRD

protected void setSizeRD(RadiusData rd, BS bsSelected)

Parameters:
  `rd` -
  `bsSelected` -

### setPropS

protected void setPropS(String propertyName, Object value, BS bsSelected)

### getPropertyData

public boolean getPropertyData(String property, Object[] data)

Parameters:
  `property` -
  `data` -
Returns:
  true if serviced

### getPropShape

protected boolean getPropShape(String property, Object[] data)

### getProperty

public Object getProperty(String property, int index)

Parameters:
  `property` -
  `index` -
Returns:
  true if serviced

### getIndexFromName

public int getIndexFromName(String thisID)

Parameters:
  `thisID` -
Returns:
  index

### wasClicked

public boolean wasClicked(int x, int y)

Parameters:
  `x` -
  `y` -
Returns:
  T/F

### findNearestAtomIndex

public void findNearestAtomIndex(int xMouse, int yMouse, Atom[] closest, BS bsNot)

Parameters:
  `xMouse` -
  `yMouse` -
  `closest` -
  `bsNot` -

### checkBoundsMinMax

public void checkBoundsMinMax(P3 pointMin, P3 pointMax)

Parameters:
  `pointMin` -
  `pointMax` -

### setAtomClickability

public void setAtomClickability()

### checkObjectClicked

public Map<String,Object> checkObjectClicked(int x, int y, int modifiers, BS bsVisible, boolean drawPicking)

Parameters:
  `x` -
  `y` -
  `modifiers` -
  `bsVisible` -
  `drawPicking` - TODO
Returns:
  Hashtable containing information about pt clicked

### checkObjectHovered

public boolean checkObjectHovered(int x, int y, BS bsVisible)

Parameters:
  `x` -
  `y` -
  `bsVisible` -
Returns:
  T/F

### checkObjectDragged

public boolean checkObjectDragged(int prevX, int prevY, int x, int y, int dragAction, BS bsVisible)

Parameters:
  `prevX` -
  `prevY` -
  `x` -
  `y` -
  `dragAction` -
  `bsVisible` -
Returns:
  T/F

### coordinateInRange

protected int coordinateInRange(int x, int y, T3 vertex, int dmin2, P3i ptXY)

### getColixI

public short getColixI(short colix, byte paletteID, int atomIndex)

### getColixA

protected short getColixA(short colix, byte paletteID, Atom atom)

### getColixB

protected short getColixB(short colix, int pid, Bond bond)

### getShapeDetail

public Object getShapeDetail()

### getColix

public static short getColix(short[] colixes, int i, Atom atom)

### getFontCommand

public static String getFontCommand(String type, Font font)

### getColorCommandUnk

public static String getColorCommandUnk(String type, short colix, boolean translucentAllowed)

### getColorCommand

public static String getColorCommand(String type, byte pid, short colix, boolean translucentAllowed)

### encodeColor

public static String encodeColor(short colix)

### getTranslucentLabel

public static String getTranslucentLabel(short colix)

### appendCmd

protected static void appendCmd(SB s, String cmd)

### setProperties

public void setProperties(Object value)