当前位置: 首页>>代码示例>>Java>>正文


Java AdjustmentEvent.getSource方法代码示例

本文整理汇总了Java中java.awt.event.AdjustmentEvent.getSource方法的典型用法代码示例。如果您正苦于以下问题:Java AdjustmentEvent.getSource方法的具体用法?Java AdjustmentEvent.getSource怎么用?Java AdjustmentEvent.getSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.event.AdjustmentEvent的用法示例。


在下文中一共展示了AdjustmentEvent.getSource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
/**
 * Listens to changes of the scroll bar of the text are showing the EULA text, enables the check
 * box once the user scrolled to the end of the document.
 */
@Override
public void adjustmentValueChanged(AdjustmentEvent e) {
	JScrollBar scrollBar = this.scrollPane.getVerticalScrollBar();
	if (e.getSource() == scrollBar) {
		// the maximum value of the scroll bar assumes that the content is
		// not visible anymore, since this is not the case when scrolling
		// to the end of the document (the last part is still visible),
		// we have to include the visible amount in the comparison
		int currentValue = scrollBar.getValue() + scrollBar.getVisibleAmount();
		if (currentValue >= scrollBar.getMaximum()) {
			// the user scrolled to the end of the document
			this.acceptCheckBox.setEnabled(true);
			this.acceptCheckBox.requestFocusInWindow();
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:21,代码来源:EULADialog.java

示例2: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
public void adjustmentValueChanged(AdjustmentEvent ae) {
	if ( sp != null && 
			ae.getSource() == sp.getVerticalScrollBar()  &&
			! adjustment && 
			coreDisp != null)	{
		adjustGraphs( coreDisp.getZScale(), 
				coreDisp.getVisibleRect().getCenterY(), 
				"FOSSIL DISPLAY" );
	}
	else if ( sedimentSP != null && 
			ae.getSource() == sedimentSP.getVerticalScrollBar() &&
			!adjustment && 
			sedimentGraph != null) {
		adjustGraphs( sedimentGraph.getZoom(), 
				sedimentGraph.getVisibleRect().getCenterY(), 
				"SEDIMENT GRAPH" );
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:19,代码来源:DSDPDemo.java

示例3: onScrollValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
public void onScrollValueChanged(AdjustmentEvent e) {
    if (e.getSource() == _vScrollBar) {
        //_vScrollBar.setValue(e.getValue());            
        //this._yShift = - this._vScrollBar.getValue();
        int y = -e.getValue();
        if (y == 1) {
            y = 0;
        }
        this._pageLocation.Y = y;
    }
    if (e.getSource() == _hScrollBar) {
        //_hScrollBar.setValue(e.getValue());       
        //this._xShift = - this._hScrollBar.getValue();
        int x = -e.getValue();
        if (x == 1) {
            x = 0;
        }
        this._pageLocation.X = x;
    }
    this.paintGraphics();
    //this.repaint();
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoLib,代码行数:23,代码来源:MapLayout.java

示例4: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
@Override
public void adjustmentValueChanged(AdjustmentEvent e) {
    int value = e.getValue();
    JScrollBar scrollBar = (JScrollBar) e.getSource();
    if (!scrolling && scrollBar.isEnabled()) {
        Point viewTranslation = canvas.getViewTranslation();
        if (e.getSource() == Atid.getRoot().getDrawingBoard().getHorizontalScrollBar()) {
            viewTranslation = new Point(-value, viewTranslation.getY());
        }
        if (e.getSource() == Atid.getRoot().getDrawingBoard().getVerticalScrollBar()) {
            viewTranslation = new Point(viewTranslation.getX(), -value);
        }
        canvas.setViewTranslation(viewTranslation);
        canvas.repaint();
    }
}
 
开发者ID:lucenacaio,项目名称:AtidDesktop,代码行数:17,代码来源:ScrollingFeature.java

示例5: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
@Override
public void adjustmentValueChanged(AdjustmentEvent e) {
    JScrollBar s = (JScrollBar) e.getSource();
    int val = s.getValue();
    if(getSkin() != null) {
        if (s.getOrientation() == Scrollbar.HORIZONTAL) {
            x = -(int) ((float) (val / 100f) * getSkin().getWidth());
        } else {
            y = -(int) ((float) (val / 100f) * getSkin().getHeight());
        }
    } else {
        if (s.getOrientation() == Scrollbar.HORIZONTAL) {
            x = -(int) ((float) (val / 100f) * getWidth());
        } else {
            y = -(int) ((float) (val / 100f) * getHeight());
        }
    }
    repaint();

}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:21,代码来源:JavaSEPort.java

示例6: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
@Override
public void adjustmentValueChanged(AdjustmentEvent e) {
	if (react) {
		if (e.getSource() == view.horizontalScroll) {
			model.setHorizontalOffset(view.horizontalScroll.getValue());
		}

		if (e.getSource() == view.verticalScroll) {
			model.setVerticalOffset(view.verticalScroll.getValue());
		}
		view.update();
	}
}
 
开发者ID:Skypr,项目名称:BEAST,代码行数:14,代码来源:ElectionSimulation.java

示例7: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
public void adjustmentValueChanged(AdjustmentEvent ev) {
	if (ev.getSource() == hBar) {
		graph.translateX(ev.getValue());
	} else if (ev.getSource() == vBar) {
		graph.translateY(ev.getValue());
	}		
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:8,代码来源:JabaCanvas.java

示例8: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
public void adjustmentValueChanged(AdjustmentEvent ae) {
		if ( ae.getSource() == graphScroll.getVerticalScrollBar() ) {
			graph.repaint();

			if ( !dsdp.getDemo().getAdjustment() ) {
				dsdp.setZScale( -1 * graph.getYScale(), this );
				Rectangle visibleRect = graph.getVisibleRect();
//				dsdp.demo.adjustGraphs( 2 * graph.getZoom(), visibleRect.getCenterY(), "AGE DEPTH MODEL" );
				dsdp.demo.adjustGraphs( graph.getZoom(), visibleRect.getCenterY(), "AGE DEPTH MODEL" );
			}
			prevYPos = -1;
		}

	}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:15,代码来源:AgeDepthModel.java

示例9: checkScrollBar

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
private void checkScrollBar(AdjustmentEvent e) {
    //  The scroll bar listModel contains information needed to determine
    //  whether the viewport should be repositioned or not.

    JScrollBar scrollBar = (JScrollBar) e.getSource();
    BoundedRangeModel scrollBarModel = scrollBar.getModel();
    int value = scrollBarModel.getValue();
    int extent = scrollBarModel.getExtent();
    int maximum = scrollBarModel.getMaximum();

    boolean valueChanged = previousScrollBarValue != value;
    boolean maximumChanged = previousScrollBarMaximum != maximum;

    //  Check if the user has manually repositioned the scrollbar
    if (valueChanged && !maximumChanged) {
        adjustScrollBar = value + extent >= maximum;
    }

    //  Reset the "value" so we can reposition the viewport and
    //  distinguish between a user scroll and a program scroll.
    //  (ie. valueChanged will be false on a program scroll)
    if (adjustScrollBar) {
        //  Scroll the viewport to the end.
        scrollBar.removeAdjustmentListener(scrollBarAdjustmentListener);
        value = maximum - extent;
        scrollBar.setValue(value);
        scrollBar.addAdjustmentListener(scrollBarAdjustmentListener);
    }

    previousScrollBarValue = value;
    previousScrollBarMaximum = maximum;
}
 
开发者ID:chipKIT32,项目名称:chipKIT-importer,代码行数:33,代码来源:SerialMonitorDisplayPane.java

示例10: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
public void adjustmentValueChanged(final AdjustmentEvent event) {
    if (event.getSource() instanceof JScrollBar) {
        JScrollBar scrollBar = (JScrollBar) event.getSource();

        setAdjusting(scrollBar.getValueIsAdjusting());
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:8,代码来源:PScrollPane.java

示例11: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
@Override
public void adjustmentValueChanged(final AdjustmentEvent event) {
  if (event.getSource() == m_scrollbar) {
    m_panel.setFirstRow(event.getValue());
  } else {
    m_panel.setFirstColumn(event.getValue());
  }

  m_panel.repaint();
}
 
开发者ID:google,项目名称:binnavi,代码行数:11,代码来源:JStackView.java

示例12: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
@Override
public void adjustmentValueChanged(final AdjustmentEvent event) {
  if (event.getSource() == m_scrollbar) {
    m_firstRow = event.getValue();
  } else {
    m_firstColumn = event.getValue();
  }

  repaint();
}
 
开发者ID:google,项目名称:binnavi,代码行数:11,代码来源:JHexView.java

示例13: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
public void adjustmentValueChanged(AdjustmentEvent event) {
	// TODO Auto-generated method stub
	if (event.getSource() == termBar) {
		transform();
		;
	}
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:8,代码来源:WaveletFit_Modeler.java

示例14: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
public void adjustmentValueChanged(AdjustmentEvent e) {
  if (e.getSource() == umlModel.getScrollPane().getVerticalScrollBar()) {
    JScrollBar bar = (JScrollBar) e.getSource();
    int row = logUmlMapper.getLogId(bar.getValue());
    Rectangle r = table.getCellRect(row, 0, true);
    table.scrollRectToVisible(r);

  } else if (e.getSource() == table) {
  }

}
 
开发者ID:otros-systems,项目名称:otroslogviewer,代码行数:12,代码来源:LogViewTableWithUMLSynchronizer.java

示例15: adjustmentValueChanged

import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
public void adjustmentValueChanged(AdjustmentEvent ev) {
	if (itemPanel == null) return;
	JScrollBar bar = (JScrollBar) (ev.getSource());
	int val = ev.getValue();

	if (bar == horizScroll) {
		itemPanel.setX(val);
	
	}
	if (bar == vertScroll)
		itemPanel.setY(ev.getValue());
}
 
开发者ID:petersalomonsen,项目名称:frinika,代码行数:13,代码来源:ItemScrollPane.java


注:本文中的java.awt.event.AdjustmentEvent.getSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。