Class Picture.Builder<B extends Picture.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, BuilderInterface
Enclosing class:
Picture

public static class Picture.Builder<B extends Picture.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public Picture build()
      Finish building the Picture object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to Picture.
      Overrides:
      build in class Widget.Builder<B extends Picture.Builder<B>>
      Returns:
      a new instance of Picture with the properties that were set in the Builder object.
    • setAlternativeText

      public B setAlternativeText(String alternativeText)
      The alternative textual description for the picture.
      Parameters:
      alternativeText - the value for the alternative-text property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setCanShrink

      public B setCanShrink(boolean canShrink)
      If the GtkPicture can be made smaller than the natural size of its contents.
      Parameters:
      canShrink - the value for the can-shrink property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setContentFit

      public B setContentFit(ContentFit contentFit)
      How the content should be resized to fit inside the GtkPicture.
      Parameters:
      contentFit - the value for the content-fit property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.8
    • setFile

      public B setFile(File file)
      The GFile that is displayed or null if none.
      Parameters:
      file - the value for the file property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setIsolateContents

      public B setIsolateContents(boolean isolateContents)
      If the rendering of the contents is isolated from the rest of the widget tree.
      Parameters:
      isolateContents - the value for the isolate-contents property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.22
    • setKeepAspectRatio

      @Deprecated public B setKeepAspectRatio(boolean keepAspectRatio)
      Deprecated.
      Use Gtk.Picture:content-fit instead.
      Whether the GtkPicture will render its contents trying to preserve the aspect ratio.
      Parameters:
      keepAspectRatio - the value for the keep-aspect-ratio property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPaintable

      public B setPaintable(Paintable paintable)
      The GdkPaintable to be displayed by this GtkPicture.
      Parameters:
      paintable - the value for the paintable property
      Returns:
      the Builder instance is returned, to allow method chaining