com.mxgraph.view.mxGraph.isSelectionEmpty()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(99)

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

mxGraph.isSelectionEmpty介绍

暂无

代码示例

代码示例来源:origin: org.tinyjee.jgraphx/jgraphx

  1. /**
  2. *
  3. */
  4. public Object[] selectRegion(Rectangle rect, MouseEvent e)
  5. {
  6. Object[] cells = getCells(rect);
  7. if (cells.length > 0)
  8. {
  9. selectCellsForEvent(cells, e);
  10. }
  11. else if (!graph.isSelectionEmpty() && !e.isConsumed())
  12. {
  13. graph.clearSelection();
  14. }
  15. return cells;
  16. }

代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx

  1. /**
  2. *
  3. */
  4. public Object[] selectRegion(Rectangle rect, MouseEvent e)
  5. {
  6. Object[] cells = getCells(rect);
  7. if (cells.length > 0)
  8. {
  9. selectCellsForEvent(cells, e);
  10. }
  11. else if (!graph.isSelectionEmpty() && !e.isConsumed())
  12. {
  13. graph.clearSelection();
  14. }
  15. return cells;
  16. }

代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx

  1. && !graphComponent.getGraph().isSelectionEmpty())

代码示例来源:origin: org.tinyjee.jgraphx/jgraphx

  1. && !graphComponent.getGraph().isSelectionEmpty())

代码示例来源:origin: org.tinyjee.jgraphx/jgraphx

  1. /**
  2. * (non-Javadoc)
  3. *
  4. * @see javax.swing.TransferHandler#createTransferable(javax.swing.JComponent)
  5. */
  6. public Transferable createTransferable(JComponent c)
  7. {
  8. if (c instanceof mxGraphComponent)
  9. {
  10. mxGraphComponent graphComponent = (mxGraphComponent) c;
  11. mxGraph graph = graphComponent.getGraph();
  12. if (!graph.isSelectionEmpty())
  13. {
  14. originalCells = graphComponent.getExportableCells(graph
  15. .getSelectionCells());
  16. if (originalCells.length > 0)
  17. {
  18. ImageIcon icon = (transferImageEnabled) ? createTransferableImage(
  19. graphComponent, originalCells) : null;
  20. return createGraphTransferable(graphComponent,
  21. originalCells, icon);
  22. }
  23. }
  24. }
  25. return null;
  26. }

代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx

  1. /**
  2. * (non-Javadoc)
  3. *
  4. * @see javax.swing.TransferHandler#createTransferable(javax.swing.JComponent)
  5. */
  6. public Transferable createTransferable(JComponent c)
  7. {
  8. if (c instanceof mxGraphComponent)
  9. {
  10. mxGraphComponent graphComponent = (mxGraphComponent) c;
  11. mxGraph graph = graphComponent.getGraph();
  12. if (!graph.isSelectionEmpty())
  13. {
  14. originalCells = graphComponent.getExportableCells(graph
  15. .getSelectionCells());
  16. if (originalCells.length > 0)
  17. {
  18. ImageIcon icon = (transferImageEnabled) ? createTransferableImage(
  19. graphComponent, originalCells) : null;
  20. return createGraphTransferable(graphComponent,
  21. originalCells, icon);
  22. }
  23. }
  24. }
  25. return null;
  26. }

代码示例来源:origin: fiji/TrackMate

  1. @Override
  2. public void zoomTo( final double newScale, final boolean center )
  3. {
  4. final mxGraphView view = graph.getView();
  5. final double scale = view.getScale();
  6. final mxPoint translate = ( pageVisible && centerPage ) ? getPageTranslate( newScale ) : new mxPoint();
  7. graph.getView().scaleAndTranslate( newScale, translate.getX(), translate.getY() );
  8. if ( keepSelectionVisibleOnZoom && !graph.isSelectionEmpty() )
  9. {
  10. getGraphControl().scrollRectToVisible( view.getBoundingBox( graph.getSelectionCells() ).getRectangle() );
  11. }
  12. else
  13. {
  14. maintainScrollBar( true, newScale / scale, center );
  15. maintainScrollBar( false, newScale / scale, center );
  16. }
  17. }

代码示例来源:origin: sc.fiji/TrackMate_

  1. @Override
  2. public void zoomTo( final double newScale, final boolean center )
  3. {
  4. final mxGraphView view = graph.getView();
  5. final double scale = view.getScale();
  6. final mxPoint translate = ( pageVisible && centerPage ) ? getPageTranslate( newScale ) : new mxPoint();
  7. graph.getView().scaleAndTranslate( newScale, translate.getX(), translate.getY() );
  8. if ( keepSelectionVisibleOnZoom && !graph.isSelectionEmpty() )
  9. {
  10. getGraphControl().scrollRectToVisible( view.getBoundingBox( graph.getSelectionCells() ).getRectangle() );
  11. }
  12. else
  13. {
  14. maintainScrollBar( true, newScale / scale, center );
  15. maintainScrollBar( false, newScale / scale, center );
  16. }
  17. }

代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx

  1. /**
  2. *
  3. */
  4. public void zoom(double factor)
  5. {
  6. mxGraphView view = graph.getView();
  7. double newScale = (double) ((int) (view.getScale() * 100 * factor)) / 100;
  8. if (newScale != view.getScale() && newScale > 0.04)
  9. {
  10. mxPoint translate = (pageVisible && centerPage) ? getPageTranslate(newScale)
  11. : new mxPoint();
  12. graph.getView().scaleAndTranslate(newScale, translate.getX(),
  13. translate.getY());
  14. if (keepSelectionVisibleOnZoom && !graph.isSelectionEmpty())
  15. {
  16. getGraphControl().scrollRectToVisible(
  17. view.getBoundingBox(graph.getSelectionCells())
  18. .getRectangle());
  19. }
  20. else
  21. {
  22. maintainScrollBar(true, factor, centerZoom);
  23. maintainScrollBar(false, factor, centerZoom);
  24. }
  25. }
  26. }

代码示例来源:origin: org.tinyjee.jgraphx/jgraphx

  1. /**
  2. *
  3. */
  4. public void zoom(double factor)
  5. {
  6. mxGraphView view = graph.getView();
  7. double newScale = (double) ((int) (view.getScale() * 100 * factor)) / 100;
  8. if (newScale != view.getScale() && newScale > 0.04)
  9. {
  10. mxPoint translate = (pageVisible && centerPage) ? getPageTranslate(newScale)
  11. : new mxPoint();
  12. graph.getView().scaleAndTranslate(newScale, translate.getX(),
  13. translate.getY());
  14. if (keepSelectionVisibleOnZoom && !graph.isSelectionEmpty())
  15. {
  16. getGraphControl().scrollRectToVisible(
  17. view.getBoundingBox(graph.getSelectionCells())
  18. .getRectangle());
  19. }
  20. else
  21. {
  22. maintainScrollBar(true, factor, centerZoom);
  23. maintainScrollBar(false, factor, centerZoom);
  24. }
  25. }
  26. }

相关文章

mxGraph类方法