4632N/A/*
4632N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
4632N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4632N/A *
4632N/A * This code is free software; you can redistribute it and/or modify it
4632N/A * under the terms of the GNU General Public License version 2 only, as
4632N/A * published by the Free Software Foundation. Oracle designates this
4632N/A * particular file as subject to the "Classpath" exception as provided
4632N/A * by Oracle in the LICENSE file that accompanied this code.
4632N/A *
4632N/A * This code is distributed in the hope that it will be useful, but WITHOUT
4632N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4632N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4632N/A * version 2 for more details (a copy is included in the LICENSE file that
4632N/A * accompanied this code).
4632N/A *
4632N/A * You should have received a copy of the GNU General Public License version
4632N/A * 2 along with this work; if not, write to the Free Software Foundation,
4632N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4632N/A *
4632N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4632N/A * or visit www.oracle.com if you need additional information or have any
4632N/A * questions.
4632N/A */
4632N/A
4632N/Apackage apple.laf;
4632N/A
4632N/Aimport java.lang.reflect.Field;
4632N/Aimport java.nio.ByteBuffer;
4632N/A
4632N/Apublic final class JRSUIConstants {
4632N/A private static native long getPtrForConstant(final int constant);
4632N/A
4632N/A static class Key {
4632N/A protected static final int _value = 20;
4632N/A public static final Key VALUE = new Key(_value);
4632N/A
4632N/A protected static final int _thumbProportion = 24;
4632N/A public static final Key THUMB_PROPORTION = new Key(_thumbProportion);
4632N/A
4632N/A protected static final int _thumbStart = 25;
4632N/A public static final Key THUMB_START = new Key(_thumbStart);
4632N/A
4632N/A protected static final int _windowTitleBarHeight = 28;
4632N/A public static final Key WINDOW_TITLE_BAR_HEIGHT = new Key(_windowTitleBarHeight);
4632N/A
4632N/A protected static final int _animationFrame = 23;
4632N/A public static final Key ANIMATION_FRAME = new Key(_animationFrame);
4632N/A
4632N/A final int constant;
4632N/A private long ptr;
4632N/A
4632N/A private Key(final int constant) {
4632N/A this.constant = constant;
4632N/A }
4632N/A
4632N/A long getConstantPtr() {
4632N/A if (ptr != 0) return ptr;
4632N/A ptr = getPtrForConstant(constant);
4632N/A if (ptr != 0) return ptr;
4632N/A throw new RuntimeException("Constant not implemented in native: " + this);
4632N/A }
4632N/A
4632N/A public String toString() {
4632N/A return getConstantName(this) + (ptr == 0 ? "(unlinked)" : "");
4632N/A }
4632N/A }
4632N/A
4632N/A static class DoubleValue {
4632N/A protected static final byte TYPE_CODE = 1;
4632N/A
4632N/A final double doubleValue;
4632N/A
4632N/A DoubleValue(final double doubleValue) {
4632N/A this.doubleValue = doubleValue;
4632N/A }
4632N/A
4632N/A public byte getTypeCode() {
4632N/A return TYPE_CODE;
4632N/A }
4632N/A
4632N/A public void putValueInBuffer(final ByteBuffer buffer) {
4632N/A buffer.putDouble(doubleValue);
4632N/A }
4632N/A
4632N/A public boolean equals(final Object obj) {
4632N/A return (obj instanceof DoubleValue) && (((DoubleValue)obj).doubleValue == doubleValue);
4632N/A }
4632N/A
4632N/A public int hashCode() {
4632N/A final long bits = Double.doubleToLongBits(doubleValue);
4632N/A return (int)(bits ^ (bits >>> 32));
4632N/A }
4632N/A
4632N/A public String toString() {
4632N/A return Double.toString(doubleValue);
4632N/A }
4632N/A }
4632N/A
4632N/A
4632N/A static class PropertyEncoding {
4632N/A final long mask;
4632N/A final byte shift;
4632N/A
4632N/A PropertyEncoding(final long mask, final byte shift) {
4632N/A this.mask = mask;
4632N/A this.shift = shift;
4632N/A }
4632N/A }
4632N/A
4632N/A static class Property {
4632N/A final PropertyEncoding encoding;
4632N/A final long value;
4632N/A final byte ordinal;
4632N/A
4632N/A Property(final PropertyEncoding encoding, final byte ordinal) {
4632N/A this.encoding = encoding;
4632N/A this.value = ((long)ordinal) << encoding.shift;
4632N/A this.ordinal = ordinal;
4632N/A }
4632N/A
4632N/A /**
4632N/A * Applies this property value to the provided state
4632N/A * @param encodedState the incoming JRSUI encoded state
4632N/A * @return the composite of the provided JRSUI encoded state and this value
4632N/A */
4632N/A public long apply(final long encodedState) {
4632N/A return (encodedState & ~encoding.mask) | value;
4632N/A }
4632N/A
4632N/A public String toString() {
4632N/A return getConstantName(this);
4632N/A }
4632N/A }
4632N/A
4632N/A public static class Size extends Property {
4632N/A private static final byte SHIFT = 0;
4632N/A private static final byte SIZE = 3;
4632N/A private static final long MASK = (long)0x7 << SHIFT;
4632N/A private static final PropertyEncoding size = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A Size(final byte value) {
4632N/A super(size, value);
4632N/A }
4632N/A
4632N/A private static final byte _mini = 1;
4632N/A public static final Size MINI = new Size(_mini);
4632N/A private static final byte _small = 2;
4632N/A public static final Size SMALL = new Size(_small);
4632N/A private static final byte _regular = 3;
4632N/A public static final Size REGULAR = new Size(_regular);
4632N/A private static final byte _large = 4;
4632N/A public static final Size LARGE = new Size(_large);
4632N/A }
4632N/A
4632N/A public static class State extends Property {
4632N/A private static final byte SHIFT = Size.SHIFT + Size.SIZE;
4632N/A private static final byte SIZE = 4;
4632N/A private static final long MASK = (long)0xF << SHIFT;
4632N/A private static final PropertyEncoding state = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A State(final byte value) {
4632N/A super(state, value);
4632N/A }
4632N/A
4632N/A private static final byte _active = 1;
4632N/A public static final State ACTIVE = new State(_active);
4632N/A private static final byte _inactive = 2;
4632N/A public static final State INACTIVE = new State(_inactive);
4632N/A private static final byte _disabled = 3;
4632N/A public static final State DISABLED = new State(_disabled);
4632N/A private static final byte _pressed = 4;
4632N/A public static final State PRESSED = new State(_pressed);
4632N/A private static final byte _pulsed = 5;
4632N/A public static final State PULSED = new State(_pulsed);
4632N/A private static final byte _rollover = 6;
4632N/A public static final State ROLLOVER = new State(_rollover);
4632N/A private static final byte _drag = 7;
4632N/A public static final State DRAG = new State(_drag);
4632N/A }
4632N/A
4632N/A public static class Direction extends Property {
4632N/A private static final byte SHIFT = State.SHIFT + State.SIZE;
4632N/A private static final byte SIZE = 4;
4632N/A private static final long MASK = (long)0xF << SHIFT;
4632N/A private static final PropertyEncoding direction = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A Direction(final byte value) {
4632N/A super(direction, value);
4632N/A }
4632N/A
4632N/A private static final byte _none = 1;
4632N/A public static final Direction NONE = new Direction(_none);
4632N/A private static final byte _up = 2;
4632N/A public static final Direction UP = new Direction(_up);
4632N/A private static final byte _down = 3;
4632N/A public static final Direction DOWN = new Direction(_down);
4632N/A private static final byte _left = 4;
4632N/A public static final Direction LEFT = new Direction(_left);
4632N/A private static final byte _right = 5;
4632N/A public static final Direction RIGHT = new Direction(_right);
4632N/A private static final byte _north = 6;
4632N/A public static final Direction NORTH = new Direction(_north);
4632N/A private static final byte _south = 7;
4632N/A public static final Direction SOUTH = new Direction(_south);
4632N/A private static final byte _east = 8;
4632N/A public static final Direction EAST = new Direction(_east);
4632N/A private static final byte _west = 9;
4632N/A public static final Direction WEST = new Direction(_west);
4632N/A }
4632N/A
4632N/A public static class Orientation extends Property {
4632N/A private static final byte SHIFT = Direction.SHIFT + Direction.SIZE;
4632N/A private static final byte SIZE = 2;
4632N/A private static final long MASK = (long)0x3 << SHIFT;
4632N/A private static final PropertyEncoding orientation = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A Orientation(final byte value) {
4632N/A super(orientation, value);
4632N/A }
4632N/A
4632N/A private static final byte _horizontal = 1;
4632N/A public static final Orientation HORIZONTAL = new Orientation(_horizontal);
4632N/A private static final byte _vertical = 2;
4632N/A public static final Orientation VERTICAL = new Orientation(_vertical);
4632N/A }
4632N/A
4632N/A public static class AlignmentVertical extends Property {
4632N/A private static final byte SHIFT = Orientation.SHIFT + Orientation.SIZE;
4632N/A private static final byte SIZE = 2;
4632N/A private static final long MASK = (long)0x3 << SHIFT;
4632N/A private static final PropertyEncoding alignmentVertical = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A AlignmentVertical(final byte value){
4632N/A super(alignmentVertical, value);
4632N/A }
4632N/A
4632N/A private static final byte _top = 1;
4632N/A public static final AlignmentVertical TOP = new AlignmentVertical(_top);
4632N/A private static final byte _center = 2;
4632N/A public static final AlignmentVertical CENTER = new AlignmentVertical(_center);
4632N/A private static final byte _bottom = 3;
4632N/A public static final AlignmentVertical BOTTOM = new AlignmentVertical(_bottom);
4632N/A }
4632N/A
4632N/A public static class AlignmentHorizontal extends Property {
4632N/A private static final byte SHIFT = AlignmentVertical.SHIFT + AlignmentVertical.SIZE;
4632N/A private static final byte SIZE = 2;
4632N/A private static final long MASK = (long)0x3 << SHIFT;
4632N/A private static final PropertyEncoding alignmentHorizontal = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A AlignmentHorizontal(final byte value){
4632N/A super(alignmentHorizontal, value);
4632N/A }
4632N/A
4632N/A private static final byte _left = 1;
4632N/A public static final AlignmentHorizontal LEFT = new AlignmentHorizontal(_left);
4632N/A private static final byte _center = 2;
4632N/A public static final AlignmentHorizontal CENTER = new AlignmentHorizontal(_center);
4632N/A private static final byte _right = 3;
4632N/A public static final AlignmentHorizontal RIGHT = new AlignmentHorizontal(_right);
4632N/A }
4632N/A
4632N/A public static class SegmentPosition extends Property {
4632N/A private static final byte SHIFT = AlignmentHorizontal.SHIFT + AlignmentHorizontal.SIZE;
4632N/A private static final byte SIZE = 3;
4632N/A private static final long MASK = (long)0x7 << SHIFT;
4632N/A private static final PropertyEncoding segmentPosition = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A SegmentPosition(final byte value) {
4632N/A super(segmentPosition, value);
4632N/A }
4632N/A
4632N/A private static final byte _first = 1;
4632N/A public static final SegmentPosition FIRST = new SegmentPosition(_first);
4632N/A private static final byte _middle = 2;
4632N/A public static final SegmentPosition MIDDLE = new SegmentPosition(_middle);
4632N/A private static final byte _last = 3;
4632N/A public static final SegmentPosition LAST = new SegmentPosition(_last);
4632N/A private static final byte _only = 4;
4632N/A public static final SegmentPosition ONLY = new SegmentPosition(_only);
4632N/A }
4632N/A
4632N/A public static class ScrollBarPart extends Property {
4632N/A private static final byte SHIFT = SegmentPosition.SHIFT + SegmentPosition.SIZE;
4632N/A private static final byte SIZE = 4;
4632N/A private static final long MASK = (long)0xF << SHIFT;
4632N/A private static final PropertyEncoding scrollBarPart = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A ScrollBarPart(final byte value) {
4632N/A super(scrollBarPart, value);
4632N/A }
4632N/A
4632N/A private static final byte _none = 1;
4632N/A public static final ScrollBarPart NONE = new ScrollBarPart(_none);
4632N/A private static final byte _thumb = 2;
4632N/A public static final ScrollBarPart THUMB = new ScrollBarPart(_thumb);
4632N/A private static final byte _arrowMin = 3;
4632N/A public static final ScrollBarPart ARROW_MIN = new ScrollBarPart(_arrowMin);
4632N/A private static final byte _arrowMax = 4;
4632N/A public static final ScrollBarPart ARROW_MAX = new ScrollBarPart(_arrowMax);
4632N/A private static final byte _arrowMaxInside = 5;
4632N/A public static final ScrollBarPart ARROW_MAX_INSIDE = new ScrollBarPart(_arrowMaxInside);
4632N/A private static final byte _arrowMinInside = 6;
4632N/A public static final ScrollBarPart ARROW_MIN_INSIDE = new ScrollBarPart(_arrowMinInside);
4632N/A private static final byte _trackMin = 7;
4632N/A public static final ScrollBarPart TRACK_MIN = new ScrollBarPart(_trackMin);
4632N/A private static final byte _trackMax = 8;
4632N/A public static final ScrollBarPart TRACK_MAX = new ScrollBarPart(_trackMax);
4632N/A }
4632N/A
4632N/A public static class Variant extends Property {
4632N/A private static final byte SHIFT = ScrollBarPart.SHIFT + ScrollBarPart.SIZE;
4632N/A private static final byte SIZE = 4;
4632N/A private static final long MASK = (long)0xF << SHIFT;
4632N/A private static final PropertyEncoding variant = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A Variant(final byte value) {
4632N/A super(variant, value);
4632N/A }
4632N/A
4632N/A private static final byte _menuGlyph = 1;
4632N/A public static final Variant MENU_GLYPH = new Variant(_menuGlyph);
4632N/A private static final byte _menuPopup = Variant._menuGlyph + 1;
4632N/A public static final Variant MENU_POPUP = new Variant(_menuPopup);
4632N/A private static final byte _menuPulldown = Variant._menuPopup + 1;
4632N/A public static final Variant MENU_PULLDOWN = new Variant(_menuPulldown);
4632N/A private static final byte _menuHierarchical = Variant._menuPulldown + 1;
4632N/A public static final Variant MENU_HIERARCHICAL = new Variant(_menuHierarchical);
4632N/A
4632N/A private static final byte _gradientListBackgroundEven = Variant._menuHierarchical + 1;
4632N/A public static final Variant GRADIENT_LIST_BACKGROUND_EVEN = new Variant(_gradientListBackgroundEven);
4632N/A private static final byte _gradientListBackgroundOdd = Variant._gradientListBackgroundEven + 1;
4632N/A public static final Variant GRADIENT_LIST_BACKGROUND_ODD = new Variant(_gradientListBackgroundOdd);
4632N/A private static final byte _gradientSideBar = Variant._gradientListBackgroundOdd + 1;
4632N/A public static final Variant GRADIENT_SIDE_BAR = new Variant(_gradientSideBar);
4632N/A private static final byte _gradientSideBarSelection = Variant._gradientSideBar + 1;
4632N/A public static final Variant GRADIENT_SIDE_BAR_SELECTION = new Variant(_gradientSideBarSelection);
4632N/A private static final byte _gradientSideBarFocusedSelection = Variant._gradientSideBarSelection + 1;
4632N/A public static final Variant GRADIENT_SIDE_BAR_FOCUSED_SELECTION = new Variant(_gradientSideBarFocusedSelection);
4632N/A }
4632N/A
4632N/A public static class WindowType extends Property {
4632N/A private static final byte SHIFT = Variant.SHIFT + Variant.SIZE;
4632N/A private static final byte SIZE = 2;
4632N/A private static final long MASK = (long)0x3 << SHIFT;
4632N/A private static final PropertyEncoding windowType = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A WindowType(final byte value){
4632N/A super(windowType, value);
4632N/A }
4632N/A
4632N/A private static final byte _document = 1;
4632N/A public static final WindowType DOCUMENT = new WindowType(_document);
4632N/A private static final byte _utility = 2;
4632N/A public static final WindowType UTILITY = new WindowType(_utility);
4632N/A private static final byte _titlelessUtility = 3;
4632N/A public static final WindowType TITLELESS_UTILITY = new WindowType(_titlelessUtility);
4632N/A }
4632N/A
4632N/A public static class Focused extends Property {
4632N/A private static final byte SHIFT = WindowType.SHIFT + WindowType.SIZE;
4632N/A private static final byte SIZE = 1;
4632N/A private static final long MASK = (long)0x1 << SHIFT;
4632N/A private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A Focused(final byte value) {
4632N/A super(focused, value);
4632N/A }
4632N/A
4632N/A private static final byte _no = 0;
4632N/A public static final Focused NO = new Focused(_no);
4632N/A private static final byte _yes = 1;
4632N/A public static final Focused YES = new Focused(_yes);
4632N/A }
4632N/A
4632N/A public static class IndicatorOnly extends Property {
4632N/A private static final byte SHIFT = Focused.SHIFT + Focused.SIZE;
4632N/A private static final byte SIZE = 1;
4632N/A private static final long MASK = (long)0x1 << SHIFT;
4632N/A private static final PropertyEncoding indicatorOnly = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A IndicatorOnly(final byte value) {
4632N/A super(indicatorOnly, value);
4632N/A }
4632N/A
4632N/A private static final byte _no = 0;
4632N/A public static final IndicatorOnly NO = new IndicatorOnly(_no);
4632N/A private static final byte _yes = 1;
4632N/A public static final IndicatorOnly YES = new IndicatorOnly(_yes);
4632N/A }
4632N/A
4632N/A public static class NoIndicator extends Property {
4632N/A private static final byte SHIFT = IndicatorOnly.SHIFT + IndicatorOnly.SIZE;
4632N/A private static final byte SIZE = 1;
4632N/A private static final long MASK = (long)0x1 << SHIFT;
4632N/A private static final PropertyEncoding noIndicator = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A NoIndicator(final byte value) {
4632N/A super(noIndicator, value);
4632N/A }
4632N/A
4632N/A private static final byte _no = 0;
4632N/A public static final NoIndicator NO = new NoIndicator(_no);
4632N/A private static final byte _yes = 1;
4632N/A public static final NoIndicator YES = new NoIndicator(_yes);
4632N/A }
4632N/A
4632N/A public static class ArrowsOnly extends Property {
4632N/A private static final byte SHIFT = NoIndicator.SHIFT + NoIndicator.SIZE;
4632N/A private static final byte SIZE = 1;
4632N/A private static final long MASK = (long)0x1 << SHIFT;
4632N/A private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A ArrowsOnly(final byte value) {
4632N/A super(focused, value);
4632N/A }
4632N/A
4632N/A private static final byte _no = 0;
4632N/A public static final ArrowsOnly NO = new ArrowsOnly(_no);
4632N/A private static final byte _yes = 1;
4632N/A public static final ArrowsOnly YES = new ArrowsOnly(_yes);
4632N/A }
4632N/A
4632N/A public static class FrameOnly extends Property {
4632N/A private static final byte SHIFT = ArrowsOnly.SHIFT + ArrowsOnly.SIZE;
4632N/A private static final byte SIZE = 1;
4632N/A private static final long MASK = (long)0x1 << SHIFT;
4632N/A private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A FrameOnly(final byte value) {
4632N/A super(focused, value);
4632N/A }
4632N/A
4632N/A private static final byte _no = 0;
4632N/A public static final FrameOnly NO = new FrameOnly(_no);
4632N/A private static final byte _yes = 1;
4632N/A public static final FrameOnly YES = new FrameOnly(_yes);
4632N/A }
4632N/A
4632N/A public static class SegmentTrailingSeparator extends Property {
4632N/A private static final byte SHIFT = FrameOnly.SHIFT + FrameOnly.SIZE;
4632N/A private static final byte SIZE = 1;
4632N/A private static final long MASK = (long)0x1 << SHIFT;
4632N/A private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A SegmentTrailingSeparator(final byte value) {
4632N/A super(focused, value);
4632N/A }
4632N/A
4632N/A private static final byte _no = 0;
4632N/A public static final SegmentTrailingSeparator NO = new SegmentTrailingSeparator(_no);
4632N/A private static final byte _yes = 1;
4632N/A public static final SegmentTrailingSeparator YES = new SegmentTrailingSeparator(_yes);
4632N/A }
4632N/A
4632N/A public static class SegmentLeadingSeparator extends Property {
4632N/A private static final byte SHIFT = SegmentTrailingSeparator.SHIFT + SegmentTrailingSeparator.SIZE;
4632N/A private static final byte SIZE = 1;
4632N/A private static final long MASK = (long)0x1 << SHIFT;
4632N/A private static final PropertyEncoding leadingSeparator = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A SegmentLeadingSeparator(final byte value) {
4632N/A super(leadingSeparator, value);
4632N/A }
4632N/A
4632N/A private static final byte _no = 0;
4632N/A public static final SegmentLeadingSeparator NO = new SegmentLeadingSeparator(_no);
4632N/A private static final byte _yes = 1;
4632N/A public static final SegmentLeadingSeparator YES = new SegmentLeadingSeparator(_yes);
4632N/A }
4632N/A
4632N/A public static class NothingToScroll extends Property {
4632N/A private static final byte SHIFT = SegmentLeadingSeparator.SHIFT + SegmentLeadingSeparator.SIZE;
4632N/A private static final byte SIZE = 1;
4632N/A private static final long MASK = (long)0x1 << SHIFT;
4632N/A private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A NothingToScroll(final byte value) {
4632N/A super(focused, value);
4632N/A }
4632N/A
4632N/A private static final byte _no = 0;
4632N/A public static final NothingToScroll NO = new NothingToScroll(_no);
4632N/A private static final byte _yes = 1;
4632N/A public static final NothingToScroll YES = new NothingToScroll(_yes);
4632N/A }
4632N/A
4632N/A public static class WindowTitleBarSeparator extends Property {
4632N/A private static final byte SHIFT = NothingToScroll.SHIFT + NothingToScroll.SIZE;
4632N/A private static final byte SIZE = 1;
4632N/A private static final long MASK = (long)0x1 << SHIFT;
4632N/A private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A WindowTitleBarSeparator(final byte value) {
4632N/A super(focused, value);
4632N/A }
4632N/A
4632N/A private static final byte _no = 0;
4632N/A public static final WindowTitleBarSeparator NO = new WindowTitleBarSeparator(_no);
4632N/A private static final byte _yes = 1;
4632N/A public static final WindowTitleBarSeparator YES = new WindowTitleBarSeparator(_yes);
4632N/A }
4632N/A
4632N/A public static class WindowClipCorners extends Property {
4632N/A private static final byte SHIFT = WindowTitleBarSeparator.SHIFT + WindowTitleBarSeparator.SIZE;
4632N/A private static final byte SIZE = 1;
4632N/A private static final long MASK = (long)0x1 << SHIFT;
4632N/A private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A WindowClipCorners(final byte value) {
4632N/A super(focused, value);
4632N/A }
4632N/A
4632N/A private static final byte _no = 0;
4632N/A public static final WindowClipCorners NO = new WindowClipCorners(_no);
4632N/A private static final byte _yes = 1;
4632N/A public static final WindowClipCorners YES = new WindowClipCorners(_yes);
4632N/A }
4632N/A
4632N/A public static class ShowArrows extends Property {
4632N/A private static final byte SHIFT = WindowClipCorners.SHIFT + WindowClipCorners.SIZE;
4632N/A private static final byte SIZE = 1;
4632N/A private static final long MASK = (long)0x1 << SHIFT;
4632N/A private static final PropertyEncoding showArrows = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A ShowArrows(final byte value) {
4632N/A super(showArrows, value);
4632N/A }
4632N/A
4632N/A private static final byte _no = 0;
4632N/A public static final ShowArrows NO = new ShowArrows(_no);
4632N/A private static final byte _yes = 1;
4632N/A public static final ShowArrows YES = new ShowArrows(_yes);
4632N/A }
4632N/A
4632N/A public static class BooleanValue extends Property {
4632N/A private static final byte SHIFT = ShowArrows.SHIFT + ShowArrows.SIZE;
4632N/A private static final byte SIZE = 1;
4632N/A private static final long MASK = (long)0x1 << SHIFT;
4632N/A private static final PropertyEncoding booleanValue = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A BooleanValue(final byte value) {
4632N/A super(booleanValue, value);
4632N/A }
4632N/A
4632N/A private static final byte _no = 0;
4632N/A public static final BooleanValue NO = new BooleanValue(_no);
4632N/A private static final byte _yes = 1;
4632N/A public static final BooleanValue YES = new BooleanValue(_yes);
4632N/A }
4632N/A
4632N/A public static class Animating extends Property {
4632N/A private static final byte SHIFT = BooleanValue.SHIFT + BooleanValue.SIZE;
4632N/A private static final byte SIZE = 1;
4632N/A private static final long MASK = (long)0x1 << SHIFT;
4632N/A private static final PropertyEncoding animating = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A Animating(final byte value) {
4632N/A super(animating, value);
4632N/A }
4632N/A
4632N/A private static final byte _no = 0;
4632N/A public static final Animating NO = new Animating(_no);
4632N/A private static final byte _yes = 1;
4632N/A public static final Animating YES = new Animating(_yes);
4632N/A }
4632N/A
4632N/A public static class Widget extends Property {
4632N/A private static final byte SHIFT = Animating.SHIFT + Animating.SIZE;
4632N/A private static final byte SIZE = 7;
4632N/A private static final long MASK = (long)0x7F << SHIFT;
4632N/A private static final PropertyEncoding widget = new PropertyEncoding(MASK, SHIFT);
4632N/A
4632N/A Widget(final byte constant) {
4632N/A super(widget, constant);
4632N/A }
4632N/A
4632N/A private static final byte _background = 1;
4632N/A public static final Widget BACKGROUND = new Widget(_background);
4632N/A
4632N/A private static final byte _buttonBevel = _background + 1;
4632N/A public static final Widget BUTTON_BEVEL = new Widget(_buttonBevel);
4632N/A private static final byte _buttonBevelInset = _buttonBevel + 1;
4632N/A public static final Widget BUTTON_BEVEL_INSET = new Widget(_buttonBevelInset);
4632N/A private static final byte _buttonBevelRound = _buttonBevelInset + 1;
4632N/A public static final Widget BUTTON_BEVEL_ROUND = new Widget(_buttonBevelRound);
4632N/A
4632N/A private static final byte _buttonCheckBox = _buttonBevelRound + 1;
4632N/A public static final Widget BUTTON_CHECK_BOX = new Widget(_buttonCheckBox);
4632N/A
4632N/A private static final byte _buttonComboBox = _buttonCheckBox + 1;
4632N/A public static final Widget BUTTON_COMBO_BOX = new Widget(_buttonComboBox);
4632N/A private static final byte _buttonComboBoxInset = _buttonComboBox + 1;
4632N/A public static final Widget BUTTON_COMBO_BOX_INSET = new Widget(_buttonComboBoxInset); // not hooked up in JRSUIConstants.m
4632N/A
4632N/A private static final byte _buttonDisclosure = _buttonComboBoxInset + 1;
4632N/A public static final Widget BUTTON_DISCLOSURE = new Widget(_buttonDisclosure);
4632N/A
4632N/A private static final byte _buttonListHeader = _buttonDisclosure + 1;
4632N/A public static final Widget BUTTON_LIST_HEADER = new Widget(_buttonListHeader);
4632N/A
4632N/A private static final byte _buttonLittleArrows = _buttonListHeader + 1;
4632N/A public static final Widget BUTTON_LITTLE_ARROWS = new Widget(_buttonLittleArrows);
4632N/A
4632N/A private static final byte _buttonPopDown = _buttonLittleArrows + 1;
4632N/A public static final Widget BUTTON_POP_DOWN = new Widget(_buttonPopDown);
4632N/A private static final byte _buttonPopDownInset = _buttonPopDown + 1;
4632N/A public static final Widget BUTTON_POP_DOWN_INSET = new Widget(_buttonPopDownInset);
4632N/A private static final byte _buttonPopDownSquare = _buttonPopDownInset + 1;
4632N/A public static final Widget BUTTON_POP_DOWN_SQUARE = new Widget(_buttonPopDownSquare);
4632N/A
4632N/A private static final byte _buttonPopUp = _buttonPopDownSquare + 1;
4632N/A public static final Widget BUTTON_POP_UP = new Widget(_buttonPopUp);
4632N/A private static final byte _buttonPopUpInset = _buttonPopUp + 1;
4632N/A public static final Widget BUTTON_POP_UP_INSET = new Widget(_buttonPopUpInset);
4632N/A private static final byte _buttonPopUpSquare = _buttonPopUpInset + 1;
4632N/A public static final Widget BUTTON_POP_UP_SQUARE = new Widget(_buttonPopUpSquare);
4632N/A
4632N/A private static final byte _buttonPush = _buttonPopUpSquare + 1;
4632N/A public static final Widget BUTTON_PUSH = new Widget(_buttonPush);
4632N/A private static final byte _buttonPushScope = _buttonPush + 1;
4632N/A public static final Widget BUTTON_PUSH_SCOPE = new Widget(_buttonPushScope);
4632N/A private static final byte _buttonPushScope2 = _buttonPushScope + 1;
4632N/A public static final Widget BUTTON_PUSH_SCOPE2 = new Widget(_buttonPushScope2);
4632N/A private static final byte _buttonPushTextured = _buttonPushScope2 + 1;
4632N/A public static final Widget BUTTON_PUSH_TEXTURED = new Widget(_buttonPushTextured);
4632N/A private static final byte _buttonPushInset = _buttonPushTextured + 1;
4632N/A public static final Widget BUTTON_PUSH_INSET = new Widget(_buttonPushInset);
4632N/A private static final byte _buttonPushInset2 = _buttonPushInset + 1;
4632N/A public static final Widget BUTTON_PUSH_INSET2 = new Widget(_buttonPushInset2);
4632N/A
4632N/A private static final byte _buttonRadio = _buttonPushInset2 + 1;
4632N/A public static final Widget BUTTON_RADIO = new Widget(_buttonRadio);
4632N/A
4632N/A private static final byte _buttonRound = _buttonRadio + 1;
4632N/A public static final Widget BUTTON_ROUND = new Widget(_buttonRound);
4632N/A private static final byte _buttonRoundHelp = _buttonRound + 1;
4632N/A public static final Widget BUTTON_ROUND_HELP = new Widget(_buttonRoundHelp);
4632N/A private static final byte _buttonRoundInset = _buttonRoundHelp + 1;
4632N/A public static final Widget BUTTON_ROUND_INSET = new Widget(_buttonRoundInset);
4632N/A private static final byte _buttonRoundInset2 =_buttonRoundInset + 1;
4632N/A public static final Widget BUTTON_ROUND_INSET2 = new Widget(_buttonRoundInset2);
4632N/A
4632N/A private static final byte _buttonSearchFieldCancel = _buttonRoundInset2 + 1;
4632N/A public static final Widget BUTTON_SEARCH_FIELD_CANCEL = new Widget(_buttonSearchFieldCancel);
4632N/A private static final byte _buttonSearchFieldFind = _buttonSearchFieldCancel + 1;
4632N/A public static final Widget BUTTON_SEARCH_FIELD_FIND = new Widget(_buttonSearchFieldFind);
4632N/A
4632N/A private static final byte _buttonSegmented = _buttonSearchFieldFind + 1;
4632N/A public static final Widget BUTTON_SEGMENTED = new Widget(_buttonSegmented);
4632N/A private static final byte _buttonSegmentedInset = _buttonSegmented + 1;
4632N/A public static final Widget BUTTON_SEGMENTED_INSET = new Widget(_buttonSegmentedInset);
4632N/A private static final byte _buttonSegmentedInset2 = _buttonSegmentedInset + 1;
4632N/A public static final Widget BUTTON_SEGMENTED_INSET2 = new Widget(_buttonSegmentedInset2);
4632N/A private static final byte _buttonSegmentedSCurve = _buttonSegmentedInset2 + 1;
4632N/A public static final Widget BUTTON_SEGMENTED_SCURVE = new Widget(_buttonSegmentedSCurve);
4632N/A private static final byte _buttonSegmentedTextured = _buttonSegmentedSCurve + 1;
4632N/A public static final Widget BUTTON_SEGMENTED_TEXTURED = new Widget(_buttonSegmentedTextured);
4632N/A private static final byte _buttonSegmentedToolbar = _buttonSegmentedTextured + 1;
4632N/A public static final Widget BUTTON_SEGMENTED_TOOLBAR = new Widget(_buttonSegmentedToolbar);
4632N/A
4632N/A private static final byte _dial = _buttonSegmentedToolbar + 1;
4632N/A public static final Widget DIAL = new Widget(_dial);
4632N/A
4632N/A private static final byte _disclosureTriangle = _dial + 1;
4632N/A public static final Widget DISCLOSURE_TRIANGLE = new Widget(_disclosureTriangle);
4632N/A
4632N/A private static final byte _dividerGrabber = _disclosureTriangle + 1;
4632N/A public static final Widget DIVIDER_GRABBER = new Widget(_dividerGrabber);
4632N/A private static final byte _dividerSeparatorBar = _dividerGrabber + 1;
4632N/A public static final Widget DIVIDER_SEPARATOR_BAR = new Widget(_dividerSeparatorBar);
4632N/A private static final byte _dividerSplitter = _dividerSeparatorBar + 1;
4632N/A public static final Widget DIVIDER_SPLITTER = new Widget(_dividerSplitter);
4632N/A
4632N/A private static final byte _focus = _dividerSplitter + 1;
4632N/A public static final Widget FOCUS = new Widget(_focus);
4632N/A
4632N/A private static final byte _frameGroupBox = _focus + 1;
4632N/A public static final Widget FRAME_GROUP_BOX = new Widget(_frameGroupBox);
4632N/A private static final byte _frameGroupBoxSecondary = _frameGroupBox + 1;
4632N/A public static final Widget FRAME_GROUP_BOX_SECONDARY = new Widget(_frameGroupBoxSecondary);
4632N/A
4632N/A private static final byte _frameListBox = _frameGroupBoxSecondary + 1;
4632N/A public static final Widget FRAME_LIST_BOX = new Widget(_frameListBox);
4632N/A
4632N/A private static final byte _framePlacard = _frameListBox + 1;
4632N/A public static final Widget FRAME_PLACARD = new Widget(_framePlacard);
4632N/A
4632N/A private static final byte _frameTextField = _framePlacard + 1;
4632N/A public static final Widget FRAME_TEXT_FIELD = new Widget(_frameTextField);
4632N/A private static final byte _frameTextFieldRound = _frameTextField + 1;
4632N/A public static final Widget FRAME_TEXT_FIELD_ROUND = new Widget(_frameTextFieldRound);
4632N/A
4632N/A private static final byte _frameWell = _frameTextFieldRound + 1;
4632N/A public static final Widget FRAME_WELL = new Widget(_frameWell);
4632N/A
4632N/A private static final byte _growBox = _frameWell + 1;
4632N/A public static final Widget GROW_BOX = new Widget(_growBox);
4632N/A private static final byte _growBoxTextured = _growBox + 1;
4632N/A public static final Widget GROW_BOX_TEXTURED = new Widget(_growBoxTextured);
4632N/A
4632N/A private static final byte _gradient = _growBoxTextured + 1;
4632N/A public static final Widget GRADIENT = new Widget(_gradient);
4632N/A
4632N/A private static final byte _menu = _gradient + 1;
4632N/A public static final Widget MENU = new Widget(_menu);
4632N/A private static final byte _menuItem = _menu + 1;
4632N/A public static final Widget MENU_ITEM = new Widget(_menuItem);
4632N/A private static final byte _menuBar = _menuItem + 1;
4632N/A public static final Widget MENU_BAR = new Widget(_menuBar);
4632N/A private static final byte _menuTitle = _menuBar + 1;
4632N/A public static final Widget MENU_TITLE = new Widget(_menuTitle);
4632N/A
4632N/A private static final byte _progressBar = _menuTitle + 1;
4632N/A public static final Widget PROGRESS_BAR = new Widget(_progressBar);
4632N/A private static final byte _progressIndeterminateBar = _progressBar + 1;
4632N/A public static final Widget PROGRESS_INDETERMINATE_BAR = new Widget(_progressIndeterminateBar);
4632N/A private static final byte _progressRelevance = _progressIndeterminateBar + 1;
4632N/A public static final Widget PROGRESS_RELEVANCE = new Widget(_progressRelevance);
4632N/A private static final byte _progressSpinner = _progressRelevance + 1;
4632N/A public static final Widget PROGRESS_SPINNER = new Widget(_progressSpinner);
4632N/A
4632N/A private static final byte _scrollBar = _progressSpinner + 1;
4632N/A public static final Widget SCROLL_BAR = new Widget(_scrollBar);
4632N/A
4632N/A private static final byte _scrollColumnSizer = _scrollBar + 1;
4632N/A public static final Widget SCROLL_COLUMN_SIZER = new Widget(_scrollColumnSizer);
4632N/A
4632N/A private static final byte _slider = _scrollColumnSizer + 1;
4632N/A public static final Widget SLIDER = new Widget(_slider);
4632N/A private static final byte _sliderThumb = _slider + 1;
4632N/A public static final Widget SLIDER_THUMB = new Widget(_sliderThumb);
4632N/A
4632N/A private static final byte _synchronization = _sliderThumb + 1;
4632N/A public static final Widget SYNCHRONIZATION = new Widget(_synchronization);
4632N/A
4632N/A private static final byte _tab = _synchronization + 1;
4632N/A public static final Widget TAB = new Widget(_tab);
4632N/A
4632N/A private static final byte _titleBarCloseBox = _tab + 1;
4632N/A public static final Widget TITLE_BAR_CLOSE_BOX = new Widget(_titleBarCloseBox);
4632N/A private static final byte _titleBarCollapseBox = _titleBarCloseBox + 1;
4632N/A public static final Widget TITLE_BAR_COLLAPSE_BOX = new Widget(_titleBarCollapseBox);
4632N/A private static final byte _titleBarZoomBox = _titleBarCollapseBox + 1;
4632N/A public static final Widget TITLE_BAR_ZOOM_BOX = new Widget(_titleBarZoomBox);
4632N/A
4632N/A private static final byte _titleBarToolbarButton = _titleBarZoomBox + 1;
4632N/A public static final Widget TITLE_BAR_TOOLBAR_BUTTON = new Widget(_titleBarToolbarButton);
4632N/A
4632N/A private static final byte _toolbarItemWell = _titleBarToolbarButton + 1;
4632N/A public static final Widget TOOLBAR_ITEM_WELL = new Widget(_toolbarItemWell);
4632N/A
4632N/A private static final byte _windowFrame = _toolbarItemWell + 1;
4632N/A public static final Widget WINDOW_FRAME = new Widget(_windowFrame);
4632N/A }
4632N/A
4632N/A public static class Hit {
4632N/A private static final int _unknown = -1;
4632N/A public static final Hit UNKNOWN = new Hit(_unknown);
4632N/A private static final int _none = 0;
4632N/A public static final Hit NONE = new Hit(_none);
4632N/A private static final int _hit = 1;
4632N/A public static final Hit HIT = new Hit(_hit);
4632N/A
4632N/A final int hit;
4632N/A Hit(final int hit) { this.hit = hit; }
4632N/A
4632N/A public boolean isHit() {
4632N/A return hit > 0;
4632N/A }
4632N/A
4632N/A public String toString() {
4632N/A return getConstantName(this);
4632N/A }
4632N/A }
4632N/A
4632N/A public static class ScrollBarHit extends Hit {
4632N/A private static final int _thumb = 2;
4632N/A public static final ScrollBarHit THUMB = new ScrollBarHit(_thumb);
4632N/A
4632N/A private static final int _trackMin = 3;
4632N/A public static final ScrollBarHit TRACK_MIN = new ScrollBarHit(_trackMin);
4632N/A private static final int _trackMax = 4;
4632N/A public static final ScrollBarHit TRACK_MAX = new ScrollBarHit(_trackMax);
4632N/A
4632N/A private static final int _arrowMin = 5;
4632N/A public static final ScrollBarHit ARROW_MIN = new ScrollBarHit(_arrowMin);
4632N/A private static final int _arrowMax = 6;
4632N/A public static final ScrollBarHit ARROW_MAX = new ScrollBarHit(_arrowMax);
4632N/A private static final int _arrowMaxInside = 7;
4632N/A public static final ScrollBarHit ARROW_MAX_INSIDE = new ScrollBarHit(_arrowMaxInside);
4632N/A private static final int _arrowMinInside = 8;
4632N/A public static final ScrollBarHit ARROW_MIN_INSIDE = new ScrollBarHit(_arrowMinInside);
4632N/A
4632N/A ScrollBarHit(final int hit) { super(hit); }
4632N/A }
4632N/A
4632N/A static Hit getHit(final int hit) {
4632N/A switch (hit) {
4632N/A case Hit._none:
4632N/A return Hit.NONE;
4632N/A case Hit._hit:
4632N/A return Hit.HIT;
4632N/A
4632N/A case ScrollBarHit._thumb:
4632N/A return ScrollBarHit.THUMB;
4632N/A case ScrollBarHit._trackMin:
4632N/A return ScrollBarHit.TRACK_MIN;
4632N/A case ScrollBarHit._trackMax:
4632N/A return ScrollBarHit.TRACK_MAX;
4632N/A case ScrollBarHit._arrowMin:
4632N/A return ScrollBarHit.ARROW_MIN;
4632N/A case ScrollBarHit._arrowMax:
4632N/A return ScrollBarHit.ARROW_MAX;
4632N/A case ScrollBarHit._arrowMaxInside:
4632N/A return ScrollBarHit.ARROW_MAX_INSIDE;
4632N/A case ScrollBarHit._arrowMinInside:
4632N/A return ScrollBarHit.ARROW_MIN_INSIDE;
4632N/A }
4632N/A return Hit.UNKNOWN;
4632N/A }
4632N/A
4632N/A static String getConstantName(final Object object) {
4632N/A final Class<? extends Object> clazz = object.getClass();
4632N/A try {
4632N/A for (final Field field : clazz.getFields()) {
4632N/A if (field.get(null) == object) {
4632N/A return field.getName();
4632N/A }
4632N/A }
4632N/A } catch (final Exception e) {}
4632N/A return clazz.getSimpleName();
4632N/A }
4632N/A}