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


Java BoundedRangeModel.removeChangeListener方法代碼示例

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


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

示例1: propertyChange

import javax.swing.BoundedRangeModel; //導入方法依賴的package包/類
/**
 * Called when one of the properties change. The UI should recalculate any
 * rectangles if necessary and repaint.
 *
 * @param e A {@link PropertyChangeEvent}.
 */
public void propertyChange(PropertyChangeEvent e)
{
  // Check for orientation changes.
  String prop = e.getPropertyName();
  if (prop.equals("orientation")
      || prop.equals("inverted")
      || prop.equals("labelTable")
      || prop.equals("majorTickSpacing")
      || prop.equals("minorTickSpacing")
      || prop.equals("paintTicks")
      || prop.equals("paintTrack")
      || prop.equals("paintLabels"))
    {
      calculateGeometry();
      slider.repaint();
    }
  else if (e.getPropertyName().equals("model"))
    {
      BoundedRangeModel oldModel = (BoundedRangeModel) e.getOldValue();
      oldModel.removeChangeListener(changeListener);
      slider.getModel().addChangeListener(changeListener);
      calculateThumbLocation();
      slider.repaint();
    }
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:32,代碼來源:BasicSliderUI.java

示例2: propertyChange

import javax.swing.BoundedRangeModel; //導入方法依賴的package包/類
public void propertyChange(final PropertyChangeEvent e) {
    String propertyName = e.getPropertyName();
    if (StringConstants.MODEL_PROPERTY_CHANGED.equals(propertyName)) {
        BoundedRangeModel oldValue = (BoundedRangeModel)e.getOldValue();
        if (oldValue != null) {
            oldValue.removeChangeListener(hsbChangeListener);
        }

        BoundedRangeModel newValue = (BoundedRangeModel)e.getNewValue();
        if (newValue != null) {
            newValue.addChangeListener(hsbChangeListener);
        }
    } else if (StringConstants.COMPONENT_ORIENTATION.equals(propertyName)) {
        hsbChangeListener.stateChanged(new ChangeEvent(e.getSource()));
    }
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:17,代碼來源:BasicScrollPaneUI.java

示例3: propertyChange

import javax.swing.BoundedRangeModel; //導入方法依賴的package包/類
public void propertyChange(final PropertyChangeEvent e) {
       String propertyName = e.getPropertyName();
       if (StringConstants.COMPONENT_ORIENTATION.equals(propertyName)) {
           uninstallKeyboardActions();
           installKeyboardActions();
       } else if (StringConstants.MODEL_PROPERTY_CHANGED.equals(propertyName)) {
           BoundedRangeModel oldValue = (BoundedRangeModel)e.getOldValue();
           if (oldValue != null) {
               oldValue.removeChangeListener(modelListener);
           }

           BoundedRangeModel newValue = (BoundedRangeModel)e.getNewValue();
           if (newValue != null) {
               newValue.addChangeListener(modelListener);
           }
       }

if (scrollbar != null) {	
           scrollbar.revalidate();
           scrollbar.repaint();
       }
   }
 
開發者ID:shannah,項目名稱:cn1,代碼行數:23,代碼來源:BasicScrollBarUI.java

示例4: setModel

import javax.swing.BoundedRangeModel; //導入方法依賴的package包/類
/**
 * @param model
 */
public synchronized void setModel(final BoundedRangeModel model) {
    if (this.model == model) { return; }
    if (this.model != null) {
        model.removeChangeListener(changeListener);
    }
    changeListener = createChangeListener();
    model.addChangeListener(changeListener);
    this.model = model;

    this.repaint();

}
 
開發者ID:friedlwo,項目名稱:AppWoksUtils,代碼行數:16,代碼來源:CircledProgressBar.java

示例5: sbPropertyChange

import javax.swing.BoundedRangeModel; //導入方法依賴的package包/類
private void sbPropertyChange(PropertyChangeEvent e) {
    String propertyName = e.getPropertyName();
    Object source = e.getSource();

    if ("model" == propertyName) {
        JScrollBar sb = scrollpane.getVerticalScrollBar();
        BoundedRangeModel oldModel = (BoundedRangeModel) e.getOldValue();
        ChangeListener cl = null;

        if (source == sb) {
            cl = vsbChangeListener;
        } else if (source == scrollpane.getHorizontalScrollBar()) {
            sb = scrollpane.getHorizontalScrollBar();
            cl = hsbChangeListener;
        }
        if (cl != null) {
            if (oldModel != null) {
                oldModel.removeChangeListener(cl);
            }
            if (sb.getModel() != null) {
                sb.getModel().addChangeListener(cl);
            }
        }
    } else if ("componentOrientation" == propertyName) {
        if (source == scrollpane.getHorizontalScrollBar()) {
            JScrollBar hsb = scrollpane.getHorizontalScrollBar();
            JViewport viewport = scrollpane.getViewport();
            Point p = viewport.getViewPosition();
            if (scrollpane.getComponentOrientation().isLeftToRight()) {
                p.x = hsb.getValue();
            } else {
                p.x = viewport.getViewSize().width - viewport.getExtentSize().width - hsb.getValue();
            }
            viewport.setViewPosition(p);
        }
    }
}
 
開發者ID:khuxtable,項目名稱:seaglass,代碼行數:38,代碼來源:SeaGlassScrollPaneUI.java

示例6: onDispose

import javax.swing.BoundedRangeModel; //導入方法依賴的package包/類
@Override
protected void onDispose(BoundedRangeModel w) {
    w.removeChangeListener(this);
}
 
開發者ID:akarnokd,項目名稱:RxJava2Swing,代碼行數:5,代碼來源:ChangeEventBoundedRangeObservable.java


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