prefuse.Visualization.getDisplay()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中prefuse.Visualization.getDisplay()方法的一些代码示例,展示了Visualization.getDisplay()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Visualization.getDisplay()方法的具体详情如下:
包路径:prefuse.Visualization
类名称:Visualization
方法名:getDisplay

Visualization.getDisplay介绍

[英]Get the display at the given list index. Displays are numbered by the order in which they are added to this visualization.
[中]获取给定列表索引处的显示。显示按添加到此可视化中的顺序进行编号。

代码示例

代码示例来源:origin: de.sciss/prefuse-core

/**
 * @see prefuse.action.Action#run(double)
 */
public void run(double frac) {
  if ( m_vis == null ) return;
  if ( frac == 0.0 || frac == 1.0 ) {
    boolean quality = frac >= 1.0;
    for ( int i=0; i<m_vis.getDisplayCount(); ++i ) {
      m_vis.getDisplay(i).setHighQuality(quality);
    }
    qualityValue(quality);
  }
}

代码示例来源:origin: de.sciss/prefuse-core

/**
 * Issue a repaint request, causing all displays associated with this
 * visualization to be repainted.
 */
public synchronized void repaint() {
  Iterator items = items(ValidatedPredicate.FALSE);
  while ( items.hasNext() ) {
    ((VisualItem)items.next()).validateBounds();
  }
  for ( int i=0; i<m_displays.size(); ++i ) {
    getDisplay(i).repaint();
  }
}

代码示例来源:origin: de.sciss/prefuse-core

private void setAnchor() {
  Display d = getVisualization().getDisplay(0);
  m_anchor.setLocation(d.getWidth()/2,d.getHeight()/2);
  d.getAbsoluteCoordinate(m_anchor, m_anchor);
  ax = m_anchor.getX();
  ay = m_anchor.getY();
}

代码示例来源:origin: de.sciss/prefuse-core

/**
 * Returns the bounds in which the layout should be computed. If the
 * bounds have been explicitly set, that value is used. Otherwise,
 * an attempt is made to compute the bounds based upon the display
 * region of the first display found in this action's associated
 * Visualization.
 * @return the layout bounds within which to constrain the layout.
 */
public Rectangle2D getLayoutBounds() {
  if ( m_bounds != null )
    return m_bounds;
  
  if ( m_vis != null && m_vis.getDisplayCount() > 0 )
  {
    Display d = m_vis.getDisplay(0);
    Insets i = m_margin ? m_insets : d.getInsets(m_insets);
    m_bpts[0] = i.left; 
    m_bpts[1] = i.top;
    m_bpts[2] = d.getWidth()-i.right;
    m_bpts[3] = d.getHeight()-i.bottom;
    d.getInverseTransform().transform(m_bpts,0,m_bpts,0,2);
    m_tmpb.setRect(m_bpts[0],m_bpts[1],
           m_bpts[2]-m_bpts[0],
           m_bpts[3]-m_bpts[1]);
    return m_tmpb;
  } else {
    return null;
  }
}

代码示例来源:origin: de.sciss/prefuse-core

/**
 * Report damage to associated displays, indicating a region that will need
 * to be redrawn.
 * @param item the item responsible for the damage
 * @param region the damaged region, in item-space coordinates
 */
public void damageReport(VisualItem item, Rectangle2D region) {
  for ( int i=0; i<m_displays.size(); ++i ) {
    Display d = getDisplay(i);
    if ( d.getPredicate().getBoolean(item) ) {
      d.damageReport(region);
    }
  }
}

代码示例来源:origin: de.sciss/prefuse-core

/**
 * Return the layout anchor at which to center or root the layout. How this
 * point is used (if it is used at all) is dependent on the particular
 * Layout implementation. If no anchor point has been explicitly set, the
 * center coordinate for the first display found in this action's
 * associated Visualization is used, if available.
 * @return the layout anchor point.
 */
public Point2D getLayoutAnchor() {
  if ( m_anchor != null )
    return m_anchor;
  
  m_tmpa.setLocation(0,0);
  if ( m_vis != null ) {
    Display d = m_vis.getDisplay(0);
    m_tmpa.setLocation(d.getWidth()/2.0,d.getHeight()/2.0);
    d.getInverseTransform().transform(m_tmpa, m_tmpa);
  }
  return m_tmpa;
}

代码示例来源:origin: de.sciss/prefuse-core

/**
 * @see prefuse.action.layout.Layout#getLayoutAnchor()
 */
public Point2D getLayoutAnchor() {
  if ( m_anchor != null )
    return m_anchor;
  
  m_tmpa.setLocation(0,0);
  if ( m_vis != null ) {
    Display d = m_vis.getDisplay(0);
    Rectangle2D b = this.getLayoutBounds();
    switch ( m_orientation ) {
    case Constants.ORIENT_LEFT_RIGHT:
      m_tmpa.setLocation(m_offset, d.getHeight()/2.0);
      break;
    case Constants.ORIENT_RIGHT_LEFT:
      m_tmpa.setLocation(b.getMaxX()-m_offset, d.getHeight()/2.0);
      break;
    case Constants.ORIENT_TOP_BOTTOM:
      m_tmpa.setLocation(d.getWidth()/2.0, m_offset);
      break;
    case Constants.ORIENT_BOTTOM_TOP:
      m_tmpa.setLocation(d.getWidth()/2.0, b.getMaxY()-m_offset);
      break;
    }
    d.getInverseTransform().transform(m_tmpa, m_tmpa);
  }
  return m_tmpa;
}

代码示例来源:origin: org.qi4j.tool/org.qi4j.tool.envisage

@Override
public void run( double frac )
{
  // setup
  NodeItem root = getLayoutRoot();
  layout( root, 0, 0 );
  Rectangle2D bounds = root.getBounds();
  Display display = this.getVisualization().getDisplay( 0 );
  Dimension size = new Dimension( (int) bounds.getWidth(), (int) bounds.getHeight() );
  display.setSize( size );
  if( !display.isValid() )
  {
    display.validate();
  }
}

相关文章