本文整理汇总了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();
}
}
示例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()));
}
}
示例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();
}
}
示例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();
}
示例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);
}
}
}
示例6: onDispose
import javax.swing.BoundedRangeModel; //导入方法依赖的package包/类
@Override
protected void onDispose(BoundedRangeModel w) {
w.removeChangeListener(this);
}