本文整理汇总了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();
}
}
}
示例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" );
}
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}
}
示例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());
}
}
示例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;
}
}
示例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;
}
示例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());
}
}
示例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();
}
示例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();
}
示例13: adjustmentValueChanged
import java.awt.event.AdjustmentEvent; //导入方法依赖的package包/类
public void adjustmentValueChanged(AdjustmentEvent event) {
// TODO Auto-generated method stub
if (event.getSource() == termBar) {
transform();
;
}
}
示例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) {
}
}
示例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());
}