本文整理汇总了Java中prefuse.util.ui.UILib类的典型用法代码示例。如果您正苦于以下问题:Java UILib类的具体用法?Java UILib怎么用?Java UILib使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UILib类属于prefuse.util.ui包,在下文中一共展示了UILib类的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: main
import prefuse.util.ui.UILib; //导入依赖的package包/类
public static void main(String argv[]) {
String infile = DATA_FILE;
String label = "name";
if ( argv.length > 1 ) {
infile = argv[0];
label = argv[1];
}
UILib.setPlatformLookAndFeel();
JFrame frame = new JFrame("p r e f u s e | r a d i a l g r a p h v i e w");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setContentPane(demo(infile, label));
frame.pack();
frame.setVisible(true);
}
示例4: 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)
*/
}
}
示例5: 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();
}
}
示例6: 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();
}
}
示例7: 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();
}
}
示例8: 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;
}
}
示例9: 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 );
}
示例10: 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 );
}
示例11: 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);
}
}
示例12: 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();
}
}
示例13: 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();
}
}
示例14: 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;
}
}
示例15: 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();
}
}