本文整理汇总了Java中prefuse.util.display.DisplayLib类的典型用法代码示例。如果您正苦于以下问题:Java DisplayLib类的具体用法?Java DisplayLib怎么用?Java DisplayLib使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DisplayLib类属于prefuse.util.display包,在下文中一共展示了DisplayLib类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeWindowCharacteristics
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
/**
* This sets up various things about the window, including the size.
* TODO include the size in the constructor
*/
private void initializeWindowCharacteristics()
{
setBorder( BorderFactory.createEmptyBorder() );
// main display controls
addComponentListener(
new ComponentAdapter() {
public void componentResized( ComponentEvent e )
{
if ( !isTranformInProgress() ) {
int margin = 10;
Rectangle2D bounds = m_vis.getBounds( Visualization.ALL_ITEMS );
double barWidth = bounds.getWidth() / m_histoTable.getBinCount();
GraphicsLib.expand( bounds, margin + (int)( 1 / getScale() ) );
DisplayLib.fitViewToBounds( HistogramGraph.this, bounds, 0 );
setBarWidth( barWidth );
}
}
}
);
// addControlListener(new ZoomToFitControl());
setHighQuality( true );
initializeLayoutBoundsForDisplay();
m_shapeR.setBounds( m_dataB );
}
示例2: mouseReleased
import prefuse.util.display.DisplayLib; //导入依赖的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();
}
}
示例3: zoomToFit
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
/**
* Zooms to fit.
*/
public void zoomToFit() {
Visualization vis = display.getVisualization();
Rectangle2D bounds = vis.getBounds(Visualization.ALL_ITEMS);
GraphicsLib.expand(bounds, 50 + (int)(1/display.getScale()));
DisplayLib.fitViewToBounds(display, bounds, duration);
}
示例4: run
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
@Override
public void run( double frac )
{
int duration = 20;
int margin = 50;
Visualization vis = getVisualization();
Rectangle2D bounds = vis.getBounds( Visualization.ALL_ITEMS );
GraphicsLib.expand( bounds, margin + (int) ( 1 / getScale() ) );
DisplayLib.fitViewToBounds( TreeGraphDisplay.this, bounds, duration );
}
示例5: getZoomToFitAction
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
private Action getZoomToFitAction() {
return(new Action() {
@Override
public void run(double frac) {
Rectangle2D bounds = m_vis.getBounds(Visualization.ALL_ITEMS);
Display display = m_vis.getDisplay(0);
GraphicsLib.expand(bounds, 50 + (int)(1/display.getScale()));
DisplayLib.fitViewToBounds(display, bounds, 2000);
}
});
}
示例6: itemBoundsChanged
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
public void itemBoundsChanged(Display d) {
d.getItemBounds(m_temp);
GraphicsLib.expand(m_temp, 25/d.getScale());
double dd = m_d/d.getScale();
double xd = Math.abs(m_temp.getMinX()-m_bounds.getMinX());
double yd = Math.abs(m_temp.getMinY()-m_bounds.getMinY());
double wd = Math.abs(m_temp.getWidth()-m_bounds.getWidth());
double hd = Math.abs(m_temp.getHeight()-m_bounds.getHeight());
if ( xd>dd || yd>dd || wd>dd || hd>dd ) {
m_bounds.setFrame(m_temp);
DisplayLib.fitViewToBounds(d, m_bounds, 0);
}
}
示例7: onDoubleTap
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
@Override
public boolean onDoubleTap(MotionEvent e)
{
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);
display.invalidate();
return true;
}
示例8: zoomToFit
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
/**
* Zoom to fit.
*
* @param display
* the display
*/
private void zoomToFit(Display display) {
if (!display.isTranformInProgress()) {
Visualization vis = display.getVisualization();
Rectangle2D bounds = vis.getBounds(Visualization.ALL_ITEMS);
GraphicsLib.expand(bounds, 300 + (int) (1 / display.getScale()));
DisplayLib.fitViewToBounds(display, bounds, 1000);
m_vis.run("layout");
}
}
示例9: zoomToFit
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
/**
* Zoom to fit.
*
* @param display
* the display
*/
public void zoomToFit(Display display) {
if (!display.isTranformInProgress()) {
Visualization vis = display.getVisualization();
Rectangle2D bounds = vis.getBounds(Visualization.ALL_ITEMS);
GraphicsLib.expand(bounds, 300 + (int) (1 / display.getScale()));
DisplayLib.fitViewToBounds(display, bounds, 1000);
m_vis.run("layout");
}
}
示例10: mouseClicked
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
/**
* @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
*/
public void mouseClicked(MouseEvent e) {
Display display = (Display)e.getComponent();
if ( !display.isTranformInProgress() &&
e.getClickCount()==2 )
{
Visualization vis = display.getVisualization();
Rectangle2D bounds = vis.getBounds(m_group);
//System.out.println("ZTO: " + bounds.getHeight());
GraphicsLib.expand(bounds, m_margin + (int)(1/display.getScale()));
DisplayLib.fitViewToBounds(display, bounds, m_duration);
}
}
示例11: ZoomToFit
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
private void ZoomToFit() {
if (!display.isTranformInProgress()) {
long m_duration = 2000;
int m_margin = 50;
Visualization vis = display.getVisualization();
Rectangle2D bounds = vis.getBounds(Visualization.ALL_ITEMS);
GraphicsLib.expand(bounds, m_margin + (int) (1 / display.getScale()));
DisplayLib.fitViewToBounds(display, bounds, m_duration);
}
}
示例12: itemBoundsChanged
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
public void itemBoundsChanged(Display d) {
d.getItemBounds(m_temp);
GraphicsLib.expand(m_temp, 25/d.getScale());
double dd = m_d/d.getScale();
double xd = Math.abs(m_temp.getMinX()-m_bounds.getMinX());
double yd = Math.abs(m_temp.getMinY()-m_bounds.getMinY());
double wd = Math.abs(m_temp.getWidth()-m_bounds.getWidth());
double hd = Math.abs(m_temp.getHeight()-m_bounds.getHeight());
if ( xd>dd || yd>dd || wd>dd || hd>dd ) {
m_bounds.setFrame(m_temp);
DisplayLib.fitViewToBounds(d, m_bounds, 0);
}
}
示例13: centerGraph
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
public void centerGraph() {
synchronized (mVis) {
if (!isTranformInProgress()) {
Rectangle2D bounds = mVis.getBounds(Visualization.ALL_ITEMS);
GraphicsLib.expand(bounds, 50 + (int) (1 / getScale()));
DisplayLib.fitViewToBounds(this, bounds, 1000);
}
}
}
示例14: zoomToFit
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
public void zoomToFit() {
Rectangle2D bounds = m_vis.getBounds(Visualization.ALL_ITEMS);
Display display = m_vis.getDisplay(0);
GraphicsLib.expand(bounds, 50 + (int)(1/display.getScale()));
DisplayLib.fitViewToBounds(display, bounds, 1000);
}
示例15: zoomToFit
import prefuse.util.display.DisplayLib; //导入依赖的package包/类
public void zoomToFit() {
Rectangle2D bounds = m_vis.getBounds(Visualization.ALL_ITEMS);
Display display = m_vis.getDisplay(0);
GraphicsLib.expand(bounds, 50 + (int)(1/display.getScale()));
DisplayLib.fitViewToBounds(display, bounds, 2000);
}