當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。