All Implemented Interfaces:
Cloneable, IFFrame, IFFrameViewDependence, org.gvsig.fmap.mapcontext.rendering.symbols.IPrintable, org.gvsig.tools.dispose.Disposable, org.gvsig.tools.lang.Cloneable, org.gvsig.tools.observer.Observable, org.gvsig.tools.persistence.Persistent

public class FFrameGrid extends AbstractFFrameViewDependence implements IFFrameViewDependence
FFrame para introducir una cuadrícula sobre una vista en el Layout.
Author:
Vicente Caballero Navarro
  • Field Details

    • PERSISTENCE_DEFINITION_NAME

      public static final String PERSISTENCE_DEFINITION_NAME
      See Also:
    • FIXED_DISTANCE_MODE

      public static final int FIXED_DISTANCE_MODE
      Use a fixed distance (intervalX and intervalY) to calculate the position of grid lines
      See Also:
    • NUM_DIVISIONS_HORIZ_MODE

      public static final int NUM_DIVISIONS_HORIZ_MODE
      Use a specific number of horizontal divisions in order to calculate the position of grid lines
      See Also:
    • NUM_DIVISIONS_VERT_MODE

      public static final int NUM_DIVISIONS_VERT_MODE
      Use a specific number of vertical divisions in order to calculate the position of grid lines
      See Also:
  • Constructor Details

    • FFrameGrid

      public FFrameGrid()
  • Method Details

    • draw

      public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv, BufferedImage imgBase)
      Description copied from class: FFrame
      Draws the FFrame on the provided Graphics, according to the provided affine transform and the visible rectangle. It has to to be implemented by each FFrame, as each of them usually draws diffently.
      Specified by:
      draw in interface IFFrame
      Specified by:
      draw in class FFrame
      Parameters:
      g - Graphics2D
      at - Affine transform to translate sheet coordinates (in cm) to screen coordinates (in pixels)
      rv - rectángulo sobre el que hacer un clip.
      imgBase - Image used to speed up the drawing process
    • getNameFFrame

      public String getNameFFrame()
      Description copied from interface: IFFrame
      Devuelve el nombre que representa al tipo de FFrame.
      Specified by:
      getNameFFrame in interface IFFrame
      Returns:
      nombre del elemento.
    • getName

      public String getName()
      Description copied from interface: IFFrame
      Devuelve el nombre que representa al fframe.
      Specified by:
      getName in interface IFFrame
      Returns:
      String nombre del FFrame.
    • setFFrameDependence

      public void setFFrameDependence(IFFrame f)
      Description copied from interface: IFFrameViewDependence
      Inserta una FFrame de la cual se necesita por tener una dependencia.
      Specified by:
      setFFrameDependence in interface IFFrameViewDependence
      Overrides:
      setFFrameDependence in class AbstractFFrameViewDependence
      Parameters:
      f - FFrame de la que se depende.
    • setIntervalX

      public void setIntervalX(double d)
    • setIntervalY

      public void setIntervalY(double d)
    • getIntervalX

      public double getIntervalX()
    • getIntervalY

      public double getIntervalY()
    • setTextColor

      public void setTextColor(Color textcolor)
    • setIsLine

      public void setIsLine(boolean b)
    • isLine

      public boolean isLine()
    • getFontColor

      public Color getFontColor()
    • getSizeFont

      public int getSizeFont()
    • setSizeFont

      public void setSizeFont(int sizeFont)
    • getBoundingBox

      public Rectangle2D.Double getBoundingBox(AffineTransform at)
      Description copied from class: FFrame
      Returns the bounding box (in pixels) of this FFrame, based on the provided AffineTransform. If the AffineTransform is null, it returns the last calculated bounding box.
      Specified by:
      getBoundingBox in interface IFFrame
      Overrides:
      getBoundingBox in class FFrame
      Parameters:
      at - Affine transform to apply to the sheet coordinates to get the bounding box in pixels.
      Returns:
      Rectangle representing the bounding box (in pixels) of this FFrame
    • getMovieRect

      public Rectangle2D getMovieRect(int difx, int dify)
      Description copied from class: FFrame
      Devuelve el rect�ngulo a partir del desplazamiento en el eje x y el desplazamiento en el eje y.
      Specified by:
      getMovieRect in interface IFFrame
      Overrides:
      getMovieRect in class FFrame
      Parameters:
      difx - desplazamiento sobre el eje x.
      dify - desplazamiento sobre el eje y.
      Returns:
      rect�ngulo modificado en funci�n del desplazamiento realizado.
    • getMovieRect

      public Rectangle2D getMovieRect(int difx, int dify, boolean prop)
      Description copied from interface: IFFrame
      Devuelve el rectángulo a partir del desplazamiento en el eje x y el desplazamiento en el eje y.
      Specified by:
      getMovieRect in interface IFFrame
      Overrides:
      getMovieRect in class FFrame
      Parameters:
      difx - desplazamiento sobre el eje x.
      dify - desplazamiento sobre el eje y.
      prop - true para un desplazamiento proporcional
      Returns:
      rectángulo modificado en función del desplazamiento realizado.
    • refreshDependence

      public void refreshDependence(IFFrame fant, IFFrame fnew)
      Description copied from interface: IFFrameViewDependence
      Refresca las dependencias de la IFFrame teniendo en cuenta la dependencia anterior.
      Specified by:
      refreshDependence in interface IFFrameViewDependence
      Overrides:
      refreshDependence in class AbstractFFrameViewDependence
      Parameters:
      fant - Dependencia anterior.
      fnew - Nueva dependencia.
    • drawHandlers

      public void drawHandlers(Graphics2D g)
      Description copied from class: FFrame
      Dibuja los handlers sobre el boundingBox en el graphics que se pasa como par�metro.
      Specified by:
      drawHandlers in interface IFFrame
      Overrides:
      drawHandlers in class FFrame
      Parameters:
      g - Graphics sobre el que dibujar.
    • getLastMoveRect

      public Rectangle2D getLastMoveRect()
      Description copied from class: FFrame
      Devuelve el rect�ngulo que representa el �ltimo generado al desplazar o modificar el tama�o del fframe.
      Specified by:
      getLastMoveRect in interface IFFrame
      Overrides:
      getLastMoveRect in class FFrame
      Returns:
      Rectangle2D
    • getSymbolLine

      public org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol getSymbolLine()
    • setSymbolLine

      public void setSymbolLine(org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbolLine)
    • getSymbolPoint

      public org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol getSymbolPoint()
    • setSymbolPoint

      public void setSymbolPoint(org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbolPoint)
    • getFont

      public Font getFont()
    • setFont

      public void setFont(Font m_font)
    • getFontSize

      public int getFontSize()
    • setUseNumDivisions

      public void setUseNumDivisions(int mode)
      Defines whether a number of divisions is used to calculate the location of grid lines, or a distance (intervalX and intervalY) is used to calculate them.
      Parameters:
      useNumDivisions - One of FIXED_DISTANCE_MODE, NUM_DIVISIONS_HORIZ_MODE or NUM_DIVISIONS_HORIZ_MODE.
    • updateIntervals

      protected void updateIntervals()
    • updateIntervals

      protected void updateIntervals(org.gvsig.fmap.geom.primitive.Envelope env)
    • getUseNumDivisions

      public int getUseNumDivisions()
      Returns true if a number of divisions is used to calculate the location of grid lines, or false if a distance (intervalX and intervalY) is used to calculate them.
      Returns:
      One of FIXED_DISTANCE_MODE, NUM_DIVISIONS_HORIZ_MODE or NUM_DIVISIONS_VERT_MODE.
    • setNumDivisionsHoriz

      public void setNumDivisionsHoriz(int nx)
    • setNumDivisionsVert

      public void setNumDivisionsVert(int ny)
    • getNumDivisionsHoriz

      public int getNumDivisionsHoriz()
    • getNumDivisionsVert

      public int getNumDivisionsVert()
    • setLabelFormat

      public void setLabelFormat(FFrameGridCoordinateFormat f)
    • getLabelFormat

      public FFrameGridCoordinateFormat getLabelFormat()
    • setHorizLabelRotation

      public void setHorizLabelRotation(double labelRotation)
      Sets the rotation of the labels corresponding to horizontal lines
      Parameters:
      labelRotation - Label rotation, measured in arc degrees
    • setVertLabelRotation

      public void setVertLabelRotation(double labelRotation)
      Sets the rotation of the labels corresponding to vertical lines
      Parameters:
      labelRotation - Label rotation, measured in arc degrees
    • getHorizLabelRotation

      public double getHorizLabelRotation()
      Gets the rotation of the labels corresponding to horizontal lines
      Parameters:
      labelRotation - Label rotation, measured in arc degrees
    • getLabelAnchor

      public int getLabelAnchor()
      Defines the alignment of the grid label compared with the associated grid tick
      Parameters:
      anchor -
      invalid reference
      RotatedTextUtils.ANCHOR_CORNER
      or
      invalid reference
      RotatedTextUtils.ANCHOR_CENTER
    • setLabelAnchor

      public void setLabelAnchor(int anchor)
      Gets the alignment of the grid labels. ANCHOR_CORNER aligns the corner of the label with the grid tick, while ANCHOR_CENTER aligns the label center with the grid tick.
      Parameters:
      anchor -
      invalid reference
      RotatedTextUtils.ANCHOR_CORNER
      or
      invalid reference
      RotatedTextUtils.ANCHOR_CENTER
    • getVertLabelRotation

      public double getVertLabelRotation()
      Gets the rotation of the labels corresponding to vertical lines
      Parameters:
      labelRotation - Label rotation, measured in arc degrees
    • print

      public void print(Graphics2D g, AffineTransform at, org.gvsig.fmap.geom.Geometry shape, org.gvsig.compat.print.PrintAttributes properties)
      Specified by:
      print in interface org.gvsig.fmap.mapcontext.rendering.symbols.IPrintable
    • registerPersistent

      public static void registerPersistent()
    • 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
      Overrides:
      loadFromState in class AbstractFFrameViewDependence
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • 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
      Overrides:
      saveToState in class AbstractFFrameViewDependence
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException