src/share/classes/java/awt/Adjustable.java

Print this page


   1 /*
   2  * Copyright (c) 1996, 2003, 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 
  26 package java.awt;
  27 
  28 import java.awt.event.*;
  29 
  30 import javax.tools.annotation.GenerateNativeHeader;
  31 
  32 /**
  33  * The interface for objects which have an adjustable numeric value
  34  * contained within a bounded range of values.
  35  *
  36  * @author Amy Fowler
  37  * @author Tim Prinzing
  38  */
  39 /* No native methods here, but the constants are needed in the supporting JNI code */
  40 @GenerateNativeHeader
  41 public interface Adjustable {
  42 
  43     /**
  44      * Indicates that the <code>Adjustable</code> has horizontal orientation.
  45      */
  46     public static final int HORIZONTAL = 0;
  47 
  48     /**
  49      * Indicates that the <code>Adjustable</code> has vertical orientation.
  50      */
  51     public static final int VERTICAL = 1;
  52 
  53     /**
  54      * Indicates that the <code>Adjustable</code> has no orientation.
  55      */
  56     public static final int NO_ORIENTATION = 2;
  57 
  58     /**
  59      * Gets the orientation of the adjustable object.
  60      * @return the orientation of the adjustable object;
  61      *   either <code>HORIZONTAL</code>, <code>VERTICAL</code>,
  62      *   or <code>NO_ORIENTATION</code>
  63      */
  64     int getOrientation();
  65 
  66     /**
  67      * Sets the minimum value of the adjustable object.
  68      * @param min the minimum value
  69      */
  70     void setMinimum(int min);
  71 
  72     /**
  73      * Gets the minimum value of the adjustable object.
  74      * @return the minimum value of the adjustable object
  75      */
  76     int getMinimum();


   1 /*
   2  * Copyright (c) 1996, 2013, 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 
  26 package java.awt;
  27 
  28 import java.awt.event.*;
  29 
  30 import java.lang.annotation.Native;
  31 
  32 /**
  33  * The interface for objects which have an adjustable numeric value
  34  * contained within a bounded range of values.
  35  *
  36  * @author Amy Fowler
  37  * @author Tim Prinzing
  38  */


  39 public interface Adjustable {
  40 
  41     /**
  42      * Indicates that the <code>Adjustable</code> has horizontal orientation.
  43      */
  44     @Native public static final int HORIZONTAL = 0;
  45 
  46     /**
  47      * Indicates that the <code>Adjustable</code> has vertical orientation.
  48      */
  49     @Native public static final int VERTICAL = 1;
  50 
  51     /**
  52      * Indicates that the <code>Adjustable</code> has no orientation.
  53      */
  54     @Native public static final int NO_ORIENTATION = 2;
  55 
  56     /**
  57      * Gets the orientation of the adjustable object.
  58      * @return the orientation of the adjustable object;
  59      *   either <code>HORIZONTAL</code>, <code>VERTICAL</code>,
  60      *   or <code>NO_ORIENTATION</code>
  61      */
  62     int getOrientation();
  63 
  64     /**
  65      * Sets the minimum value of the adjustable object.
  66      * @param min the minimum value
  67      */
  68     void setMinimum(int min);
  69 
  70     /**
  71      * Gets the minimum value of the adjustable object.
  72      * @return the minimum value of the adjustable object
  73      */
  74     int getMinimum();