Class DefaultLayoutContext

java.lang.Object
org.gvsig.app.project.documents.layout.DefaultLayoutContext
All Implemented Interfaces:
LayoutContext, org.gvsig.tools.observer.Observable, org.gvsig.tools.persistence.Persistent

public class DefaultLayoutContext extends Object implements LayoutContext
Model of LayoutControl.
Author:
Vicente Caballero Navarro
  • Field Details

  • Constructor Details

    • DefaultLayoutContext

      public DefaultLayoutContext()
      Create a new object of LayoutContext.
  • Method Details

    • getAT

      public AffineTransform getAT()
      Description copied from interface: LayoutContext
      Returns the AffineTransform that is applying in the Layout.
      Specified by:
      getAT in interface LayoutContext
      Returns:
      AffineTransform
    • getAttributes

      public Attributes getAttributes()
      Description copied from interface: LayoutContext
      It returns the print attributes of the Layout.
      Specified by:
      getAttributes in interface LayoutContext
      Returns:
      Attributes.
    • setAtributes

      public void setAtributes(Attributes attributes)
      Description copied from interface: LayoutContext
      Inserts the print attributes of Layout.
      Specified by:
      setAtributes in interface LayoutContext
      Parameters:
      attributes - Attributes.
    • getFFrames

      public IFFrame[] getFFrames()
      Description copied from interface: LayoutContext
      It obtains the Array with all the FFrames that have been added al Layout.
      Specified by:
      getFFrames in interface LayoutContext
      Returns:
      Array with all the FFrames that have been added al Layout.
    • getFFrame

      public IFFrame getFFrame(int i)
      Description copied from interface: LayoutContext
      It obtains the FFrame from an index.
      Specified by:
      getFFrame in interface LayoutContext
    • updateFFrames

      public void updateFFrames()
      Description copied from interface: LayoutContext
      It orders the FFrames depending on its position specified by level.
      Specified by:
      updateFFrames in interface LayoutContext
    • delFFrameSelected

      public void delFFrameSelected()
      Description copied from interface: LayoutContext
      Remove the fframes selected.
      Specified by:
      delFFrameSelected in interface LayoutContext
    • clearSelection

      public void clearSelection()
      Description copied from interface: LayoutContext
      Clear the selection of FFrames.
      Specified by:
      clearSelection in interface LayoutContext
    • delFFrame

      public void delFFrame(int index)
      Description copied from interface: LayoutContext
      Remove the fframe of index.
      Specified by:
      delFFrame in interface LayoutContext
    • delFFrame

      public void delFFrame(IFFrame frame)
      Description copied from interface: LayoutContext
      Remove the fframe of parameter.
      Specified by:
      delFFrame in interface LayoutContext
      Parameters:
      frame - FFrame to remove.
    • getFrameCommandsRecord

      public FrameCommandsRecord getFrameCommandsRecord()
      Description copied from interface: LayoutContext
      Returns the EditableFeatureSource, is the control of all change in the FFrames of Layout.
      Specified by:
      getFrameCommandsRecord in interface LayoutContext
      Returns:
      EditableFatureSource.
    • addFFrame

      public void addFFrame(IFFrame frame, boolean clearSelection, boolean select)
      Description copied from interface: LayoutContext
      It adds a fframe to Arraylist of FFrames .
      Specified by:
      addFFrame in interface LayoutContext
      Parameters:
      frame - fframe to add.
      clearSelection - True True if clean the selection of the fframes already added and false if intends to maintain the same selection.
      select - Boolean that indicates if has to remain selected the FFrame that is added or not.
    • addFFrameSameProperties

      public void addFFrameSameProperties(IFFrame frame)
      Description copied from interface: LayoutContext
      It adds a fframe to Arraylist of FFrames with the same properties.
      Specified by:
      addFFrameSameProperties in interface LayoutContext
      Parameters:
      frame - fframe to add.
    • getNumBehind

      public int getNumBehind()
      Description copied from interface: LayoutContext
      Returns other number behind the current fframes.
      Specified by:
      getNumBehind in interface LayoutContext
      Returns:
      new Position behind.
    • getNumBefore

      public int getNumBefore()
      Description copied from interface: LayoutContext
      Returns other number before the current fframes.
      Specified by:
      getNumBefore in interface LayoutContext
      Returns:
      new Position before.
    • getAllFFrames

      public IFFrame[] getAllFFrames()
      Description copied from interface: LayoutContext
      It returns all the fframes included them erased and modified in all its previous forms.
      Specified by:
      getAllFFrames in interface LayoutContext
      Returns:
      IFFrame[] Array of FFrames.
    • deepiterator

      public Iterator deepiterator()
      Description copied from interface: LayoutContext
      Get an Iterator over al elements in the layout.
      Specified by:
      deepiterator in interface LayoutContext
      Returns:
    • iterator

      public Iterator iterator()
      Specified by:
      iterator in interface LayoutContext
    • getSelectedFFrames

      public IFFrame[] getSelectedFFrames()
      Description copied from interface: LayoutContext
      Gets the list of selected FFrames
      Specified by:
      getSelectedFFrames in interface LayoutContext
      Returns:
      An Array of selected FFrames
    • getSelectedFFrames

      public <T> T[] getSelectedFFrames(Class<T> clazz)
      Description copied from interface: LayoutContext
      Gets the list of selected FFrames that are instance of the provided Class.
      Specified by:
      getSelectedFFrames in interface LayoutContext
      Type Parameters:
      T -
      Parameters:
      clazz - A class
      Returns:
      An Array of selected FFrames
    • isEditable

      public boolean isEditable()
      Description copied from interface: LayoutContext
      It returns if the Layout is in edition.
      Specified by:
      isEditable in interface LayoutContext
      Returns:
      True if Layout is in edition.
    • setEditable

      public void setEditable(boolean b)
      Description copied from interface: LayoutContext
      It inserts if the Layout is in edition.
      Specified by:
      setEditable in interface LayoutContext
      Parameters:
      b - True if Layout is in edition.
    • isAdjustingToGrid

      public boolean isAdjustingToGrid()
      Description copied from interface: LayoutContext
      It returns if has been applying in the fframes that are added to Layout the grid, or not.
      Specified by:
      isAdjustingToGrid in interface LayoutContext
      Returns:
      true if has been applying the grid.
    • setAdjustToGrid

      public void setAdjustToGrid(boolean b)
      Description copied from interface: LayoutContext
      It inserts if has been applying in the fframes that are added to Layout the grid, or not.
      Specified by:
      setAdjustToGrid in interface LayoutContext
      Parameters:
      b - true if has been applying the grid.
    • setRuler

      public void setRuler(boolean b)
      Description copied from interface: LayoutContext
      It inserts if is shown or not the rule of the Layout.
      Specified by:
      setRuler in interface LayoutContext
      Parameters:
      b - True if is shown or not the rule of the Layout.
    • getRuler

      public boolean getRuler()
      Description copied from interface: LayoutContext
      Returns if is shown or not the rule of the Layout.
      Specified by:
      getRuler in interface LayoutContext
      Returns:
      True si se muestra la regla.
    • isGridVisible

      public boolean isGridVisible()
      Description copied from interface: LayoutContext
      It returns if has been showing the grid of Layout, or not.
      Specified by:
      isGridVisible in interface LayoutContext
      Returns:
      true if has been showing the grid of Layout.
    • setGridVisible

      public void setGridVisible(boolean b)
      Description copied from interface: LayoutContext
      It inserts if draws the Grid in the Layout or not.
      Specified by:
      setGridVisible in interface LayoutContext
      Parameters:
      b - True if draws the Grid in the Layout.
    • fullRefresh

      public void fullRefresh()
      Description copied from interface: LayoutContext
      Refresh all FFrames of Layout.
      Specified by:
      fullRefresh in interface LayoutContext
    • notifAllObservers

      public void notifAllObservers()
      Description copied from interface: LayoutContext
      Call all LayoutDrawListeners.
      Specified by:
      notifAllObservers in interface LayoutContext
    • 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
      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
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • setNumBefore

      public void setNumBefore(int numBefore)
      Specified by:
      setNumBefore in interface LayoutContext
    • setNumBehind

      public void setNumBehind(int numBehind)
      Specified by:
      setNumBehind in interface LayoutContext
    • addObserver

      public void addObserver(org.gvsig.tools.observer.Observer o)
      Specified by:
      addObserver in interface org.gvsig.tools.observer.Observable
    • deleteObserver

      public void deleteObserver(org.gvsig.tools.observer.Observer o)
      Specified by:
      deleteObserver in interface org.gvsig.tools.observer.Observable
    • deleteObservers

      public void deleteObservers()
      Specified by:
      deleteObservers in interface org.gvsig.tools.observer.Observable
    • setTocModel

      public void setTocModel(org.gvsig.fmap.mapcontext.MapContext tocModel)
      Description copied from interface: LayoutContext
      Sets the model of the TOC. The LayoutPanel will create a TOC in the user interface if a tocModel has been set.
      Specified by:
      setTocModel in interface LayoutContext
    • notifyTocUpdated

      public void notifyTocUpdated(TocModelChangedNotification.Type type)
      Description copied from interface: LayoutContext
      Triggers a notification to the TocModel observers of type
      invalid reference
      TocModelChangedNotification#MODEL_CHANGED
      Specified by:
      notifyTocUpdated in interface LayoutContext
    • getTocModel

      public org.gvsig.fmap.mapcontext.MapContext getTocModel()
      Description copied from interface: LayoutContext
      Gets the model of the TOC. The LayoutPanel will create a TOC in the user interface if a tocModel has been set.
      Specified by:
      getTocModel in interface LayoutContext
    • addTocObserver

      public void addTocObserver(TocModelObserver observer)
      Specified by:
      addTocObserver in interface LayoutContext
    • removeTocObserver

      public void removeTocObserver(TocModelObserver observer)
      Specified by:
      removeTocObserver in interface LayoutContext
    • removeTocObservers

      public void removeTocObservers()
      Specified by:
      removeTocObservers in interface LayoutContext
    • hasDocBeenOpened

      public boolean hasDocBeenOpened()
      True when the document window has been opened at least once, false otherwise. This is required to decide whether the page setting dialog has to be shown to the user, otherwise it would be shown every time the document is opened from project persistence
      Specified by:
      hasDocBeenOpened in interface LayoutContext
    • setHasDocBeenOpened

      public void setHasDocBeenOpened(boolean hasBeenOpened)
      True when the document window has been opened at least once, false otherwise. This is required to decide whether the page setting dialog has to be shown to the user, otherwise it would be shown every time the document is opened from project persistence
      Specified by:
      setHasDocBeenOpened in interface LayoutContext