# Class Widget

Object
Widget

All Implemented Interfaces:
  `Localized`

Direct Known Subclasses:
  `CoverageExplorer, GridSliceSelector, ImagePropertyExplorer, LogViewer, MetadataSummary, ResourceExplorer, StatusBar`

public abstract class Widget extends Object implements Localized
Base class of user interfaces provided by Apache SIS. This base class is used for components that encapsulate JavaFX controls instead of extending them. We use this indirection level for hiding implementation details such as the exact JavaFX classes used for implementing the widget.

## Other controls

Not all Apache SIS widgets extent this class. Other widgets extending directly a JavaFX control or other classes are `MetadataTree`, `ResourceTree`, `FeatureTable`, `GridView`, `CRSChooser` and `MapCanvas`.

Since:
  1.1

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Widget()`
  Creates a new widget.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Locale`
  `getLocale()`
  Returns the locale for controls and messages.
  `abstract Region`
  `getView()`
  Returns the encapsulated JavaFX component to add in a scene graph for making the widget visible.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Widget

    protected Widget()
    Creates a new widget.

- ## Method Details

  - ### getView

    public abstract Region getView()
    Returns the encapsulated JavaFX component to add in a scene graph for making the widget visible. The `Region` subclass is implementation dependent and may change in any future SIS version.
    Returns:
      the JavaFX component to insert in a scene graph.

  - ### getLocale

    public Locale getLocale()
    Returns the locale for controls and messages. This is usually the default locale but some widgets allow alternative locale. This is indicative; there is no guarantee that this locale will be honored by all controls.
    Specified by:
      `getLocale` in interface `Localized`
    Returns:
      the locale for controls in this widget.
    Since:
      1.2