Ignore:
Timestamp:
Apr 27, 2004, 8:39:34 PM (22 years ago)
Author:
bird
Message:

GCC v3.3.3 sources.

Location:
branches/GNU/src/gcc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gcc

    • Property svn:ignore
      •  

        old new  
        2626configure.vr
        2727configure.vrs
         28
        2829Makefile
        29 dir.info
        3030lost+found
        3131update.out
  • branches/GNU/src/gcc/libjava/java/awt/event/AdjustmentEvent.java

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    1 /* Copyright (C) 2000  Free Software Foundation
    2 
    3    This file is part of libjava.
    4 
    5 This software is copyrighted work licensed under the terms of the
    6 Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
    7 details.  */
     1/* AdjustmentEvent.java -- an adjustable value was changed
     2   Copyright (C) 1999, 2002 Free Software Foundation, Inc.
     3
     4This file is part of GNU Classpath.
     5
     6GNU Classpath is free software; you can redistribute it and/or modify
     7it under the terms of the GNU General Public License as published by
     8the Free Software Foundation; either version 2, or (at your option)
     9any later version.
     10
     11GNU Classpath is distributed in the hope that it will be useful, but
     12WITHOUT ANY WARRANTY; without even the implied warranty of
     13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     14General Public License for more details.
     15
     16You should have received a copy of the GNU General Public License
     17along with GNU Classpath; see the file COPYING.  If not, write to the
     18Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
     1902111-1307 USA.
     20
     21Linking this library statically or dynamically with other modules is
     22making a combined work based on this library.  Thus, the terms and
     23conditions of the GNU General Public License cover the whole
     24combination.
     25
     26As a special exception, the copyright holders of this library give you
     27permission to link this library with independent modules to produce an
     28executable, regardless of the license terms of these independent
     29modules, and to copy and distribute the resulting executable under
     30terms of your choice, provided that you also meet, for each linked
     31independent module, the terms and conditions of the license of that
     32module.  An independent module is a module which is not derived from
     33or based on this library.  If you modify this library, you may extend
     34this exception to your version of the library, but you are not
     35obligated to do so.  If you do not wish to do so, delete this
     36exception statement from your version. */
     37
    838
    939package java.awt.event;
    10 import java.awt.*;
     40
     41import java.awt.Adjustable;
     42import java.awt.AWTEvent;
    1143
    1244/**
    13  * @author Tom Tromey <[email protected]>
    14  * @date April 8, 2000
     45 * This class represents an event that is generated when an adjustable
     46 * value is changed.
     47 *
     48 * @author Aaron M. Renn <[email protected]>
     49 * @see Adjustable
     50 * @see AdjustmentListener
     51 * @since 1.1
     52 * @status updated to 1.4
    1553 */
    16 
    17 /* Status: Believed complete and correct to JDK 1.2.  */
    18 
    1954public class AdjustmentEvent extends AWTEvent
    2055{
     56
     57
     58
     59
     60
     61
    2162  public static final int ADJUSTMENT_FIRST = 601;
     63
     64
    2265  public static final int ADJUSTMENT_LAST = 601;
     66
     67
    2368  public static final int ADJUSTMENT_VALUE_CHANGED = 601;
     69
     70
     71
     72
     73
     74
     75
     76
    2477  public static final int BLOCK_DECREMENT = 3;
     78
     79
    2580  public static final int BLOCK_INCREMENT = 4;
     81
     82
    2683  public static final int TRACK = 5;
    27   public static final int UNIT_DECREMENT = 2;
    28   public static final int UNIT_INCREMENT = 1;
    29 
    30   public AdjustmentEvent (Adjustable source, int id, int type, int value)
    31   {
    32     super (source, id);
    33     this.adjType = type;
     84
     85  /**
     86   * The adjustable object that caused the event.
     87   *
     88   * @see #getAdjustable()
     89   * @serial the cause
     90   */
     91  private final Adjustable adjustable;
     92
     93  /**
     94   * The type of adjustment, one of {@link #UNIT_INCREMENT},
     95   * {@link #UNIT_DECREMENT}, {@link #BLOCK_INCREMENT},
     96   * {@link #BLOCK_DECREMENT}, or {@link #TRACK}.
     97   *
     98   * @see #getAdjustmentType()
     99   * @serial the adjustment type
     100   */
     101  private final int adjustmentType;
     102
     103  /**
     104   * The new value of the adjustable; it should be in the range of the
     105   * adjustable cause.
     106   *
     107   * @see #getValue()
     108   * @serial the adjustment value
     109   */
     110  private final int value;
     111
     112  /**
     113   * True if this is in a series of multiple adjustment events.
     114   *
     115   * @see #getValueIsAdjusting()
     116   * @serial true if this is not the last adjustment
     117   * @since 1.4
     118   */
     119  private final boolean isAdjusting;
     120
     121  /**
     122   * Initializes an instance of <code>AdjustmentEvent</code> with the
     123   * specified source, id, type, and value. Note that an invalid id leads to
     124   * unspecified results.
     125   *
     126   * @param source the source of the event
     127   * @param id the event id
     128   * @param type the event type, one of the constants of this class
     129   * @param value the value of the adjustment
     130   * @throws IllegalArgumentException if source is null
     131   */
     132  public AdjustmentEvent(Adjustable source, int id, int type, int value)
     133  {
     134    this(source, id, type, value, false);
     135  }
     136
     137  /**
     138   * Initializes an instance of <code>AdjustmentEvent</code> with the
     139   * specified source, id, type, and value. Note that an invalid id leads to
     140   * unspecified results.
     141   *
     142   * @param source the source of the event
     143   * @param id the event id
     144   * @param type the event type, one of the constants of this class
     145   * @param value the value of the adjustment
     146   * @param isAdjusting if this event is in a chain of adjustments
     147   * @throws IllegalArgumentException if source is null
     148   * @since 1.4
     149   */
     150  public AdjustmentEvent(Adjustable source, int id, int type, int value,
     151                         boolean isAdjusting)
     152  {
     153    super(source, id);
     154    this.adjustmentType = type;
    34155    this.value = value;
    35   }
    36 
    37   public Adjustable getAdjustable ()
    38   {
    39     return (Adjustable) source;
    40   }
    41 
    42   public int getAdjustmentType ()
    43   {
    44     return adjType;
    45   }
    46 
    47   public int getValue ()
     156    adjustable = source;
     157    this.isAdjusting = isAdjusting;
     158  }
     159
     160  /**
     161   * This method returns the source of the event as an <code>Adjustable</code>.
     162   *
     163   * @return the <code>Adjustable</code> source of the event
     164   */
     165  public Adjustable getAdjustable()
     166  {
     167    return adjustable;
     168  }
     169
     170  /**
     171   * Returns the new value of the adjustable object.
     172   *
     173   * @return the value of the event
     174   */
     175  public int getValue()
    48176  {
    49177    return value;
    50178  }
    51179
    52   public String paramString ()
    53   {
    54     String r;
    55     switch (id)
    56       {
    57         case ADJUSTMENT_VALUE_CHANGED:
    58           r = "ADJUSTMENT_VALUE_CHANGED";
    59         break;
    60         default:
    61           r = "unknown id";
    62         break;
    63       }
    64    
    65     r += ",adjType=";
    66    
    67     switch (adjType)
    68       {
    69         case BLOCK_DECREMENT:
    70           r += "BLOCK_DECREMENT";
    71         break;
    72         case BLOCK_INCREMENT:
    73           r += "BLOCK_INCREMENT";
    74         break;
    75         case TRACK:
    76           r += "TRACK";
    77         break;
    78         case UNIT_DECREMENT:
    79           r += "UNIT_DECREMENT";
    80         break;
    81         case UNIT_INCREMENT:
    82           r += "UNIT_INCREMENT";
    83         break;
    84         default:
    85           r += "unknown type";
    86         break;
    87       }
    88  
    89     r += ",value=" + value; 
    90     return r;
    91   }
    92 
    93   private int adjType;
    94   private int value;
    95 }
     180  /**
     181   * Returns the type of the event, which will be one of
     182   * {@link #UNIT_INCREMENT}, {@link #UNIT_DECREMENT},
     183   * {@link #BLOCK_INCREMENT}, {@link #BLOCK_DECREMENT}, or {@link #TRACK}.
     184   *
     185   * @return the type of the event
     186   */
     187  public int getAdjustmentType()
     188  {
     189    return adjustmentType;
     190  }
     191
     192  /**
     193   * Test if this event is part of a sequence of multiple adjustements.
     194   *
     195   * @return true if this is not the last adjustment
     196   * @since 1.4
     197   */
     198  public boolean getValueIsAdjusting()
     199  {
     200    return isAdjusting;
     201  }
     202
     203  /**
     204   * Returns a string that describes the event. This is in the format
     205   * <code>"ADJUSTMENT_VALUE_CHANGED,adjType=" + &lt;type&gt; + ",value="
     206   * + getValue() + ",isAdjusting=" + getValueIsAdjusting()</code>, where
     207   * type is the name of the constant returned by getAdjustmentType().
     208   *
     209   * @return a string that describes the event
     210   */
     211  public String paramString()
     212  {
     213    return (id == ADJUSTMENT_VALUE_CHANGED
     214            ? "ADJUSTMENT_VALUE_CHANGED,adjType=" : "unknown type,adjType=")
     215      + (adjustmentType == UNIT_INCREMENT ? "UNIT_INCREMENT,value="
     216         : adjustmentType == UNIT_DECREMENT ? "UNIT_DECREMENT,value="
     217         : adjustmentType == BLOCK_INCREMENT ? "BLOCK_INCREMENT,value="
     218         : adjustmentType == BLOCK_DECREMENT ? "BLOCK_DECREMENT,value="
     219         : adjustmentType == TRACK ? "TRACK,value=" : "unknown type,value=")
     220      + value + ",isAdjusting=" + isAdjusting;
     221  }
     222} // class AdjustmentEvent
Note: See TracChangeset for help on using the changeset viewer.