Package ij.gui

Class Overlay


  • public class Overlay
    extends java.lang.Object
    An Overlay is a list of ROIs that can be drawn non-destructively on an Image.
    • Constructor Summary

      Constructors 
      Constructor Description
      Overlay()
      Constructs an empty Overlay.
      Overlay​(Roi roi)
      Constructs an Overlay and adds the specified ROI.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(Roi roi)
      Adds an ROI to this Overlay.
      void add​(Roi roi, java.lang.String name)
      Adds an ROI to this Overlay using the specified name.
      void addElement​(Roi roi)
      Adds an ROI to this Overlay.
      void clear()
      Removes all the ROIs in this Overlay.
      boolean contains​(Roi roi)
      Returns 'true' if this Overlay contains the specified ROI.
      Overlay create()
      Returns a new Overlay that has the same properties as this one.
      void crop​(int firstSlice, int lastSlice)
      Removes ROIs having positions outside of the interval defined by firstSlice and lastSlice.
      void crop​(int firstC, int lastC, int firstZ, int lastZ, int firstT, int lastT)
      Removes ROIs having a C, Z or T coordinate outside the volume defined by firstC, lastC, firstZ, lastZ, firstT and lastT.
      Overlay crop​(java.awt.Rectangle bounds)  
      void drawBackgrounds​(boolean b)  
      void drawLabels​(boolean b)  
      void drawNames​(boolean b)  
      Overlay duplicate()
      Returns a clone of this Overlay.
      Roi get​(int index)
      Returns the ROI with the specified index or null if the index is invalid.
      boolean getDrawBackgrounds()  
      boolean getDrawLabels()  
      boolean getDrawNames()  
      int getIndex​(java.lang.String name)
      Returns the index of the ROI with the specified name, or -1 if not found.
      java.awt.Color getLabelColor()  
      java.awt.Font getLabelFont()  
      boolean isCalibrationBar()  
      void remove​(int index)
      Removes the ROI with the specified index from this Overlay.
      void remove​(Roi roi)
      Removes the specified ROI from this Overlay.
      void remove​(java.lang.String name)
      Removes all ROIs that have the specified name.
      void setFillColor​(java.awt.Color color)
      Sets the fill color of all the ROIs in this overlay.
      void setIsCalibrationBar​(boolean b)  
      void setLabelColor​(java.awt.Color c)  
      void setLabelFont​(java.awt.Font font)  
      void setStrokeColor​(java.awt.Color color)
      Sets the stroke color of all the ROIs in this overlay.
      int size()
      Returns the number of ROIs in this Overlay.
      Roi[] toArray()
      Returns on array containing the ROIs in this Overlay.
      java.lang.String toString()  
      void translate​(double dx, double dy)
      Moves all the ROIs in this overlay.
      void translate​(int dx, int dy)
      Moves all the ROIs in this overlay.
      • Methods inherited from class java.lang.Object

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

      • Overlay

        public Overlay()
        Constructs an empty Overlay.
      • Overlay

        public Overlay​(Roi roi)
        Constructs an Overlay and adds the specified ROI.
    • Method Detail

      • add

        public void add​(Roi roi)
        Adds an ROI to this Overlay.
      • add

        public void add​(Roi roi,
                        java.lang.String name)
        Adds an ROI to this Overlay using the specified name.
      • addElement

        public void addElement​(Roi roi)
        Adds an ROI to this Overlay.
      • remove

        public void remove​(int index)
        Removes the ROI with the specified index from this Overlay.
      • remove

        public void remove​(Roi roi)
        Removes the specified ROI from this Overlay.
      • remove

        public void remove​(java.lang.String name)
        Removes all ROIs that have the specified name.
      • clear

        public void clear()
        Removes all the ROIs in this Overlay.
      • get

        public Roi get​(int index)
        Returns the ROI with the specified index or null if the index is invalid.
      • getIndex

        public int getIndex​(java.lang.String name)
        Returns the index of the ROI with the specified name, or -1 if not found.
      • contains

        public boolean contains​(Roi roi)
        Returns 'true' if this Overlay contains the specified ROI.
      • size

        public int size()
        Returns the number of ROIs in this Overlay.
      • toArray

        public Roi[] toArray()
        Returns on array containing the ROIs in this Overlay.
      • setStrokeColor

        public void setStrokeColor​(java.awt.Color color)
        Sets the stroke color of all the ROIs in this overlay.
      • setFillColor

        public void setFillColor​(java.awt.Color color)
        Sets the fill color of all the ROIs in this overlay.
      • translate

        public void translate​(int dx,
                              int dy)
        Moves all the ROIs in this overlay.
      • translate

        public void translate​(double dx,
                              double dy)
        Moves all the ROIs in this overlay. Marcel Boeglin, October 2013
      • crop

        public Overlay crop​(java.awt.Rectangle bounds)
      • crop

        public void crop​(int firstSlice,
                         int lastSlice)
        Removes ROIs having positions outside of the interval defined by firstSlice and lastSlice. Marcel Boeglin, September 2013
      • crop

        public void crop​(int firstC,
                         int lastC,
                         int firstZ,
                         int lastZ,
                         int firstT,
                         int lastT)
        Removes ROIs having a C, Z or T coordinate outside the volume defined by firstC, lastC, firstZ, lastZ, firstT and lastT. Marcel Boeglin, September 2013
      • create

        public Overlay create()
        Returns a new Overlay that has the same properties as this one.
      • duplicate

        public Overlay duplicate()
        Returns a clone of this Overlay.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • drawLabels

        public void drawLabels​(boolean b)
      • getDrawLabels

        public boolean getDrawLabels()
      • drawNames

        public void drawNames​(boolean b)
      • getDrawNames

        public boolean getDrawNames()
      • drawBackgrounds

        public void drawBackgrounds​(boolean b)
      • getDrawBackgrounds

        public boolean getDrawBackgrounds()
      • setLabelColor

        public void setLabelColor​(java.awt.Color c)
      • getLabelColor

        public java.awt.Color getLabelColor()
      • setLabelFont

        public void setLabelFont​(java.awt.Font font)
      • getLabelFont

        public java.awt.Font getLabelFont()
      • setIsCalibrationBar

        public void setIsCalibrationBar​(boolean b)
      • isCalibrationBar

        public boolean isCalibrationBar()