Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8102470

Move Size and SizeUnit to public API

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Withdrawn
    • Icon: P4 P4
    • 8
    • None
    • javafx

      Size and SizeUnit are used for CSS numeric data types (http://www.w3.org/TR/css3-values/#numeric-types), CSS percentage values (http://www.w3.org/TR/css3-values/#percentages), CSS lengths (http://www.w3.org/TR/css3-values/#lengths) and CSS angles (http://www.w3.org/TR/css3-values/#angles). These currently live in the com.sun.javafx.css package. These classes need to be moved to javafx.css in order to remove raw types from generics in the CSS public API. Some methods in the com.sun.javafx.css API should be renamed to make their purpose clearer.

      Size:
      public double getValue() - return the number part of the css value
      public SizeUnits getUnits() - return the units, e.g. - em, px, %
      public double computeValue(Font font) - convert the value from its units to pixels, percents, or degrees using the size of the given font if the units are font-relative or percentage

      enum SizeUnits

      public boolean isFontRelative() - return true if the units are font-relative (em or ex)

      SizeUnits enums are: PERCENT, CM, IN, MM, PC, PT, PX, EM, EX, DEG, GRAD, RAD, TURN

            dgrieve David Grieve
            dgrieve David Grieve
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: