Documentation of 'sgtplot.swing.ValueIcon' Java class
ValueIcon
sgtplot.swing

Class ValueIcon

  • All Implemented Interfaces:
    java.io.Serializable, javax.accessibility.Accessible, javax.swing.Icon, LayerChild, Selectable, Draggable


    public class ValueIcon
    extends javax.swing.ImageIcon
    implements LayerChild, Draggable
    ValueIcon extends ImageIcon to create a icon than can be dragged on a sgtplot plot displaying the local coordinates along with the image. Typically a cross-hairs image is used, but others can be substituted.
    Since:
    2.0
    See Also:
    UserIcon, ValueIconFormat, Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      ValueIcon(java.awt.Image image, java.lang.String description)
      Construct a ValueIcon using an Image.
      ValueIcon(java.lang.String filename, java.lang.String description)
      Construct a ValueIcon using an image from a specified file.
      ValueIcon(java.net.URL location, java.lang.String description)
      Construct a ValueIcon using an image from a specified URL.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addPropertyChangeListener(java.beans.PropertyChangeListener l) 
      void addVetoableChangeListener(java.beans.VetoableChangeListener l) 
      LayerChild copy()
      Create a copy of the LayerChild.
      void draw(org.freehep.graphics2d.VectorGraphics g)
      Draw the LayerChild.
      java.awt.Rectangle getBounds()
      Gets the bounding rectangle in device coordinates.
      java.awt.Font getFont()
      Get the value label font
      int getIconHeight()
      Get the total heigth.
      int getIconWidth()
      Get the total width, icon + label.
      java.lang.String getId()
      Get the identifier.
      Layer getLayer()
      Get the associated Layer.
      Point2D.Double getLocationP()
      Get the icon location in physical units.
      SoTPoint getLocationU()
      Get the icon location in user units.
      AbstractPane getPane()
      Get AbstractPane of the LayerChild.
      boolean isSelectable()
      Returns true if the current state is selectable.
      boolean isSelected()
      Returns true if the object's selected property is set.
      boolean isVisible()
      Check if LayerChild is visible.
      void modified(java.lang.String mess)
      Used by sgtplot internally.
      void paintIcon(java.awt.Component c, org.freehep.graphics2d.VectorGraphics g2, int x, int y)
      Paint the icon at the specified location.
      void removePropertyChangeListener(java.beans.PropertyChangeListener l) 
      void removeVetoableChangeListener(java.beans.VetoableChangeListener l) 
      void setBounds(int x, int y, int width, int height)
      Set icon bounds.
      void setBounds(java.awt.Rectangle bounds)
      Set icon bounds.
      void setFont(java.awt.Font font)
      Set the font for the value label.
      void setId(java.lang.String id)
      Set the identifier.
      void setLayer(Layer l)
      Associate a Layer with the LayerChild.
      void setLocation(java.awt.Point loc)
      Set icon location in device units
      void setLocation(java.awt.Point loc, boolean fireEvent)
      Set icon location in device units and optionally fire a PropertyChangeEvent.
      void setLocationNoVeto(int x, int y)
      Set icon location in device coordinates.
      void setLocationP(Point2D.Double loc)
      Set the icon location in physical units.
      void setLocationU(SoTPoint loc)
      Set the icon location in user units.
      void setLocationUNoVeto(SoTPoint loc)
      Set the icon location in user units.
      void setSelectable(boolean select)
      Set the Selectable property.
      void setSelected(boolean sel)
      Sets the selected property.
      void setValueFormat(ValueIconFormat vf)
      Set format to be used to create the value string.
      void setVisible(boolean vis)
      Set visibility for a LayerChild.
      java.lang.String toString()
      Return a string that represents the LayerChild.
      • Methods inherited from class javax.swing.ImageIcon

        getAccessibleContext, getDescription, getImage, getImageLoadStatus, getImageObserver, paintIcon, setDescription, setImage, setImageObserver
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ValueIcon

        public ValueIcon(java.lang.String filename,
                         java.lang.String description)
        Construct a ValueIcon using an image from a specified file.
        Parameters:
        filename - name of image file
        description - brief textual description of the image
      • ValueIcon

        public ValueIcon(java.net.URL location,
                         java.lang.String description)
        Construct a ValueIcon using an image from a specified URL.
        Parameters:
        location - URL of image file
        description - brief textual description of the image
      • ValueIcon

        public ValueIcon(java.awt.Image image,
                         java.lang.String description)
        Construct a ValueIcon using an Image.
        Parameters:
        image - the image
        description - brief textual description of the image
    • Method Detail

      • setValueFormat

        public void setValueFormat(ValueIconFormat vf)
        Set format to be used to create the value string. Default format is new ValueIconFormat("#####.##", "#").
        Parameters:
        the - value format
      • paintIcon

        public void paintIcon(java.awt.Component c,
                              org.freehep.graphics2d.VectorGraphics g2,
                              int x,
                              int y)
        Paint the icon at the specified location.
      • setFont

        public void setFont(java.awt.Font font)
        Set the font for the value label.
        Parameters:
        font - the font
      • getFont

        public java.awt.Font getFont()
        Get the value label font
      • getIconWidth

        public int getIconWidth()
        Get the total width, icon + label.
        Specified by:
        getIconWidth in interface javax.swing.Icon
        Overrides:
        getIconWidth in class javax.swing.ImageIcon
      • getIconHeight

        public int getIconHeight()
        Get the total heigth.
        Specified by:
        getIconHeight in interface javax.swing.Icon
        Overrides:
        getIconHeight in class javax.swing.ImageIcon
      • copy

        public LayerChild copy()
        Description copied from interface: LayerChild
        Create a copy of the LayerChild.
        Specified by:
        copy in interface LayerChild
        Returns:
        A copy of the LayerChild.
      • setVisible

        public void setVisible(boolean vis)
        Description copied from interface: LayerChild
        Set visibility for a LayerChild.
        Specified by:
        setVisible in interface LayerChild
        Parameters:
        vis - visible if true
      • isVisible

        public boolean isVisible()
        Description copied from interface: LayerChild
        Check if LayerChild is visible.
        Specified by:
        isVisible in interface LayerChild
        Returns:
        true if visible
      • draw

        public void draw(org.freehep.graphics2d.VectorGraphics g)
        Description copied from interface: LayerChild
        Draw the LayerChild.
        Specified by:
        draw in interface LayerChild
        Parameters:
        g - Graphics context
      • getId

        public java.lang.String getId()
        Description copied from interface: LayerChild
        Get the identifier.
        Specified by:
        getId in interface LayerChild
        Returns:
        LayerChild identification.
      • getLayer

        public Layer getLayer()
        Description copied from interface: LayerChild
        Get the associated Layer.
        Specified by:
        getLayer in interface LayerChild
        Returns:
        Associated layer
      • modified

        public void modified(java.lang.String mess)
        Description copied from interface: LayerChild
        Used by sgtplot internally.
        Specified by:
        modified in interface LayerChild
      • setId

        public void setId(java.lang.String id)
        Description copied from interface: LayerChild
        Set the identifier.
        Specified by:
        setId in interface LayerChild
        Parameters:
        id - LayerChild identification.
      • setLayer

        public void setLayer(Layer l)
        Description copied from interface: LayerChild
        Associate a Layer with the LayerChild.
        Specified by:
        setLayer in interface LayerChild
        Parameters:
        l - Parent layer.
      • toString

        public java.lang.String toString()
        Description copied from interface: LayerChild
        Return a string that represents the LayerChild.
        Specified by:
        toString in interface LayerChild
        Overrides:
        toString in class javax.swing.ImageIcon
        Returns:
        Stringified LayerChild representation.
      • getBounds

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

        public boolean isSelected()
        Description copied from interface: Selectable
        Returns true if the object's selected property is set.
        Specified by:
        isSelected in interface Selectable
        Returns:
        true if selected, false if not.
      • setSelected

        public void setSelected(boolean sel)
        Description copied from interface: Selectable
        Sets the selected property.
        Specified by:
        setSelected in interface Selectable
        Parameters:
        sel - true if selected, false if not.
      • isSelectable

        public boolean isSelectable()
        Description copied from interface: Selectable
        Returns true if the current state is selectable.
        Specified by:
        isSelectable in interface Selectable
        Returns:
        true if selectable
      • setSelectable

        public void setSelectable(boolean select)
        Description copied from interface: Selectable
        Set the Selectable property.
        Specified by:
        setSelectable in interface Selectable
        Parameters:
        select - if true object is selectable
      • getLocationP

        public Point2D.Double getLocationP()
        Get the icon location in physical units.
      • setLocationP

        public void setLocationP(Point2D.Double loc)
        Set the icon location in physical units.
        Property Change: location.
      • getLocationU

        public SoTPoint getLocationU()
        Get the icon location in user units.
        Since:
        3.0
      • setLocationUNoVeto

        public void setLocationUNoVeto(SoTPoint loc)
        Set the icon location in user units. Location change can't be vetoed.
        Since:
        3.0
      • setLocationU

        public void setLocationU(SoTPoint loc)
                          throws java.beans.PropertyVetoException
        Set the icon location in user units. Location change can be vetoed.
        Property Change: location.
        Throws:
        java.beans.PropertyVetoException
        Since:
        3.0
      • setLocationNoVeto

        public void setLocationNoVeto(int x,
                                      int y)
        Set icon location in device coordinates. Locatoin change can't be vetoed.
        Specified by:
        setLocationNoVeto in interface Draggable
      • setLocation

        public void setLocation(java.awt.Point loc)
        Set icon location in device units
        Specified by:
        setLocation in interface Draggable
      • setLocation

        public void setLocation(java.awt.Point loc,
                                boolean fireEvent)
        Set icon location in device units and optionally fire a PropertyChangeEvent.
        Specified by:
        setLocation in interface Draggable
        Since:
        3.0
      • setBounds

        public void setBounds(int x,
                              int y,
                              int width,
                              int height)
        Set icon bounds.
        Property Change: location.
      • setBounds

        public void setBounds(java.awt.Rectangle bounds)
        Set icon bounds.
      • addVetoableChangeListener

        public void addVetoableChangeListener(java.beans.VetoableChangeListener l)
      • removeVetoableChangeListener

        public void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
      • addPropertyChangeListener

        public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
      • removePropertyChangeListener

        public void removePropertyChangeListener(java.beans.PropertyChangeListener l)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.