本文整理了Java中com.mxgraph.view.mxGraph.getView()
方法的一些代码示例,展示了mxGraph.getView()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。mxGraph.getView()
方法的具体详情如下:
包路径:com.mxgraph.view.mxGraph
类名称:mxGraph
方法名:getView
[英]Returns the view that contains the cell states.
[中]返回包含单元格状态的视图。
代码示例来源:origin: Activiti/Activiti
protected void generateAssociationDiagramInterchangeElements() {
for (String associationId : generatedAssociationEdges.keySet()) {
Object edge = generatedAssociationEdges.get(associationId);
List<mxPoint> points = graph.getView().getState(edge).getAbsolutePoints();
createDiagramInterchangeInformation(handledArtifacts.get(associationId), optimizeEdgePoints(points));
}
}
代码示例来源:origin: Activiti/Activiti
protected void generateActivityDiagramInterchangeElements() {
for (String flowElementId : generatedVertices.keySet()) {
Object vertex = generatedVertices.get(flowElementId);
mxCellState cellState = graph.getView().getState(vertex);
GraphicInfo subProcessGraphicInfo = createDiagramInterchangeInformation(handledFlowElements.get(flowElementId), (int) cellState.getX(), (int) cellState.getY(), (int) cellState.getWidth(),
(int) cellState.getHeight());
// The DI for the elements of a subprocess are generated without
// knowledge of the rest of the graph
// So we must translate all it's elements with the x and y of the
// subprocess itself
if (handledFlowElements.get(flowElementId) instanceof SubProcess) {
// Always expanded when auto layouting
subProcessGraphicInfo.setExpanded(true);
}
}
}
代码示例来源:origin: Activiti/Activiti
protected void handleSubProcess(FlowElement flowElement) {
BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel);
bpmnAutoLayout.layout((SubProcess) flowElement);
double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth();
double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight();
Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin);
generatedVertices.put(flowElement.getId(), subProcessVertex);
}
代码示例来源:origin: Activiti/Activiti
Object target = graph.getView().getVisibleTerminal(edge, invert);
TreeNode tmp = dfs(target, parent, visited);
代码示例来源:origin: Activiti/Activiti
protected void generateSequenceFlowDiagramInterchangeElements() {
for (String sequenceFlowId : generatedSequenceFlowEdges.keySet()) {
Object edge = generatedSequenceFlowEdges.get(sequenceFlowId);
List<mxPoint> points = graph.getView().getState(edge).getAbsolutePoints();
mxPoint startPoint = points.get(0);
Object gatewayVertex = generatedVertices.get(sourceElement.getId());
mxCellState gatewayState = graph.getView().getState(gatewayVertex);
代码示例来源:origin: sc.fiji/TrackMate_
@Override
public void paint( final Graphics g )
{
final double scale = graph.getView().getScale();
final double xcs = TrackScheme.X_COLUMN_SIZE * Math.min( 1d, scale );
final double ycs = TrackScheme.Y_COLUMN_SIZE * Math.min( 1d, scale );
g.setColor( BACKGROUND_COLOR_1 );
g.fillRect( 0, 0, ( int ) xcs, ( int ) ycs );
g.setColor( LINE_COLOR );
g.drawLine( 0, ( int ) ycs, ( int ) xcs, ( int ) ycs );
g.drawLine( ( int ) xcs, 0, ( int ) xcs, ( int ) ycs );
}
代码示例来源:origin: sc.fiji/TrackMate_
@Override
public String getToolTipText( final MouseEvent event )
{
final Point point = event.getPoint();
final double scale = graph.getView().getScale();
final int frame = ( int ) ( point.y / ( TrackScheme.Y_COLUMN_SIZE * scale ) );
return "frame " + frame;
}
代码示例来源:origin: sc.fiji/TrackMate_
@Override
public Dimension getPreferredSize()
{
final double scale = Math.min( 1, graph.getView().getScale() );
final double xcs = TrackScheme.X_COLUMN_SIZE * scale + 1;
return new Dimension( ( int ) xcs, ( int ) viewport.getPreferredSize().getHeight() );
}
代码示例来源:origin: sc.fiji/TrackMate_
@Override
public Dimension getPreferredSize()
{
final double scale = Math.min( 1, graph.getView().getScale() );
final double ycs = TrackScheme.Y_COLUMN_SIZE * scale + 1;
final int width = getViewport().getView().getSize().width;
return new Dimension( width, ( int ) ycs );
}
代码示例来源:origin: org.flowable/flowable-bpmn-layout
protected void generateAssociationDiagramInterchangeElements() {
for (String associationId : generatedAssociationEdges.keySet()) {
Object edge = generatedAssociationEdges.get(associationId);
List<mxPoint> points = graph.getView().getState(edge).getAbsolutePoints();
createDiagramInterchangeInformation(handledArtifacts.get(associationId), optimizeEdgePoints(points));
}
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
*
*/
protected mxRectangle getPlaceholderBounds(mxCellState startState)
{
mxGraph graph = graphComponent.getGraph();
return graph.getView().getBounds(graph.getSelectionCells());
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Returns true if the given cell is not the current root or the root in
* the model. This can be overridden to not render certain cells in the
* graph display.
*/
protected boolean isCellDisplayable(Object cell)
{
return cell != graph.getView().getCurrentRoot()
&& cell != graph.getModel().getRoot();
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
*
*/
protected mxRectangle getPlaceholderBounds(mxCellState startState)
{
mxGraph graph = graphComponent.getGraph();
return graph.getView().getBounds(graph.getSelectionCells());
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Returns true if the given cell is not the current root or the root in
* the model. This can be overridden to not render certain cells in the
* graph display.
*/
protected boolean isCellDisplayable(Object cell)
{
return cell != graph.getView().getCurrentRoot()
&& cell != graph.getModel().getRoot();
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
*
*/
protected mxPoint transformScreenPoint(double x, double y)
{
mxGraph graph = graphComponent.getGraph();
mxPoint tr = graph.getView().getTranslate();
double scale = graph.getView().getScale();
return new mxPoint(graph.snap(x / scale - tr.getX()), graph.snap(y
/ scale - tr.getY()));
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
*
*/
protected mxPoint transformScreenPoint(double x, double y)
{
mxGraph graph = graphComponent.getGraph();
mxPoint tr = graph.getView().getTranslate();
double scale = graph.getView().getScale();
return new mxPoint(graph.snap(x / scale - tr.getX()), graph.snap(y
/ scale - tr.getY()));
}
代码示例来源:origin: com.bbossgroups.activiti/activiti-bpmn-layout
protected void handleSubProcess(FlowElement flowElement) {
BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel);
bpmnAutoLayout.layout((SubProcess) flowElement);
double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth();
double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight();
Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0,
subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin);
generatedVertices.put(flowElement.getId(), subProcessVertex);
}
代码示例来源:origin: org.flowable/flowable-bpmn-layout
protected void handleSubProcess(FlowElement flowElement) {
BpmnAutoLayout bpmnAutoLayout = new BpmnAutoLayout(bpmnModel);
bpmnAutoLayout.layout((SubProcess) flowElement);
double subProcessWidth = bpmnAutoLayout.getGraph().getView().getGraphBounds().getWidth();
double subProcessHeight = bpmnAutoLayout.getGraph().getView().getGraphBounds().getHeight();
Object subProcessVertex = graph.insertVertex(cellParent, flowElement.getId(), "", 0, 0, subProcessWidth + 2 * subProcessMargin, subProcessHeight + 2 * subProcessMargin);
generatedVertices.put(flowElement.getId(), subProcessVertex);
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Uses getCell, getMarkedState and intersects to return the state for
* the given event.
*/
protected mxCellState getState(MouseEvent e)
{
Object cell = getCell(e);
mxGraphView view = graphComponent.getGraph().getView();
mxCellState state = getStateToMark(view.getState(cell));
return (state != null && intersects(state, e)) ? state : null;
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Uses getCell, getMarkedState and intersects to return the state for
* the given event.
*/
protected mxCellState getState(MouseEvent e)
{
Object cell = getCell(e);
mxGraphView view = graphComponent.getGraph().getView();
mxCellState state = getStateToMark(view.getState(cell));
return (state != null && intersects(state, e)) ? state : null;
}
内容来源于网络,如有侵权,请联系作者删除!