Overview
Package
Class
Use
Tree
Deprecated
Index
All Classes
Help
Prev Class
Next Class
VAquaRendering - Release 4
Interface org.violetlib.jnr.aqua.AquaUIPainter
Inherited members: ShowHide
Deprecated: ShowHide
org.violetlib.jnr.aqua

Interface AquaUIPainter

  • public interface AquaUIPainter
    An interface that supports native rendering for the Aqua look and feel. The goals of this interface are to isolate the specific set of features needed by the Aqua look and feel when using native rendering and to allow experimentation with different native rendering implementations. Although designed to support the Aqua look and feel, additional options are provided that could be supported by an extension to the Aqua look and feel.

    This interface supports the creation of renderings for user interface components. In most cases, the renderings are incomplete. For example, the rendering of a button does not include the button label or icon. For lack of a better word, the different kinds of renderings are identified as widgets.

    A rendering is represented by a painter object. To render a specific component, a painter is created for that component and then used to draw the rendering into a graphics context. The painter can be cached for future use (assuming that the rendering parameters have not changed); however, caching a painter is unlikely to provide a significant performance benefit. Implementations of this interface may support internal caching of images.

    This interface also makes available some layout related information associated with native renderings, such as fixed layout widths and/or heights, information about component outlines for painting focus rings, and information about active areas within rendered components, such as the label within a button or the portion of a search field that corresponds to the cancel button.

    The appropriate use of this interface is to call configure() immediately before each call to obtain a painter or to obtain a shape or bounds.

    All sizes and positions are specified in device independent pixels, sometimes called points.

    All combinations of parameters are not necessarily supported. Some widgets support only the regular and small size variants. Some widgets support only two display states, active and disabled. Other size variants and states are mapped to the most appropriate supported value.

    Some possible rendering options may not be supported by a specific implementation of this interface. In general, when a requested rendering cannot be performed, an UnsupportedOperationException is thrown.

    Because of the limitations of the Swing architecture, no current implementation of this interface paints the overlay focus rings used in recent releases of OS X. The isFocused parameters should always be false. They are provided for possible use for other UIs.

    • Nested Classes 
      Modifier and Type Interface and Description
      Ordinary member indicator ButtonState Reveal DetailHide Detail
      static class ButtonState
      States of a toggle button.
      static class ButtonState
      States of a toggle button.
      Ordinary member indicator ButtonWidget Reveal DetailHide Detail
      static class ButtonWidget
      Widgets for a button.
      static class ButtonWidget
      Widgets for a button.
      Ordinary member indicator ColumnSortArrowDirection Reveal DetailHide Detail
      static class ColumnSortArrowDirection
      Direction options for a column sort indicator in a table header.
      static class ColumnSortArrowDirection
      Direction options for a column sort indicator in a table header.
      Ordinary member indicator ComboBoxWidget Reveal DetailHide Detail
      static class ComboBoxWidget
      Widgets for an editable combo box.
      static class ComboBoxWidget
      Widgets for an editable combo box.
      Ordinary member indicator Direction Reveal DetailHide Detail
      static class Direction
      Direction options.
      static class Direction
      Direction options.
      Ordinary member indicator DividerWidget Reveal DetailHide Detail
      static class DividerWidget
      Widgets for a split pane divider.
      static class DividerWidget
      Widgets for a split pane divider.
      Ordinary member indicator GradientWidget Reveal DetailHide Detail
      static class GradientWidget
      Widgets for a gradient background.
      static class GradientWidget
      Widgets for a gradient background.
      Ordinary member indicator HorizontalAlignment Reveal DetailHide Detail
      static class HorizontalAlignment
      Horizontal alignment options.
      static class HorizontalAlignment
      Horizontal alignment options.
      Ordinary member indicator Orientation Reveal DetailHide Detail
      static class Orientation
      Orientation options.
      static class Orientation
      Orientation options.
      Ordinary member indicator PopupButtonWidget Reveal DetailHide Detail
      static class PopupButtonWidget
      Widgets for a non-editable combo box.
      static class PopupButtonWidget
      Widgets for a non-editable combo box.
      Ordinary member indicator Position Reveal DetailHide Detail
      static class Position
      Options for the position of a button in a segmented control.
      static class Position
      Options for the position of a button in a segmented control.
      Ordinary member indicator ProgressWidget Reveal DetailHide Detail
      static class ProgressWidget
      Widgets for a progress indicator.
      static class ProgressWidget
      Widgets for a progress indicator.
      Ordinary member indicator ScrollBarKnobWidget Reveal DetailHide Detail
      static class ScrollBarKnobWidget
      Widgets for a scroll bar knob.
      static class ScrollBarKnobWidget
      Widgets for a scroll bar knob.
      Ordinary member indicator ScrollBarWidget Reveal DetailHide Detail
      static class ScrollBarWidget
      Widgets for a scroll bar.
      static class ScrollBarWidget
      Widgets for a scroll bar.
      Ordinary member indicator SegmentedButtonWidget Reveal DetailHide Detail
      static class SegmentedButtonWidget
      Widgets for a button in a segmented control.
      static class SegmentedButtonWidget
      Widgets for a button in a segmented control.
      Ordinary member indicator Size Reveal DetailHide Detail
      static class Size
      Size options.
      static class Size
      Size options.
      Ordinary member indicator SliderWidget Reveal DetailHide Detail
      static class SliderWidget
      Widgets for a slider.
      static class SliderWidget
      Widgets for a slider.
      Ordinary member indicator State Reveal DetailHide Detail
      static class State
      States of a component.
      static class State
      States of a component.
      Ordinary member indicator TextFieldWidget Reveal DetailHide Detail
      static class TextFieldWidget
      Widgets for a text field.
      static class TextFieldWidget
      Widgets for a text field.
      Ordinary member indicator TickMarkPosition Reveal DetailHide Detail
      static class TickMarkPosition
      Options for the position of slider tick marks.
      static class TickMarkPosition
      Options for the position of slider tick marks.
      Ordinary member indicator TitleBarButtonWidget Reveal DetailHide Detail
      static class TitleBarButtonWidget
      Widgets for a button on a window title bar.
      static class TitleBarButtonWidget
      Widgets for a button on a window title bar.
      Ordinary member indicator TitleBarWidget Reveal DetailHide Detail
      static class TitleBarWidget
      Widgets for window title bar.
      static class TitleBarWidget
      Widgets for window title bar.
      Ordinary member indicator UILayoutDirection Reveal DetailHide Detail
      static class UILayoutDirection
      User interface layout direction options.
      static class UILayoutDirection
      User interface layout direction options.
      Ordinary member indicator VerticalAlignment Reveal DetailHide Detail
      static class VerticalAlignment
      Vertical alignment options.
      static class VerticalAlignment
      Vertical alignment options.
    • Methods 
      Modifier and Type Method and Description
      Ordinary member indicator configure Reveal DetailHide Detail
      abstract void configure(int w, int h)
      Configure the generic parameters for the next request.
      void configure(int w, int h)
      Configure the generic parameters for the next request.
      Parameters:
      w - The width of the widget.
      h - The height of the widget.
      Ordinary member indicator copy Reveal DetailHide Detail
      abstract AquaUIPainter copy()
      Create a new instance with the same implementation.
      AquaUIPainter copy()
      Create a new instance with the same implementation.
      Ordinary member indicator getComboBoxEditorBounds Reveal DetailHide Detail
      abstract Rectangle2D getComboBoxEditorBounds(ComboBoxLayoutConfiguration g)
      Return the bounds of the editor area of a combo box based on the configured width and height.
      Rectangle2D getComboBoxEditorBounds(ComboBoxLayoutConfiguration g)
      Return the bounds of the editor area of a combo box based on the configured width and height. The bounds of the editor area may differ from that predicted using the editor insets if the rendering is limited in width or height.
      Parameters:
      g - This parameter specifies the layout configuration of the combo box.
      Ordinary member indicator getComboBoxIndicatorBounds Reveal DetailHide Detail
      abstract Rectangle2D getComboBoxIndicatorBounds(ComboBoxLayoutConfiguration g)
      Return the bounds of the indicator within the combo box based on the configured width and height.
      Rectangle2D getComboBoxIndicatorBounds(ComboBoxLayoutConfiguration g)
      Return the bounds of the indicator within the combo box based on the configured width and height.
      Parameters:
      g - This parameter specifies the layout configuration of the segmented button.
      Ordinary member indicator getLayoutInfo Reveal DetailHide Detail
      abstract AquaUILayoutInfo getLayoutInfo()
      Return a provider of layout information.
      AquaUILayoutInfo getLayoutInfo()
      Return a provider of layout information.
      Ordinary member indicator getOutline Reveal DetailHide Detail
      abstract Shape getOutline(LayoutConfiguration g)
      Return the visible outline of a widget based on the configured width and height.
      Shape getOutline(LayoutConfiguration g)
      Return the visible outline of a widget based on the configured width and height. The returned shape can be used to create a focus ring. The returned shape need not correspond exactly to the painted area. For example, a shadow might be painted outside this shape.
      Parameters:
      g - This configuration describes the widget.
      Returns:
      the outline.
      Ordinary member indicator getPainter Reveal DetailHide Detail
      abstract Painter getPainter(Configuration g)
      Return a widget painter based on the specified configuration and the previously configured widget size.
      Painter getPainter(Configuration g) throws UnsupportedOperationException
      Return a widget painter based on the specified configuration and the previously configured widget size.
      Parameters:
      g - The widget configuration.
      Returns:
      the painter.
      Throws:
      UnsupportedOperationException - if the configuration is not supported.
      Ordinary member indicator getPopupButtonContentBounds Reveal DetailHide Detail
      abstract Rectangle2D getPopupButtonContentBounds(PopupButtonLayoutConfiguration g)
      Return the bounds of the content area of a pop up button based on the configured width and height.
      Rectangle2D getPopupButtonContentBounds(PopupButtonLayoutConfiguration g)
      Return the bounds of the content area of a pop up button based on the configured width and height. The bounds of the content area may differ from that predicted using the content insets if the rendering is limited in width or height.
      Parameters:
      g - This parameter specifies the layout configuration of the pop up button.
      Ordinary member indicator getScrollBarThumbHit Reveal DetailHide Detail
      abstract int getScrollBarThumbHit(ScrollBarThumbConfiguration g)
      Determine whether a major axis coordinate of a scroll bar corresponds to the visible thumb.
      int getScrollBarThumbHit(ScrollBarThumbConfiguration g)
      Determine whether a major axis coordinate of a scroll bar corresponds to the visible thumb. This method relies on the previously configured widget size.
      Parameters:
      g - This parameter describes the scroll bar and the major axis coordinate.
      Returns:
      zero if the coordinate corresponds to the visible thumb, -1 if it is in the track at a lower position, 1 if it is in the track at a higher position, a large negative number otherwise. The scroll bar track is the portion of the widget that the thumb can occupy.
      Ordinary member indicator getScrollBarThumbPosition Reveal DetailHide Detail
      abstract float getScrollBarThumbPosition(ScrollBarThumbLayoutConfiguration g, boolean useExtent)
      Map a major axis coordinate of a scroll bar to a thumb position along the scroll bar track.
      float getScrollBarThumbPosition(ScrollBarThumbLayoutConfiguration g, boolean useExtent)
      Map a major axis coordinate of a scroll bar to a thumb position along the scroll bar track. This method relies on the previously configured widget size.
      Parameters:
      g - This parameter describes the scroll bar and the major axis coordinate.
      useExtent - If true, the coordinate is interpreted as the location of the leading edge of the thumb, for the purpose of repositioning the thumb. If false, the coordinate is interpreted as a fraction of the full track, for the purpose of scroll-to-here.
      Returns:
      the thumb position as a fraction of the scroll bar track, if in the range 0 to 1 (inclusive), or a value less than 0 if the coordinate is outside the track in the area corresponding to low values, or a value greater than 1 if the coordinate is outside the track in the area corresponding to high values. The scroll bar track is the portion of the widget that the thumb can occupy.
      Ordinary member indicator getSliderLabelBounds Reveal DetailHide Detail
      abstract Rectangle2D getSliderLabelBounds(SliderLayoutConfiguration g, double thumbPosition, Dimension size)
      Return the recommended bounds for a label corresponding to a given thumb position.
      Rectangle2D getSliderLabelBounds(SliderLayoutConfiguration g, double thumbPosition, Dimension size)
      Return the recommended bounds for a label corresponding to a given thumb position. This method relies on the previously configured widget size.
      Parameters:
      g - This parameter specifies the layout configuration of the slider.
      thumbPosition - The thumb position represented by the label, expressed as a fraction of the slider range, in the range 0 to 1 (inclusive). Thumb position 0 corresponds to the lowest slider value.
      size - The intended size of the label.
      Returns:
      the recommended bounds for the label.
      Ordinary member indicator getSliderThumbBounds Reveal DetailHide Detail
      abstract Rectangle2D getSliderThumbBounds(SliderLayoutConfiguration g, double thumbPosition)
      Return the bounds of the thumb area based on the configured width and height.
      Rectangle2D getSliderThumbBounds(SliderLayoutConfiguration g, double thumbPosition)
      Return the bounds of the thumb area based on the configured width and height.
      Parameters:
      g - This parameter specifies the layout configuration of the slider.
      thumbPosition - The position where the thumb would be be painted, expressed as a fraction of the slider range, in the range 0 to 1 (inclusive). Thumb position 0 corresponds to the lowest slider value.
      Ordinary member indicator getSliderThumbPosition Reveal DetailHide Detail
      abstract double getSliderThumbPosition(SliderLayoutConfiguration g, int x, int y)
      Map a mouse coordinate to a slider thumb position.
      double getSliderThumbPosition(SliderLayoutConfiguration g, int x, int y)
      Map a mouse coordinate to a slider thumb position. This method relies on the previously configured widget size.
      Parameters:
      g - This parameter specifies the layout configuration of the slider.
      x - The x coordinate relative to the configured bounds.
      y - The y coordinate relative to the configured bounds.
      Returns:
      the thumb position as a fraction of the slider range, if in the range 0 to 1 (inclusive), or a value less than 0 if the coordinate is outside the slider range in the area corresponding to low values, or a value greater than 1 if the coordinate is outside the slider range in the area corresponding to high values.