code: protected SegmentType getSegmentType(JComponent c) {
          Object      buttonType  = c.getClientProperty("JButton.buttonType");
          SegmentType segmentType = SegmentType.NONE;
  
          if (buttonType != null && buttonType instanceof String && ((String) buttonType).startsWith("segmented")) {
              String position = (String) c.getClientProperty("JButton.segmentPosition");
  
              if ("first".equals(position)) {
                  segmentType = SegmentType.FIRST;
              } else if ("middle".equals(position)) {
                  segmentType = SegmentType.MIDDLE;
              } else if ("last".equals(position)) {
                  segmentType = SegmentType.LAST;
              }
          }
  
          return segmentType;
      }
docs: Get the segment type (if any) from the component's client properties.
  
  @param  c the component.
  
  @return the segment status.