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

Move Size and SizeUnit to public API

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Withdrawn
    • Affects Version/s: None
    • Fix Version/s: 8
    • Component/s: javafx

      Description

      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

        Attachments

          Activity

            People

            • Assignee:
              dgrieve David Grieve (Inactive)
              Reporter:
              dgrieve David Grieve (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: