Class DefaultRasterLegend

java.lang.Object
org.gvsig.fmap.raster.lib.legend.impl.DefaultRasterLegend
All Implemented Interfaces:
Cloneable, org.gvsig.fmap.mapcontext.rendering.legend.ILegend, org.gvsig.fmap.mapcontext.rendering.legend.Legend, org.gvsig.raster.lib.legend.api.RasterLegend, org.gvsig.tools.lang.Cloneable, org.gvsig.tools.observer.Observer, org.gvsig.tools.persistence.Persistent

public class DefaultRasterLegend extends Object implements org.gvsig.raster.lib.legend.api.RasterLegend
Default implementation of RasterLegend. This object can draw buffers with a ColorInterpretation, ColorTable and OperationList
Author:
Lluis Marques
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
    Description of persistence definition
    static final String
    Persistence definition name
  • Constructor Summary

    Constructors
    Constructor
    Description
    Empty constructor
    DefaultRasterLegend(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation)
    Default RasterLegend constructor
    DefaultRasterLegend(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation, org.gvsig.raster.lib.legend.api.Transparency transparency, org.gvsig.raster.lib.buffer.api.operations.OperationList filters)
    Default RasterLegend constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addCMYKToRGBOperation(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation)
     
    void
    addColorTableOperation(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation, int index)
     
    void
    addHSLToRGBOperation(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation)
     
    void
    addLegendListener(org.gvsig.fmap.mapcontext.rendering.legend.events.LegendContentsChangedListener listener)
     
    void
    addLinearStretchEnhancementOperationIfNeeded(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation, List<org.gvsig.fmap.dal.raster.BandDescriptor> bands, int index)
     
    void
    addYCBCRToRGBOperation(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation)
     
    boolean
     
     
    org.gvsig.fmap.mapcontext.rendering.legend.ILegend
     
    void
    draw(Graphics graphics, org.gvsig.raster.lib.buffer.api.Buffer buffer, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.SimpleTaskStatus taskStatus)
     
    void
    fireColorinterpretationChangedEvent(org.gvsig.fmap.mapcontext.raster.api.legend.RasterLegendEvent event)
     
    void
    fireDefaultSymbolChangedEvent(org.gvsig.fmap.mapcontext.rendering.legend.events.SymbolLegendEvent event)
     
    void
    fireOperationListChangedEvent(org.gvsig.fmap.mapcontext.raster.api.legend.RasterLegendEvent event)
     
    org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation
     
    org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
     
    org.gvsig.raster.lib.buffer.api.operations.OperationList
     
    org.gvsig.fmap.mapcontext.rendering.legend.events.LegendContentsChangedListener[]
     
    org.gvsig.raster.lib.legend.api.Transparency
     
    void
    loadFromState(org.gvsig.tools.persistence.PersistentState state)
     
    static void
     
    void
    removeLegendListener(org.gvsig.fmap.mapcontext.rendering.legend.events.LegendContentsChangedListener listener)
     
    void
    saveToState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    setColorInterpretation(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation)
     
    void
    setFilters(org.gvsig.raster.lib.buffer.api.operations.OperationList filterList)
     
    void
    setTransparency(org.gvsig.raster.lib.legend.api.Transparency transparency)
     
    void
    setTransparentNoData(boolean noDataTransparent)
     
    void
    update(org.gvsig.tools.observer.Observable observable, Object notification)
     

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • DefaultRasterLegend

      public DefaultRasterLegend()
      Empty constructor
    • DefaultRasterLegend

      public DefaultRasterLegend(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation)
      Default RasterLegend constructor
      Parameters:
      colorInterpretation - Color interpretation of legend
    • DefaultRasterLegend

      public DefaultRasterLegend(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation, org.gvsig.raster.lib.legend.api.Transparency transparency, org.gvsig.raster.lib.buffer.api.operations.OperationList filters)
      Default RasterLegend constructor
      Parameters:
      colorInterpretation - Color interpretation of legend
      transparency - Transparency of legend
      filters - Filters of legend
      colorTable - Color table of legend
  • Method Details

    • draw

      public void draw(Graphics graphics, org.gvsig.raster.lib.buffer.api.Buffer buffer, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.SimpleTaskStatus taskStatus)
      Specified by:
      draw in interface org.gvsig.raster.lib.legend.api.RasterLegend
    • getColorInterpretation

      public org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation getColorInterpretation()
      Specified by:
      getColorInterpretation in interface org.gvsig.raster.lib.legend.api.RasterLegend
    • setColorInterpretation

      public void setColorInterpretation(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation)
      Specified by:
      setColorInterpretation in interface org.gvsig.raster.lib.legend.api.RasterLegend
    • getFilters

      public org.gvsig.raster.lib.buffer.api.operations.OperationList getFilters()
      Specified by:
      getFilters in interface org.gvsig.raster.lib.legend.api.RasterLegend
    • setFilters

      public void setFilters(org.gvsig.raster.lib.buffer.api.operations.OperationList filterList)
      Specified by:
      setFilters in interface org.gvsig.raster.lib.legend.api.RasterLegend
    • registerPersistence

      public static void registerPersistence()
    • saveToState

      public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      saveToState in interface org.gvsig.tools.persistence.Persistent
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • loadFromState

      public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      loadFromState in interface org.gvsig.tools.persistence.Persistent
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • setTransparency

      public void setTransparency(org.gvsig.raster.lib.legend.api.Transparency transparency)
      Specified by:
      setTransparency in interface org.gvsig.raster.lib.legend.api.RasterLegend
    • getTransparency

      public org.gvsig.raster.lib.legend.api.Transparency getTransparency()
      Specified by:
      getTransparency in interface org.gvsig.raster.lib.legend.api.RasterLegend
    • getDefaultSymbol

      public org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol getDefaultSymbol()
      Specified by:
      getDefaultSymbol in interface org.gvsig.fmap.mapcontext.rendering.legend.ILegend
    • clone

      public Object clone() throws CloneNotSupportedException
      Specified by:
      clone in interface org.gvsig.tools.lang.Cloneable
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • cloneLegend

      public org.gvsig.fmap.mapcontext.rendering.legend.ILegend cloneLegend()
      Specified by:
      cloneLegend in interface org.gvsig.fmap.mapcontext.rendering.legend.ILegend
    • fireDefaultSymbolChangedEvent

      public void fireDefaultSymbolChangedEvent(org.gvsig.fmap.mapcontext.rendering.legend.events.SymbolLegendEvent event)
      Specified by:
      fireDefaultSymbolChangedEvent in interface org.gvsig.fmap.mapcontext.rendering.legend.ILegend
    • getListeners

      public org.gvsig.fmap.mapcontext.rendering.legend.events.LegendContentsChangedListener[] getListeners()
      Specified by:
      getListeners in interface org.gvsig.fmap.mapcontext.rendering.legend.ILegend
    • setTransparentNoData

      public void setTransparentNoData(boolean noDataTransparent)
      Specified by:
      setTransparentNoData in interface org.gvsig.raster.lib.legend.api.RasterLegend
    • areTransparentNoData

      public boolean areTransparentNoData()
      Specified by:
      areTransparentNoData in interface org.gvsig.raster.lib.legend.api.RasterLegend
    • update

      public void update(org.gvsig.tools.observer.Observable observable, Object notification)
      Specified by:
      update in interface org.gvsig.tools.observer.Observer
    • fireColorinterpretationChangedEvent

      public void fireColorinterpretationChangedEvent(org.gvsig.fmap.mapcontext.raster.api.legend.RasterLegendEvent event)
      Parameters:
      event -
    • fireOperationListChangedEvent

      public void fireOperationListChangedEvent(org.gvsig.fmap.mapcontext.raster.api.legend.RasterLegendEvent event)
      Parameters:
      event -
    • addLegendListener

      public void addLegendListener(org.gvsig.fmap.mapcontext.rendering.legend.events.LegendContentsChangedListener listener)
      Specified by:
      addLegendListener in interface org.gvsig.fmap.mapcontext.rendering.legend.ILegend
    • removeLegendListener

      public void removeLegendListener(org.gvsig.fmap.mapcontext.rendering.legend.events.LegendContentsChangedListener listener)
      Specified by:
      removeLegendListener in interface org.gvsig.fmap.mapcontext.rendering.legend.ILegend
    • addColorTableOperation

      public void addColorTableOperation(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation, int index)
      Specified by:
      addColorTableOperation in interface org.gvsig.raster.lib.legend.api.RasterLegend
    • addLinearStretchEnhancementOperationIfNeeded

      public void addLinearStretchEnhancementOperationIfNeeded(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation, List<org.gvsig.fmap.dal.raster.BandDescriptor> bands, int index)
      Specified by:
      addLinearStretchEnhancementOperationIfNeeded in interface org.gvsig.raster.lib.legend.api.RasterLegend
    • addHSLToRGBOperation

      public void addHSLToRGBOperation(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation)
      Specified by:
      addHSLToRGBOperation in interface org.gvsig.raster.lib.legend.api.RasterLegend
    • addCMYKToRGBOperation

      public void addCMYKToRGBOperation(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation)
      Specified by:
      addCMYKToRGBOperation in interface org.gvsig.raster.lib.legend.api.RasterLegend
    • addYCBCRToRGBOperation

      public void addYCBCRToRGBOperation(org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation colorInterpretation)
      Specified by:
      addYCBCRToRGBOperation in interface org.gvsig.raster.lib.legend.api.RasterLegend