当前位置: 首页>>代码示例>>Java>>正文


Java MutableTransformer.shear方法代码示例

本文整理汇总了Java中edu.uci.ics.jung.visualization.transform.MutableTransformer.shear方法的典型用法代码示例。如果您正苦于以下问题:Java MutableTransformer.shear方法的具体用法?Java MutableTransformer.shear怎么用?Java MutableTransformer.shear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.uci.ics.jung.visualization.transform.MutableTransformer的用法示例。


在下文中一共展示了MutableTransformer.shear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mouseDragged

import edu.uci.ics.jung.visualization.transform.MutableTransformer; //导入方法依赖的package包/类
/**
* 
* 
* 
* 
*/
  public void mouseDragged(MouseEvent e) {
      if(down == null) return;
      VisualizationViewer vv = (VisualizationViewer)e.getSource();
      boolean accepted = checkModifiers(e);
      if(accepted) {
          MutableTransformer modelTransformer = 
          	vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT);
          vv.setCursor(cursor);
          Point2D q = down;
          Point2D p = e.getPoint();
          float dx = (float) (p.getX()-q.getX());
          float dy = (float) (p.getY()-q.getY());

          Dimension d = vv.getSize();
          float shx = 2.f*dx/d.height;
          float shy = 2.f*dy/d.width;
          Point2D center = vv.getCenter();
          if(p.getX() < center.getX()) {
              shy = -shy;
          }
          if(p.getY() < center.getY()) {
              shx = -shx;
          }
          modelTransformer.shear(shx, shy, center);
          down.x = e.getX();
          down.y = e.getY();
      
          e.consume();
      }
  }
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:37,代码来源:ShearingGraphMousePlugin.java

示例2: mouseDragged

import edu.uci.ics.jung.visualization.transform.MutableTransformer; //导入方法依赖的package包/类
/**
 * overridden to shear the main view
 */
public void mouseDragged(MouseEvent e) {
    if(down == null) return;
    VisualizationViewer vv = (VisualizationViewer)e.getSource();
    boolean accepted = checkModifiers(e);
    if(accepted) {
        if(vv instanceof SatelliteVisualizationViewer) {
            VisualizationViewer vvMaster = 
                ((SatelliteVisualizationViewer)vv).getMaster();
            
            MutableTransformer modelTransformerMaster = vvMaster.getLayoutTransformer();

            vv.setCursor(cursor);
            Point2D q = down;
            Point2D p = e.getPoint();
            float dx = (float) (p.getX()-q.getX());
            float dy = (float) (p.getY()-q.getY());

            Dimension d = vv.getSize();
            float shx = 2.f*dx/d.height;
            float shy = 2.f*dy/d.width;
            // I want to compute shear based on the view coordinates of the
            // lens center in the satellite view.
            // translate the master view center to layout coords, then translate
            // that point to the satellite view's view coordinate system....
            Point2D center = vv.transform(vvMaster.inverseTransform(vvMaster.getCenter()));
            if(p.getX() < center.getX()) {
                shy = -shy;
            }
            if(p.getY() < center.getY()) {
                shx = -shx;
            }
            modelTransformerMaster.shear(-shx, -shy, vvMaster.getCenter());

            down.x = e.getX();
            down.y = e.getY();
        }
        e.consume();
    }
}
 
开发者ID:markus1978,项目名称:clickwatch,代码行数:43,代码来源:SatelliteShearingGraphMousePlugin.java

示例3: mouseDragged

import edu.uci.ics.jung.visualization.transform.MutableTransformer; //导入方法依赖的package包/类
/**
* 
* 
* 
* 
*/
  public void mouseDragged(MouseEvent e) {
      if(down == null) return;
      VisualizationViewer vv = (VisualizationViewer)e.getSource();
      boolean accepted = checkModifiers(e);
      if(accepted) {
          MutableTransformer modelTransformer = vv.getLayoutTransformer();
          vv.setCursor(cursor);
          Point2D q = down;
          Point2D p = e.getPoint();
          float dx = (float) (p.getX()-q.getX());
          float dy = (float) (p.getY()-q.getY());

          Dimension d = vv.getSize();
          float shx = 2.f*dx/d.height;
          float shy = 2.f*dy/d.width;
          Point2D center = vv.getCenter();
          if(p.getX() < center.getX()) {
              shy = -shy;
          }
          if(p.getY() < center.getY()) {
              shx = -shx;
          }
          modelTransformer.shear(shx, shy, center);
          down.x = e.getX();
          down.y = e.getY();
      
          e.consume();
      }
  }
 
开发者ID:markus1978,项目名称:clickwatch,代码行数:36,代码来源:ShearingGraphMousePlugin.java

示例4: mouseDragged

import edu.uci.ics.jung.visualization.transform.MutableTransformer; //导入方法依赖的package包/类
/**
 * overridden to shear the main view
 */
public void mouseDragged(MouseEvent e) {
    if(down == null) return;
    VisualizationViewer vv = (VisualizationViewer)e.getSource();
    boolean accepted = checkModifiers(e);
    if(accepted) {
        if(vv instanceof SatelliteVisualizationViewer) {
            VisualizationViewer vvMaster = 
                ((SatelliteVisualizationViewer)vv).getMaster();
            
            MutableTransformer modelTransformerMaster = 
            	vvMaster.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT);

            vv.setCursor(cursor);
            Point2D q = down;
            Point2D p = e.getPoint();
            float dx = (float) (p.getX()-q.getX());
            float dy = (float) (p.getY()-q.getY());

            Dimension d = vv.getSize();
            float shx = 2.f*dx/d.height;
            float shy = 2.f*dy/d.width;
            // I want to compute shear based on the view coordinates of the
            // lens center in the satellite view.
            // translate the master view center to layout coords, then translate
            // that point to the satellite view's view coordinate system....
            Point2D center = vv.getRenderContext().getMultiLayerTransformer().transform(vvMaster.getRenderContext().getMultiLayerTransformer().inverseTransform(vvMaster.getCenter()));
            if(p.getX() < center.getX()) {
                shy = -shy;
            }
            if(p.getY() < center.getY()) {
                shx = -shx;
            }
            modelTransformerMaster.shear(-shx, -shy, vvMaster.getCenter());

            down.x = e.getX();
            down.y = e.getY();
        }
        e.consume();
    }
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:44,代码来源:SatelliteShearingGraphMousePlugin.java


注:本文中的edu.uci.ics.jung.visualization.transform.MutableTransformer.shear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。