Package com.ribs

Class RUBorders

java.lang.Object
com.ribs.RUBorders

public class RUBorders extends Object
A class to help manage and archive borders.

Would be nice if border archival supported multiple elements and nested elements to easily express compound borders (would also need nice border inspector).

Would also be nice to archive more border specific attributes, like EmptyBorder insets and LineBorder color and thickness (again, only useful with new border inspector UI).

Might also be nice to do "Border was explicitly overridden by Ribs" trick with borders, like we do with foreground/background (with reset button). This might make it viable to offer border editing to all components.

  • Constructor Details

    • RUBorders

      public RUBorders()
  • Method Details

    • getTitle

      public static String getTitle(Border aBorder)
      Returns the title of a given border (if it's a titled border).
    • setTitle

      public static Border setTitle(Border aBorder, String aTitle)
      Sets the title of a given border (if it's a titled border).
    • getTitleFont

      public static Font getTitleFont(Border aBorder)
      Returns the title font of the given border (if it's a TitledBorder).
    • setTitleFont

      public static void setTitleFont(Border aBorder, Font aFont)
      Sets the title font of the given border (if it's a TitledBorder).
    • getBorder

      public static Border getBorder(Border aBorder)
      Returns the given border, or if border is TitledBorder, the titled inner border.
    • isEmpty

      public static boolean isEmpty(Border aBorder)
      Returns whether a border is effectively not there (either null or an EmptyBorder with no margin).
    • toXML

      public static RXElement toXML(Border aBorder)
      Border XML archival.
    • fromXML

      public static Border fromXML(JComponent aComponent, RXElement anElement)
      Border XML unarchival.
      Parameters:
      aComponent - the component that borders will be set on
      anElement - the xml node that may (or may not) have a border element in