本文整理汇总了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();
}
示例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();
}
}
}
示例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)
*/
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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;
}
}
示例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 );
}
示例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 );
}
示例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);
}
}
示例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();
}
}
示例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();
}
}
示例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;
}
}
示例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();
}
}
示例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;
}
}