classdef ButtonOrientation
  % Toolstrip button orientations.
  %
  % See also toolpack.component.TSButton
  
  % Author(s): Bora Eryilmaz
  % Revised:
  % Copyright 2011 The MathWorks, Inc.
  
  % ----------------------------------------------------------------------------
  enumeration
    % Button orientation (default = Auto)
    AUTO (com.mathworks.toolstrip.components.ButtonOrientation.AUTO)
    HORIZONTAL (com.mathworks.toolstrip.components.ButtonOrientation.HORIZONTAL)
    VERTICAL (com.mathworks.toolstrip.components.ButtonOrientation.VERTICAL)
  end
  
  % ----------------------------------------------------------------------------
  properties
    % Matching Java enum ButtonOrientation.
    JavaEnum
  end
  
  % ----------------------------------------------------------------------------
  methods
    function this = ButtonOrientation(data)
      this.JavaEnum = data;
    end
  end
  
  methods (Static)
    function orientation = getOrientation(javaOrientation)
      % Return matching enumeration for specified Java ButtonOrientation.
      if (javaOrientation == toolpack.component.ButtonOrientation.AUTO.JavaEnum)
        orientation = toolpack.component.ButtonOrientation.AUTO;
      elseif (javaOrientation == toolpack.component.ButtonOrientation.HORIZONTAL.JavaEnum)
        orientation = toolpack.component.ButtonOrientation.HORIZONTAL;
      else
        orientation = toolpack.component.ButtonOrientation.VERTICAL;
      end
    end
  end
end
