Class Map

All Implemented Interfaces:
Accessible, AccessibleText, Buildable, ConstraintTarget, Scrollable, Proxy

@Generated("org.javagi.JavaGI") public class Map extends View implements Accessible, AccessibleText, Buildable, ConstraintTarget, Scrollable

Widget that displays a map for a specific View.

GtkSourceMap is a widget that maps the content of a View into a smaller view so the user can have a quick overview of the whole document.

This works by connecting a View to to the GtkSourceMap using the Map:view property or setView(View).

GtkSourceMap is a View object. This means that you can add a GutterRenderer to a gutter in the same way you would for a View. One example might be a GutterRenderer that shows which lines have changed in the document.

Additionally, it is desirable to match the font of the GtkSourceMap and the View used for editing. Therefore, Map:font-desc should be used to set the target font. You will need to adjust this to the desired font size for the map. A 1pt font generally seems to be an appropriate font size. "Monospace 1" is the default. See FontDescription#setSize for how to alter the size of an existing Pango.FontDescription.

When FontConfig is available, GtkSourceMap will try to use a bundled "block" font to make the map more legible.

  • Constructor Details

    • Map

      public Map(MemorySegment address)
      Create a Map instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • Map

      public Map()
      Create a new Map.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the Map class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected Map asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class View
      Returns:
      the instance as if it were its parent type
    • getView

      public @Nullable View getView()
      Gets the Map:view property, which is the view this widget is mapping.
      Returns:
      a GtkSourceView or null.
    • setView

      public void setView(View view)
      Sets the view that this Map will be doing the mapping to.
      Parameters:
      view - a GtkSourceView
    • builder

      public static Map.Builder<? extends Map.Builder> builder()
      A Map.Builder object constructs a Map with the specified properties. Use the various set...() methods to set properties, and finish construction with Map.Builder.build().
      Returns:
      the builder object