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

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

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

mxGraph.getView介绍

[英]Returns the view that contains the cell states.
[中]返回包含单元格状态的视图。

代码示例

代码示例来源:origin: Activiti/Activiti

  1. protected void generateAssociationDiagramInterchangeElements() {
  2. for (String associationId : generatedAssociationEdges.keySet()) {
  3. Object edge = generatedAssociationEdges.get(associationId);
  4. List<mxPoint> points = graph.getView().getState(edge).getAbsolutePoints();
  5. createDiagramInterchangeInformation(handledArtifacts.get(associationId), optimizeEdgePoints(points));
  6. }
  7. }

代码示例来源:origin: Activiti/Activiti

  1. protected void generateActivityDiagramInterchangeElements() {
  2. for (String flowElementId : generatedVertices.keySet()) {
  3. Object vertex = generatedVertices.get(flowElementId);
  4. mxCellState cellState = graph.getView().getState(vertex);
  5. GraphicInfo subProcessGraphicInfo = createDiagramInterchangeInformation(handledFlowElements.get(flowElementId), (int) cellState.getX(), (int) cellState.getY(), (int) cellState.getWidth(),
  6. (int) cellState.getHeight());
  7. // The DI for the elements of a subprocess are generated without
  8. // knowledge of the rest of the graph
  9. // So we must translate all it's elements with the x and y of the
  10. // subprocess itself
  11. if (handledFlowElements.get(flowElementId) instanceof SubProcess) {
  12. // Always expanded when auto layouting
  13. subProcessGraphicInfo.setExpanded(true);
  14. }
  15. }
  16. }

代码示例来源:origin: Activiti/Activiti

  1. protected void handleSubProcess(FlowElement flowElement) {
  2. BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel);
  3. bpmnAutoLayout.layout((SubProcess) flowElement);
  4. double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth();
  5. double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight();
  6. Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin);
  7. generatedVertices.put(flowElement.getId(), subProcessVertex);
  8. }

代码示例来源:origin: Activiti/Activiti

  1. Object target = graph.getView().getVisibleTerminal(edge, invert);
  2. TreeNode tmp = dfs(target, parent, visited);

代码示例来源:origin: Activiti/Activiti

  1. protected void generateSequenceFlowDiagramInterchangeElements() {
  2. for (String sequenceFlowId : generatedSequenceFlowEdges.keySet()) {
  3. Object edge = generatedSequenceFlowEdges.get(sequenceFlowId);
  4. List<mxPoint> points = graph.getView().getState(edge).getAbsolutePoints();
  5. mxPoint startPoint = points.get(0);
  6. Object gatewayVertex = generatedVertices.get(sourceElement.getId());
  7. mxCellState gatewayState = graph.getView().getState(gatewayVertex);

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

  1. @Override
  2. public void paint( final Graphics g )
  3. {
  4. final double scale = graph.getView().getScale();
  5. final double xcs = TrackScheme.X_COLUMN_SIZE * Math.min( 1d, scale );
  6. final double ycs = TrackScheme.Y_COLUMN_SIZE * Math.min( 1d, scale );
  7. g.setColor( BACKGROUND_COLOR_1 );
  8. g.fillRect( 0, 0, ( int ) xcs, ( int ) ycs );
  9. g.setColor( LINE_COLOR );
  10. g.drawLine( 0, ( int ) ycs, ( int ) xcs, ( int ) ycs );
  11. g.drawLine( ( int ) xcs, 0, ( int ) xcs, ( int ) ycs );
  12. }

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

  1. @Override
  2. public String getToolTipText( final MouseEvent event )
  3. {
  4. final Point point = event.getPoint();
  5. final double scale = graph.getView().getScale();
  6. final int frame = ( int ) ( point.y / ( TrackScheme.Y_COLUMN_SIZE * scale ) );
  7. return "frame " + frame;
  8. }

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

  1. @Override
  2. public Dimension getPreferredSize()
  3. {
  4. final double scale = Math.min( 1, graph.getView().getScale() );
  5. final double xcs = TrackScheme.X_COLUMN_SIZE * scale + 1;
  6. return new Dimension( ( int ) xcs, ( int ) viewport.getPreferredSize().getHeight() );
  7. }

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

  1. @Override
  2. public Dimension getPreferredSize()
  3. {
  4. final double scale = Math.min( 1, graph.getView().getScale() );
  5. final double ycs = TrackScheme.Y_COLUMN_SIZE * scale + 1;
  6. final int width = getViewport().getView().getSize().width;
  7. return new Dimension( width, ( int ) ycs );
  8. }

代码示例来源:origin: org.flowable/flowable-bpmn-layout

  1. protected void generateAssociationDiagramInterchangeElements() {
  2. for (String associationId : generatedAssociationEdges.keySet()) {
  3. Object edge = generatedAssociationEdges.get(associationId);
  4. List<mxPoint> points = graph.getView().getState(edge).getAbsolutePoints();
  5. createDiagramInterchangeInformation(handledArtifacts.get(associationId), optimizeEdgePoints(points));
  6. }
  7. }

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

  1. /**
  2. *
  3. */
  4. protected mxRectangle getPlaceholderBounds(mxCellState startState)
  5. {
  6. mxGraph graph = graphComponent.getGraph();
  7. return graph.getView().getBounds(graph.getSelectionCells());
  8. }

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

  1. /**
  2. * Returns true if the given cell is not the current root or the root in
  3. * the model. This can be overridden to not render certain cells in the
  4. * graph display.
  5. */
  6. protected boolean isCellDisplayable(Object cell)
  7. {
  8. return cell != graph.getView().getCurrentRoot()
  9. && cell != graph.getModel().getRoot();
  10. }

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

  1. /**
  2. *
  3. */
  4. protected mxRectangle getPlaceholderBounds(mxCellState startState)
  5. {
  6. mxGraph graph = graphComponent.getGraph();
  7. return graph.getView().getBounds(graph.getSelectionCells());
  8. }

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

  1. /**
  2. * Returns true if the given cell is not the current root or the root in
  3. * the model. This can be overridden to not render certain cells in the
  4. * graph display.
  5. */
  6. protected boolean isCellDisplayable(Object cell)
  7. {
  8. return cell != graph.getView().getCurrentRoot()
  9. && cell != graph.getModel().getRoot();
  10. }

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

  1. /**
  2. *
  3. */
  4. protected mxPoint transformScreenPoint(double x, double y)
  5. {
  6. mxGraph graph = graphComponent.getGraph();
  7. mxPoint tr = graph.getView().getTranslate();
  8. double scale = graph.getView().getScale();
  9. return new mxPoint(graph.snap(x / scale - tr.getX()), graph.snap(y
  10. / scale - tr.getY()));
  11. }

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

  1. /**
  2. *
  3. */
  4. protected mxPoint transformScreenPoint(double x, double y)
  5. {
  6. mxGraph graph = graphComponent.getGraph();
  7. mxPoint tr = graph.getView().getTranslate();
  8. double scale = graph.getView().getScale();
  9. return new mxPoint(graph.snap(x / scale - tr.getX()), graph.snap(y
  10. / scale - tr.getY()));
  11. }

代码示例来源:origin: com.bbossgroups.activiti/activiti-bpmn-layout

  1. protected void handleSubProcess(FlowElement flowElement) {
  2. BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel);
  3. bpmnAutoLayout.layout((SubProcess) flowElement);
  4. double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth();
  5. double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight();
  6. Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0,
  7. subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin);
  8. generatedVertices.put(flowElement.getId(), subProcessVertex);
  9. }

代码示例来源:origin: org.flowable/flowable-bpmn-layout

  1. protected void handleSubProcess(FlowElement flowElement) {
  2. BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel);
  3. bpmnAutoLayout.layout((SubProcess) flowElement);
  4. double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth();
  5. double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight();
  6. Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin);
  7. generatedVertices.put(flowElement.getId(), subProcessVertex);
  8. }

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

  1. /**
  2. * Uses getCell, getMarkedState and intersects to return the state for
  3. * the given event.
  4. */
  5. protected mxCellState getState(MouseEvent e)
  6. {
  7. Object cell = getCell(e);
  8. mxGraphView view = graphComponent.getGraph().getView();
  9. mxCellState state = getStateToMark(view.getState(cell));
  10. return (state != null && intersects(state, e)) ? state : null;
  11. }

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

  1. /**
  2. * Uses getCell, getMarkedState and intersects to return the state for
  3. * the given event.
  4. */
  5. protected mxCellState getState(MouseEvent e)
  6. {
  7. Object cell = getCell(e);
  8. mxGraphView view = graphComponent.getGraph().getView();
  9. mxCellState state = getStateToMark(view.getState(cell));
  10. return (state != null && intersects(state, e)) ? state : null;
  11. }

相关文章

mxGraph类方法