Class Control

  • All Implemented Interfaces:
    java.lang.Comparable<Char>, Char, net.morimekta.util.Numeric, net.morimekta.util.Stringable
    Direct Known Subclasses:
    Color

    public class Control
    extends java.lang.Object
    implements Char
    https://en.wikipedia.org/wiki/C0_and_C1_control_codes
    • Field Detail

      • UP

        public static final Control UP
      • DOWN

        public static final Control DOWN
      • RIGHT

        public static final Control RIGHT
      • LEFT

        public static final Control LEFT
      • CTRL_UP

        public static final Control CTRL_UP
      • CTRL_DOWN

        public static final Control CTRL_DOWN
      • CTRL_RIGHT

        public static final Control CTRL_RIGHT
      • CTRL_LEFT

        public static final Control CTRL_LEFT
      • CURSOR_ERASE

        public static final Control CURSOR_ERASE
      • CURSOR_SAVE

        public static final Control CURSOR_SAVE
      • CURSOR_RESTORE

        public static final Control CURSOR_RESTORE
      • DPAD_MID

        public static final Control DPAD_MID
      • INSERT

        public static final Control INSERT
      • DELETE

        public static final Control DELETE
      • HOME

        public static final Control HOME
      • END

        public static final Control END
      • PAGE_UP

        public static final Control PAGE_UP
      • PAGE_DOWN

        public static final Control PAGE_DOWN
      • F1

        public static final Control F1
      • F2

        public static final Control F2
      • F3

        public static final Control F3
      • F4

        public static final Control F4
      • F5

        public static final Control F5
      • F6

        public static final Control F6
      • F7

        public static final Control F7
      • F8

        public static final Control F8
      • F9

        public static final Control F9
      • F10

        public static final Control F10
      • F11

        public static final Control F11
        NOTE: It is common to use F11 to mean 'fullscreen'.
      • F12

        public static final Control F12
    • Method Detail

      • cursorSetPos

        public static Control cursorSetPos​(int line)
      • cursorSetPos

        public static Control cursorSetPos​(int line,
                                           int col)
      • cursorUp

        public static Control cursorUp​(int num)
      • cursorDown

        public static Control cursorDown​(int num)
      • cursorRight

        public static Control cursorRight​(int num)
      • cursorLeft

        public static Control cursorLeft​(int num)
      • asInteger

        public int asInteger()
        Description copied from interface: Char
        Unicode codepoint representing this character.
        Specified by:
        asInteger in interface Char
        Specified by:
        asInteger in interface net.morimekta.util.Numeric
        Returns:
        The 31 bit unsigned unicode code-point, or -1 if not representing a single unicode character.
      • asString

        public java.lang.String asString()
        Specified by:
        asString in interface net.morimekta.util.Stringable
      • printableWidth

        public int printableWidth()
        Description copied from interface: Char
        The number of character spaces taken up by this symbol. Usually 1, but 0 for control sequences, control characters, and 2 for wide symbols like CJK characters.
        Specified by:
        printableWidth in interface Char
        Returns:
        The printable width of the character.
      • length

        public int length()
        Description copied from interface: Char
        Number of utf-16 characters that this character takes up if enclosed in a java string.
        Specified by:
        length in interface Char
        Returns:
        The char count of the character.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

        public int compareTo​(Char o)
        Specified by:
        compareTo in interface java.lang.Comparable<Char>