Class 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 Detail

      • myType

        public String myType
      • 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 javajs.util.BS bsSizeSet
      • bsColixSet

        public javajs.util.BS bsColixSet
    • Constructor Detail

      • Shape

        public Shape()
    • Method Detail

      • getShapeState

        public abstract String getShapeState()
      • setProperty

        public abstract void setProperty​(String propertyName,
                                         Object value,
                                         javajs.util.BS bsSelected)
      • initializeShape

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

        public abstract void initShape()
      • setModelVisibilityFlags

        public void setModelVisibilityFlags​(javajs.util.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,
                                   javajs.util.BS bsSelected)
      • setSize

        protected void setSize​(int size,
                               javajs.util.BS bsSelected)
        Parameters:
        size -
        bsSelected -
      • setSizeRD

        protected void setSizeRD​(RadiusData rd,
                                 javajs.util.BS bsSelected)
        Parameters:
        rd -
        bsSelected -
      • setPropS

        protected void setPropS​(String propertyName,
                                Object value,
                                javajs.util.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,
                                         javajs.util.BS bsNot)
        Parameters:
        xMouse -
        yMouse -
        closest -
        bsNot -
      • checkBoundsMinMax

        public void checkBoundsMinMax​(javajs.util.P3 pointMin,
                                      javajs.util.P3 pointMax)
        Parameters:
        pointMin -
        pointMax -
      • setAtomClickability

        public void setAtomClickability()
      • checkObjectClicked

        public Map<String,​Object> checkObjectClicked​(int x,
                                                           int y,
                                                           int modifiers,
                                                           javajs.util.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,
                                          javajs.util.BS bsVisible)
        Parameters:
        x -
        y -
        bsVisible -
        Returns:
        T/F
      • checkObjectDragged

        public boolean checkObjectDragged​(int prevX,
                                          int prevY,
                                          int x,
                                          int y,
                                          int dragAction,
                                          javajs.util.BS bsVisible)
        Parameters:
        prevX -
        prevY -
        x -
        y -
        dragAction -
        bsVisible -
        Returns:
        T/F
      • coordinateInRange

        protected int coordinateInRange​(int x,
                                        int y,
                                        javajs.util.T3 vertex,
                                        int dmin2,
                                        javajs.util.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​(javajs.util.SB s,
                                        String cmd)