42 * <code>JSeparator</code>s may also be used elsewhere in a GUI
43 * wherever a visual divider is useful.
44 *
45 * <p>
46 *
47 * For more information and examples see
48 * <a
49 href="https://docs.oracle.com/javase/tutorial/uiswing/components/menu.html">How to Use Menus</a>,
50 * a section in <em>The Java Tutorial.</em>
51 * <p>
52 * <strong>Warning:</strong> Swing is not thread safe. For more
53 * information see <a
54 * href="package-summary.html#threading">Swing's Threading
55 * Policy</a>.
56 * <p>
57 * <strong>Warning:</strong>
58 * Serialized objects of this class will not be compatible with
59 * future Swing releases. The current serialization support is
60 * appropriate for short term storage or RMI between applications running
61 * the same version of Swing. As of 1.4, support for long term storage
62 * of all JavaBeans™
63 * has been added to the <code>java.beans</code> package.
64 * Please see {@link java.beans.XMLEncoder}.
65 *
66 * @author Georges Saab
67 * @author Jeff Shapiro
68 * @since 1.2
69 */
70 @JavaBean(defaultProperty = "UI", description = "A divider between menu items.")
71 @SwingContainer(false)
72 @SuppressWarnings("serial")
73 public class JSeparator extends JComponent implements SwingConstants, Accessible
74 {
75 /**
76 * @see #getUIClassID
77 * @see #readObject
78 */
79 private static final String uiClassID = "SeparatorUI";
80
81 private int orientation = HORIZONTAL;
82
253 * AccessibleContext of this JSeparator
254 */
255 @BeanProperty(bound = false)
256 public AccessibleContext getAccessibleContext() {
257 if (accessibleContext == null) {
258 accessibleContext = new AccessibleJSeparator();
259 }
260 return accessibleContext;
261 }
262
263 /**
264 * This class implements accessibility support for the
265 * <code>JSeparator</code> class. It provides an implementation of the
266 * Java Accessibility API appropriate to separator user-interface elements.
267 * <p>
268 * <strong>Warning:</strong>
269 * Serialized objects of this class will not be compatible with
270 * future Swing releases. The current serialization support is
271 * appropriate for short term storage or RMI between applications running
272 * the same version of Swing. As of 1.4, support for long term storage
273 * of all JavaBeans™
274 * has been added to the <code>java.beans</code> package.
275 * Please see {@link java.beans.XMLEncoder}.
276 */
277 @SuppressWarnings("serial")
278 protected class AccessibleJSeparator extends AccessibleJComponent {
279
280 /**
281 * Get the role of this object.
282 *
283 * @return an instance of AccessibleRole describing the role of the
284 * object
285 */
286 public AccessibleRole getAccessibleRole() {
287 return AccessibleRole.SEPARATOR;
288 }
289 }
290 }
|
42 * <code>JSeparator</code>s may also be used elsewhere in a GUI
43 * wherever a visual divider is useful.
44 *
45 * <p>
46 *
47 * For more information and examples see
48 * <a
49 href="https://docs.oracle.com/javase/tutorial/uiswing/components/menu.html">How to Use Menus</a>,
50 * a section in <em>The Java Tutorial.</em>
51 * <p>
52 * <strong>Warning:</strong> Swing is not thread safe. For more
53 * information see <a
54 * href="package-summary.html#threading">Swing's Threading
55 * Policy</a>.
56 * <p>
57 * <strong>Warning:</strong>
58 * Serialized objects of this class will not be compatible with
59 * future Swing releases. The current serialization support is
60 * appropriate for short term storage or RMI between applications running
61 * the same version of Swing. As of 1.4, support for long term storage
62 * of all JavaBeans
63 * has been added to the <code>java.beans</code> package.
64 * Please see {@link java.beans.XMLEncoder}.
65 *
66 * @author Georges Saab
67 * @author Jeff Shapiro
68 * @since 1.2
69 */
70 @JavaBean(defaultProperty = "UI", description = "A divider between menu items.")
71 @SwingContainer(false)
72 @SuppressWarnings("serial")
73 public class JSeparator extends JComponent implements SwingConstants, Accessible
74 {
75 /**
76 * @see #getUIClassID
77 * @see #readObject
78 */
79 private static final String uiClassID = "SeparatorUI";
80
81 private int orientation = HORIZONTAL;
82
253 * AccessibleContext of this JSeparator
254 */
255 @BeanProperty(bound = false)
256 public AccessibleContext getAccessibleContext() {
257 if (accessibleContext == null) {
258 accessibleContext = new AccessibleJSeparator();
259 }
260 return accessibleContext;
261 }
262
263 /**
264 * This class implements accessibility support for the
265 * <code>JSeparator</code> class. It provides an implementation of the
266 * Java Accessibility API appropriate to separator user-interface elements.
267 * <p>
268 * <strong>Warning:</strong>
269 * Serialized objects of this class will not be compatible with
270 * future Swing releases. The current serialization support is
271 * appropriate for short term storage or RMI between applications running
272 * the same version of Swing. As of 1.4, support for long term storage
273 * of all JavaBeans
274 * has been added to the <code>java.beans</code> package.
275 * Please see {@link java.beans.XMLEncoder}.
276 */
277 @SuppressWarnings("serial")
278 protected class AccessibleJSeparator extends AccessibleJComponent {
279
280 /**
281 * Get the role of this object.
282 *
283 * @return an instance of AccessibleRole describing the role of the
284 * object
285 */
286 public AccessibleRole getAccessibleRole() {
287 return AccessibleRole.SEPARATOR;
288 }
289 }
290 }
|