本文整理匯總了Java中edu.uci.ics.jung.visualization.VisualizationViewer.getPreferredSize方法的典型用法代碼示例。如果您正苦於以下問題:Java VisualizationViewer.getPreferredSize方法的具體用法?Java VisualizationViewer.getPreferredSize怎麽用?Java VisualizationViewer.getPreferredSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類edu.uci.ics.jung.visualization.VisualizationViewer
的用法示例。
在下文中一共展示了VisualizationViewer.getPreferredSize方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: MagnifyImageLensSupport
import edu.uci.ics.jung.visualization.VisualizationViewer; //導入方法依賴的package包/類
/**
* create the base class, setting common members and creating
* a custom GraphMouse
* @param vv the VisualizationViewer to work on
*/
public MagnifyImageLensSupport(VisualizationViewer<V,E> vv, LensTransformer lensTransformer,
ModalGraphMouse lensGraphMouse) {
super(vv, lensGraphMouse);
this.renderContext = vv.getRenderContext();
this.pickSupport = renderContext.getPickSupport();
this.renderer = vv.getRenderer();
this.transformingRenderer = new BasicRenderer<V,E>();
this.savedGraphicsDecorator = renderContext.getGraphicsContext();
this.lensTransformer = lensTransformer;
this.savedEdgeRenderer = vv.getRenderer().getEdgeRenderer();
this.reshapingEdgeRenderer = new ReshapingEdgeRenderer<V,E>();
this.reshapingEdgeRenderer.setEdgeArrowRenderingSupport(savedEdgeRenderer.getEdgeArrowRenderingSupport());
Dimension d = vv.getSize();
if(d.width == 0 || d.height == 0) {
d = vv.getPreferredSize();
}
lensTransformer.setViewRadius(d.width/5);
this.lensGraphicsDecorator = new MagnifyIconGraphics(lensTransformer);
}
示例2: LayoutLensSupport
import edu.uci.ics.jung.visualization.VisualizationViewer; //導入方法依賴的package包/類
/**
* create the base class, setting common members and creating
* a custom GraphMouse
* @param vv the VisualizationViewer to work on
*/
public LayoutLensSupport(VisualizationViewer<V,E> vv, LensTransformer lensTransformer,
ModalGraphMouse lensGraphMouse) {
super(vv, lensGraphMouse);
this.lensTransformer = lensTransformer;
this.pickSupport = vv.getPickSupport();
Dimension d = vv.getSize();
if(d.width <= 0 || d.height <= 0) {
d = vv.getPreferredSize();
}
lensTransformer.setViewRadius(d.width/5);
}