当前位置: 首页>>代码示例>>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;未经允许,请勿转载。