Documentation of 'sgtplot.ColorKey' Java class
ColorKey
sgtplot

Class ColorKey

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener, DataKey, LayerChild, Selectable


    public class ColorKey
    extends java.lang.Object
    implements java.lang.Cloneable, DataKey, java.beans.PropertyChangeListener
    The ColorKey class provides a graphical depiction of the relationship between a ColorMap and user values. A single ColorKey can be attached to a Layer. A ColorMap is associated with the Key and therefor with a specific transformation and optionally a SGTData object.
    Since:
    1.0
    See Also:
    Ruler, ColorMap, Layer
    • Constructor Detail

      • ColorKey

        public ColorKey()
        Default ColorKey constructor. The location and size must be specified before the ColorKey is attached to a layer!
      • ColorKey

        public ColorKey(Rectangle2D.Double pr,
                        int valign,
                        int halign)
        ColorKey constructor that include location, size, and alignment information. Default orientation is HORIZONTAL.
        Parameters:
        pr - a Rectangle2D object that includes location and size
        valign - vertical alignment
        halign - horizontal alignment
    • Method Detail

      • copy

        public LayerChild copy()
        Create a copy of ColorKey.
        Specified by:
        copy in interface LayerChild
        Returns:
        a copy of the key
      • setSelected

        public void setSelected(boolean sel)
        Sets the selected property.
        Specified by:
        setSelected in interface Selectable
        Parameters:
        sel - true if selected, false if not.
        Since:
        2.0
      • isSelected

        public boolean isSelected()
        Returns true if the selected property is set.
        Specified by:
        isSelected in interface Selectable
        Returns:
        true is selected, false if not.
      • setSelectable

        public void setSelectable(boolean select)
        Sets the selectable property.
        Specified by:
        setSelectable in interface Selectable
        Parameters:
        select - if true object is selectable
        Since:
        2.0
      • isSelectable

        public boolean isSelectable()
        Tests the selectable property.
        Specified by:
        isSelectable in interface Selectable
        Returns:
        true if selectable
        Since:
        2.0
      • setId

        public void setId(java.lang.String id)
        Set ColorKey identifier.
        Specified by:
        setId in interface LayerChild
        Parameters:
        id - key identifier
      • setScaleP

        public void setScaleP(double scaleMin,
                              double scaleMax)
      • getId

        public java.lang.String getId()
        Get ColorKey identifier
        Specified by:
        getId in interface LayerChild
        Returns:
        identifier
      • setLayer

        public void setLayer(Layer l)
        Set parent Layer. Method should not be called directly, called when the Layer.addChild method is called.
        Specified by:
        setLayer in interface LayerChild
        Parameters:
        l - parent layer
      • getLayer

        public Layer getLayer()
        Returns the layer the ColorKey is attached.
        Specified by:
        getLayer in interface LayerChild
        Returns:
        The parent layer.
        See Also:
        Layer
      • modified

        public void modified(java.lang.String mess)
        For internal sgtplot use.
        Specified by:
        modified in interface LayerChild
        Since:
        2.0
      • setColorMap

        public void setColorMap(ColorMap cm)
        Set color map.
        Parameters:
        cm - color map
      • addGraph

        public void addGraph(CartesianRenderer rend,
                             SGLabel label)
                      throws java.lang.IllegalArgumentException
        Add a GridCartesianRenderer and label to the ColorKey.
        Specified by:
        addGraph in interface DataKey
        Parameters:
        rend - GridCartesianRenderer object
        label - descriptive label
        Throws:
        java.lang.IllegalArgumentException
        Since:
        3.0
      • getColorMap

        public ColorMap getColorMap()
        Get color map.
        Returns:
        color map
      • getBorderStyle

        public int getBorderStyle()
        Get border style.
        Returns:
        border style
      • setAlign

        public void setAlign(int vert,
                             int horz)
        Set color key alignment.
        Specified by:
        setAlign in interface DataKey
        Parameters:
        vert - vertical alignment
        horz - horizontal alignment
      • setOrientation

        public void setOrientation(int orient)
        Set orientation.
        Parameters:
        orient - key orientation
      • setVAlign

        public void setVAlign(int vert)
        Set vertical alignment
        Specified by:
        setVAlign in interface DataKey
        Parameters:
        vert - vertical alignment
      • setHAlign

        public void setHAlign(int horz)
        Set horizontal alignment
        Specified by:
        setHAlign in interface DataKey
        Parameters:
        horz - horizontal alignment
      • getVAlign

        public int getVAlign()
        Get vertical alignment
        Returns:
        vertical alignment
      • getHAlign

        public int getHAlign()
        Get horizontal alignment
        Returns:
        horizontal alignment
      • setLocationP

        public void setLocationP(Point2D.Double loc)
        Set location of key in physical coordinates.
        Specified by:
        setLocationP in interface DataKey
        Parameters:
        loc - key location
      • setSizeP

        public void setSizeP(Dimension2D d)
        Set the size of the key in physical coordinates.
        Parameters:
        d - size of key
      • setBoundsP

        public void setBoundsP(Rectangle2D.Double r)
        Set the bounds of the key in physical coordinates.
        Specified by:
        setBoundsP in interface DataKey
        Parameters:
        r - bounding rectangle
      • getBoundsP

        public Rectangle2D.Double getBoundsP()
        Get the bounding rectangle for the key in physical coordinates.
        Returns:
        bounding rectangle
      • getBounds

        public java.awt.Rectangle getBounds()
        Gets the bounding rectangle in device coordinates.
        Specified by:
        getBounds in interface Selectable
        Returns:
        bounding rectangle
      • setBounds

        public void setBounds(java.awt.Rectangle r)
        Change the selected objects bounding rectangle in device coordinates. The object will move to the new bounding rectangle.
        Parameters:
        r - new bounding rectangle
      • setBounds

        public void setBounds(int x,
                              int y,
                              int width,
                              int height)
        Change the selected objects bounding rectangle in device coordinates. The object will move to the new bounding rectangle.
        Parameters:
        x - horizontal location, positive right
        y - vertical location, positive down
        width - horizontal size
        height - vertical size
      • setTitle

        public void setTitle(SGLabel title)
        Set the title of the key.
        Parameters:
        title - key title
      • getTitle

        public SGLabel getTitle()
        Get the key's title.
        Returns:
        the title
      • getRuler

        public Ruler getRuler()
        Get the Ruler associated with the key.
        Returns:
        the ruler
      • toString

        public java.lang.String toString()
        Get a string representation of the key.
        Specified by:
        toString in interface LayerChild
        Overrides:
        toString in class java.lang.Object
        Returns:
        string representation
      • isVisible

        public boolean isVisible()
        Check if ColorKey is visible.
        Specified by:
        isVisible in interface LayerChild
        Returns:
        true if visible
        Since:
        2.0
      • setVisible

        public void setVisible(boolean visible)
        Set visibility state for ColorKey.
        Specified by:
        setVisible in interface LayerChild
        Parameters:
        visible - visible if true
        Since:
        2.0
      • propertyChange

        public void propertyChange(java.beans.PropertyChangeEvent evt)
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
      • setColumns

        public void setColumns(int col)
        Set columns. Unimplmented.
        Specified by:
        setColumns in interface DataKey
        Parameters:
        col -
        Since:
        3.0
      • setLineLengthP

        public void setLineLengthP(double len)
        Set line lenght. Unimplemented.
        Specified by:
        setLineLengthP in interface DataKey
        Since:
        3.0

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.