java.awt.event

Class AdjustmentEvent

Implemented Interfaces:
Serializable

public class AdjustmentEvent
extends AWTEvent

The adjustment event emitted by Adjustable objects.
Since:
1.1
See Also:
Adjustable, AdjustmentListener, Serialized Form

Field Summary

static int
ADJUSTMENT_FIRST
Marks the first integer id for the range of adjustment event ids.
static int
ADJUSTMENT_LAST
Marks the last integer id for the range of adjustment event ids.
static int
ADJUSTMENT_VALUE_CHANGED
The adjustment value changed event.
static int
BLOCK_DECREMENT
The block decrement adjustment type.
static int
BLOCK_INCREMENT
The block increment adjustment type.
static int
TRACK
The absolute tracking adjustment type.
static int
UNIT_DECREMENT
The unit decrement adjustment type.
static int
UNIT_INCREMENT
The unit increment adjustment type.

Fields inherited from class java.awt.AWTEvent

ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK, consumed, id

Fields inherited from class java.util.EventObject

source

Constructor Summary

AdjustmentEvent(Adjustable source, int id, int type, int value)
Constructs an AdjustmentEvent object with the specified Adjustable source, event type, adjustment type, and value.
AdjustmentEvent(Adjustable source, int id, int type, int value, boolean isAdjusting)
Constructs an AdjustmentEvent object with the specified Adjustable source, event type, adjustment type, and value.

Method Summary

Adjustable
getAdjustable()
Returns the Adjustable object where this event originated.
int
getAdjustmentType()
Returns the type of adjustment which caused the value changed event.
int
getValue()
Returns the current value in the adjustment event.
boolean
getValueIsAdjusting()
Returns true if this is one of multiple adjustment events.
String
paramString()
Returns a string representing the state of this Event.

Methods inherited from class java.awt.AWTEvent

consume, getID, isConsumed, paramString, setSource, toString

Methods inherited from class java.util.EventObject

getSource, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

ADJUSTMENT_FIRST

public static final int ADJUSTMENT_FIRST
Marks the first integer id for the range of adjustment event ids.
Field Value:
601

ADJUSTMENT_LAST

public static final int ADJUSTMENT_LAST
Marks the last integer id for the range of adjustment event ids.
Field Value:
601

ADJUSTMENT_VALUE_CHANGED

public static final int ADJUSTMENT_VALUE_CHANGED
The adjustment value changed event.
Field Value:
601
Usages and Demos :

View More Examples of AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED
   1:     AdjustmentEvent e = new AdjustmentEvent((Scrollbar)owner,
   2:                         AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   3:                         type, value);
   4:     QtToolkit.eventQueue.postEvent(e);
   5:   }

View Full Code Here
   1:     q.postEvent (new AdjustmentEvent ((Adjustable)awtComponent, 
   2:                       AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   3:                       type, value));
   4:   }
   5: }

View Full Code Here
   1:     AdjustmentEvent ae = new AdjustmentEvent (this,
   2:                           AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   3:                           AdjustmentEvent.UNIT_INCREMENT,
   4:                           newValue);
   5:     super.processEvent (ae);

View Full Code Here
   1:                 new AdjustmentEvent( this,
   2:                              AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   3:                              AdjustmentEvent.BLOCK_DECREMENT, 
   4:         ...
   5:                 new AdjustmentEvent( this,
   6:                              AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   7:                              AdjustmentEvent.BLOCK_INCREMENT, 
   8:         ...
   9:                 new AdjustmentEvent( this,
  10:                              AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
  11:                              AdjustmentEvent.TRACK, 

View Full Code Here
   1:       model.setValue(value);
   2:       fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   3:                                  AdjustmentEvent.TRACK, value);
   4:         ...
   5:       model.setExtent(extent);
   6:       fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   7:                                  AdjustmentEvent.TRACK, extent);
   8:         ...
   9:       model.setMinimum(minimum);
  10:       fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
  11:                                  AdjustmentEvent.TRACK, minimum);

View Full Code Here

BLOCK_DECREMENT

public static final int BLOCK_DECREMENT
The block decrement adjustment type.
Field Value:
3
Usages and Demos :

View More Examples of AdjustmentEvent.BLOCK_DECREMENT
   1:         break;
   2:       case AdjustmentEvent.BLOCK_DECREMENT:
   3:         setValue(lastValue - getBlockIncrement());
   4:         break;
   5:     }

View Full Code Here
   1:                     L.pageUp(); break;
   2:                 case AdjustmentEvent.BLOCK_DECREMENT :
   3:                     L.pageDown(); break;
   4:         ...
   5:                     pos+=50; break;
   6:                 case AdjustmentEvent.BLOCK_DECREMENT :
   7:                     pos-=50; break;
   8:             }
   9:             L.setHorizontalPos((double)(pos)/1000);

View Full Code Here
   1:                     TD.verticalPageUp(); break;
   2:                 case AdjustmentEvent.BLOCK_DECREMENT :
   3:                     TD.verticalPageDown(); break;
   4:                 default :
   5:                     int v=Vertical.getValue();

View Full Code Here
   1:                     TD.verticalPageUp(); break;
   2:                 case AdjustmentEvent.BLOCK_DECREMENT :
   3:                     TD.verticalPageDown(); break;
   4:                 default :
   5:                     int v=Vertical.getValue();

View Full Code Here
   1:                              AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   2:                              AdjustmentEvent.BLOCK_DECREMENT, 
   3:                              getValue() ));
   4:   }  
   5:   private void doBlockIncrement()

View Full Code Here

BLOCK_INCREMENT

public static final int BLOCK_INCREMENT
The block increment adjustment type.
Field Value:
4
Usages and Demos :

View More Examples of AdjustmentEvent.BLOCK_INCREMENT
   1:         break;
   2:       case AdjustmentEvent.BLOCK_INCREMENT:
   3:         setValue(lastValue + getBlockIncrement());
   4:         break;
   5:       case AdjustmentEvent.BLOCK_DECREMENT:

View Full Code Here
   1:                     L.down(1); break;
   2:                 case AdjustmentEvent.BLOCK_INCREMENT :
   3:                     L.pageUp(); break;
   4:         ...
   5:                     pos-=10; break;
   6:                 case AdjustmentEvent.BLOCK_INCREMENT :
   7:                     pos+=50; break;
   8:                 case AdjustmentEvent.BLOCK_DECREMENT :
   9:                     pos-=50; break;

View Full Code Here
   1:                     TD.verticalDown(); break;
   2:                 case AdjustmentEvent.BLOCK_INCREMENT :
   3:                     TD.verticalPageUp(); break;
   4:                 case AdjustmentEvent.BLOCK_DECREMENT :
   5:                     TD.verticalPageDown(); break;

View Full Code Here
   1:                     TD.verticalDown(); break;
   2:                 case AdjustmentEvent.BLOCK_INCREMENT :
   3:                     TD.verticalPageUp(); break;
   4:                 case AdjustmentEvent.BLOCK_DECREMENT :
   5:                     TD.verticalPageDown(); break;

View Full Code Here
   1:                              AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   2:                              AdjustmentEvent.BLOCK_INCREMENT, 
   3:                              getValue() ));
   4:   }  
   5:   private void doTrack( int value )

View Full Code Here

TRACK

public static final int TRACK
The absolute tracking adjustment type.
Field Value:
5
Usages and Demos :

View More Examples of AdjustmentEvent.TRACK
   1:                              AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   2:                              AdjustmentEvent.TRACK, 
   3:                              getValue() ));
   4:   }  
   5:   private void doUnitDecrement()

View Full Code Here
   1:             switch (evt.getID()) {
   2:             case AdjustmentEvent.TRACK:
   3:                 System.out.print("SCROLL_ABSOLUTE"); 
   4:                 break;
   5:             case AdjustmentEvent.UNIT_INCREMENT:

View Full Code Here
   1:       fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   2:                                  AdjustmentEvent.TRACK, value);
   3:     }
   4:         ...
   5:       fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   6:                                  AdjustmentEvent.TRACK, extent);
   7:     }
   8:         ...
   9:       fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
  10:                                  AdjustmentEvent.TRACK, minimum);
  11:     }

View Full Code Here
   1:       AdjustmentEvent adjevt = new AdjustmentEvent(
   2:         this, 0, AdjustmentEvent.TRACK, getValue());
   3:       processAdjustmentEvent(adjevt);
   4:         ...
   5:       AdjustmentEvent adjevt = new AdjustmentEvent(this, 0,
   6:                                                       AdjustmentEvent.TRACK,
   7:                                                       getValue());
   8:         ...
   9:       AdjustmentEvent adjevt = 
  10:               new AdjustmentEvent(this, 0, AdjustmentEvent.TRACK, getValue());
  11:       processAdjustmentEvent(adjevt);

View Full Code Here

UNIT_DECREMENT

public static final int UNIT_DECREMENT
The unit decrement adjustment type.
Field Value:
2
Usages and Demos :

View More Examples of AdjustmentEvent.UNIT_DECREMENT
   1:         break;
   2:       case AdjustmentEvent.UNIT_DECREMENT:
   3:         setValue(lastValue - getUnitIncrement());
   4:         break;
   5:       case AdjustmentEvent.BLOCK_INCREMENT:

View Full Code Here
   1:                     L.up(1); break;
   2:                 case AdjustmentEvent.UNIT_DECREMENT :
   3:                     L.down(1); break;
   4:         ...
   5:                     pos+=10; break;
   6:                 case AdjustmentEvent.UNIT_DECREMENT :
   7:                     pos-=10; break;
   8:                 case AdjustmentEvent.BLOCK_INCREMENT :
   9:                     pos+=50; break;

View Full Code Here
   1:                     TD.verticalUp(); break;
   2:                 case AdjustmentEvent.UNIT_DECREMENT :
   3:                     TD.verticalDown(); break;
   4:                 case AdjustmentEvent.BLOCK_INCREMENT :
   5:                     TD.verticalPageUp(); break;

View Full Code Here
   1:                     TD.verticalUp(); break;
   2:                 case AdjustmentEvent.UNIT_DECREMENT :
   3:                     TD.verticalDown(); break;
   4:                 case AdjustmentEvent.BLOCK_INCREMENT :
   5:                     TD.verticalPageUp(); break;

View Full Code Here
   1:                              AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   2:                              AdjustmentEvent.UNIT_DECREMENT, 
   3:                              getValue() ));
   4:   }  
   5:   private void doUnitIncrement()

View Full Code Here

UNIT_INCREMENT

public static final int UNIT_INCREMENT
The unit increment adjustment type.
Field Value:
1
Usages and Demos :

View More Examples of AdjustmentEvent.UNIT_INCREMENT
   1:     switch(type) {
   2:       case AdjustmentEvent.UNIT_INCREMENT:
   3:         setValue(lastValue + getUnitIncrement());
   4:         break;
   5:       case AdjustmentEvent.UNIT_DECREMENT:

View Full Code Here
   1:         {    switch (e.getAdjustmentType())
   2:             {    case AdjustmentEvent.UNIT_INCREMENT :
   3:                     L.up(1); break;
   4:         ...
   5:             switch (e.getAdjustmentType())
   6:             {    case AdjustmentEvent.UNIT_INCREMENT :
   7:                     pos+=10; break;
   8:                 case AdjustmentEvent.UNIT_DECREMENT :
   9:                     pos-=10; break;

View Full Code Here
   1:         {    switch (e.getAdjustmentType())
   2:             {    case AdjustmentEvent.UNIT_INCREMENT :
   3:                     TD.verticalUp(); break;
   4:                 case AdjustmentEvent.UNIT_DECREMENT :
   5:                     TD.verticalDown(); break;

View Full Code Here
   1:                           AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
   2:                           AdjustmentEvent.UNIT_INCREMENT,
   3:                           newValue);
   4:     super.processEvent (ae);
   5:     changes.firePropertyChange("currentvalue",

View Full Code Here
   1:         {    switch (e.getAdjustmentType())
   2:             {    case AdjustmentEvent.UNIT_INCREMENT :
   3:                     TD.verticalUp(); break;
   4:                 case AdjustmentEvent.UNIT_DECREMENT :
   5:                     TD.verticalDown(); break;

View Full Code Here

Constructor Details

AdjustmentEvent

public AdjustmentEvent(Adjustable source,
                       int id,
                       int type,
                       int value)
Constructs an AdjustmentEvent object with the specified Adjustable source, event type, adjustment type, and value.

Note that passing in an invalid id results in unspecified behavior. This method throws an IllegalArgumentException if source is null.

Parameters:
source - the Adjustable object where the event originated
id - the event type
type - the adjustment type
value - the current value of the adjustment
Throws:
IllegalArgumentException - if source is null
Usages and Demos :

View More Examples of AdjustmentEvent(Adjustable source,int id,int type,int value)
   1:   {
   2:     adjustmentValueChanged(new AdjustmentEvent(a, 0, 0, 0));
   3:   }
   4:   public void removeAdjustmentListener( AdjustmentListener l ) {}
   5:   public void removeSlave( Adjustable vx ) {

View Full Code Here
   1:       AdjustmentEvent adjevt = 
   2:               new AdjustmentEvent(this, 0, AdjustmentEvent.TRACK, getValue());
   3:       processAdjustmentEvent(adjevt);
   4:         ...
   5:       AdjustmentEvent adjevt = 
   6:         new AdjustmentEvent(this, 0, AdjustmentEvent.TRACK, getValue());
   7:       processAdjustmentEvent(adjevt);
   8:     }
   9:   }

View Full Code Here
   1: 
   2:     myVScrollSync.adjustmentValueChanged(new AdjustmentEvent(this, 0, 0, 0));
   3:   }  
   4:         ...
   5: 
   6:     myVScrollSync.adjustmentValueChanged(new AdjustmentEvent(this, 0, 0, 0));
   7:   }  
   8:         ...
   9: 
  10:     myVScrollSync.adjustmentValueChanged(new AdjustmentEvent(this, 0, 0, 0));
  11:   }  

View Full Code Here

AdjustmentEvent

public AdjustmentEvent(Adjustable source,
                       int id,
                       int type,
                       int value,
                       boolean isAdjusting)
Constructs an AdjustmentEvent object with the specified Adjustable source, event type, adjustment type, and value.

Note that passing in an invalid id results in unspecified behavior. This method throws an IllegalArgumentException if source is null.

Parameters:
source - the Adjustable object where the event originated
id - the event type
type - the adjustment type
value - the current value of the adjustment
isAdjusting - true if the event is one of a series of multiple adjusting events, otherwise false
Throws:
IllegalArgumentException - if source is null

Method Details

getAdjustable

public Adjustable getAdjustable()
Returns the Adjustable object where this event originated.
Returns:
the Adjustable object where this event originated
Usages and Demos :

View More Examples of getAdjustable()
   1:     {
   2:         public void adjustmentValueChanged(AdjustmentEvent ae)
   3:         {
   4:         ...
   5:             JScrollBar source = (JScrollBar) ae.getAdjustable();
   6: 
   7:             int translation = source.getValue();

View Full Code Here

getAdjustmentType

public int getAdjustmentType()
Returns the type of adjustment which caused the value changed event. It will have one of the following values:
Returns:
one of the adjustment values listed above
Usages and Demos :

View More Examples of getAdjustmentType()
   1: import java.awt.event.AdjustmentListener;
   2: import java.awt.event.AdjustmentEvent;
   3: import java.applet.Applet;
   4:         ...
   5:         
   6:     public void adjustmentValueChanged(AdjustmentEvent e) {
   7:         ...
   8:         setLabelText(e.getValue(), e.getAdjustmentType());
   9:     }

View Full Code Here
   1:    
   2:   public void processAdjustmentEvent(AdjustmentEvent e) {
   3:         ...
   4:     int type = e.getAdjustmentType();
   5:     switch(type) {
   6:         ...
   7:       case AdjustmentEvent.UNIT_INCREMENT:
   8:         setValue(lastValue + getUnitIncrement());
   9:         ...
  10:         break;
  11:       case AdjustmentEvent.UNIT_DECREMENT:

View Full Code Here
   1:     
   2:     public void adjustmentValueChanged (AdjustmentEvent e) 
   3:     {    if (Vertical!=null && e.getSource()==Vertical)
   4:         ...
   5:         {    switch (e.getAdjustmentType())
   6:         ...
   7:             {    case AdjustmentEvent.UNIT_INCREMENT :
   8:                     L.up(1); break;
   9:         ...
  10:                 case AdjustmentEvent.UNIT_DECREMENT :

View Full Code Here

getValue

public int getValue()
Returns the current value in the adjustment event.
Returns:
the current value in the adjustment event
Usages and Demos :

View More Examples of getValue()
   1: import java.awt.event.AdjustmentListener;
   2: import java.awt.event.AdjustmentEvent;
   3: import java.applet.Applet;
   4:         ...
   5:         
   6:     public void adjustmentValueChanged(AdjustmentEvent e) {
   7:         ...
   8:         setLabelText(e.getValue(), e.getAdjustmentType());
   9:     }

View Full Code Here
   1:         AdjustmentListener adjustmentListener = new AdjustmentListener() {
   2:           public void adjustmentValueChanged(AdjustmentEvent adjustmentEvent) {
   3:         ...
   4:             System.out.println("Adjusted: " + adjustmentEvent.getValue());
   5:           }
   6:         };
   7:         JScrollBar oneJScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);

View Full Code Here
   1:     
   2:     public void adjustmentValueChanged(AdjustmentEvent e)
   3:     {
   4:         ...
   5:         if ((JScrollBar)e.getSource() == scrollBar1)
   6:             label2.setText("???????"+e.getValue());
   7:         if ((JScrollBar)e.getSource() == scrollBar2)
   8:         ...
   9:             label2.setText("??????"+e.getValue());
  10:     }

View Full Code Here
   1: 
   2:   public void adjustmentValueChanged (AdjustmentEvent e) {
   3:         ...
   4:     tallyMonth = e.getValue();
   5:     compute();
   6:   }
   7: }

View Full Code Here
   1:     class MyAdjustmentListener implements AdjustmentListener {
   2:         public void adjustmentValueChanged(AdjustmentEvent evt) {
   3:               
   4:         ...
   5:             }
   6:             scrollValue = evt.getValue();
   7:             System.out.println("scrollValue = " + scrollValue);
   8:             if (scrollValue > 275)
   9:                 ackButton.setSelected(true);

View Full Code Here

getValueIsAdjusting

public boolean getValueIsAdjusting()
Returns true if this is one of multiple adjustment events.
Returns:
true if this is one of multiple adjustment events, otherwise returns false

paramString

public String paramString()
Returns a string representing the state of this Event. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.
Overrides:
paramString in interface AWTEvent
Returns:
a string representation of this event