本文整理匯總了Java中java.awt.event.AdjustmentEvent.TRACK屬性的典型用法代碼示例。如果您正苦於以下問題:Java AdjustmentEvent.TRACK屬性的具體用法?Java AdjustmentEvent.TRACK怎麽用?Java AdjustmentEvent.TRACK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.awt.event.AdjustmentEvent
的用法示例。
在下文中一共展示了AdjustmentEvent.TRACK屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setValueIsAdjusting
/**
* Sets the <code>valueIsAdjusting</code> property.
*
* @param b new adjustment-in-progress status
* @see #getValueIsAdjusting
* @since 1.4
*/
public void setValueIsAdjusting(boolean b) {
if (isAdjusting != b) {
isAdjusting = b;
AdjustmentEvent e =
new AdjustmentEvent(this,
AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
AdjustmentEvent.TRACK, value, b);
adjustmentListener.adjustmentValueChanged(e);
}
}
示例2: stateChanged
public void stateChanged(ChangeEvent e) {
Object obj = e.getSource();
if (obj instanceof BoundedRangeModel) {
int id = AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED;
int type = AdjustmentEvent.TRACK;
BoundedRangeModel model = (BoundedRangeModel)obj;
int value = model.getValue();
boolean isAdjusting = model.getValueIsAdjusting();
fireAdjustmentValueChanged(id, type, value, isAdjusting);
}
}
示例3: setValueIsAdjusting
/**
* Sets the {@code valueIsAdjusting} property.
*
* @param b new adjustment-in-progress status
* @see #getValueIsAdjusting
* @since 1.4
*/
public void setValueIsAdjusting(boolean b) {
if (isAdjusting != b) {
isAdjusting = b;
AdjustmentEvent e =
new AdjustmentEvent(this,
AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
AdjustmentEvent.TRACK, value, b);
adjustmentListener.adjustmentValueChanged(e);
}
}
示例4: setValueIsAdjusting
/**
* Sets the <code>valueIsAdjusting</code> property.
*
* @param b new adjustment-in-progress status
* @see #getValueIsAdjusting
* @since 1.4
*/
public void setValueIsAdjusting(boolean b) {
if (isAdjusting != b) {
isAdjusting = b;
AdjustmentEvent e =
new AdjustmentEvent(this,
AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
AdjustmentEvent.TRACK, value, b);
adjustmentListener.adjustmentValueChanged(e);
}
}
示例5: adjustmentValueChanged
@Override
public void adjustmentValueChanged(AdjustmentEvent evt) {
Adjustable source = evt.getAdjustable();
// getValueIsAdjusting() returns true if the user is currently
// dragging the scrollbar's knob and has not picked a final value
if (evt.getValueIsAdjusting()) {
// The user is dragging the knob
return;
} else {
((Component) source).getParent().repaint();
}
// Determine the type of event
int type = evt.getAdjustmentType();
switch (type) {
case AdjustmentEvent.UNIT_INCREMENT:
// Scrollbar was increased by one unit
break;
case AdjustmentEvent.UNIT_DECREMENT:
// Scrollbar was decreased by one unit
break;
case AdjustmentEvent.BLOCK_INCREMENT:
// Scrollbar was increased by one block
break;
case AdjustmentEvent.BLOCK_DECREMENT:
// Scrollbar was decreased by one block
break;
case AdjustmentEvent.TRACK:
// The knob on the scrollbar was dragged
break;
}
// Get current value
int value = evt.getValue();
}
示例6: adjustmentValueChanged
@Override
public void adjustmentValueChanged(AdjustmentEvent evt) {
Adjustable source = evt.getAdjustable();
// getValueIsAdjusting() returns true if the user is currently
// dragging the scrollbar's knob and has not picked a final value
if (evt.getValueIsAdjusting()) {
// The user is dragging the knob
return;
} else {
((javax.swing.JScrollBar) source).getParent().repaint();
}
// Determine which scrollbar fired the event
int orient = source.getOrientation();
if (orient == Adjustable.HORIZONTAL) {
// Event from horizontal scrollbar
} else {
// Event from vertical scrollbar
}
// Determine the type of event
int type = evt.getAdjustmentType();
switch (type) {
case AdjustmentEvent.UNIT_INCREMENT:
// Scrollbar was increased by one unit
break;
case AdjustmentEvent.UNIT_DECREMENT:
// Scrollbar was decreased by one unit
break;
case AdjustmentEvent.BLOCK_INCREMENT:
// Scrollbar was increased by one block
break;
case AdjustmentEvent.BLOCK_DECREMENT:
// Scrollbar was decreased by one block
break;
case AdjustmentEvent.TRACK:
// The knob on the scrollbar was dragged
break;
}
// Get current value
//int value = evt.getValue();
}
示例7: adjustmentValueChanged
public void adjustmentValueChanged(AdjustmentEvent evt) {
Adjustable source = evt.getAdjustable();
// getValueIsAdjusting() returns true if the user is currently
// dragging the scrollbar's knob and has not picked a final value
if (evt.getValueIsAdjusting()) {
// The user is dragging the knob
return;
} else {
((javax.swing.JScrollBar) source).getParent().repaint();
}
// Determine which scrollbar fired the event
int orient = source.getOrientation();
if (orient == Adjustable.HORIZONTAL) {
// Event from horizontal scrollbar
} else {
// Event from vertical scrollbar
}
// Determine the type of event
int type = evt.getAdjustmentType();
switch (type) {
case AdjustmentEvent.UNIT_INCREMENT:
// Scrollbar was increased by one unit
break;
case AdjustmentEvent.UNIT_DECREMENT:
// Scrollbar was decreased by one unit
break;
case AdjustmentEvent.BLOCK_INCREMENT:
// Scrollbar was increased by one block
break;
case AdjustmentEvent.BLOCK_DECREMENT:
// Scrollbar was decreased by one block
break;
case AdjustmentEvent.TRACK:
// The knob on the scrollbar was dragged
break;
}
// Get current value
//int value = evt.getValue();
}