1 /* 2 * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 package javax.swing; 26 27 28 /** 29 * A collection of constants generally used for positioning and orienting 30 * components on the screen. 31 * 32 * @author Jeff Dinkins 33 * @author Ralph Kar (orientation support) 34 * @since 1.2 35 */ 36 public interface SwingConstants { 37 38 /** 39 * The central position in an area. Used for 40 * both compass-direction constants (NORTH, etc.) 41 * and box-orientation constants (TOP, etc.). 42 */ 43 public static final int CENTER = 0; 44 45 // 46 // Box-orientation constant used to specify locations in a box. 47 // 48 /** 49 * Box-orientation constant used to specify the top of a box. 50 */ 51 public static final int TOP = 1; 52 /** 53 * Box-orientation constant used to specify the left side of a box. 54 */ 55 public static final int LEFT = 2; 56 /** 57 * Box-orientation constant used to specify the bottom of a box. 58 */ 59 public static final int BOTTOM = 3; 60 /** 61 * Box-orientation constant used to specify the right side of a box. 62 */ 63 public static final int RIGHT = 4; 64 65 // 66 // Compass-direction constants used to specify a position. 67 // 68 /** 69 * Compass-direction North (up). 70 */ 71 public static final int NORTH = 1; 72 /** 73 * Compass-direction north-east (upper right). 74 */ 75 public static final int NORTH_EAST = 2; 76 /** 77 * Compass-direction east (right). 78 */ 79 public static final int EAST = 3; 80 /** 81 * Compass-direction south-east (lower right). 82 */ 83 public static final int SOUTH_EAST = 4; 84 /** 85 * Compass-direction south (down). 86 */ 87 public static final int SOUTH = 5; 88 /** 89 * Compass-direction south-west (lower left). 90 */ 91 public static final int SOUTH_WEST = 6; 92 /** 93 * Compass-direction west (left). 94 */ 95 public static final int WEST = 7; 96 /** 97 * Compass-direction north west (upper left). 98 */ 99 public static final int NORTH_WEST = 8; 100 101 // 102 // These constants specify a horizontal or 103 // vertical orientation. For example, they are 104 // used by scrollbars and sliders. 105 // 106 /** Horizontal orientation. Used for scrollbars and sliders. */ 107 public static final int HORIZONTAL = 0; 108 /** Vertical orientation. Used for scrollbars and sliders. */ 109 public static final int VERTICAL = 1; 110 111 // 112 // Constants for orientation support, since some languages are 113 // left-to-right oriented and some are right-to-left oriented. 114 // This orientation is currently used by buttons and labels. 115 // 116 /** 117 * Identifies the leading edge of text for use with left-to-right 118 * and right-to-left languages. Used by buttons and labels. 119 */ 120 public static final int LEADING = 10; 121 /** 122 * Identifies the trailing edge of text for use with left-to-right 123 * and right-to-left languages. Used by buttons and labels. 124 */ 125 public static final int TRAILING = 11; 126 /** 127 * Identifies the next direction in a sequence. 128 * 129 * @since 1.4 130 */ 131 public static final int NEXT = 12; 132 133 /** 134 * Identifies the previous direction in a sequence. 135 * 136 * @since 1.4 137 */ 138 public static final int PREVIOUS = 13; 139 }