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

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

本文整理了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

  1. /**
  2. * @see prefuse.action.Action#run(double)
  3. */
  4. public void run(double frac) {
  5. if ( m_vis == null ) return;
  6. if ( frac == 0.0 || frac == 1.0 ) {
  7. boolean quality = frac >= 1.0;
  8. for ( int i=0; i<m_vis.getDisplayCount(); ++i ) {
  9. m_vis.getDisplay(i).setHighQuality(quality);
  10. }
  11. qualityValue(quality);
  12. }
  13. }

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

  1. /**
  2. * Issue a repaint request, causing all displays associated with this
  3. * visualization to be repainted.
  4. */
  5. public synchronized void repaint() {
  6. Iterator items = items(ValidatedPredicate.FALSE);
  7. while ( items.hasNext() ) {
  8. ((VisualItem)items.next()).validateBounds();
  9. }
  10. for ( int i=0; i<m_displays.size(); ++i ) {
  11. getDisplay(i).repaint();
  12. }
  13. }

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

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

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

  1. /**
  2. * Returns the bounds in which the layout should be computed. If the
  3. * bounds have been explicitly set, that value is used. Otherwise,
  4. * an attempt is made to compute the bounds based upon the display
  5. * region of the first display found in this action's associated
  6. * Visualization.
  7. * @return the layout bounds within which to constrain the layout.
  8. */
  9. public Rectangle2D getLayoutBounds() {
  10. if ( m_bounds != null )
  11. return m_bounds;
  12. if ( m_vis != null && m_vis.getDisplayCount() > 0 )
  13. {
  14. Display d = m_vis.getDisplay(0);
  15. Insets i = m_margin ? m_insets : d.getInsets(m_insets);
  16. m_bpts[0] = i.left;
  17. m_bpts[1] = i.top;
  18. m_bpts[2] = d.getWidth()-i.right;
  19. m_bpts[3] = d.getHeight()-i.bottom;
  20. d.getInverseTransform().transform(m_bpts,0,m_bpts,0,2);
  21. m_tmpb.setRect(m_bpts[0],m_bpts[1],
  22. m_bpts[2]-m_bpts[0],
  23. m_bpts[3]-m_bpts[1]);
  24. return m_tmpb;
  25. } else {
  26. return null;
  27. }
  28. }

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

  1. /**
  2. * Report damage to associated displays, indicating a region that will need
  3. * to be redrawn.
  4. * @param item the item responsible for the damage
  5. * @param region the damaged region, in item-space coordinates
  6. */
  7. public void damageReport(VisualItem item, Rectangle2D region) {
  8. for ( int i=0; i<m_displays.size(); ++i ) {
  9. Display d = getDisplay(i);
  10. if ( d.getPredicate().getBoolean(item) ) {
  11. d.damageReport(region);
  12. }
  13. }
  14. }

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

  1. /**
  2. * Return the layout anchor at which to center or root the layout. How this
  3. * point is used (if it is used at all) is dependent on the particular
  4. * Layout implementation. If no anchor point has been explicitly set, the
  5. * center coordinate for the first display found in this action's
  6. * associated Visualization is used, if available.
  7. * @return the layout anchor point.
  8. */
  9. public Point2D getLayoutAnchor() {
  10. if ( m_anchor != null )
  11. return m_anchor;
  12. m_tmpa.setLocation(0,0);
  13. if ( m_vis != null ) {
  14. Display d = m_vis.getDisplay(0);
  15. m_tmpa.setLocation(d.getWidth()/2.0,d.getHeight()/2.0);
  16. d.getInverseTransform().transform(m_tmpa, m_tmpa);
  17. }
  18. return m_tmpa;
  19. }

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

  1. /**
  2. * @see prefuse.action.layout.Layout#getLayoutAnchor()
  3. */
  4. public Point2D getLayoutAnchor() {
  5. if ( m_anchor != null )
  6. return m_anchor;
  7. m_tmpa.setLocation(0,0);
  8. if ( m_vis != null ) {
  9. Display d = m_vis.getDisplay(0);
  10. Rectangle2D b = this.getLayoutBounds();
  11. switch ( m_orientation ) {
  12. case Constants.ORIENT_LEFT_RIGHT:
  13. m_tmpa.setLocation(m_offset, d.getHeight()/2.0);
  14. break;
  15. case Constants.ORIENT_RIGHT_LEFT:
  16. m_tmpa.setLocation(b.getMaxX()-m_offset, d.getHeight()/2.0);
  17. break;
  18. case Constants.ORIENT_TOP_BOTTOM:
  19. m_tmpa.setLocation(d.getWidth()/2.0, m_offset);
  20. break;
  21. case Constants.ORIENT_BOTTOM_TOP:
  22. m_tmpa.setLocation(d.getWidth()/2.0, b.getMaxY()-m_offset);
  23. break;
  24. }
  25. d.getInverseTransform().transform(m_tmpa, m_tmpa);
  26. }
  27. return m_tmpa;
  28. }

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

  1. @Override
  2. public void run( double frac )
  3. {
  4. // setup
  5. NodeItem root = getLayoutRoot();
  6. layout( root, 0, 0 );
  7. Rectangle2D bounds = root.getBounds();
  8. Display display = this.getVisualization().getDisplay( 0 );
  9. Dimension size = new Dimension( (int) bounds.getWidth(), (int) bounds.getHeight() );
  10. display.setSize( size );
  11. if( !display.isValid() )
  12. {
  13. display.validate();
  14. }
  15. }

相关文章