當前位置: 首頁>>代碼示例>>Java>>正文


Java AdjustmentEvent.getAdjustable方法代碼示例

本文整理匯總了Java中java.awt.event.AdjustmentEvent.getAdjustable方法的典型用法代碼示例。如果您正苦於以下問題:Java AdjustmentEvent.getAdjustable方法的具體用法?Java AdjustmentEvent.getAdjustable怎麽用?Java AdjustmentEvent.getAdjustable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.event.AdjustmentEvent的用法示例。


在下文中一共展示了AdjustmentEvent.getAdjustable方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //導入方法依賴的package包/類
public void adjustmentValueChanged(AdjustmentEvent e) {
  Adjustable bar = e.getAdjustable();
  int currentMaximum = bar.getMaximum();
  if (bar.getMaximum() == _lastMaximum) {
    return; // nothing to do, the adjustable has not expanded
  }
  int bottom = bar.getValue() + bar.getVisibleAmount();

  if (bottom + bar.getUnitIncrement() >= _lastMaximum) {
    bar.setValue(bar.getMaximum()); // use the most recent maximum
  }
  _lastMaximum = currentMaximum;
}
 
開發者ID:cacheonix,項目名稱:cacheonix-core,代碼行數:14,代碼來源:TrackingAdjustmentListener.java

示例2: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //導入方法依賴的package包/類
public final void adjustmentValueChanged(final AdjustmentEvent e) {
   final Adjustable bar = e.getAdjustable();
   final int currentMaximum = bar.getMaximum();
   if (bar.getMaximum() == _lastMaximum) {
      return; // nothing to do, the adjustable has not expanded
   }
   final int bottom = bar.getValue() + bar.getVisibleAmount();

   if (bottom + bar.getUnitIncrement() >= _lastMaximum) {
      bar.setValue(bar.getMaximum()); // use the most recent maximum
   }
   _lastMaximum = currentMaximum;
}
 
開發者ID:cacheonix,項目名稱:cacheonix-core,代碼行數:14,代碼來源:TrackingAdjustmentListener.java

示例3: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //導入方法依賴的package包/類
@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();
}
 
開發者ID:CIRDLES,項目名稱:ET_Redux,代碼行數:37,代碼來源:AliquotEditorDialog.java

示例4: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //導入方法依賴的package包/類
@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();
}
 
開發者ID:CIRDLES,項目名稱:ET_Redux,代碼行數:45,代碼來源:SampleAnalysisWorkflowManagerIDTIMS.java

示例5: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //導入方法依賴的package包/類
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();
}
 
開發者ID:CIRDLES,項目名稱:ET_Redux,代碼行數:44,代碼來源:SampleAnalysisWorkflowManagerLAICPMS.java


注:本文中的java.awt.event.AdjustmentEvent.getAdjustable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。