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


Java UILib.isButtonPressed方法代码示例

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


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

示例1: itemDragged

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see Control#itemDragged(VisualItem, MouseEvent)
 */
public void itemDragged( VisualItem item, MouseEvent e )
{
	if ( !UILib.isButtonPressed( e, button ) )
		return;
	if ( !( item instanceof NodeItem ) )
		return;

	Display d = (Display)e.getComponent();
	tmp = d.getAbsoluteCoordinate( e.getPoint(), tmp );
	double dx = tmp.getX() - down.getX();
	double dy = tmp.getY() - down.getY();

	updateLocations( (NodeItem)item, dx, dy );

	down.setLocation( tmp );
	item.getVisualization().repaint();
}
 
开发者ID:kartoFlane,项目名称:hiervis,代码行数:21,代码来源:SubtreeDragControl.java

示例2: mouseDragged

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see java.awt.event.MouseMotionListener#mouseDragged(java.awt.event.MouseEvent)
 */
public void mouseDragged(MouseEvent e) {
    if (UILib.isButtonPressed(e, button) ) {
        Display display = (Display)e.getComponent();
        if (display.isTranformInProgress() || down == null) {
            hideZoomBox();
            return;
        }
        current = new Point2D.Float();
        display.getAbsoluteCoordinate(e.getPoint(), current);
   
        if (boxItem != null) {
        	boxItem.setVisible(true);
         boxItem.setValidated(false);
         boxItem.getVisualization().repaint();
        }
    }
}
 
开发者ID:P15,项目名称:jailer,代码行数:21,代码来源:ZoomBoxControl.java

示例3: mouseClicked

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
 */
public void mouseClicked(MouseEvent e) {
	Display display = (Display)e.getComponent();
	if ( !display.isTranformInProgress() && 
    	  UILib.isButtonPressed(e, m_button_zoom_in) &&
    	  e.getClickCount() == 2)
    {
		
		Point2D center = new Point2D.Double((double)e.getX(), (double)e.getY());
		double scale = 3.0;
		display.animatePanAndZoomTo(center, scale, m_duration);
	    /*   
        Visualization vis = display.getVisualization();
        Rectangle2D bounds = vis.getBounds(m_group);
        GraphicsLib.expand(bounds, m_margin + (int)(1/display.getScale()));
        DisplayLib.fitViewToBounds(display, bounds, m_duration);
        DisplayLib.fitViewToBounds(display, bounds, center, duration)
    	*/
    }
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:23,代码来源:FlyInOutZoomControl.java

示例4: mouseDragged

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see java.awt.event.MouseMotionListener#mouseDragged(java.awt.event.MouseEvent)
 */
public void mouseDragged(MouseEvent e) {
	if (UILib.isButtonPressed(e, BUTTON)) {
		Display display = (Display) e.getComponent();
		int x = e.getX(), y = e.getY();
		int dx = x - xDown, dy = y - yDown;
		int rangeModeldx = 1;
		if (rangeModel != null) {
			if (panInDetailSpace)
				rangeModeldx = rangeModel.panActual(dx);
			else 
				rangeModel.setValue(rangeModel.getValue() - dx);
		}
		display.pan(0, dy);
		
		// next panning step starts here (if last pan had a result)
		if (rangeModeldx != 0) {
			xDown = x;
			yDown = y;
		}
		display.repaint();
	}
}
 
开发者ID:ieg-vienna,项目名称:TimeBench,代码行数:26,代码来源:RangePanControl.java

示例5: mousePressed

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see MouseListener#mousePressed(MouseEvent)
 */
public void mousePressed( MouseEvent e )
{
	if ( UILib.isButtonPressed( e, m_button ) ) {
		e.getComponent().setCursor( Cursor.getPredefinedCursor( Cursor.MOVE_CURSOR ) );
		m_xDown = e.getX();
		m_yDown = e.getY();
	}
}
 
开发者ID:kartoFlane,项目名称:hiervis,代码行数:12,代码来源:PanControl.java

示例6: mouseDragged

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see MouseMotionListener#mouseDragged(MouseEvent)
 */
public void mouseDragged( MouseEvent e )
{
	if ( UILib.isButtonPressed( e, m_button ) ) {
		Display display = (Display)e.getComponent();
		int x = e.getX(), y = e.getY();
		int dx = x - m_xDown, dy = y - m_yDown;
		display.pan( dx, dy );
		m_xDown = x;
		m_yDown = y;
		display.repaint();
	}
}
 
开发者ID:kartoFlane,项目名称:hiervis,代码行数:16,代码来源:PanControl.java

示例7: mouseReleased

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see MouseListener#mouseReleased(MouseEvent)
 */
public void mouseReleased( MouseEvent e )
{
	if ( UILib.isButtonPressed( e, m_button ) ) {
		e.getComponent().setCursor( Cursor.getDefaultCursor() );
		m_xDown = -1;
		m_yDown = -1;
	}
}
 
开发者ID:kartoFlane,项目名称:hiervis,代码行数:12,代码来源:PanControl.java

示例8: itemPressed

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see Control#itemPressed(VisualItem, MouseEvent)
 */
public void itemPressed( VisualItem item, MouseEvent e )
{
	if ( !UILib.isButtonPressed( e, button ) )
		return;
	if ( !( item instanceof NodeItem ) )
		return;

	Display d = (Display)e.getComponent();
	down = d.getAbsoluteCoordinate( e.getPoint(), down );
	wasFixed = item.isFixed();
	item.setFixed( true );
}
 
开发者ID:kartoFlane,项目名称:hiervis,代码行数:16,代码来源:SubtreeDragControl.java

示例9: itemReleased

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see Control#itemReleased(VisualItem, MouseEvent)
 */
public void itemReleased( VisualItem item, MouseEvent e )
{
	if ( !UILib.isButtonPressed( e, button ) )
		return;
	if ( !( item instanceof NodeItem ) )
		return;

	item.setFixed( wasFixed );
}
 
开发者ID:kartoFlane,项目名称:hiervis,代码行数:13,代码来源:SubtreeDragControl.java

示例10: mousePressed

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
 */
public void mousePressed(MouseEvent e) {
    if ( UILib.isButtonPressed(e, button) ) {
        Display display = (Display)e.getComponent();
        if (display.isTranformInProgress()) {
            return;
        }
        down = new Point2D.Float();
        current = null;
        display.getAbsoluteCoordinate(e.getPoint(), down);
    }
}
 
开发者ID:P15,项目名称:jailer,代码行数:15,代码来源:ZoomBoxControl.java

示例11: mouseMoved

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
    * Overridden to hide zoom box if no mouse button is pressed.
    */
   @Override
public void mouseMoved(MouseEvent e) {
   	if (!UILib.isButtonPressed(e, button) ) {
   		hideZoomBox();
       }
}
 
开发者ID:P15,项目名称:jailer,代码行数:10,代码来源:ZoomBoxControl.java

示例12: mouseReleased

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
 */
public void mouseReleased(MouseEvent e) {
    if ( UILib.isButtonPressed(e, button) ) {
    	if (down != null && current != null) {
    		Display display = (Display)e.getComponent();
            DisplayLib.fitViewToBounds(display, getZoomBoxBounds(200), 500);
    	}
    	hideZoomBox();
    }
}
 
开发者ID:P15,项目名称:jailer,代码行数:13,代码来源:ZoomBoxControl.java

示例13: mousePressed

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
 */
public void mousePressed(MouseEvent e) {
    if ( UILib.isButtonPressed(e, m_button) ) {
        e.getComponent().setCursor(
            Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
        m_xDown = e.getX();
        m_yDown = e.getY();
        m_DownValid = true;
    }
}
 
开发者ID:P15,项目名称:jailer,代码行数:13,代码来源:PanControl.java

示例14: mouseDragged

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see java.awt.event.MouseMotionListener#mouseDragged(java.awt.event.MouseEvent)
 */
public void mouseDragged(MouseEvent e) {
    if ( UILib.isButtonPressed(e, m_button) ) {
        Display display = (Display)e.getComponent();
        int x = e.getX(),   y = e.getY();
        int dx = x-m_xDown, dy = y-m_yDown;
        if (m_DownValid) {
        	display.pan(dx,dy);
        }
        m_xDown = x;
        m_yDown = y;
        m_DownValid = true;
        display.repaint();
    }
}
 
开发者ID:P15,项目名称:jailer,代码行数:18,代码来源:PanControl.java

示例15: mouseReleased

import prefuse.util.ui.UILib; //导入方法依赖的package包/类
/**
 * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
 */
public void mouseReleased(MouseEvent e) {
    if ( UILib.isButtonPressed(e, m_button) ) {
        e.getComponent().setCursor(Cursor.getDefaultCursor());
        m_xDown = -1;
        m_yDown = -1;
        m_DownValid = false;
    }
}
 
开发者ID:P15,项目名称:jailer,代码行数:12,代码来源:PanControl.java


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