Interface MapCellRenderer

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      CellGeometry getCellGeometry()
      Returns the CellGeometry object this object uses for rendering.
      java.lang.String getName()
      Returns a name for this renderer.
      int getPlaneIndex()
      Returns the index of the default rendering plane of this renderer.
      PreferencesAdapter getPreferencesAdapter()
      Returns a component that allows to modify the preferences available for this renderer.
      void init​(GameData data, java.awt.Graphics g, java.awt.Rectangle offset)
      Initializes the renderer for one rendering pass.
      void render​(java.lang.Object obj, boolean active, boolean selected)
      Renders the supplied object.
      void scale​(float scaleFactor)
      Tells the renderer that it should re-adjust the scale factor it uses for rendering.
      void setCellGeometry​(CellGeometry geo)
      Sets the CellGeometry object this object uses for rendering.
    • Method Detail

      • render

        void render​(java.lang.Object obj,
                    boolean active,
                    boolean selected)
        Renders the supplied object. The active and selected parameters influence how the object is drawn.
        Parameters:
        obj - This object is going to be displayed (typically a region).
        active - Indicates if the object is the currently active object.
        selected - Indicates if the object is the currently selected.
      • getName

        java.lang.String getName()
        Returns a name for this renderer.
      • getPlaneIndex

        int getPlaneIndex()
        Returns the index of the default rendering plane of this renderer. See the constants specified in com.eressea.swing.map.Mapper for possible values.
      • getCellGeometry

        CellGeometry getCellGeometry()
        Returns the CellGeometry object this object uses for rendering.
      • setCellGeometry

        void setCellGeometry​(CellGeometry geo)
        Sets the CellGeometry object this object uses for rendering.
      • init

        void init​(GameData data,
                  java.awt.Graphics g,
                  java.awt.Rectangle offset)
        Initializes the renderer for one rendering pass. All supplied informations stays constant during a pass and is therefore not transferred with each render() call.
      • scale

        void scale​(float scaleFactor)
        Tells the renderer that it should re-adjust the scale factor it uses for rendering.
        Parameters:
        scaleFactor - The new factor. Must be > 0.
        Throws:
        java.lang.IllegalArgumentException - if scaleFactor <= 0.
      • getPreferencesAdapter

        PreferencesAdapter getPreferencesAdapter()
        Returns a component that allows to modify the preferences available for this renderer.